From: DaveG <da...@us...> - 2005-10-16 23:06:20
|
Update of /cvsroot/planeshift/planeshift/src/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15195/src/server Modified Files: adminmanager.cpp Log Message: Fixed a bug where /slide me direction was falsely being reported to the server as an error. Index: adminmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/adminmanager.cpp,v retrieving revision 1.203 retrieving revision 1.204 diff -C2 -d -r1.203 -r1.204 *** adminmanager.cpp 16 Oct 2005 20:24:44 -0000 1.203 --- adminmanager.cpp 16 Oct 2005 23:06:12 -0000 1.204 *************** *** 295,302 **** if (!msg.valid) return; ! ! ! // log the gm command ! int targetID = 0; if ( msg.player.Length() > 0 ) { --- 295,302 ---- if (!msg.valid) return; ! ! int targetID = 0; ! Client* targetclient = NULL; ! if ( msg.player.Length() > 0 ) { *************** *** 304,311 **** target = NormalizeCharacterName(target); ! Client* client = clients->Find(target); ! if(client) { ! targetID = client->GetPlayerID(); } else --- 304,315 ---- target = NormalizeCharacterName(target); ! if (msg.player == "me") ! targetclient = client; ! else ! targetclient = FindPlayerClient(msg.player, me->clientnum); ! ! if(targetclient) { ! targetID = targetclient->GetPlayerID(); } else *************** *** 315,319 **** targetID = object->GetPlayerID(); } ! } LogGMCommand( clients->Find(me->clientnum)->GetPlayerID(), targetID, msg.cmd); --- 319,324 ---- targetID = object->GetPlayerID(); } ! } ! LogGMCommand( clients->Find(me->clientnum)->GetPlayerID(), targetID, msg.cmd); *************** *** 361,373 **** else if (msg.command == "/mute") { ! Client *target; ! if ( (target = FindPlayerClient(msg.player, me->clientnum)) ) ! MutePlayer(me,msg,client,target); } else if (msg.command == "/unmute") { ! Client *target; ! if ( (target = FindPlayerClient(msg.player, me->clientnum)) ) ! UnmutePlayer(me,msg,client,target); } else if (msg.command == "/teleport") --- 366,374 ---- else if (msg.command == "/mute") { ! MutePlayer(me,msg,client,targetclient); } else if (msg.command == "/unmute") { ! UnmutePlayer(me,msg,client,targetclient); } else if (msg.command == "/teleport") *************** *** 377,385 **** else if (msg.command == "/slide") { ! Client *target; ! if (msg.player == "me") ! SlideTarget(me,msg,client,client); ! else if ( (target = FindPlayerClient(msg.player,me->clientnum)) ) ! SlideTarget(me,msg,client,target); } else if (msg.command == "/petition") --- 378,382 ---- else if (msg.command == "/slide") { ! SlideTarget(me,msg,client,targetclient); } else if (msg.command == "/petition") *************** *** 389,395 **** else if (msg.command == "/kick") { ! Client *target; ! if ( (target = FindPlayerClient(msg.player, me->clientnum)) ) ! KickPlayer(me,msg,client,target); } else if (msg.command == "/death" ) --- 386,390 ---- else if (msg.command == "/kick") { ! KickPlayer(me,msg,client,targetclient); } else if (msg.command == "/death" ) *************** *** 1031,1034 **** --- 1026,1032 ---- } + if (!target) + return; + csVector3 pos; iSector* sector = 0; *************** *** 1688,1691 **** --- 1686,1692 ---- } + if (!target) + return; + // Now we have a valid player target, so remove from server psserver->RemovePlayer(target->GetClientNum(),"You were kicked from the server by a GM. Reason: " + msg.reason); *************** *** 1802,1806 **** } ! // Grab the player who was specified in the command call psserver->MutePlayer(target->GetClientNum(),"You were muted by a GM, until log off."); --- 1803,1808 ---- } ! if (!target) ! return; psserver->MutePlayer(target->GetClientNum(),"You were muted by a GM, until log off."); *************** *** 1820,1823 **** --- 1822,1828 ---- } + if (!target) + return; + psserver->UnmutePlayer(target->GetClientNum(),"You were unmuted by a GM."); |