Remove trailing whitespace

This commit is contained in:
j883376
2013-05-06 13:07:41 -04:00
parent 7a93966158
commit ffcff4aea1
548 changed files with 16397 additions and 16398 deletions
+81 -81
View File
@@ -4,13 +4,13 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -105,9 +105,9 @@ void WorldServer::SetZone(uint32 iZoneID, uint32 iInstanceID) {
void WorldServer::OnConnected() {
WorldConnection::OnConnected();
ServerPacket* pack;
//tell the launcher what name we were started with.
pack = new ServerPacket(ServerOP_SetLaunchName,sizeof(LaunchName_Struct));
LaunchName_Struct* ln = (LaunchName_Struct*)pack->pBuffer;
@@ -121,7 +121,7 @@ void WorldServer::OnConnected() {
sci->port = ZoneConfig::get()->ZonePort;
SendPacket(pack);
safe_delete(pack);
if (ZoneLoaded) {
this->SetZone(zone->GetZoneID(), zone->GetInstanceID());
entity_list.UpdateWho(true);
@@ -130,7 +130,7 @@ void WorldServer::OnConnected() {
} else {
this->SetZone(0);
}
pack = new ServerPacket(ServerOP_LSZoneBoot,sizeof(ZoneBoot_Struct));
ZoneBoot_Struct* zbs = (ZoneBoot_Struct*)pack->pBuffer;
strcpy(zbs->compile_time,LAST_MODIFIED);
@@ -140,9 +140,9 @@ void WorldServer::OnConnected() {
void WorldServer::Process() {
_ZP(WorldServer_Process);
WorldConnection::Process();
if (!Connected())
return;
@@ -161,7 +161,7 @@ void WorldServer::Process() {
// World is tellins us what port to use.
case ServerOP_SetConnectInfo: {
if (pack->size != sizeof(ServerConnectInfo))
break;
break;
ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer;
_log(ZONE__WORLD,"World indicated port %d for this zone.",sci->port);
ZoneConfig::SetZonePort(sci->port);
@@ -201,7 +201,7 @@ void WorldServer::Process() {
}
case ServerOP_VoiceMacro: {
if (!ZoneLoaded)
if (!ZoneLoaded)
break;
ServerVoiceMacro_Struct* svm = (ServerVoiceMacro_Struct*) pack->pBuffer;
@@ -217,7 +217,7 @@ void WorldServer::Process() {
switch(svm->Type) {
case VoiceMacroTell: {
Client* c = entity_list.GetClientByName(svm->To);
if(!c)
if(!c)
break;
c->QueuePacket(outapp);
@@ -227,7 +227,7 @@ void WorldServer::Process() {
case VoiceMacroGroup: {
Group* g = entity_list.GetGroupByID(svm->GroupID);
if(!g)
if(!g)
break;
for(unsigned int i = 0; i < MAX_GROUP_MEMBERS; i++) {
@@ -241,7 +241,7 @@ void WorldServer::Process() {
case VoiceMacroRaid: {
Raid *r = entity_list.GetRaidByID(svm->RaidID);
if(!r)
if(!r)
break;
for(int i = 0; i < MAX_RAID_MEMBERS; i++)
@@ -261,9 +261,9 @@ void WorldServer::Process() {
if (!ZoneLoaded)
break;
ServerSpawnCondition_Struct* ssc = (ServerSpawnCondition_Struct*) pack->pBuffer;
zone->spawn_conditions.SetCondition(zone->GetShortName(), zone->GetInstanceID(), ssc->condition_id, ssc->value, true);
break;
break;
}
case ServerOP_SpawnEvent: {
if(pack->size != sizeof(ServerSpawnEvent_Struct))
@@ -271,10 +271,10 @@ void WorldServer::Process() {
if (!ZoneLoaded)
break;
ServerSpawnEvent_Struct* sse = (ServerSpawnEvent_Struct*) pack->pBuffer;
zone->spawn_conditions.ReloadEvent(sse->event_id);
break;
break;
}
case ServerOP_AcceptWorldEntrance: {
if(pack->size != sizeof(WorldToZone_Struct))
@@ -289,7 +289,7 @@ void WorldServer::Process() {
wtz->response = 1;
SendPacket(pack);
break;
break;
}
case ServerOP_ZoneToZoneRequest: {
if(pack->size != sizeof(ZoneToZone_Struct))
@@ -297,8 +297,8 @@ void WorldServer::Process() {
if (!ZoneLoaded)
break;
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
if(ztz->current_zone_id == zone->GetZoneID()
if(ztz->current_zone_id == zone->GetZoneID()
&& ztz->current_instance_id == zone->GetInstanceID()) {
// it's a response
Entity* entity = entity_list.GetClientByName(ztz->name);
@@ -372,8 +372,8 @@ void WorldServer::Process() {
case ServerOP_WhoAllReply:{
if(!ZoneLoaded)
break;
WhoAllReturnStruct* wars= (WhoAllReturnStruct*)pack->pBuffer;
if (wars && wars->id!=0 && wars->id<0xFFFFFFFF){
Client* client = entity_list.GetClientByID(wars->id);
@@ -463,7 +463,7 @@ void WorldServer::Process() {
}
else {
SendEmoteMessage(0, 0, 15, "Zone shutdown: %s", zone->GetLongName());
ServerZoneStateChange_struct* zst = (ServerZoneStateChange_struct *) pack->pBuffer;
cout << "Zone shutdown by " << zst->adminname << endl;
Zone::Shutdown();
@@ -487,10 +487,10 @@ void WorldServer::Process() {
}
break;
}
if (zst->adminname[0] != 0)
cout << "Zone bootup by " << zst->adminname << endl;
if (!(Zone::Bootup(zst->zoneid, zst->instanceid, zst->makestatic))) {
SendChannelMessage(0, 0, 10, 0, 0, "%s:%i Zone::Bootup failed: %s", net.GetZoneAddress(), net.GetZonePort(), database.GetZoneName(zst->zoneid));
}
@@ -570,7 +570,7 @@ void WorldServer::Process() {
}
break;
}
//hand all the guild related packets to the guild manager for processing.
case ServerOP_OnlineGuildMembersResponse:
case ServerOP_RefreshGuild:
@@ -683,15 +683,15 @@ void WorldServer::Process() {
//pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0
//also serves to inform Client::OPRezzAnswer to expect a packet.
client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name);
_log(SPELLS__REZ, "OP_RezzRequest in zone %s for %s, spellid:%i",
_log(SPELLS__REZ, "OP_RezzRequest in zone %s for %s, spellid:%i",
zone->GetShortName(), client->GetName(), srs->rez.spellid);
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest,
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest,
sizeof(Resurrect_Struct));
memcpy(outapp->pBuffer, &srs->rez, sizeof(Resurrect_Struct));
client->QueuePacket(outapp);
_pkt(SPELLS__REZ, outapp);
safe_delete(outapp);
break;
break;
}
}
if (srs->rezzopcode == OP_RezzComplete){
@@ -708,7 +708,7 @@ void WorldServer::Process() {
corpse->CompleteRezz();
}
}
break;
}
case ServerOP_RezzPlayerReject:
@@ -733,17 +733,17 @@ void WorldServer::Process() {
snprintf(buffer,200,". %s %i %s",zb->ip2, zb->port, inet_ntoa(in));
if(zb->zoneid != 0) {
snprintf(buffer,200,"%s %s %i %s",database.GetZoneName(zb->zoneid),zb->ip2, zb->port ,inet_ntoa(in));
cout << "executing: " << buffer;
cout << "executing: " << buffer;
ShellExecute(0,"Open",net.GetZoneFileName(), buffer, 0, SW_SHOWDEFAULT);
}
else
{
cout << "executing: " << net.GetZoneFileName() << " " << buffer;
cout << "executing: " << net.GetZoneFileName() << " " << buffer;
ShellExecute(0,"Open",net.GetZoneFileName(), buffer, 0, SW_SHOWDEFAULT);
}
#else
char buffer[5];
snprintf(buffer,5,"%i",zb->port); //just to be sure that it will work on linux
snprintf(buffer,5,"%i",zb->port); //just to be sure that it will work on linux
if(zb->zoneid != 0)
execl(net.GetZoneFileName(),net.GetZoneFileName(),database.GetZoneName(zb->zoneid),zb->ip2, buffer,inet_ntoa(in), nullptr);
else
@@ -796,7 +796,7 @@ void WorldServer::Process() {
oocmuted = *(pack->pBuffer);
break;
}
case ServerOP_Revoke: {
case ServerOP_Revoke: {
RevokeStruct* rev = (RevokeStruct*) pack->pBuffer;
Client* client = entity_list.GetClientByName(rev->name);
if (client)
@@ -858,7 +858,7 @@ void WorldServer::Process() {
Group* group = entity_list.GetGroupByClient(Inviter->CastToClient());
if(!group){
group = new Group(Inviter);
if(!group)
@@ -892,9 +892,9 @@ void WorldServer::Process() {
{
// SoD and later
//
Inviter->CastToClient()->SendGroupCreatePacket();
Inviter->CastToClient()->SendGroupCreatePacket();
Inviter->CastToClient()->SendGroupLeaderChangePacket(Inviter->GetName());
Inviter->CastToClient()->SendGroupJoinAcknowledge();
Inviter->CastToClient()->SendGroupJoinAcknowledge();
}
}
if(!group)
@@ -907,7 +907,7 @@ void WorldServer::Process() {
strn0cpy(gg->name1, sgfs->gf.name1, sizeof(gg->name1));
strn0cpy(gg->name2, sgfs->gf.name2, sizeof(gg->name2));
Inviter->CastToClient()->QueuePacket(outapp);
safe_delete(outapp);
@@ -957,7 +957,7 @@ void WorldServer::Process() {
if(!c)
break;
uint32 groupid = database.GetGroupID(c->GetName());
Group* group = nullptr;
@@ -1007,7 +1007,7 @@ void WorldServer::Process() {
Client *lc = entity_list.GetClientByName(ln);
if(lc)
group->SetLeader(lc);
group->SetMainTank(MainTankName);
group->SetMainAssist(AssistName);
group->SetPuller(PullerName);
@@ -1068,7 +1068,7 @@ void WorldServer::Process() {
entity_list.GroupMessage(gcm->groupid, gcm->from, gcm->message);
}
break;
break;
}
case ServerOP_DisbandGroup: {
ServerDisbandGroup_Struct* sd = (ServerDisbandGroup_Struct*)pack->pBuffer;
@@ -1087,7 +1087,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
r->LearnMembers();
@@ -1103,7 +1103,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
r->SendRaidRemoveAll(rga->playername);
@@ -1112,7 +1112,7 @@ void WorldServer::Process() {
r->SendRaidDisband(rem);
}
r->LearnMembers();
r->VerifyRaid();
r->VerifyRaid();
}
}
break;
@@ -1123,7 +1123,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
r->SendRaidDisbandAll();
@@ -1139,7 +1139,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
r->GetRaidDetails(); //update our details
@@ -1157,7 +1157,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
r->LearnMembers();
@@ -1186,7 +1186,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
r->GroupUpdate(rga->gid, false);
@@ -1209,7 +1209,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
Client *c = entity_list.GetClientByName(rga->playername);
@@ -1230,7 +1230,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
r->GetRaidDetails();
@@ -1246,7 +1246,7 @@ void WorldServer::Process() {
if(zone){
if(rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break;
Client *c = entity_list.GetClientByName(rga->playername);
if(c)
{
@@ -1262,14 +1262,14 @@ void WorldServer::Process() {
}
case ServerOP_RaidGroupAdd:{
ServerRaidGroupAction_Struct* rga = (ServerRaidGroupAction_Struct*)pack->pBuffer;
ServerRaidGroupAction_Struct* rga = (ServerRaidGroupAction_Struct*)pack->pBuffer;
if(zone){
Raid *r = entity_list.GetRaidByID(rga->rid);
if(r){
r->LearnMembers();
r->VerifyRaid();
EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
GroupJoin_Struct* gj = (GroupJoin_Struct*) outapp->pBuffer;
GroupJoin_Struct* gj = (GroupJoin_Struct*) outapp->pBuffer;
strn0cpy(gj->membername, rga->membername, 64);
gj->action = groupActJoin;
@@ -1300,7 +1300,7 @@ void WorldServer::Process() {
r->LearnMembers();
r->VerifyRaid();
EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
GroupJoin_Struct* gj = (GroupJoin_Struct*) outapp->pBuffer;
GroupJoin_Struct* gj = (GroupJoin_Struct*) outapp->pBuffer;
strn0cpy(gj->membername, rga->membername, 64);
gj->action = groupActLeave;
@@ -1324,7 +1324,7 @@ void WorldServer::Process() {
}
case ServerOP_RaidGroupSay:{
ServerRaidMessage_Struct* rmsg = (ServerRaidMessage_Struct*)pack->pBuffer;
ServerRaidMessage_Struct* rmsg = (ServerRaidMessage_Struct*)pack->pBuffer;
if(zone){
Raid *r = entity_list.GetRaidByID(rmsg->rid);
if(r)
@@ -1377,7 +1377,7 @@ void WorldServer::Process() {
Corpse* NewCorpse = database.LoadPlayerCorpse(s->player_corpse_id);
if(NewCorpse)
NewCorpse->Spawn();
else
else
LogFile->write(EQEMuLog::Error,"Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName());
break;
@@ -1451,7 +1451,7 @@ void WorldServer::Process() {
UpdateSpawnTimer_Struct *ust = (UpdateSpawnTimer_Struct*)pack->pBuffer;
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
iterator.Reset();
while (iterator.MoreElements())
while (iterator.MoreElements())
{
if(iterator.GetData()->GetID() == ust->id)
{
@@ -1548,7 +1548,7 @@ void WorldServer::Process() {
{
break;
}
if(zone)
{
ServerQGlobalUpdate_Struct *qgu = (ServerQGlobalUpdate_Struct*)pack->pBuffer;
@@ -1574,7 +1574,7 @@ void WorldServer::Process() {
{
break;
}
if(zone)
{
ServerQGlobalDelete_Struct *qgd = (ServerQGlobalDelete_Struct*)pack->pBuffer;
@@ -1674,7 +1674,7 @@ void WorldServer::Process() {
}
break;
}
case ServerOP_AdventureLeaveReply:
{
Client *c = entity_list.GetClientByName((const char*)pack->pBuffer);
@@ -1780,7 +1780,7 @@ void WorldServer::Process() {
default:
break;
}
break;
}
case ServerOP_CZSignalClient:
@@ -1826,7 +1826,7 @@ void WorldServer::Process() {
}
safe_delete(pack);
}
return;
}
@@ -1835,15 +1835,15 @@ bool WorldServer::SendChannelMessage(Client* from, const char* to, uint8 chan_nu
return false;
va_list argptr;
char buffer[512];
va_start(argptr, message);
vsnprintf(buffer, 512, message, argptr);
va_end(argptr);
buffer[511] = '\0';
ServerPacket* pack = new ServerPacket(ServerOP_ChannelMessage, sizeof(ServerChannelMessage_Struct) + strlen(buffer) + 1);
ServerChannelMessage_Struct* scm = (ServerChannelMessage_Struct*) pack->pBuffer;
if (from == 0) {
strcpy(scm->from, "ZServer");
scm->fromadmin = 0;
@@ -1863,7 +1863,7 @@ bool WorldServer::SendChannelMessage(Client* from, const char* to, uint8 chan_nu
scm->guilddbid = guilddbid;
scm->language = language;
strcpy(scm->message, buffer);
pack->Deflate();
bool ret = SendPacket(pack);
safe_delete(pack);
@@ -1873,18 +1873,18 @@ bool WorldServer::SendChannelMessage(Client* from, const char* to, uint8 chan_nu
bool WorldServer::SendEmoteMessage(const char* to, uint32 to_guilddbid, uint32 type, const char* message, ...) {
va_list argptr;
char buffer[256];
va_start(argptr, message);
vsnprintf(buffer, 256, message, argptr);
va_end(argptr);
return SendEmoteMessage(to, to_guilddbid, 0, type, buffer);
}
bool WorldServer::SendEmoteMessage(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message, ...) {
va_list argptr;
char buffer[256];
va_start(argptr, message);
vsnprintf(buffer, 256, message, argptr);
va_end(argptr);
@@ -1893,7 +1893,7 @@ bool WorldServer::SendEmoteMessage(const char* to, uint32 to_guilddbid, int16 to
entity_list.MessageStatus(to_guilddbid, to_minstatus, type, buffer);
return false;
}
ServerPacket* pack = new ServerPacket(ServerOP_EmoteMessage, sizeof(ServerEmoteMessage_Struct)+strlen(buffer)+1);
ServerEmoteMessage_Struct* sem = (ServerEmoteMessage_Struct*) pack->pBuffer;
sem->type = type;
@@ -1913,11 +1913,11 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32
if(!worldserver.Connected() || !From)
return false;
ServerPacket* pack = new ServerPacket(ServerOP_VoiceMacro, sizeof(ServerVoiceMacro_Struct));
ServerVoiceMacro_Struct* svm = (ServerVoiceMacro_Struct*) pack->pBuffer;
strcpy(svm->From, From->GetName());
switch(Type) {
@@ -1979,8 +1979,8 @@ void WorldServer::SendReloadTasks(int Command, int TaskID) {
SendPacket(pack);
}
void WorldServer::HandleReloadTasks(ServerPacket *pack)
{
void WorldServer::HandleReloadTasks(ServerPacket *pack)
{
ReloadTasks_Struct* rts = (ReloadTasks_Struct*) pack->pBuffer;
_log(TASKS__GLOBALLOAD, "Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command);
@@ -1994,7 +1994,7 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack)
safe_delete(taskmanager);
taskmanager = new TaskManager;
taskmanager->LoadTasks();
if(zone)
if(zone)
taskmanager->LoadProximities(zone->GetZoneID());
entity_list.ReloadAllClientsTaskState();
}
@@ -2052,7 +2052,7 @@ uint32 WorldServer::NextGroupID() {
return(cur_groupid++);
}
void WorldServer::UpdateLFP(uint32 LeaderID, uint8 Action, uint8 MatchFilter, uint32 FromLevel, uint32 ToLevel, uint32 Classes,
void WorldServer::UpdateLFP(uint32 LeaderID, uint8 Action, uint8 MatchFilter, uint32 FromLevel, uint32 ToLevel, uint32 Classes,
const char *Comments, GroupLFPMemberEntry *LFPMembers) {
ServerPacket* pack = new ServerPacket(ServerOP_LFPUpdate, sizeof(ServerLFPUpdate_Struct));
@@ -2123,7 +2123,7 @@ void WorldServer::HandleLFGMatches(ServerPacket *pack) {
client->QueuePacket(outapp);
safe_delete(outapp);
}
}
}
void WorldServer::HandleLFPMatches(ServerPacket *pack) {
@@ -2134,7 +2134,7 @@ void WorldServer::HandleLFPMatches(ServerPacket *pack) {
int Entries = (pack->size - 4) / sizeof(ServerLFPMatchesResponse_Struct);
uint32 EntityID = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
ServerLFPMatchesResponse_Struct* smrs = (ServerLFPMatchesResponse_Struct*)Buffer;
Client* client = entity_list.GetClientByID(EntityID);
@@ -2144,7 +2144,7 @@ void WorldServer::HandleLFPMatches(ServerPacket *pack) {
PacketLength += strlen(smrs->Comments) + 11;
for(unsigned int j=0; j<MAX_GROUP_MEMBERS; j++) {
if(smrs->Members[j].Name[0] != '\0')
if(smrs->Members[j].Name[0] != '\0')
PacketLength += strlen(smrs->Members[j].Name) + 9;
}
smrs++;
@@ -2161,7 +2161,7 @@ void WorldServer::HandleLFPMatches(ServerPacket *pack) {
int MemberCount = 0;
for(unsigned int j=0; j<MAX_GROUP_MEMBERS; j++)
for(unsigned int j=0; j<MAX_GROUP_MEMBERS; j++)
if(smrs->Members[j].Name[0] != '\0')
MemberCount++;