about summary refs log tree commit diff
path: root/src/game/client/gc_hooks.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-06-12 10:51:48 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-06-12 10:51:48 +0000
commitf6c67c29cd10d41b877ee1319801edc01b625e72 (patch)
tree6ca26c44ac0218a57d078a6f72034f2924b44104 /src/game/client/gc_hooks.cpp
parent0d3b988c1aed8f6b91879a801253db81a251a532 (diff)
downloadzcatch-f6c67c29cd10d41b877ee1319801edc01b625e72.tar.gz
zcatch-f6c67c29cd10d41b877ee1319801edc01b625e72.zip
large commit with loads of clean up. more is comming
Diffstat (limited to 'src/game/client/gc_hooks.cpp')
-rw-r--r--src/game/client/gc_hooks.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp
index 36e166d4..61e5f2e8 100644
--- a/src/game/client/gc_hooks.cpp
+++ b/src/game/client/gc_hooks.cpp
@@ -83,7 +83,7 @@ extern "C" void modc_init()
 	snd_set_channel(CHN_GLOBAL, 1.0f, 0.0f);
 
 	// load the data container
-	data = load_data_from_memory(internal_data);
+	//data = load_data_from_memory(internal_data);
 
 	// TODO: should be removed
 	snd_set_listener_pos(0.0f, 0.0f);
@@ -128,18 +128,18 @@ extern "C" void modc_shutdown()
 }
 
 
-player_core predicted_prev_player;
-player_core predicted_player;
+PLAYER_CORE predicted_prev_player;
+PLAYER_CORE predicted_player;
 static int predicted_tick = 0;
 static int last_new_predicted_tick = -1;
 
 extern "C" void modc_predict()
 {
-	player_core before_prev_player = predicted_prev_player;
-	player_core before_player = predicted_player;
+	PLAYER_CORE before_prev_player = predicted_prev_player;
+	PLAYER_CORE before_player = predicted_player;
 
 	// repredict player
-	world_core world;
+	WORLD_CORE world;
 	world.tuning = tuning;
 	int local_cid = -1;
 
@@ -271,10 +271,10 @@ extern "C" void modc_newsnapshot()
 		{
 			SNAP_ITEM item;
 			void *data = snap_get_item(SNAP_CURRENT, index, &item);
-			if(netobj_secure(item.type, data, item.datasize) != 0)
+			if(netobj_validate(item.type, data, item.datasize) != 0)
 			{
 				if(config.debug)
-					dbg_msg("game", "invalidated %d %d (%s) %d", index, item.type, netobj_get_name(item.type), item.id);
+					dbg_msg("game", "invalidated index=%d type=%d (%s) size=%d id=%d", index, item.type, netobj_get_name(item.type), item.datasize, item.id);
 				snap_invalidate_item(SNAP_CURRENT, index);
 			}
 		}
@@ -477,7 +477,7 @@ int64 server_motd_time = 0;
 extern "C" void modc_message(int msgtype)
 {
 	// special messages
-	if(msgtype == NETMSGTYPE_SV_EXTRA_PROJECTILE)
+	if(msgtype == NETMSGTYPE_SV_EXTRAPROJECTILE)
 	{
 		int num = msg_unpack_int();
 		
@@ -499,12 +499,12 @@ extern "C" void modc_message(int msgtype)
 		
 		return;
 	}
-	else if(msgtype == NETMSGTYPE_SV_TUNE_PARAMS)
+	else if(msgtype == NETMSGTYPE_SV_TUNEPARAMS)
 	{
 		// unpack the new tuning
-		tuning_params new_tuning;
+		TUNING_PARAMS new_tuning;
 		int *params = (int *)&new_tuning;
-		for(unsigned i = 0; i < sizeof(tuning_params)/sizeof(int); i++)
+		for(unsigned i = 0; i < sizeof(TUNING_PARAMS)/sizeof(int); i++)
 			params[i] = msg_unpack_int();
 
 		// check for unpacking errors
@@ -595,13 +595,13 @@ extern "C" void modc_message(int msgtype)
 
 		client_datas[msg->cid].update_render_info();
 	}
-    else if(msgtype == NETMSGTYPE_SV_WEAPON_PICKUP)
+    else if(msgtype == NETMSGTYPE_SV_WEAPONPICKUP)
     {
-    	NETMSG_SV_WEAPON_PICKUP *msg = (NETMSG_SV_WEAPON_PICKUP *)rawmsg;
+    	NETMSG_SV_WEAPONPICKUP *msg = (NETMSG_SV_WEAPONPICKUP *)rawmsg;
         if(config.cl_autoswitch_weapons)
         	input_data.wanted_weapon = msg->weapon+1;
     }
-	else if(msgtype == NETMSGTYPE_SV_READY_TO_ENTER)
+	else if(msgtype == NETMSGTYPE_SV_READYTOENTER)
 	{
 		client_entergame();
 	}
@@ -610,7 +610,7 @@ extern "C" void modc_message(int msgtype)
 		NETMSG_SV_KILLMSG *msg = (NETMSG_SV_KILLMSG *)rawmsg;
 		
 		// unpack messages
-		killmsg kill;
+		KILLMSG kill;
 		kill.killer = msg->killer;
 		kill.victim = msg->victim;
 		kill.weapon = msg->weapon;
@@ -629,9 +629,9 @@ extern "C" void modc_message(int msgtype)
 		client_datas[msg->cid].emoticon = msg->emoticon;
 		client_datas[msg->cid].emoticon_start = client_tick();
 	}
-	else if(msgtype == NETMSGTYPE_SV_SOUND_GLOBAL)
+	else if(msgtype == NETMSGTYPE_SV_SOUNDGLOBAL)
 	{
-		NETMSG_SV_SOUND_GLOBAL *msg = (NETMSG_SV_SOUND_GLOBAL *)rawmsg;
+		NETMSG_SV_SOUNDGLOBAL *msg = (NETMSG_SV_SOUNDGLOBAL *)rawmsg;
 		snd_play_random(CHN_GLOBAL, msg->soundid, 1.0f, vec2(0,0));
 	}
 }