about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gamecontext.cpp37
-rw-r--r--src/game/server/gamecontext.hpp1
-rw-r--r--src/game/server/hooks.cpp11
-rw-r--r--src/game/server/player.cpp14
4 files changed, 7 insertions, 56 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 0cdd4227..a36a9144 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -170,29 +170,6 @@ void GAMECONTEXT::send_chat(int chatter_cid, int team, const char *text)
 	}
 }
 
-
-void GAMECONTEXT::send_info(int who, int to_who, bool recordonly)
-{
-	NETMSG_SV_SETINFO msg;
-	msg.cid = who;
-	msg.name = server_clientname(who);
-	msg.skin = players[who]->skin_name;
-	msg.use_custom_color = players[who]->use_custom_color;
-	msg.color_body = players[who]->color_body;
-	msg.color_feet = players[who]->color_feet;
-	
-	if(recordonly)
-	{
-		msg.pack(MSGFLAG_NOSEND);
-		server_send_msg(to_who);
-	}
-	else
-	{
-		msg.pack(MSGFLAG_VITAL);
-		server_send_msg(to_who);
-	}
-}
-
 void GAMECONTEXT::send_emoticon(int cid, int emoticon)
 {
 	NETMSG_SV_EMOTICON msg;
@@ -219,8 +196,6 @@ void GAMECONTEXT::send_broadcast(const char *text, int cid)
 	server_send_msg(cid);
 }
 
-
-
 // 
 void GAMECONTEXT::start_vote(const char *desc, const char *command)
 {
@@ -341,18 +316,6 @@ void GAMECONTEXT::tick()
 
 void GAMECONTEXT::snap(int client_id)
 {
-	// check if we are recording a demo
-	if(client_id == -1)
-	{
-		// we are recording, make sure that we set
-		// the info for all players all the time
-		for(int i = 0; i < MAX_CLIENTS; i++)
-		{
-			if(game.players[i])
-				send_info(i, -1, true);
-		}
-	}
-	
 	world.snap(client_id);
 	controller->snap(client_id);
 	events.snap(client_id);
diff --git a/src/game/server/gamecontext.hpp b/src/game/server/gamecontext.hpp
index 8a1ff918..6e833178 100644
--- a/src/game/server/gamecontext.hpp
+++ b/src/game/server/gamecontext.hpp
@@ -77,7 +77,6 @@ public:
 	void send_emoticon(int cid, int emoticon);
 	void send_weapon_pickup(int cid, int weapon);
 	void send_broadcast(const char *text, int cid);
-	void send_info(int who, int to_who, bool recordonly = false);
 
 };
 
diff --git a/src/game/server/hooks.cpp b/src/game/server/hooks.cpp
index b3425694..d8e6c9bb 100644
--- a/src/game/server/hooks.cpp
+++ b/src/game/server/hooks.cpp
@@ -281,15 +281,6 @@ void mods_message(int msgtype, int client_id)
 		
 		if(msgtype == NETMSGTYPE_CL_STARTINFO)
 		{
-			// a client that connected!
-			
-			// send all info to this client
-			for(int i = 0; i < MAX_CLIENTS; i++)
-			{
-				if(game.players[i])
-					game.send_info(i, client_id);
-			}
-
 			// send tuning parameters to client
 			send_tuning_params(client_id);
 			
@@ -306,8 +297,6 @@ void mods_message(int msgtype, int client_id)
 			m.pack(MSGFLAG_VITAL|MSGFLAG_FLUSH);
 			server_send_msg(client_id);
 		}
-		
-		game.send_info(client_id, -1);
 	}
 	else if (msgtype == NETMSGTYPE_CL_EMOTICON)
 	{
diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp
index 45d56388..b2f72d0e 100644
--- a/src/game/server/player.cpp
+++ b/src/game/server/player.cpp
@@ -62,6 +62,13 @@ void PLAYER::tick()
 
 void PLAYER::snap(int snaping_client)
 {
+	NETOBJ_CLIENT_INFO *client_info = (NETOBJ_CLIENT_INFO *)snap_new_item(NETOBJTYPE_CLIENT_INFO, client_id, sizeof(NETOBJ_CLIENT_INFO));
+	str_to_ints(&client_info->name0, 6, server_clientname(client_id));
+	str_to_ints(&client_info->skin0, 6, skin_name);
+	client_info->use_custom_color = use_custom_color;
+	client_info->color_body = color_body;
+	client_info->color_feet = color_feet;
+
 	NETOBJ_PLAYER_INFO *info = (NETOBJ_PLAYER_INFO *)snap_new_item(NETOBJTYPE_PLAYER_INFO, client_id, sizeof(NETOBJ_PLAYER_INFO));
 
 	info->latency = latency.min;
@@ -151,13 +158,6 @@ void PLAYER::set_team(int new_team)
 	dbg_msg("game", "team_join player='%d:%s' team=%d", client_id, server_clientname(client_id), team);
 	
 	game.controller->on_player_info_change(game.players[client_id]);
-
-	// send all info to this client
-	for(int i = 0; i < MAX_CLIENTS; i++)
-	{
-		if(game.players[i])
-			game.send_info(i, -1);
-	}
 }
 
 void PLAYER::try_respawn()