diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 8f0399637e3ce4c501d6a56c653c32fa077f31c7..5b1fd6fce9b9537313c2bd7b51cb055fdc5f4d74 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -17,10 +17,8 @@ #include <unistd.h> //for unlink #endif -#include "i_net.h" #include "i_system.h" #include "i_video.h" -#include "d_net.h" #include "d_main.h" #include "g_game.h" #include "hu_stuff.h" @@ -94,8 +92,6 @@ static boolean cl_packetmissed; // here it is for the secondary local player (splitscreen) static UINT8 mynode; // my address pointofview server -static UINT8 localtextcmd[MAXTEXTCMD]; -static UINT8 localtextcmd2[MAXTEXTCMD]; // splitscreen SINT8 servernode = 0; // the number of the server node /// \brief do we accept new players? /// \todo WORK! @@ -201,42 +197,19 @@ void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(UINT8 **p, INT32 playernum)) void SendNetXCmd(netxcmd_t id, const void *param, size_t nparam) { - if (localtextcmd[0]+2+nparam > MAXTEXTCMD) - { - // for future reference: if (cv_debug) != debug disabled. - CONS_Alert(CONS_ERROR, M_GetText("NetXCmd buffer full, cannot add netcmd %d! (size: %d, needed: %s)\n"), id, localtextcmd[0], sizeu1(nparam)); - return; - } - localtextcmd[0]++; - localtextcmd[localtextcmd[0]] = (UINT8)id; - if (param && nparam) - { - M_Memcpy(&localtextcmd[localtextcmd[0]+1], param, nparam); - localtextcmd[0] = (UINT8)(localtextcmd[0] + (UINT8)nparam); - } + // NET TODO } // splitscreen player void SendNetXCmd2(netxcmd_t id, const void *param, size_t nparam) { - if (localtextcmd2[0]+2+nparam > MAXTEXTCMD) - { - I_Error("No more place in the buffer for netcmd %d\n",id); - return; - } - localtextcmd2[0]++; - localtextcmd2[localtextcmd2[0]] = (UINT8)id; - if (param && nparam) - { - M_Memcpy(&localtextcmd2[localtextcmd2[0]+1], param, nparam); - localtextcmd2[0] = (UINT8)(localtextcmd2[0] + (UINT8)nparam); - } + // NET TODO } UINT8 GetFreeXCmdSize(void) { - // -1 for the size and another -1 for the ID. - return (UINT8)(localtextcmd[0] - 2); + // NET TODO + return -1; } // Frees all textcmd memory for the specified tic @@ -540,8 +513,9 @@ static inline void CL_DrawConnectionStatus(void) Net_GetNetStat(); V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, va(" %4uK",fileneeded[lastfilenum].currentsize>>10)); - V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, - va("%3.1fK/s ", ((double)getbps)/1024)); + // NET TODO + //V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, + // va("%3.1fK/s ", ((double)getbps)/1024)); break; #endif case cl_askjoin: @@ -573,8 +547,9 @@ static inline void CL_DrawConnectionStatus(void) va(M_GetText("Downloading \"%s\""), tempname)); V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, va(" %4uK/%4uK",fileneeded[lastfilenum].currentsize>>10,fileneeded[lastfilenum].totalsize>>10)); - V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, - va("%3.1fK/s ", ((double)getbps)/1024)); + // NET TODO + //V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, + // va("%3.1fK/s ", ((double)getbps)/1024)); } } #endif @@ -1622,6 +1597,7 @@ void CL_ClearPlayer(INT32 playernum) } players[playernum].mo = NULL; memset(&players[playernum], 0, sizeof (player_t)); + sprintf(player_names[playernum], "New Player %u", playernum+1); } // @@ -1690,9 +1666,6 @@ static void CL_RemovePlayer(INT32 playernum) while (!playeringame[doomcom->numslots-1] && doomcom->numslots > 1) doomcom->numslots--; - // Reset the name - sprintf(player_names[playernum], "Player %d", playernum+1); - if (playernum == adminplayer) adminplayer = -1; // don't stay admin after you're gone @@ -2102,9 +2075,8 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done -static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}}; -consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_blamecfail = {"blamecfail", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; +static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}}; +consvar_t cv_maxplayers = {"maxplayers", "12", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // max file size to send to a player (in kilobytes) static CV_PossibleValue_t maxsend_cons_t[] = {{0, "MIN"}, {51200, "MAX"}, {0, NULL}}; @@ -2135,7 +2107,6 @@ void D_ClientServerInit(void) CV_RegisterVar(&cv_allownewplayer); CV_RegisterVar(&cv_joinnextround); CV_RegisterVar(&cv_showjoinaddress); - CV_RegisterVar(&cv_blamecfail); #ifdef DUMPCONSISTENCY CV_RegisterVar(&cv_dumpconsistency); #endif diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 7e0fba0afc74f7ee369479efe70d943d48e57fed..9b1c52bb88268514e59129d2b7bd46a2139985a5 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -24,6 +24,9 @@ // one that defines the actual packets to // be transmitted. +// Make sure we allocate a network node for every player, "server full" denials, the Master server heartbeat, and potential RCON connections. +#define MAXNETNODES MAXPLAYERS+2 + // Networking and tick handling related. #define BACKUPTICS 32 #define MAXTEXTCMD 256 @@ -285,7 +288,7 @@ extern UINT32 realpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS]; #endif -extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_blamecfail, cv_maxsend; +extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_maxsend; // used in d_net, the only dependence tic_t ExpandTics(INT32 low); diff --git a/src/d_main.c b/src/d_main.c index c5f0d0b396029bb4c18b8e46a2488906abc51c21..bda5768e6c85adc3098584451d075f02c3fd8035 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -482,8 +482,9 @@ static void D_Display(void) s[sizeof s - 1] = '\0'; - snprintf(s, sizeof s - 1, "get %d b/s", getbps); - V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-40, V_YELLOWMAP, s); + // NET TODO + //snprintf(s, sizeof s - 1, "get %d b/s", getbps); + //V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-40, V_YELLOWMAP, s); snprintf(s, sizeof s - 1, "send %d b/s", sendbps); V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-30, V_YELLOWMAP, s); snprintf(s, sizeof s - 1, "GameMiss %.2f%%", gamelostpercent); diff --git a/src/doomdef.h b/src/doomdef.h index 7572778653c122ad5b4c57fc181f89007f801200..74bab9a467333a2f0565c751408cf8b79c25864f 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -222,7 +222,7 @@ extern FILE *logstream; // The maximum number of players, multiplayer/networking. // NOTE: it needs more than this to increase the number of players... -#define MAXPLAYERS 32 +#define MAXPLAYERS 64 #define MAXSKINS MAXPLAYERS #define PLAYERSMASK (MAXPLAYERS-1) #define MAXPLAYERNAME 21 diff --git a/src/g_game.c b/src/g_game.c index e2ed1e792b841bab73f3795426808ab06eebe7af..423be93389b991dd2c4c884a6d0f951883b10682 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -437,50 +437,11 @@ consvar_t cv_fireaxis2 = {"joyaxis2_fire", "None", CV_SAVE, joyaxis_cons_t, NULL consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif - -#if MAXPLAYERS > 32 -#error "please update player_name table using the new value for MAXPLAYERS" -#endif - #ifdef SEENAMES player_t *seenplayer; // player we're aiming at right now #endif -char player_names[MAXPLAYERS][MAXPLAYERNAME+1] = -{ - "Player 1", - "Player 2", - "Player 3", - "Player 4", - "Player 5", - "Player 6", - "Player 7", - "Player 8", - "Player 9", - "Player 10", - "Player 11", - "Player 12", - "Player 13", - "Player 14", - "Player 15", - "Player 16", - "Player 17", - "Player 18", - "Player 19", - "Player 20", - "Player 21", - "Player 22", - "Player 23", - "Player 24", - "Player 25", - "Player 26", - "Player 27", - "Player 28", - "Player 29", - "Player 30", - "Player 31", - "Player 32" -}; +char player_names[MAXPLAYERS][MAXPLAYERNAME+1]; INT16 rw_maximums[NUM_WEAPONS] = {