@@ -1361,6 +1361,27 @@ void IGameController::Com_ServerInfo(IConsole::IResult *pResult, void *pContext)
13611361 pSelf->GameServer ()->SendChat (-1 , CHAT_ALL, ClientID, pSelf->Config ()->m_SvInfoLine3 );
13621362}
13631363
1364+ void IGameController::Com_Whisper (IConsole::IResult *pResult, void *pContext)
1365+ {
1366+ CCommandManager::SCommandContext *pComContext = (CCommandManager::SCommandContext *)pContext;
1367+ IGameController *pSelf = (IGameController *)pComContext->m_pContext ;
1368+
1369+ int ClientID = pComContext->m_ClientID ;
1370+ {
1371+ const char * TargetID = pResult->GetString (0 );
1372+ if (!(TargetID[0 ] == ' 0' || TargetID[0 ] == ' 1' || TargetID[0 ] == ' 2' || TargetID[0 ] == ' 3' || TargetID[0 ] == ' 4' || TargetID[0 ] == ' 5' || TargetID[0 ] == ' 6' || TargetID[0 ] == ' 7' || TargetID[0 ] == ' 8' || TargetID[0 ] == ' 9' ))
1373+ {
1374+ pSelf->GameServer ()->SendChat (-1 , CHAT_ALL, ClientID, " You need to use client id" );
1375+ return ;
1376+ }
1377+ }
1378+
1379+ int TargetID = pResult->GetInteger (0 );
1380+ const char * pMsg = pResult->GetString (1 );
1381+
1382+ pSelf->GameServer ()->SendChat (ClientID, CHAT_WHISPER, TargetID, pMsg);
1383+ }
1384+
13641385/* void IGameController::Com_Example(IConsole::IResult *pResult, void *pContext)
13651386{
13661387 CCommandManager::SCommandContext *pComContext = (CCommandManager::SCommandContext *)pContext;
@@ -1375,5 +1396,6 @@ void IGameController::RegisterChatCommands(CCommandManager *pManager)
13751396 pManager->AddCommand (" help" , " get info about the current gametype" , " " , Com_GameHelp, this );
13761397 pManager->AddCommand (" restart" , " vote for restarting the match" , " " , Com_Restart, this );
13771398 pManager->AddCommand (" info" , " get info about the server and contact links" , " " , Com_ServerInfo, this );
1399+ pManager->AddCommand (" w" , " send private message" , " ir" , Com_Whisper, this );
13781400 // pManager->AddCommand("test", "Test the command system", "r", Com_Example, this);
13791401}
0 commit comments