mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[12022] Some more warning fixes
This commit is contained in:
parent
f777665d48
commit
a309de2e6d
8 changed files with 25 additions and 34 deletions
|
|
@ -1580,7 +1580,7 @@ void World::Update(uint32 diff)
|
|||
}
|
||||
|
||||
/// Send a packet to all players (except self if mentioned)
|
||||
void World::SendGlobalMessage(WorldPacket *packet, WorldSession *self, uint32 team)
|
||||
void World::SendGlobalMessage(WorldPacket* packet, WorldSession* self /*= NULL*/, Team team /*= TEAM_NONE*/)
|
||||
{
|
||||
SessionMap::const_iterator itr;
|
||||
for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
|
|
@ -1589,7 +1589,7 @@ void World::SendGlobalMessage(WorldPacket *packet, WorldSession *self, uint32 te
|
|||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second != self &&
|
||||
(team == 0 || itr->second->GetPlayer()->GetTeam() == team) )
|
||||
(team == TEAM_NONE || itr->second->GetPlayer()->GetTeam() == team))
|
||||
{
|
||||
itr->second->SendPacket(packet);
|
||||
}
|
||||
|
|
@ -1673,7 +1673,7 @@ void World::SendWorldText(int32 string_id, ...)
|
|||
}
|
||||
|
||||
/// DEPRICATED, only for debug purpose. Send a System Message to all players (except self if mentioned)
|
||||
void World::SendGlobalText(const char* text, WorldSession *self)
|
||||
void World::SendGlobalText(const char* text, WorldSession* self)
|
||||
{
|
||||
WorldPacket data;
|
||||
|
||||
|
|
@ -1681,17 +1681,17 @@ void World::SendGlobalText(const char* text, WorldSession *self)
|
|||
char* buf = mangos_strdup(text);
|
||||
char* pos = buf;
|
||||
|
||||
while(char* line = ChatHandler::LineFromMessage(pos))
|
||||
while (char* line = ChatHandler::LineFromMessage(pos))
|
||||
{
|
||||
ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, line);
|
||||
SendGlobalMessage(&data, self);
|
||||
}
|
||||
|
||||
delete [] buf;
|
||||
delete[] buf;
|
||||
}
|
||||
|
||||
/// Send a packet to all players (or players selected team) in the zone (except self if mentioned)
|
||||
void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self, uint32 team)
|
||||
void World::SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self /*= NULL*/, Team team /*= TEAM_NONE*/)
|
||||
{
|
||||
SessionMap::const_iterator itr;
|
||||
for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
|
|
@ -1701,7 +1701,7 @@ void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self
|
|||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second->GetPlayer()->GetZoneId() == zone &&
|
||||
itr->second != self &&
|
||||
(team == 0 || itr->second->GetPlayer()->GetTeam() == team) )
|
||||
(team == TEAM_NONE || itr->second->GetPlayer()->GetTeam() == team))
|
||||
{
|
||||
itr->second->SendPacket(packet);
|
||||
}
|
||||
|
|
@ -1709,11 +1709,11 @@ void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self
|
|||
}
|
||||
|
||||
/// Send a System Message to all players in the zone (except self if mentioned)
|
||||
void World::SendZoneText(uint32 zone, const char* text, WorldSession *self, uint32 team)
|
||||
void World::SendZoneText(uint32 zone, const char* text, WorldSession* self /*= NULL*/, Team team /*= TEAM_NONE*/)
|
||||
{
|
||||
WorldPacket data;
|
||||
ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, text);
|
||||
SendZoneMessage(zone, &data, self,team);
|
||||
SendZoneMessage(zone, &data, self, team);
|
||||
}
|
||||
|
||||
/// Kick (and save) all players
|
||||
|
|
@ -1918,16 +1918,16 @@ void World::ShutdownCancel()
|
|||
}
|
||||
|
||||
/// Send a server message to the user(s)
|
||||
void World::SendServerMessage(ServerMessageType type, const char *text, Player* player)
|
||||
void World::SendServerMessage(ServerMessageType type, const char* text /*=""*/, Player* player /*= NULL*/)
|
||||
{
|
||||
WorldPacket data(SMSG_SERVER_MESSAGE, 50); // guess size
|
||||
data << uint32(type);
|
||||
data << text;
|
||||
|
||||
if(player)
|
||||
if (player)
|
||||
player->GetSession()->SendPacket(&data);
|
||||
else
|
||||
SendGlobalMessage( &data );
|
||||
SendGlobalMessage(&data);
|
||||
}
|
||||
|
||||
void World::UpdateSessions( uint32 diff )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue