From: Anders R. <ma...@us...> - 2003-04-18 17:01:07
|
Update of /cvsroot/planeshift/planeshift/src/client/aws In directory sc8-pr-cvs1:/tmp/cvs-serv18174/src/client/aws Modified Files: pscommwindow.cpp Log Message: - Added a group manager and group commands. - Fixed some csPtr to pointers in the CEL wrapper code. Index: pscommwindow.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/aws/pscommwindow.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** pscommwindow.cpp 25 Mar 2003 08:14:21 -0000 1.24 --- pscommwindow.cpp 18 Apr 2003 17:00:33 -0000 1.25 *************** *** 218,221 **** --- 218,226 ---- { case CHAT_GROUP: + { + cs_snprintf(buff,1024,"%s tells group: %s\n", + (const char *)msg.sPerson,(const char *)msg.sText); + break; + } case CHAT_SHOUT: { *************** *** 315,320 **** chattype = CHAT_GUILD; } ! else if ( !strncmp(buff+1, "group ", 6) || ! !strncmp(buff+1, "shout ", 6)) { pPerson = ""; --- 320,324 ---- chattype = CHAT_GUILD; } ! else if ( !strncmp(buff+1, "shout ", 6)) { pPerson = ""; *************** *** 323,326 **** --- 327,337 ---- chattype = CHAT_SHOUT; } + else if ( !strncmp(buff+1, "group ", 6)) + { + pPerson = ""; + pText = buff + 7; + *(pText-1) = 0; + chattype = CHAT_GROUP; + } else if ( !strncmp(buff+1, "tell ", 5) ) { *************** *** 336,340 **** chattype = CHAT_TELL; } - else if ( !strncmp(buff+1, "auction ", 8)) { --- 347,350 ---- *************** *** 344,348 **** chattype = CHAT_AUCTION; } - else if ( !strncmp(buff+1, "me ", 3)) { --- 354,357 ---- *************** *** 352,372 **** chattype = CHAT_ME; } - else if ( !strncmp(buff+1, "admin", 5)) - { - delete[] buff; - return "Not implemented yet"; - } - - else if ( !strncmp(buff+1, "help", 4)) - { - delete[] buff; - return "Valid commands: /say, /me, /shout, /group, /guild, " - "/auction, /tell, /admin and /help"; - } - else { delete[] buff; ! return "Invalid command (use /help)"; } --- 361,368 ---- chattype = CHAT_ME; } else { delete[] buff; ! return "Unknown command"; } *************** *** 397,404 **** --- 393,403 ---- char* Str = String->GetData(); + // Ignore empty string if ( Str && strcmp(Str,"") != 0 ) { if ( Str[0] != '/' ) { + // This is no command so add /say infront of text + // before publishing char* tmp = new char[strlen(Str)+7]; tmp[0] = '/'; *************** *** 418,421 **** --- 417,421 ---- else { + // Publish the command const char* pErr = cmdsource->Publish(Str); if ( pErr ) |