diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 628c7d025..04b26e825 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ D2X-Rebirth Changelog main/net_udp.c: Fixed small bug in net_udp_list_join_poll() which was introduced when I reorganized the events for making console render global main/gamecntl.c, main/gameseq.c: Allowing loading a savestate while being in death sequence and resetting Dead_player_camera correctly in init_player_stats_level() so forther death sequences won't screw up main/net_udp.c: In net_udp_send_objects() player_num byte was not considered for mode 1 resulting on incorrect object count for this mode +main/net_ipx.c, main/net_udp.c: Instead of calling object/extras sending every frame, use a delay of 100ms between packet send to not overload the network stack 20110117 -------- diff --git a/main/net_ipx.c b/main/net_ipx.c index cc833165c..d7e49c2ba 100644 --- a/main/net_ipx.c +++ b/main/net_ipx.c @@ -1466,6 +1466,11 @@ void net_ipx_send_objects(void) int obj_count_frame = 0; int player_num = IPX_sync_player.player.connected; + static fix64 last_send_time = 0; + + if (last_send_time + (F1_0/10) > timer_query()) + return; + last_send_time = timer_query(); // Send clear objects array trigger and send player num @@ -1578,7 +1583,7 @@ void net_ipx_send_objects(void) //if (!multi_i_am_master ()) // Int3(); // Bad!! Get Jason. Someone goofy is trying to get ahold of the game! - Network_sending_extras=40; // start to send extras + Network_sending_extras=8; // start to send extras Player_joining_extras=player_num; return; @@ -5200,6 +5205,12 @@ int net_ipx_get_new_player_num (IPX_sequence_packet *their) void net_ipx_send_extras () { + static fix64 last_send_time = 0; + + if (last_send_time + (F1_0/10) > timer_query()) + return; + last_send_time = timer_query(); + Assert (Player_joining_extras>-1); if (!multi_i_am_master()) @@ -5210,21 +5221,21 @@ void net_ipx_send_extras () } - if (Network_sending_extras==40) + if (Network_sending_extras==8) net_ipx_send_fly_thru_triggers(Player_joining_extras); - if (Network_sending_extras==38) + if (Network_sending_extras==7) net_ipx_send_door_updates(Player_joining_extras); - if (Network_sending_extras==35) + if (Network_sending_extras==6) net_ipx_send_markers(); - if (Network_sending_extras==30 && (Game_mode & GM_MULTI_ROBOTS)) + if (Network_sending_extras==5 && (Game_mode & GM_MULTI_ROBOTS)) multi_send_stolen_items(); - if (Network_sending_extras==25 && (Netgame.PlayTimeAllowed || Netgame.KillGoal)) + if (Network_sending_extras==4 && (Netgame.PlayTimeAllowed || Netgame.KillGoal)) multi_send_kill_goal_counts(); - if (Network_sending_extras==20) + if (Network_sending_extras==3) net_ipx_send_smash_lights(Player_joining_extras); - if (Network_sending_extras==15) + if (Network_sending_extras==2) net_ipx_send_player_flags(); - if (Network_sending_extras==10) + if (Network_sending_extras==1) multi_send_powcap_update(); // if (Network_sending_extras==5) // net_ipx_send_door_updates(Player_joining_extras); // twice! diff --git a/main/net_udp.c b/main/net_udp.c index d718a44ff..1d3e1055e 100644 --- a/main/net_udp.c +++ b/main/net_udp.c @@ -1449,6 +1449,11 @@ void net_udp_send_objects(void) sbyte owner, player_num = UDP_sync_player.player.connected; static int obj_count = 0; int loc = 0, i = 0, remote_objnum = 0, obj_count_frame = 0; + static fix64 last_send_time = 0; + + if (last_send_time + (F1_0/10) > timer_query()) + return; + last_send_time = timer_query(); // Send clear objects array trigger and send player num @@ -1549,7 +1554,7 @@ void net_udp_send_objects(void) Network_send_objects = 0; obj_count = 0; - Network_sending_extras=40; // start to send extras + Network_sending_extras=8; // start to send extras VerifyPlayerJoined = Player_joining_extras = player_num; return; @@ -4833,23 +4838,29 @@ int net_udp_get_new_player_num (UDP_sequence_packet *their) void net_udp_send_extras () { + static fix64 last_send_time = 0; + + if (last_send_time + (F1_0/10) > timer_query()) + return; + last_send_time = timer_query(); + Assert (Player_joining_extras>-1); - if (Network_sending_extras==40) + if (Network_sending_extras==8) net_udp_send_fly_thru_triggers(Player_joining_extras); - if (Network_sending_extras==38) + if (Network_sending_extras==7) net_udp_send_door_updates(Player_joining_extras); - if (Network_sending_extras==35) + if (Network_sending_extras==6) net_udp_send_markers(); - if (Network_sending_extras==30 && (Game_mode & GM_MULTI_ROBOTS)) + if (Network_sending_extras==5 && (Game_mode & GM_MULTI_ROBOTS)) multi_send_stolen_items(); - if (Network_sending_extras==25 && (Netgame.PlayTimeAllowed || Netgame.KillGoal)) + if (Network_sending_extras==4 && (Netgame.PlayTimeAllowed || Netgame.KillGoal)) multi_send_kill_goal_counts(); - if (Network_sending_extras==20) + if (Network_sending_extras==3) net_udp_send_smash_lights(Player_joining_extras); - if (Network_sending_extras==15) + if (Network_sending_extras==2) net_udp_send_player_flags(); - if (Network_sending_extras==10) + if (Network_sending_extras==1) multi_send_powcap_update(); Network_sending_extras--;