From 5c4a3850cdaf969c3e010aa1b811b411722d4376 Mon Sep 17 00:00:00 2001 From: zicodxx Date: Tue, 12 Apr 2011 00:45:06 +0200 Subject: [PATCH] Little fix for typing-indicator in multiplayer - was showing comma even if no player name was displayed; Removed team_vector from UDP lite_info structure - it's not needed; Increased UDP_NETGAMES_PAGES to actually show 3000 possible games --- CHANGELOG.txt | 4 ++++ main/gauges.c | 7 ++++++- main/multi.h | 1 - main/net_udp.c | 4 ---- main/net_udp.h | 5 ++--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3c3935160..7e05b6224 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20110412 +-------- +main/gauges.c, main/multi.h, main/net_udp.c, main/net_udp.h: Little fix for typing-indicator in multiplayer - was showing comma even if no player name was displayed; Removed team_vector from UDP lite_info structure - it's not needed; Increased UDP_NETGAMES_PAGES to actually show 3000 possible games + 20110411 -------- main/game.c, main/gamecntl.c, main/gamerend.c, main/gauges.c, main/multi.c, main/multi.h: Improved syntax for Multi messages/commands: Commands starting with '/' and those accepting arguments as well as Player/Team messages require space after ':' ; Added indicator on HUD to show if a player is typing a message to prevent accidential kills diff --git a/main/gauges.c b/main/gauges.c index 66eade17b..a8e9da8d1 100644 --- a/main/gauges.c +++ b/main/gauges.c @@ -2355,7 +2355,12 @@ void show_HUD_names() else snprintf( s, strlen(Players[pnum].callsign)+1, "%s", Players[pnum].callsign ); if (multi_sending_message[pnum]) - strncat( s, ", typing", 8); + { + if (strlen(s)) + strncat( s, ", typing", 8); + else + strncpy( s, "Typing", 6 ); + } gr_get_string_size(s, &w, &h, &aw); gr_set_fontcolor(BM_XRGB(player_rgb[color_num].r,player_rgb[color_num].g,player_rgb[color_num].b),-1 ); diff --git a/main/multi.h b/main/multi.h index e181fd773..ece112f3e 100644 --- a/main/multi.h +++ b/main/multi.h @@ -428,7 +428,6 @@ typedef struct netgame_info u_int32_t AllowedItems; short Allow_marker_view; // (unused in D1 - no markers in game) short AlwaysLighting; // (unused in D1 - cannot destroy lights after all) - short ShowAllNames; // (unused in D1 - solved with Show_reticle_name by Client) short BrightPlayers; // (unused in D1) short InvulAppear; // (unused in D1) char team_name[2][CALLSIGN_LEN+1]; diff --git a/main/net_udp.c b/main/net_udp.c index 3f3d4f787..6ade1ddc9 100644 --- a/main/net_udp.c +++ b/main/net_udp.c @@ -2123,7 +2123,6 @@ void net_udp_send_game_info(struct _sockaddr sender_addr, ubyte info_upid) buf[len] = Netgame.numconnected; len++; buf[len] = Netgame.max_numplayers; len++; buf[len] = Netgame.game_flags; len++; - buf[len] = Netgame.team_vector; len++; sendto (UDP_Socket[0], buf, len, 0, (struct sockaddr *)&sender_addr, sizeof(struct _sockaddr)); } @@ -2179,7 +2178,6 @@ void net_udp_send_game_info(struct _sockaddr sender_addr, ubyte info_upid) PUT_INTEL_INT(buf + len, Netgame.AllowedItems); len += 4; PUT_INTEL_SHORT(buf + len, Netgame.Allow_marker_view); len += 2; PUT_INTEL_SHORT(buf + len, Netgame.AlwaysLighting); len += 2; - PUT_INTEL_SHORT(buf + len, Netgame.ShowAllNames); len += 2; PUT_INTEL_SHORT(buf + len, Netgame.BrightPlayers); len += 2; PUT_INTEL_SHORT(buf + len, Netgame.InvulAppear); len += 2; memcpy(&buf[len], Netgame.team_name, 2*(CALLSIGN_LEN+1)); len += 2*(CALLSIGN_LEN+1); @@ -2296,7 +2294,6 @@ void net_udp_process_game_info(ubyte *data, int data_len, struct _sockaddr game_ recv_game.numconnected = data[len]; len++; recv_game.max_numplayers = data[len]; len++; recv_game.game_flags = data[len]; len++; - recv_game.team_vector = data[len]; len++; num_active_udp_changed = 1; @@ -2360,7 +2357,6 @@ void net_udp_process_game_info(ubyte *data, int data_len, struct _sockaddr game_ Netgame.AllowedItems = GET_INTEL_INT(&(data[len])); len += 4; Netgame.Allow_marker_view = GET_INTEL_SHORT(&(data[len])); len += 2; Netgame.AlwaysLighting = GET_INTEL_SHORT(&(data[len])); len += 2; - Netgame.ShowAllNames = GET_INTEL_SHORT(&(data[len])); len += 2; Netgame.BrightPlayers = GET_INTEL_SHORT(&(data[len])); len += 2; Netgame.InvulAppear = GET_INTEL_SHORT(&(data[len])); len += 2; memcpy(Netgame.team_name, &(data[len]), 2*(CALLSIGN_LEN+1)); len += 2*(CALLSIGN_LEN+1); diff --git a/main/net_udp.h b/main/net_udp.h index e0b87328a..b854cb788 100644 --- a/main/net_udp.h +++ b/main/net_udp.h @@ -31,7 +31,7 @@ int net_udp_level_sync(); #define UDP_REQ_ID "D1XR" // ID string for a request packet #define UDP_MAX_NETGAMES 3000 #define UDP_NETGAMES_PPAGE 12 // Netgames on one page of Netlist -#define UDP_NETGAMES_PAGES 50 // Pages available on Netlist (UDP_MAX_NETGAMES/UDP_NETGAMES_PPAGE) +#define UDP_NETGAMES_PAGES 250 // Pages available on Netlist (UDP_MAX_NETGAMES/UDP_NETGAMES_PPAGE) #define UDP_TIMEOUT (10*F1_0) // 10 seconds disconnect timeout #define UDP_MDATA_STOR_QUEUE_SIZE 500 // Store up to 500 MDATA packets @@ -73,8 +73,8 @@ int net_udp_level_sync(); typedef struct UDP_netgame_info_lite { struct _sockaddr game_addr; - fix GameID; short program_iver[3]; + fix GameID; char game_name[NETGAME_NAME_LEN+1]; char mission_title[MISSION_NAME_LEN+1]; char mission_name[9]; @@ -86,7 +86,6 @@ typedef struct UDP_netgame_info_lite ubyte numconnected; ubyte max_numplayers; ubyte game_flags; - ubyte team_vector; } __pack__ UDP_netgame_info_lite; typedef struct UDP_sequence_packet