about summary refs log tree commit diff
path: root/src/engine/server/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/server/server.cpp')
-rw-r--r--src/engine/server/server.cpp226
1 files changed, 113 insertions, 113 deletions
diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp
index 95cb06bd..30cdf259 100644
--- a/src/engine/server/server.cpp
+++ b/src/engine/server/server.cpp
@@ -113,15 +113,15 @@ int CSnapIDPool::NewID()
 	while(m_FirstTimed != -1 && m_aIDs[m_FirstTimed].m_Timeout < Now)
 		RemoveFirstTimeout();
 	
-	int Id = m_FirstFree;
-	dbg_assert(Id != -1, "id error");
-	if(Id == -1)
-		return Id;
+	int ID = m_FirstFree;
+	dbg_assert(ID != -1, "id error");
+	if(ID == -1)
+		return ID;
 	m_FirstFree = m_aIDs[m_FirstFree].m_Next;
-	m_aIDs[Id].m_State = 1;
+	m_aIDs[ID].m_State = 1;
 	m_Usage++;
 	m_InUsage++;
-	return Id;
+	return ID;
 }
 
 void CSnapIDPool::TimeoutIDs()
@@ -131,26 +131,26 @@ void CSnapIDPool::TimeoutIDs()
 		RemoveFirstTimeout();
 }
 
-void CSnapIDPool::FreeID(int Id)
+void CSnapIDPool::FreeID(int ID)
 {
-	if(Id < 0)
+	if(ID < 0)
 		return;
-	dbg_assert(m_aIDs[Id].m_State == 1, "id is not alloced");
+	dbg_assert(m_aIDs[ID].m_State == 1, "id is not alloced");
 
 	m_InUsage--;
-	m_aIDs[Id].m_State = 2;
-	m_aIDs[Id].m_Timeout = time_get()+time_freq()*5;
-	m_aIDs[Id].m_Next = -1;
+	m_aIDs[ID].m_State = 2;
+	m_aIDs[ID].m_Timeout = time_get()+time_freq()*5;
+	m_aIDs[ID].m_Next = -1;
 	
 	if(m_LastTimed != -1)
 	{
-		m_aIDs[m_LastTimed].m_Next = Id;
-		m_LastTimed = Id;
+		m_aIDs[m_LastTimed].m_Next = ID;
+		m_LastTimed = ID;
 	}
 	else
 	{
-		m_FirstTimed = Id;
-		m_LastTimed = Id;
+		m_FirstTimed = ID;
+		m_LastTimed = ID;
 	}
 }
 	
@@ -186,7 +186,7 @@ CServer::CServer() : m_DemoRecorder(&m_SnapshotDelta)
 	
 	m_MapReload = 0;
 
-	m_RconClientId = -1;
+	m_RconClientID = -1;
 
 	Init();
 }
@@ -270,7 +270,7 @@ void CServer::Kick(int ClientID, const char *pReason)
 		Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "invalid client id to kick");
 		return;
 	}
-	else if(m_RconClientId == ClientID)
+	else if(m_RconClientID == ClientID)
 	{
 		Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "you can't kick yourself");
  		return;
@@ -338,20 +338,20 @@ void CServer::GetClientIP(int ClientID, char *pIPString, int Size)
 }
 	
 
-int *CServer::LatestInput(int ClientId, int *size)
+int *CServer::LatestInput(int ClientID, int *size)
 {
-	if(ClientId < 0 || ClientId >= MAX_CLIENTS || m_aClients[ClientId].m_State < CServer::CClient::STATE_READY)
+	if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State < CServer::CClient::STATE_READY)
 		return 0;
-	return m_aClients[ClientId].m_LatestInput.m_aData;
+	return m_aClients[ClientID].m_LatestInput.m_aData;
 }
 
-const char *CServer::ClientName(int ClientId)
+const char *CServer::ClientName(int ClientID)
 {
-	if(ClientId < 0 || ClientId >= MAX_CLIENTS || m_aClients[ClientId].m_State == CServer::CClient::STATE_EMPTY)
+	if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State == CServer::CClient::STATE_EMPTY)
 		return "(invalid client)";
-	else if(m_aClients[ClientId].m_State < CServer::CClient::STATE_READY)
+	else if(m_aClients[ClientID].m_State < CServer::CClient::STATE_READY)
 		return "(connecting client)";
-	return m_aClients[ClientId].m_aName;
+	return m_aClients[ClientID].m_aName;
 }	
 
 bool CServer::ClientIngame(int ClientID)
@@ -359,9 +359,9 @@ bool CServer::ClientIngame(int ClientID)
 	return ClientID >= 0 && ClientID < MAX_CLIENTS && m_aClients[ClientID].m_State == CServer::CClient::STATE_INGAME;
 }
 
-int CServer::SendMsg(CMsgPacker *pMsg, int Flags, int ClientId)
+int CServer::SendMsg(CMsgPacker *pMsg, int Flags, int ClientID)
 {
-	return SendMsgEx(pMsg, Flags, ClientId, false);
+	return SendMsgEx(pMsg, Flags, ClientID, false);
 }
 
 int CServer::SendMsgEx(CMsgPacker *pMsg, int Flags, int ClientID, bool System)
@@ -542,57 +542,57 @@ void CServer::DoSnapshot()
 }
 
 
-int CServer::NewClientCallback(int ClientId, void *pUser)
+int CServer::NewClientCallback(int ClientID, void *pUser)
 {
 	CServer *pThis = (CServer *)pUser;
-	pThis->m_aClients[ClientId].m_State = CClient::STATE_AUTH;
-	pThis->m_aClients[ClientId].m_aName[0] = 0;
-	pThis->m_aClients[ClientId].m_aClan[0] = 0;
-	pThis->m_aClients[ClientId].m_Authed = 0;
-	pThis->m_aClients[ClientId].m_AuthTries = 0;
-	pThis->m_aClients[ClientId].Reset();
+	pThis->m_aClients[ClientID].m_State = CClient::STATE_AUTH;
+	pThis->m_aClients[ClientID].m_aName[0] = 0;
+	pThis->m_aClients[ClientID].m_aClan[0] = 0;
+	pThis->m_aClients[ClientID].m_Authed = 0;
+	pThis->m_aClients[ClientID].m_AuthTries = 0;
+	pThis->m_aClients[ClientID].Reset();
 	return 0;
 }
 
-int CServer::DelClientCallback(int ClientId, const char *pReason, void *pUser)
+int CServer::DelClientCallback(int ClientID, const char *pReason, void *pUser)
 {
 	CServer *pThis = (CServer *)pUser;
 	
-	NETADDR Addr = pThis->m_NetServer.ClientAddr(ClientId);
+	NETADDR Addr = pThis->m_NetServer.ClientAddr(ClientID);
 	char aBuf[256];
 	str_format(aBuf, sizeof(aBuf), "client dropped. cid=%d ip=%d.%d.%d.%d reason=\"%s\"",
-		ClientId,
+		ClientID,
 		Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3],
 		pReason
 	);
 	pThis->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
 
 	// notify the mod about the drop
-	if(pThis->m_aClients[ClientId].m_State >= CClient::STATE_READY)
-		pThis->GameServer()->OnClientDrop(ClientId);
+	if(pThis->m_aClients[ClientID].m_State >= CClient::STATE_READY)
+		pThis->GameServer()->OnClientDrop(ClientID);
 	
-	pThis->m_aClients[ClientId].m_State = CClient::STATE_EMPTY;
-	pThis->m_aClients[ClientId].m_aName[0] = 0;
-	pThis->m_aClients[ClientId].m_aClan[0] = 0;
-	pThis->m_aClients[ClientId].m_Authed = 0;
-	pThis->m_aClients[ClientId].m_AuthTries = 0;
-	pThis->m_aClients[ClientId].m_Snapshots.PurgeAll();
+	pThis->m_aClients[ClientID].m_State = CClient::STATE_EMPTY;
+	pThis->m_aClients[ClientID].m_aName[0] = 0;
+	pThis->m_aClients[ClientID].m_aClan[0] = 0;
+	pThis->m_aClients[ClientID].m_Authed = 0;
+	pThis->m_aClients[ClientID].m_AuthTries = 0;
+	pThis->m_aClients[ClientID].m_Snapshots.PurgeAll();
 	return 0;
 }
 
-void CServer::SendMap(int ClientId)
+void CServer::SendMap(int ClientID)
 {
 	CMsgPacker Msg(NETMSG_MAP_CHANGE);
 	Msg.AddString(GetMapName(), 0);
 	Msg.AddInt(m_CurrentMapCrc);
-	SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientId, true);
+	SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientID, true);
 }
 
-void CServer::SendRconLine(int ClientId, const char *pLine)
+void CServer::SendRconLine(int ClientID, const char *pLine)
 {
 	CMsgPacker Msg(NETMSG_RCON_LINE);
 	Msg.AddString(pLine, 512);
-	SendMsgEx(&Msg, MSGFLAG_VITAL, ClientId, true);
+	SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true);
 }
 
 void CServer::SendRconLineAuthed(const char *pLine, void *pUser)
@@ -615,7 +615,7 @@ void CServer::SendRconLineAuthed(const char *pLine, void *pUser)
 
 void CServer::ProcessClientPacket(CNetChunk *pPacket)
 {
-	int ClientId = pPacket->m_ClientID;
+	int ClientID = pPacket->m_ClientID;
 	NETADDR Addr;
 	CUnpacker Unpacker;
 	Unpacker.Reset(pPacket->m_pData, pPacket->m_DataSize);
@@ -628,7 +628,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 	if(Unpacker.Error())
 		return;
 	
-	if(m_aClients[ClientId].m_State == CClient::STATE_AUTH)
+	if(m_aClients[ClientID].m_State == CClient::STATE_AUTH)
 	{
 		if(Sys && Msg == NETMSG_INFO)
 		{
@@ -640,23 +640,23 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 				// OH FUCK! wrong version, drop him
 				char aReason[256];
 				str_format(aReason, sizeof(aReason), "Wrong version. Server is running '%s' and client '%s'", GameServer()->NetVersion(), aVersion);
-				m_NetServer.Drop(ClientId, aReason);
+				m_NetServer.Drop(ClientID, aReason);
 				return;
 			}
 			
-			str_copy(m_aClients[ClientId].m_aName, Unpacker.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), MAX_NAME_LENGTH);
-			str_copy(m_aClients[ClientId].m_aClan, Unpacker.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), MAX_CLANNAME_LENGTH);
+			str_copy(m_aClients[ClientID].m_aName, Unpacker.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), MAX_NAME_LENGTH);
+			str_copy(m_aClients[ClientID].m_aClan, Unpacker.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), MAX_CLANNAME_LENGTH);
 			pPassword = Unpacker.GetString(CUnpacker::SANITIZE_CC);
 			
 			if(g_Config.m_Password[0] != 0 && str_comp(g_Config.m_Password, pPassword) != 0)
 			{
 				// wrong password
-				m_NetServer.Drop(ClientId, "Wrong password");
+				m_NetServer.Drop(ClientID, "Wrong password");
 				return;
 			}
 			
-			m_aClients[ClientId].m_State = CClient::STATE_CONNECTING;
-			SendMap(ClientId);
+			m_aClients[ClientID].m_State = CClient::STATE_CONNECTING;
+			SendMap(ClientID);
 		}
 	}
 	else
@@ -688,7 +688,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 				Msg.AddInt(m_CurrentMapSize);
 				Msg.AddInt(ChunkSize);
 				Msg.AddRaw(&m_pCurrentMapData[Offset], ChunkSize);
-				SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientId, true);
+				SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientID, true);
 				
 				if(g_Config.m_Debug)
 				{
@@ -699,30 +699,30 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 			}
 			else if(Msg == NETMSG_READY)
 			{
-				if(m_aClients[ClientId].m_State == CClient::STATE_CONNECTING)
+				if(m_aClients[ClientID].m_State == CClient::STATE_CONNECTING)
 				{
-					Addr = m_NetServer.ClientAddr(ClientId);
+					Addr = m_NetServer.ClientAddr(ClientID);
 					
 					char aBuf[256];
-					str_format(aBuf, sizeof(aBuf), "player is ready. ClientId=%x ip=%d.%d.%d.%d",
-						ClientId, Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3]);
+					str_format(aBuf, sizeof(aBuf), "player is ready. ClientID=%x ip=%d.%d.%d.%d",
+						ClientID, Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3]);
 					Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
-					m_aClients[ClientId].m_State = CClient::STATE_READY;
-					GameServer()->OnClientConnected(ClientId);
+					m_aClients[ClientID].m_State = CClient::STATE_READY;
+					GameServer()->OnClientConnected(ClientID);
 				}
 			}
 			else if(Msg == NETMSG_ENTERGAME)
 			{
-				if(m_aClients[ClientId].m_State == CClient::STATE_READY)
+				if(m_aClients[ClientID].m_State == CClient::STATE_READY)
 				{
-					Addr = m_NetServer.ClientAddr(ClientId);
+					Addr = m_NetServer.ClientAddr(ClientID);
 					
 					char aBuf[256];
-					str_format(aBuf, sizeof(aBuf), "player has entered the game. ClientId=%x ip=%d.%d.%d.%d",
-						ClientId, Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3]);
+					str_format(aBuf, sizeof(aBuf), "player has entered the game. ClientID=%x ip=%d.%d.%d.%d",
+						ClientID, Addr.ip[0], Addr.ip[1], Addr.ip[2], Addr.ip[3]);
 					Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
-					m_aClients[ClientId].m_State = CClient::STATE_INGAME;
-					GameServer()->OnClientEnter(ClientId);
+					m_aClients[ClientID].m_State = CClient::STATE_INGAME;
+					GameServer()->OnClientEnter(ClientID);
 				}
 			}
 			else if(Msg == NETMSG_INPUT)
@@ -730,7 +730,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 				CClient::CInput *pInput;
 				int64 TagTime;
 				
-				m_aClients[ClientId].m_LastAckedSnapshot = Unpacker.GetInt();
+				m_aClients[ClientID].m_LastAckedSnapshot = Unpacker.GetInt();
 				int IntendedTick = Unpacker.GetInt();
 				int Size = Unpacker.GetInt();
 				
@@ -738,27 +738,27 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 				if(Unpacker.Error() || Size/4 > MAX_INPUT_SIZE)
 					return;
 
-				if(m_aClients[ClientId].m_LastAckedSnapshot > 0)
-					m_aClients[ClientId].m_SnapRate = CClient::SNAPRATE_FULL;
+				if(m_aClients[ClientID].m_LastAckedSnapshot > 0)
+					m_aClients[ClientID].m_SnapRate = CClient::SNAPRATE_FULL;
 					
-				if(m_aClients[ClientId].m_Snapshots.Get(m_aClients[ClientId].m_LastAckedSnapshot, &TagTime, 0, 0) >= 0)
-					m_aClients[ClientId].m_Latency = (int)(((time_get()-TagTime)*1000)/time_freq());
+				if(m_aClients[ClientID].m_Snapshots.Get(m_aClients[ClientID].m_LastAckedSnapshot, &TagTime, 0, 0) >= 0)
+					m_aClients[ClientID].m_Latency = (int)(((time_get()-TagTime)*1000)/time_freq());
 
 				// add message to report the input timing
 				// skip packets that are old
-				if(IntendedTick > m_aClients[ClientId].m_LastInputTick)
+				if(IntendedTick > m_aClients[ClientID].m_LastInputTick)
 				{
 					int TimeLeft = ((TickStartTime(IntendedTick)-time_get())*1000) / time_freq();
 					
 					CMsgPacker Msg(NETMSG_INPUTTIMING);
 					Msg.AddInt(IntendedTick);
 					Msg.AddInt(TimeLeft);
-					SendMsgEx(&Msg, 0, ClientId, true);
+					SendMsgEx(&Msg, 0, ClientID, true);
 				}
 
-				m_aClients[ClientId].m_LastInputTick = IntendedTick;
+				m_aClients[ClientID].m_LastInputTick = IntendedTick;
 
-				pInput = &m_aClients[ClientId].m_aInputs[m_aClients[ClientId].m_CurrentInput];
+				pInput = &m_aClients[ClientID].m_aInputs[m_aClients[ClientID].m_CurrentInput];
 				
 				if(IntendedTick <= Tick())
 					IntendedTick = Tick()+1;
@@ -768,27 +768,27 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 				for(int i = 0; i < Size/4; i++)
 					pInput->m_aData[i] = Unpacker.GetInt();
 				
-				mem_copy(m_aClients[ClientId].m_LatestInput.m_aData, pInput->m_aData, MAX_INPUT_SIZE*sizeof(int));
+				mem_copy(m_aClients[ClientID].m_LatestInput.m_aData, pInput->m_aData, MAX_INPUT_SIZE*sizeof(int));
 				
-				m_aClients[ClientId].m_CurrentInput++;
-				m_aClients[ClientId].m_CurrentInput %= 200;
+				m_aClients[ClientID].m_CurrentInput++;
+				m_aClients[ClientID].m_CurrentInput %= 200;
 			
 				// call the mod with the fresh input data
-				if(m_aClients[ClientId].m_State == CClient::STATE_INGAME)
-					GameServer()->OnClientDirectInput(ClientId, m_aClients[ClientId].m_LatestInput.m_aData);
+				if(m_aClients[ClientID].m_State == CClient::STATE_INGAME)
+					GameServer()->OnClientDirectInput(ClientID, m_aClients[ClientID].m_LatestInput.m_aData);
 			}
 			else if(Msg == NETMSG_RCON_CMD)
 			{
 				const char *pCmd = Unpacker.GetString();
 				
-				if(Unpacker.Error() == 0 && m_aClients[ClientId].m_Authed)
+				if(Unpacker.Error() == 0 && m_aClients[ClientID].m_Authed)
 				{
 					char aBuf[256];
-					str_format(aBuf, sizeof(aBuf), "ClientId=%d rcon='%s'", ClientId, pCmd);
+					str_format(aBuf, sizeof(aBuf), "ClientID=%d rcon='%s'", ClientID, pCmd);
 					Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf);
-					m_RconClientId = ClientId;
+					m_RconClientID = ClientID;
 					Console()->ExecuteLine(pCmd);
-					m_RconClientId = -1;
+					m_RconClientID = -1;
 				}
 			}
 			else if(Msg == NETMSG_RCON_AUTH)
@@ -801,47 +801,47 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 				{
 					if(g_Config.m_SvRconPassword[0] == 0)
 					{
-						SendRconLine(ClientId, "No rcon password set on server. Set sv_rcon_password to enable the remote console.");
+						SendRconLine(ClientID, "No rcon password set on server. Set sv_rcon_password to enable the remote console.");
 					}
 					else if(str_comp(pPw, g_Config.m_SvRconPassword) == 0)
 					{
 						CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS);
 						Msg.AddInt(1);
-						SendMsgEx(&Msg, MSGFLAG_VITAL, ClientId, true);
+						SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true);
 						
-						m_aClients[ClientId].m_Authed = 1;
-						SendRconLine(ClientId, "Authentication successful. Remote console access granted.");
+						m_aClients[ClientID].m_Authed = 1;
+						SendRconLine(ClientID, "Authentication successful. Remote console access granted.");
 						char aBuf[256];
-						str_format(aBuf, sizeof(aBuf), "ClientId=%d authed", ClientId);
+						str_format(aBuf, sizeof(aBuf), "ClientID=%d authed", ClientID);
 						Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
 					}
 					else if(g_Config.m_SvRconMaxTries)
 					{
-						m_aClients[ClientId].m_AuthTries++;
+						m_aClients[ClientID].m_AuthTries++;
 						char aBuf[128];
-						str_format(aBuf, sizeof(aBuf), "Wrong password %d/%d.", m_aClients[ClientId].m_AuthTries, g_Config.m_SvRconMaxTries);
-						SendRconLine(ClientId, aBuf);
-						if(m_aClients[ClientId].m_AuthTries >= g_Config.m_SvRconMaxTries)
+						str_format(aBuf, sizeof(aBuf), "Wrong password %d/%d.", m_aClients[ClientID].m_AuthTries, g_Config.m_SvRconMaxTries);
+						SendRconLine(ClientID, aBuf);
+						if(m_aClients[ClientID].m_AuthTries >= g_Config.m_SvRconMaxTries)
 						{
 							if(!g_Config.m_SvRconBantime)
-								m_NetServer.Drop(ClientId, "Too many remote console authentication tries");
+								m_NetServer.Drop(ClientID, "Too many remote console authentication tries");
 							else
 							{
-								NETADDR Addr = m_NetServer.ClientAddr(ClientId);
+								NETADDR Addr = m_NetServer.ClientAddr(ClientID);
 								BanAdd(Addr, g_Config.m_SvRconBantime*60, "Too many remote console authentication tries");
 							}
 						}
 					}
 					else
 					{
-						SendRconLine(ClientId, "Wrong password.");
+						SendRconLine(ClientID, "Wrong password.");
 					}
 				}
 			}
 			else if(Msg == NETMSG_PING)
 			{
 				CMsgPacker Msg(NETMSG_PING_REPLY);
-				SendMsgEx(&Msg, 0, ClientId, true);
+				SendMsgEx(&Msg, 0, ClientID, true);
 			}
 			else
 			{
@@ -859,7 +859,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 					}
 
 					char aBufMsg[256];
-					str_format(aBufMsg, sizeof(aBufMsg), "strange message ClientId=%d msg=%d data_size=%d", ClientId, Msg, pPacket->m_DataSize);
+					str_format(aBufMsg, sizeof(aBufMsg), "strange message ClientID=%d msg=%d data_size=%d", ClientID, Msg, pPacket->m_DataSize);
 					Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "server", aBufMsg);
 					Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "server", aBuf);
 				}
@@ -868,8 +868,8 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 		else
 		{
 			// game message
-			if(m_aClients[ClientId].m_State >= CClient::STATE_READY)
-				GameServer()->OnMessage(Msg, &Unpacker, ClientId);
+			if(m_aClients[ClientID].m_State >= CClient::STATE_READY)
+				GameServer()->OnMessage(Msg, &Unpacker, ClientID);
 		}
 	}
 }
@@ -1286,9 +1286,9 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser)
 	
 	if(net_addr_from_str(&Addr, pStr) == 0)
 	{
-		if(pServer->m_RconClientId >= 0 && pServer->m_RconClientId < MAX_CLIENTS && pServer->m_aClients[pServer->m_RconClientId].m_State != CClient::STATE_EMPTY)
+		if(pServer->m_RconClientID >= 0 && pServer->m_RconClientID < MAX_CLIENTS && pServer->m_aClients[pServer->m_RconClientID].m_State != CClient::STATE_EMPTY)
 		{
-			NETADDR AddrCheck = pServer->m_NetServer.ClientAddr(pServer->m_RconClientId);
+			NETADDR AddrCheck = pServer->m_NetServer.ClientAddr(pServer->m_RconClientID);
 			Addr.port = AddrCheck.port = 0;
 			if(net_addr_comp(&Addr, &AddrCheck) == 0)
 			{
@@ -1300,20 +1300,20 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser)
 	}
 	else if(StrAllnum(pStr))
 	{
-		int ClientId = str_toint(pStr);
+		int ClientID = str_toint(pStr);
 
-		if(ClientId < 0 || ClientId >= MAX_CLIENTS || pServer->m_aClients[ClientId].m_State == CClient::STATE_EMPTY)
+		if(ClientID < 0 || ClientID >= MAX_CLIENTS || pServer->m_aClients[ClientID].m_State == CClient::STATE_EMPTY)
 		{
 			pServer->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "invalid client id");
 			return;
 		}
-		else if(pServer->m_RconClientId == ClientId)
+		else if(pServer->m_RconClientID == ClientID)
 		{
 			pServer->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "you can't ban yourself");
 			return;
 		}
 
-		Addr = pServer->m_NetServer.ClientAddr(ClientId);
+		Addr = pServer->m_NetServer.ClientAddr(ClientID);
 		pServer->BanAdd(Addr, Minutes*60, pReason);
 	}
 	else
@@ -1483,11 +1483,11 @@ void CServer::SnapFreeID(int ID)
 }
 
 
-void *CServer::SnapNewItem(int Type, int Id, int Size)
+void *CServer::SnapNewItem(int Type, int ID, int Size)
 {
 	dbg_assert(Type >= 0 && Type <=0xffff, "incorrect type");
-	dbg_assert(Id >= 0 && Id <=0xffff, "incorrect id");
-	return Id < 0 ? 0 : m_SnapshotBuilder.NewItem(Type, Id, Size);		
+	dbg_assert(ID >= 0 && ID <=0xffff, "incorrect id");
+	return ID < 0 ? 0 : m_SnapshotBuilder.NewItem(Type, ID, Size);		
 }
 
 void CServer::SnapSetStaticsize(int ItemType, int Size)