From: Andy D. <kha...@us...> - 2005-01-05 23:37:20
|
Update of /cvsroot/planeshift/planeshift/src/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29383/server Modified Files: usermanager.cpp Log Message: Fixed the case where if % appeared in /who the server would crash. Index: usermanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/usermanager.cpp,v retrieving revision 1.180 retrieving revision 1.181 diff -C2 -d -r1.180 -r1.181 *** usermanager.cpp 5 Jan 2005 16:44:59 -0000 1.180 --- usermanager.cpp 5 Jan 2005 23:37:11 -0000 1.181 *************** *** 592,595 **** --- 592,596 ---- csString temp((size_t) 1024); csString headerMsg("Players Currently Online"); + psString filter(msg.filter); if (!msg.filter.IsEmpty()) { *************** *** 597,600 **** --- 598,602 ---- headerMsg.Append(msg.filter); headerMsg.Append("*')"); + filter.ReplaceAllSubString("%", ""); } message.Append(headerMsg); *************** *** 609,613 **** { csString playerName(curr->GetName()); ! if (!msg.filter.IsEmpty() && !playerName.StartsWith(msg.filter, true)) continue; --- 611,615 ---- { csString playerName(curr->GetName()); ! if (!filter.IsEmpty() && !playerName.StartsWith(filter, true)) continue; *************** *** 641,645 **** if(temp.Length() + message.Length() > 1000) { ! psserver->SafeSendSystemMessage(clientnum,MSG_INFO, message.GetData()); message.Clear(); } --- 643,647 ---- if(temp.Length() + message.Length() > 1000) { ! psserver->SafeSendSystemMessage(clientnum,MSG_INFO, message); message.Clear(); } *************** *** 654,658 **** if(temp.Length() + message.Length() > 1000) { ! psserver->SafeSendSystemMessage(clientnum, MSG_INFO, message.GetData()); message.Clear(); } --- 656,660 ---- if(temp.Length() + message.Length() > 1000) { ! psserver->SafeSendSystemMessage(clientnum, MSG_INFO, message); message.Clear(); } *************** *** 660,664 **** message.Append('\n'); message.Append(temp); ! psserver->SafeSendSystemMessage(clientnum, MSG_INFO, message.GetData()); } --- 662,666 ---- message.Append('\n'); message.Append(temp); ! psserver->SafeSendSystemMessage(clientnum, MSG_INFO, message); } |