diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7dc213a09..8131b05b4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20111102 +-------- +SConstruct, arch/carbon/conf.h, main/gameseq.c, main/inferno.c, main/inferno.h, main/menu.c, main/multi.h, main/net_udp.c, main/net_udp.h, main/vers_id.h: Introduced extra short based on MULTI_PROTO_VERSION for version-independent Multiplayer-compability-check; Changed version to 0.57.2 to make new version checking not cause problems with stable release 0.57.1; Removed old version_major/minor variables from netgame and player structures since DXX handles this independently; Cleaned up old version stuff and copyright messages + 20111030 -------- arch/include/mouse.h, arch/sdl/mouse.c, ui/dialog.c: Return 1 (event handled) in ui_dialog_handler for mouse button events if the mouse was in the dialog diff --git a/SConstruct b/SConstruct index acc1c19c9..ff19e57ee 100644 --- a/SConstruct +++ b/SConstruct @@ -11,7 +11,7 @@ target = 'd2x-rebirth' # version number D2XMAJOR = 0 D2XMINOR = 57 -D2XMICRO = 1 +D2XMICRO = 2 VERSION_STRING = ' v' + str(D2XMAJOR) + '.' + str(D2XMINOR) + '.' + str(D2XMICRO) # installation path diff --git a/arch/carbon/conf.h b/arch/carbon/conf.h index 09c426faf..2192dbb4d 100644 --- a/arch/carbon/conf.h +++ b/arch/carbon/conf.h @@ -12,7 +12,7 @@ #define D2XMINOR "57" /* d2x micro version */ -#define D2XMICRO "1" +#define D2XMICRO "2" /* Define if you want to build the editor */ /* #undef EDITOR */ diff --git a/main/gameseq.c b/main/gameseq.c index 61e2a2b61..e14150cbe 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -227,28 +227,6 @@ gameseq_init_network_players() } NumNetPlayerPositions = k; - -#ifdef NETWORK - if (is_D2_OEM && (Game_mode & GM_MULTI) && PLAYING_BUILTIN_MISSION && Current_level_num==8) - { - for (i=0;i 4 DXX-Rebirth +#define MULTI_PROTO_VERSION 5 // PROTOCOL VARIABLES AND DEFINES - END @@ -419,8 +421,6 @@ typedef struct netplayer_info } protocol; #endif char callsign[CALLSIGN_LEN+1]; - ubyte version_major; - ubyte version_minor; sbyte connected; ubyte rank; fix ping; @@ -441,15 +441,13 @@ typedef struct netgame_info struct { struct _sockaddr addr; // IP address of this netgame's host - short program_iver[3]; // IVER of program for version checking + short program_iver[4]; // IVER of program for version checking sbyte valid; // Status of Netgame info: -1 = Failed, Wrong version; 0 = No info, yet; 1 = Success fix GameID; } udp; #endif } protocol; #endif - ubyte version_major; // Game content data version major - ubyte version_minor; // Game content data version minor struct netplayer_info players[MAX_PLAYERS+4]; char game_name[NETGAME_NAME_LEN+1]; char mission_title[MISSION_NAME_LEN+1]; diff --git a/main/net_udp.c b/main/net_udp.c index d9f0cd659..5aa80c1e6 100644 --- a/main/net_udp.c +++ b/main/net_udp.c @@ -92,7 +92,6 @@ void net_udp_noloss_got_ack(ubyte *data, int data_len); void net_udp_noloss_init_mdata_queue(void); void net_udp_noloss_clear_mdata_got(ubyte player_num); void net_udp_noloss_process_queue(fix64 time); -void net_udp_check_for_old_version (char pnum); void net_udp_send_extras (); extern void multi_reset_object_texture(object *objp); extern void multi_send_stolen_items (); @@ -123,7 +122,6 @@ struct _sockaddr TrackerSocket; int iTrackerVerified = 0; #endif extern obj_position Player_init[MAX_PLAYERS]; -extern ubyte Version_major,Version_minor; extern char MaxPowerupsAllowed[MAX_POWERUP_TYPES]; extern char PowerupsInMine[MAX_POWERUP_TYPES]; extern int Final_boss_is_dead; @@ -538,7 +536,7 @@ int net_udp_game_connect(direct_join *dj) if (Netgame.protocol.udp.valid == -1) { - nm_messagebox(TXT_ERROR,1,TXT_OK,"Version mismatch! Cannot join Game.\nHost game version: %i.%i.%i\nYour game version: %s",Netgame.protocol.udp.program_iver[0],Netgame.protocol.udp.program_iver[1],Netgame.protocol.udp.program_iver[2],VERSION); + nm_messagebox(TXT_ERROR,1,TXT_OK,"Version mismatch! Cannot join Game.\nHost game version: %i.%i.%i\nHost game protocol: %i\nYour game version: %s\nYour game protocol: %i",Netgame.protocol.udp.program_iver[0],Netgame.protocol.udp.program_iver[1],Netgame.protocol.udp.program_iver[2],Netgame.protocol.udp.program_iver[3],VERSION, MULTI_PROTO_VERSION); dj->connecting = 0; return 0; } @@ -1022,8 +1020,6 @@ void net_udp_send_sequence_packet(UDP_sequence_packet seq, struct _sockaddr recv memset(buf, 0, sizeof(buf)); buf[0] = seq.type; len++; memcpy(&buf[len], seq.player.callsign, CALLSIGN_LEN+1); len += CALLSIGN_LEN+1; - buf[len] = seq.player.version_major; len++; - buf[len] = seq.player.version_minor; len++; buf[len] = seq.player.connected; len++; buf[len] = seq.player.rank; len++; @@ -1036,8 +1032,6 @@ void net_udp_receive_sequence_packet(ubyte *data, UDP_sequence_packet *seq, stru seq->type = data[0]; len++; memcpy(seq->player.callsign, &(data[len]), CALLSIGN_LEN+1); len += CALLSIGN_LEN+1; - seq->player.version_major = data[len]; len++; - seq->player.version_minor = data[len]; len++; seq->player.connected = data[len]; len++; memcpy (&(seq->player.rank),&(data[len]),1); len++; @@ -1082,8 +1076,6 @@ void net_udp_init() UDP_Seq.type = UPID_REQUEST; memcpy(UDP_Seq.player.callsign, Players[Player_num].callsign, CALLSIGN_LEN+1); - UDP_Seq.player.version_major=Version_major; - UDP_Seq.player.version_minor=Version_minor; UDP_Seq.player.rank=GetMyNetRanking(); for (Player_num = 0; Player_num < MAX_NUM_NET_PLAYERS; Player_num++) @@ -1206,16 +1198,6 @@ net_udp_can_join_netgame(netgame_info *game) return 0; } - if (game->version_major==0 && Version_major>0) - { - return (0); - } - - if (game->version_major>0 && Version_major==0) - { - return (0); - } - // Game is in progress, figure out if this guy can re-join it num_players = game->numplayers; @@ -1319,9 +1301,6 @@ net_udp_new_player(UDP_sequence_packet *their) ClipRank (&their->player.rank); Netgame.players[pnum].rank=their->player.rank; - Netgame.players[pnum].version_major=their->player.version_major; - Netgame.players[pnum].version_minor=their->player.version_minor; - net_udp_check_for_old_version(pnum); Players[pnum].connected = CONNECT_PLAYING; Players[pnum].net_kills_total = 0; @@ -1362,16 +1341,6 @@ void net_udp_welcome_player(UDP_sequence_packet *their) WaitForRefuseAnswer=0; - if (HoardEquipped()) - { - // If hoard game, and this guy isn't D2 Christmas (v1.2), dump him - if ((Game_mode & GM_HOARD) && ((their->player.version_minor & 0x0F)<2)) - { - net_udp_dump_player(their->player.protocol.udp.addr, DUMP_DORK); - return; - } - } - // Don't accept new players if we're ending this level. Its safe to // ignore since they'll request again later @@ -2005,11 +1974,8 @@ void net_udp_add_player(UDP_sequence_packet *p) ClipRank (&p->player.rank); memcpy( Netgame.players[N_players].callsign, p->player.callsign, CALLSIGN_LEN+1 ); memcpy( (struct _sockaddr *)&Netgame.players[N_players].protocol.udp.addr, (struct _sockaddr *)&p->player.protocol.udp.addr, sizeof(struct _sockaddr) ); - Netgame.players[N_players].version_major=p->player.version_major; - Netgame.players[N_players].version_minor=p->player.version_minor; Netgame.players[N_players].rank=p->player.rank; Netgame.players[N_players].connected = CONNECT_PLAYING; - net_udp_check_for_old_version (N_players); Players[N_players].KillGoalCount=0; Players[N_players].connected = CONNECT_PLAYING; Netgame.players[N_players].LastPacketTime = timer_query(); @@ -2042,11 +2008,8 @@ void net_udp_remove_player(UDP_sequence_packet *p) { memcpy( Netgame.players[i].callsign, Netgame.players[i+1].callsign, CALLSIGN_LEN+1 ); memcpy( (struct _sockaddr *)&Netgame.players[i].protocol.udp.addr, (struct _sockaddr *)&Netgame.players[i+1].protocol.udp.addr, sizeof(struct _sockaddr) ); - Netgame.players[i].version_major=Netgame.players[i+1].version_major; - Netgame.players[i].version_minor=Netgame.players[i+1].version_minor; Netgame.players[i].rank=Netgame.players[i+1].rank; ClipRank (&Netgame.players[i].rank); - net_udp_check_for_old_version(i); } N_players--; @@ -2079,9 +2042,6 @@ void net_udp_update_netgame(void) int i, j; - Netgame.version_major=Version_major; - Netgame.version_minor=Version_minor; - Netgame.numconnected=0; for (i=0;i N_players) { memcpy(Netgame.players[N_players].callsign, Netgame.players[i].callsign, CALLSIGN_LEN+1); - Netgame.players[N_players].version_major=Netgame.players[i].version_major; - Netgame.players[N_players].version_minor=Netgame.players[i].version_minor; Netgame.players[N_players].rank=Netgame.players[i].rank; ClipRank (&Netgame.players[N_players].rank); - net_udp_check_for_old_version(i); } Players[N_players].connected = CONNECT_PLAYING; N_players++; @@ -3800,8 +3753,6 @@ abort: for (i = N_players; i < MAX_NUM_NET_PLAYERS; i++) { memset(Netgame.players[i].callsign, 0, CALLSIGN_LEN+1); - Netgame.players[i].version_major=0; - Netgame.players[i].version_minor=0; Netgame.players[i].rank=0; } @@ -3839,8 +3790,6 @@ int net_udp_start_game(void) d_srand( (fix)timer_query() ); Netgame.protocol.udp.GameID=d_rand(); - if (is_D2_OEM) - UDP_Seq.player.version_minor|=0x10; N_players = 0; Netgame.game_status = NETSTAT_STARTING; Netgame.numplayers = 0; @@ -4037,7 +3986,6 @@ int net_udp_do_join_game() if (is_D2_OEM) { - UDP_Seq.player.version_minor|=0x10; if (Netgame.levelnum>8) { nm_messagebox(NULL, 1, TXT_OK, "This OEM version only supports\nthe first 8 levels!"); @@ -5287,12 +5235,6 @@ void net_udp_send_extras () Player_joining_extras=-1; } -void net_udp_check_for_old_version (char pnum) - { - if (Netgame.players[(int)pnum].version_major==1 && (Netgame.players[(int)pnum].version_minor & 0x0F)==0) - Netgame.players[(int)pnum].rank=0; - } - static int show_game_rules_handler(window *wind, d_event *event, netgame_info *netgame) { int k; diff --git a/main/net_udp.h b/main/net_udp.h index eafc3e3f2..385f42e59 100644 --- a/main/net_udp.h +++ b/main/net_udp.h @@ -40,15 +40,15 @@ void net_udp_send_netgame_update(); #define UDP_NETGAMES_PPAGE 12 // Netgames on one page of Netlist #define UDP_NETGAMES_PAGES 75 // 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 +#define UDP_MDATA_STOR_QUEUE_SIZE 500 // Store up to 500 MDATA packets // UDP-Packet identificators (ubyte) and their (max. sizes). #define UPID_VERSION_DENY 1 // Netgame join or info has been denied due to version difference. -#define UPID_VERSION_DENY_SIZE 7 +#define UPID_VERSION_DENY_SIZE 9 #define UPID_GAME_INFO_REQ 2 // Requesting all info about a netgame. -#define UPID_GAME_INFO_REQ_SIZE 11 +#define UPID_GAME_INFO_REQ_SIZE 13 #define UPID_GAME_INFO 3 // Packet containing all info about a netgame. -#define UPID_GAME_INFO_SIZE 535 +#define UPID_GAME_INFO_SIZE 509 #define UPID_GAME_INFO_LITE_REQ 4 // Requesting lite info about a netgame. Used for discovering games. #define UPID_GAME_INFO_LITE 5 // Packet containing lite netgame info. #define UPID_GAME_INFO_LITE_SIZE 73 @@ -57,7 +57,7 @@ void net_udp_send_netgame_update(); #define UPID_ADDPLAYER 7 // Packet from Host containing info about a new player. #define UPID_REQUEST 8 // New player says: "I want to be inside of you!" (haha, sorry I could not resist) / Packet containing request to join the game actually. #define UPID_QUIT_JOINING 9 // Packet from a player who suddenly quits joining. -#define UPID_SEQUENCE_SIZE 14 +#define UPID_SEQUENCE_SIZE 12 #define UPID_SYNC 10 // Packet from host containing full netgame info to sync players up. #define UPID_OBJECT_DATA 11 // Packet from host containing object buffer. #define UPID_PING 12 // Packet from host containing his GameTime and the Ping list. Client returns this time to host as UPID_PONG and adapts the ping list. diff --git a/main/vers_id.h b/main/vers_id.h index 51fd8995c..2c65e9180 100644 --- a/main/vers_id.h +++ b/main/vers_id.h @@ -3,7 +3,7 @@ #ifndef _VERS_ID #define _VERS_ID -#define VERSION_TYPE "Full Version" +#define BASED_VERSION "Full Version v1.2" #define VERSION D2XMAJOR "." D2XMINOR "." D2XMICRO #define DESCENT_VERSION "D2X-Rebirth v" VERSION