network_server.c
changeset 1795 06f7b463ee52
parent 1752 d65cd19f7117
child 1804 fbe724472bb4
equal deleted inserted replaced
1794:24b4239f2090 1795:06f7b463ee52
   820 
   820 
   821 	ci = DEREF_CLIENT_INFO(cs);
   821 	ci = DEREF_CLIENT_INFO(cs);
   822 	// Only CMD_PLAYER_CTRL is always allowed, for the rest, playas needs
   822 	// Only CMD_PLAYER_CTRL is always allowed, for the rest, playas needs
   823 	//  to match the player in the packet
   823 	//  to match the player in the packet
   824 	if (!(cp->cmd == CMD_PLAYER_CTRL && cp->p1 == 0) && ci->client_playas-1 != cp->player) {
   824 	if (!(cp->cmd == CMD_PLAYER_CTRL && cp->p1 == 0) && ci->client_playas-1 != cp->player) {
       
   825 		IConsolePrintF(_iconsole_color_error, "WARNING: player %d (IP: %s) tried to execute a command as player %d, kicking...",
       
   826 									 ci->client_playas - 1, inet_ntoa(*(struct in_addr *)&ci->client_ip), cp->player);
   825 		// The player did a command with the wrong player_id.. bad!!
   827 		// The player did a command with the wrong player_id.. bad!!
   826 		SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_PLAYER_MISMATCH);
   828 		SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_PLAYER_MISMATCH);
   827 		return;
   829 		return;
   828 	}
   830 	}
   829 	switch (cp->cmd) {
   831 	switch (cp->cmd) {