pp revert

This commit is contained in:
Akkadius 2014-08-31 21:58:04 -05:00
parent 6497bdf45a
commit e0a99730e5
7 changed files with 11 additions and 71 deletions

View File

@ -1130,7 +1130,7 @@ bool Database::CheckDatabaseConversions() {
/* Verify PP Integrity */
lengths = mysql_fetch_lengths(result2);
if (lengths[1] > 0) {
if (lengths[1] == sizeof(PlayerProfile_Struct)) {
memcpy(pp, row2[1], sizeof(PlayerProfile_Struct));
// printf("FINE: Player profile '%s' %i length Expected: %i, Got: %i \n", row2[2], atoi(row2[3]), sizeof(PlayerProfile_Struct), lengths[1]);
}

View File

@ -801,8 +801,8 @@ struct SuspendedMinion_Struct
** OpCode: 0x006a
*/
static const uint32 MAX_PP_LANGUAGE = 28;
static const uint32 MAX_PP_SPELLBOOK = 720; // Increased to 480 to support SoF
static const uint32 MAX_PP_MEMSPELL = 12;
static const uint32 MAX_PP_SPELLBOOK = 480; // Increased to 480 to support SoF
static const uint32 MAX_PP_MEMSPELL = 9;
static const uint32 MAX_PP_SKILL = _SkillPacketArraySize; // 100 - actual skills buffer size
static const uint32 MAX_PP_AA_ARRAY = 240;
static const uint32 MAX_GROUP_MEMBERS = 6;

View File

@ -124,61 +124,6 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
uint8 bind_heading_id = atoi(row_b[r]); r++;
}
// if (pp->binds[4].zoneId == 0) {
// bool altered = false;
// MYSQL_RES *result2;
// MYSQL_ROW row2;
// char startzone[50] = { 0 };
//
// // check for start zone variable (I didn't even know any variables were still being used...)
// if (database.GetVariable("startzone", startzone, 50)) {
// uint32 zoneid = database.GetZoneID(startzone);
// if (zoneid) {
// pp->binds[4].zoneId = zoneid;
// GetSafePoints(zoneid, 0, &pp->binds[4].x, &pp->binds[4].y, &pp->binds[4].z);
// altered = true;
// }
// }
// else {
// RunQuery(query,
// MakeAnyLenString(&query,
// "SELECT zone_id,bind_id,x,y,z FROM start_zones "
// "WHERE player_class=%i AND player_deity=%i AND player_race=%i",
// pp->class_,
// pp->deity,
// pp->race
// ),
// errbuf,
// &result2
// );
// safe_delete_array(query);
//
// // if there is only one possible start city, set it
// if (mysql_num_rows(result2) == 1) {
// row2 = mysql_fetch_row(result2);
// if (atoi(row2[1]) != 0) { // if a bind_id is specified, make them start there
// pp->binds[4].zoneId = (uint32)atoi(row2[1]);
// GetSafePoints(pp->binds[4].zoneId, 0, &pp->binds[4].x, &pp->binds[4].y, &pp->binds[4].z);
// }
// else { // otherwise, use the zone and coordinates given
// pp->binds[4].zoneId = (uint32)atoi(row2[0]);
// float x = atof(row2[2]);
// float y = atof(row2[3]);
// float z = atof(row2[4]);
// if (x == 0 && y == 0 && z == 0)
// GetSafePoints(pp->binds[4].zoneId, 0, &x, &y, &z);
//
// pp->binds[4].x = x;
// pp->binds[4].y = y;
// pp->binds[4].z = z;
// }
// altered = true;
// }
//
// mysql_free_result(result2);
// }
// }
/*
Character's equipped items
@merth: Haven't done bracer01/bracer02 yet.
@ -194,10 +139,6 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
slot = atoi(row_b[0]);
if (atoi(row_b[1]) == 1){ pp.item_tint[slot].rgb.use_tint = 0xFF; }
pp.item_tint[slot].color = atoul(row_b[2]);
printf("charid: %u \n", character_id);
printf("slot: %u \n", slot);
printf("use_tint: %u item_tint: %u \n", pp.item_tint[slot].rgb.use_tint, atoul(row_b[2]));
cs->cs_colors[char_num][slot].color = atoul(row_b[2]);
}
/* Load Inventory */
@ -212,9 +153,8 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
cs->equip[char_num][material] = item->GetItem()->Material;
color = pp.item_tint[material].color;
// if (pp.item_tint[material].rgb.use_tint){ color = pp.item_tint[material].color; }
// else{ color = item->GetItem()->Color; }
if (pp.item_tint[material].rgb.use_tint){ color = pp.item_tint[material].color; }
else{ color = item->GetItem()->Color; }
cs->cs_colors[char_num][material].color = color;

View File

@ -597,7 +597,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
loaditems = database.GetInventory(cid, &m_inv); /* Load Character Inventory */
database.LoadCharacterBindPoint(cid, &m_pp); /* Load Character Bind */
database.LoadCharacterMaterial(cid, &m_pp); /* Load Character Material */
database.LoadCharacterMaterialColor(cid, &m_pp); /* Load Character Material */
database.LoadCharacterCurrency(cid, &m_pp); /* Load Character Currency into PP */
database.LoadCharacterData(cid, &m_pp); /* Load Character Data from DB into PP */
database.GetPlayerInspectMessage(m_pp.name, &m_inspect_message); /* Move to another method when can, this is pointless... */

View File

@ -1878,8 +1878,8 @@ void Client::DyeArmor(DyeStruct* dye){
ItemInst* inst = this->m_inv.GetItem(slot2);
if(inst){
uint32 armor_color = (dye->dye[i].rgb.red * 65536) + (dye->dye[i].rgb.green * 256) + (dye->dye[i].rgb.blue);
inst->SetColor(armor_color);
database.SaveCharacterMaterialColor(this->CharacterID(), slot2, armor_color);
inst->SetColor(armor_color);
database.SaveCharacterMaterialColor(this->CharacterID(), i, armor_color);
database.SaveInventory(CharacterID(),inst,slot2);
if(dye->dye[i].rgb.use_tint)
m_pp.item_tint[i].rgb.use_tint = 0xFF;

View File

@ -1151,9 +1151,9 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i
return true;
}
bool ZoneDatabase::LoadCharacterMaterial(uint32 character_id, PlayerProfile_Struct* pp){
bool ZoneDatabase::LoadCharacterMaterialColor(uint32 character_id, PlayerProfile_Struct* pp){
std::string query = StringFormat("SELECT slot, blue, green, red, use_tint, color FROM `character_material` WHERE `id` = %u LIMIT 9", character_id);
auto results = database.QueryDatabase(query); int i = 0; int r = 0;
auto results = database.QueryDatabase(query); int i = 0; int r = 0;
for (auto row = results.begin(); row != results.end(); ++row) {
r = 0;
i = atoi(row[r]); /* Slot */ r++;

View File

@ -266,7 +266,7 @@ public:
bool LoadCharacterData(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterMaterial(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterMaterialColor(uint32 character_id, PlayerProfile_Struct* pp);
/* Character Data Saves */
bool SaveCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);