mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[0031] Improvements and typofixes
Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>
This commit is contained in:
parent
afde27af12
commit
00488d845c
8 changed files with 14 additions and 23 deletions
|
|
@ -553,18 +553,6 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data)
|
||||||
LoginDatabase.PExecute("DELETE FROM realmcharacters WHERE acctid= '%u' AND realmid = '%u'", GetAccountId(), realmID);
|
LoginDatabase.PExecute("DELETE FROM realmcharacters WHERE acctid= '%u' AND realmid = '%u'", GetAccountId(), realmID);
|
||||||
LoginDatabase.PExecute("INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (%u, %u, %u)", charcount, GetAccountId(), realmID);
|
LoginDatabase.PExecute("INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (%u, %u, %u)", charcount, GetAccountId(), realmID);
|
||||||
|
|
||||||
result = WorldDatabase.PQuery("SELECT phaseMap FROM playercreateinfo WHERE race = '%u' AND class = '%u'", race_, class_);
|
|
||||||
if(result)
|
|
||||||
{
|
|
||||||
Field* field = result->Fetch();
|
|
||||||
uint16 mapId = field[0].GetUInt16();
|
|
||||||
|
|
||||||
if (mapId != 0)
|
|
||||||
CharacterDatabase.PExecute("INSERT INTO character_phase_data (`guid`, `map`) VALUES (%u, %u)", pNewChar->GetGUIDLow(), mapId);
|
|
||||||
|
|
||||||
delete result;
|
|
||||||
}
|
|
||||||
|
|
||||||
data << (uint8)CHAR_CREATE_SUCCESS;
|
data << (uint8)CHAR_CREATE_SUCCESS;
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2721,8 +2721,8 @@ void ObjectMgr::LoadPlayerInfo()
|
||||||
{
|
{
|
||||||
// Load playercreate
|
// Load playercreate
|
||||||
{
|
{
|
||||||
// 0 1 2 3 4 5 6
|
// 0 1 2 3 4 5 6 7 8
|
||||||
QueryResult* result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo");
|
QueryResult* result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation, phaseMap FROM playercreateinfo");
|
||||||
|
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
||||||
|
|
@ -2751,6 +2751,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||||
float positionY = fields[5].GetFloat();
|
float positionY = fields[5].GetFloat();
|
||||||
float positionZ = fields[6].GetFloat();
|
float positionZ = fields[6].GetFloat();
|
||||||
float orientation = fields[7].GetFloat();
|
float orientation = fields[7].GetFloat();
|
||||||
|
uint16 phaseMap = fields[8].GetUInt16();
|
||||||
|
|
||||||
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race);
|
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race);
|
||||||
if (!rEntry || !((1 << (current_race - 1)) & RACEMASK_ALL_PLAYABLE))
|
if (!rEntry || !((1 << (current_race - 1)) & RACEMASK_ALL_PLAYABLE))
|
||||||
|
|
@ -2787,6 +2788,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||||
pInfo->positionY = positionY;
|
pInfo->positionY = positionY;
|
||||||
pInfo->positionZ = positionZ;
|
pInfo->positionZ = positionZ;
|
||||||
pInfo->orientation = orientation;
|
pInfo->orientation = orientation;
|
||||||
|
pInfo->phaseMap = phaseMap;
|
||||||
|
|
||||||
pInfo->displayId_m = rEntry->model_m;
|
pInfo->displayId_m = rEntry->model_m;
|
||||||
pInfo->displayId_f = rEntry->model_f;
|
pInfo->displayId_f = rEntry->model_f;
|
||||||
|
|
|
||||||
|
|
@ -1190,7 +1190,7 @@ void InitializeOpcodes()
|
||||||
//OPCODE(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
//OPCODE(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||||
//OPCODE(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent );
|
//OPCODE(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent );
|
||||||
//OPCODE(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
//OPCODE(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||||
OPCODE(SMSG_PHASE_SHIFT_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
OPCODE(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||||
OPCODE(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
OPCODE(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||||
//OPCODE(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
//OPCODE(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||||
//OPCODE(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
//OPCODE(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||||
|
|
|
||||||
|
|
@ -1184,7 +1184,7 @@ enum Opcodes
|
||||||
CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x147A,
|
CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x147A,
|
||||||
CMSG_PET_LEARN_TALENT = 0x147B,
|
CMSG_PET_LEARN_TALENT = 0x147B,
|
||||||
CMSG_PET_UNLEARN_TALENTS = 0x147C,
|
CMSG_PET_UNLEARN_TALENTS = 0x147C,
|
||||||
SMSG_PHASE_SHIFT_CHANGE = 0x70A0, // 4.3.4 15595
|
SMSG_SET_PHASE_SHIFT = 0x70A0, // 4.3.4 15595
|
||||||
SMSG_ALL_ACHIEVEMENT_DATA = 0x58B1, // 4.3.4 15595
|
SMSG_ALL_ACHIEVEMENT_DATA = 0x58B1, // 4.3.4 15595
|
||||||
CMSG_FORCE_SAY_CHEAT = 0x147F,
|
CMSG_FORCE_SAY_CHEAT = 0x147F,
|
||||||
SMSG_HEALTH_UPDATE = 0x1480,
|
SMSG_HEALTH_UPDATE = 0x1480,
|
||||||
|
|
|
||||||
|
|
@ -846,6 +846,9 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
||||||
}
|
}
|
||||||
// all item positions resolved
|
// all item positions resolved
|
||||||
|
|
||||||
|
if (info->phaseMap != 0)
|
||||||
|
CharacterDatabase.PExecute("REPLACE INTO `character_phase_data` (`guid`, `map`) VALUES (%u, %u)", guidlow, info->phaseMap);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -15371,9 +15374,8 @@ void Player::SendQuestReward(Quest const* pQuest, uint32 XP, Object* questGiver)
|
||||||
{
|
{
|
||||||
for (QuestPhaseMapsVector::const_iterator itr = QuestPhaseVector->begin(); itr != QuestPhaseVector->end(); ++itr)
|
for (QuestPhaseMapsVector::const_iterator itr = QuestPhaseVector->begin(); itr != QuestPhaseVector->end(); ++itr)
|
||||||
{
|
{
|
||||||
GetSession()->SendSetPhaseShift(itr->MapId, itr->PhaseMask);
|
GetSession()->SendSetPhaseShift(itr->PhaseMask, itr->MapId);
|
||||||
CharacterDatabase.PExecute("DELETE FROM character_phase_data` WHERE `guid` = %u", GetSession()->GetPlayer()->GetGUIDLow());
|
CharacterDatabase.PExecute("REPLACE INTO character_phase_data` (`guid`, `map`, `phase`) VALUES (%u, %u, %u)", GetSession()->GetPlayer()->GetGUIDLow(), itr->MapId, itr->PhaseMask);
|
||||||
CharacterDatabase.PExecute("INSERT INTO character_phase_data` (`guid`, `map`, `phase`) VALUES (%u, %u, %u)", GetSession()->GetPlayer()->GetGUIDLow(), itr->MapId, itr->PhaseMask);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -299,6 +299,7 @@ struct PlayerInfo
|
||||||
float positionY;
|
float positionY;
|
||||||
float positionZ;
|
float positionZ;
|
||||||
float orientation;
|
float orientation;
|
||||||
|
uint16 phaseMap;
|
||||||
uint16 displayId_m;
|
uint16 displayId_m;
|
||||||
uint16 displayId_f;
|
uint16 displayId_f;
|
||||||
PlayerCreateInfoItems item;
|
PlayerCreateInfoItems item;
|
||||||
|
|
|
||||||
|
|
@ -572,8 +572,6 @@ void WorldSession::SendNotification(int32 string_id, ...)
|
||||||
void WorldSession::SendSetPhaseShift(uint32 phaseMask, uint16 mapId)
|
void WorldSession::SendSetPhaseShift(uint32 phaseMask, uint16 mapId)
|
||||||
{
|
{
|
||||||
ObjectGuid guid = _player->GetObjectGuid();
|
ObjectGuid guid = _player->GetObjectGuid();
|
||||||
uint8 guidMask[] = { 2, 3, 1, 6, 4, 5, 0, 7 };
|
|
||||||
uint8 guidBytes[] = { 1, 2, 6, 3, 0, 5 };
|
|
||||||
|
|
||||||
uint32 phaseFlags = 0;
|
uint32 phaseFlags = 0;
|
||||||
|
|
||||||
|
|
@ -589,7 +587,7 @@ void WorldSession::SendSetPhaseShift(uint32 phaseMask, uint16 mapId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldPacket data(SMSG_PHASE_SHIFT_CHANGE, 30);
|
WorldPacket data(SMSG_SET_PHASE_SHIFT, 30);
|
||||||
data.WriteGuidMask<2, 3, 1, 6, 4, 5, 0, 7>(guid);
|
data.WriteGuidMask<2, 3, 1, 6, 4, 5, 0, 7>(guid);
|
||||||
data.WriteGuidBytes<7, 4>(guid);
|
data.WriteGuidBytes<7, 4>(guid);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "0029"
|
#define REVISION_NR "0031"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue