[Gcblue-commits] gcb_wx/src/network tcMultiplayerInterface.cpp, 1.40, 1.41
Status: Alpha
                
                Brought to you by:
                
                    ddcforge
                    
                
            | 
      
      
      From: Dewitt C. <ddc...@us...> - 2006-12-20 01:39:23
      
     | 
| Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14177/src/network Modified Files: tcMultiplayerInterface.cpp Log Message: Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcMultiplayerInterface.cpp 6 Dec 2006 01:20:42 -0000 1.40 --- tcMultiplayerInterface.cpp 20 Dec 2006 01:39:20 -0000 1.41 *************** *** 447,452 **** /** * Broadcast chat text to all connected clients */ ! void tcMultiplayerInterface::BroadcastChatText(const std::string& message) { char buff[256]; --- 447,453 ---- /** * Broadcast chat text to all connected clients + * @param alliance 0 to broadcast to all players, otherwise only send to players matching alliance */ ! void tcMultiplayerInterface::BroadcastChatText(const std::string& message, unsigned char alliance) { char buff[256]; *************** *** 464,469 **** int destination = *iter; ! networkInterface->SendMessage(destination, MSG_CHATTEXT, ! messageLength, (unsigned char*)buff, protocol); } --- 465,474 ---- int destination = *iter; ! tcPlayerStatus& player = GetPlayerStatus(destination); ! if ((alliance == 0) || (player.GetAlliance() == alliance)) ! { ! networkInterface->SendMessage(destination, MSG_CHATTEXT, ! messageLength, (unsigned char*)buff, protocol); ! } } *************** *** 1184,1189 **** { SendChatText(connectionId, "*** Help ***"); - SendChatText(connectionId, " /help - print command list"); SendChatText(connectionId, " /alliance <int> - choose alliance"); } else if (command == "alliance") --- 1189,1199 ---- { SendChatText(connectionId, "*** Help ***"); SendChatText(connectionId, " /alliance <int> - choose alliance"); + if (pstatus.IsGM()) + { + SendChatText(connectionId, " /gm - game master commands"); + } + SendChatText(connectionId, " /help - print command list"); + SendChatText(connectionId, " /who - list players"); } else if (command == "alliance") *************** *** 1195,1198 **** --- 1205,1212 ---- ProcessGameMasterCommand(pstatus, args); } + else if (command == "team") + { + ProcessTeamChat(pstatus, args); + } else if (command == "who") { *************** *** 1299,1302 **** --- 1313,1325 ---- /** + * Send chat text to all players with matching alliance + */ + void tcMultiplayerInterface::ProcessTeamChat(const tcPlayerStatus& player, const wxString& msg) + { + BroadcastChatText(msg.c_str(), player.GetAlliance()); + } + + + /** * Send list of players currently in game back to client */ |