Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76747b4677 | ||
|
|
5268fc2d19 | ||
|
|
7325c8dbfd | ||
|
|
e5c18ae1f1 | ||
|
|
4bb5b8fa04 |
No files matched your search
+55
-1
@@ -143,6 +143,11 @@ static CV_PossibleValue_t mindelay_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL
|
||||
consvar_t cv_mindelay = {"mindelay", "0", CV_SAVE, mindelay_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_gentlemens = {"gentlemensdelay", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Lagless_OnChange, 0, NULL, NULL, 0, 0, NULL}; // this should be a netvar Zzz...
|
||||
|
||||
// allows a fake player to appear on the ms and serverlist when your dedi server is empty
|
||||
static void FakeSeed_OnChange(void);
|
||||
consvar_t cv_usefakeseed = {"fakeseed", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, FakeSeed_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fakeseedname = {"fakeseedname", "Player 1", CV_SAVE|CV_CALL|CV_NOINIT, NULL, FakeSeed_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
SINT8 nodetoplayer[MAXNETNODES] = {};
|
||||
SINT8 nodetoplayer2[MAXNETNODES] = {}; // say the numplayer for this node if any (splitscreen)
|
||||
SINT8 nodetoplayer3[MAXNETNODES] = {}; // say the numplayer for this node if any (splitscreen == 2)
|
||||
@@ -240,6 +245,13 @@ consvar_t cv_httpsource = {"http_source", "", CV_SAVE, NULL, NULL, 0, NULL, NULL
|
||||
|
||||
consvar_t cv_kicktime = {"kicktime", "10", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static void FakeSeed_OnChange(void)
|
||||
{
|
||||
#ifdef MASTERSERVER
|
||||
Update_MS();
|
||||
#endif
|
||||
}
|
||||
|
||||
static boolean UseLocalDelay(void)
|
||||
{
|
||||
if (dedicated || (server && server_lagless && !cv_mindelay.value) || modeattacking == ATTACKING_RECORD)
|
||||
@@ -1544,6 +1556,12 @@ static boolean CL_SendJoin(void)
|
||||
return HSendPacket(servernode, false, 0, sizeof(clientconfig_pak));
|
||||
}
|
||||
|
||||
static boolean UseFakeSeed(void)
|
||||
{
|
||||
// due to complexity this will disable the moment a real player joins
|
||||
return (dedicated && cv_usefakeseed.value && D_NumPlayers() == 0);
|
||||
}
|
||||
|
||||
static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
||||
{
|
||||
UINT8 *p;
|
||||
@@ -1566,7 +1584,12 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
||||
netbuffer->u.serverinfo.time = (tic_t)LONG(servertime);
|
||||
netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime);
|
||||
|
||||
netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers();
|
||||
// force 1 player
|
||||
if (UseFakeSeed())
|
||||
netbuffer->u.serverinfo.numberofplayer = (UINT8)1;
|
||||
else
|
||||
netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers();
|
||||
|
||||
netbuffer->u.serverinfo.maxplayer = (UINT8)(min((dedicated ? MAXPLAYERS-1 : MAXPLAYERS), cv_maxplayers.value));
|
||||
|
||||
// SRB2Kart: Vanilla's gametype constants for MS support
|
||||
@@ -1645,6 +1668,37 @@ static void SV_SendPlayerInfo(INT32 node)
|
||||
|
||||
netbuffer->packettype = PT_PLAYERINFO;
|
||||
|
||||
// send a fake player to trick ms and serverbrowser
|
||||
if (UseFakeSeed())
|
||||
{
|
||||
//printf("sending fake player lmao\n");
|
||||
netbuffer->u.playerinfo[0].node = 0;
|
||||
|
||||
// fallback to smth, make sure this is always set
|
||||
if (!cv_fakeseedname.string[0])
|
||||
CV_Set(&cv_fakeseedname, "Player 1");
|
||||
strlcpy(netbuffer->u.playerinfo[0].name, cv_fakeseedname.string, MAXPLAYERNAME+1);
|
||||
|
||||
memset(netbuffer->u.playerinfo[0].address, 0, 4);
|
||||
|
||||
// make it appear as spectator
|
||||
netbuffer->u.playerinfo[0].team = 255;
|
||||
|
||||
// doesent really matter what we put here lel
|
||||
netbuffer->u.playerinfo[0].score = LONG(42069);
|
||||
netbuffer->u.playerinfo[0].timeinserver = SHORT(42069);
|
||||
netbuffer->u.playerinfo[0].skin = (UINT8)1; // no clue wtf skin 1 is, tails maybe?
|
||||
|
||||
netbuffer->u.playerinfo[0].data = 0;
|
||||
|
||||
// mark every other slot as empty
|
||||
for (i = 1; i < MSCOMPAT_MAXPLAYERS; i++)
|
||||
netbuffer->u.playerinfo[i].node = 255;
|
||||
|
||||
HSendPacket(node, false, 0, sizeof(plrinfo) * MSCOMPAT_MAXPLAYERS);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < MSCOMPAT_MAXPLAYERS; i++)
|
||||
{
|
||||
if ((i >= MAXPLAYERS) || !playeringame[i])
|
||||
|
||||
@@ -582,6 +582,8 @@ extern tic_t simulated_lag;
|
||||
extern tic_t lowest_lag;
|
||||
extern consvar_t cv_mindelay, cv_gentlemens;
|
||||
|
||||
extern consvar_t cv_usefakeseed, cv_fakeseedname;
|
||||
|
||||
extern consvar_t
|
||||
cv_netticbuffer, cv_allownewplayer,
|
||||
#ifdef SATURNJOIN
|
||||
|
||||
@@ -166,6 +166,57 @@ UINT8 ctrldown = 0; // 0x1 left, 0x2 right
|
||||
UINT8 altdown = 0; // 0x1 left, 0x2 right
|
||||
boolean capslock = 0; // gee i wonder what this does.
|
||||
|
||||
static void D_PadMenuScrollInput(UINT8 input)
|
||||
{
|
||||
event_t dpadev;
|
||||
memset(&dpadev, 0, sizeof(event_t));
|
||||
dpadev.type = ev_keydown;
|
||||
|
||||
switch (input)
|
||||
{
|
||||
case DPAD_UP:
|
||||
dpadev.data1 = KEY_UPARROW;
|
||||
break;
|
||||
case DPAD_DOWN:
|
||||
dpadev.data1 = KEY_DOWNARROW;
|
||||
break;
|
||||
case DPAD_LEFT:
|
||||
dpadev.data1 = KEY_LEFTARROW;
|
||||
break;
|
||||
case DPAD_RIGHT:
|
||||
dpadev.data1 = KEY_RIGHTARROW;
|
||||
break;
|
||||
}
|
||||
|
||||
D_PostEvent(&dpadev); // put into eventlist
|
||||
}
|
||||
|
||||
#define SCROLLDELAY 19
|
||||
|
||||
// Check if any dpad button is held
|
||||
// and pass it to the eventlist
|
||||
static void D_GamePadMenuScrollTicker(void)
|
||||
{
|
||||
UINT8 i;
|
||||
static UINT8 menuInputDelayTimer = 0;
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
if (dpadscrollstate[i])
|
||||
{
|
||||
if (menuInputDelayTimer < SCROLLDELAY)
|
||||
menuInputDelayTimer++;
|
||||
else if (menuInputDelayTimer == SCROLLDELAY)
|
||||
D_PadMenuScrollInput(i);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
menuInputDelayTimer = 0;
|
||||
}
|
||||
#undef SCROLLDELAY
|
||||
|
||||
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {};
|
||||
|
||||
static void D_DeviceLEDTick(void)
|
||||
|
||||
@@ -760,6 +760,9 @@ void D_RegisterServerCommands(void)
|
||||
CV_RegisterVar(&cv_showping);
|
||||
CV_RegisterVar(&cv_pingmeasurement);
|
||||
|
||||
CV_RegisterVar(&cv_usefakeseed);
|
||||
CV_RegisterVar(&cv_fakeseedname);
|
||||
|
||||
#ifdef SEENAMES
|
||||
CV_RegisterVar(&cv_allowseenames);
|
||||
#endif
|
||||
|
||||
+8
-1
@@ -608,10 +608,17 @@ Update_parameters (void)
|
||||
}
|
||||
#endif/*MASTERSERVER*/
|
||||
}
|
||||
|
||||
#ifdef MASTERSERVER
|
||||
void Update_MS(void)
|
||||
{
|
||||
Update_parameters();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MASTERSERVER
|
||||
static void MasterServer_OnChange(void)
|
||||
{
|
||||
|
||||
UnregisterServer();
|
||||
|
||||
Set_api(cv_masterserver.string);
|
||||
|
||||
@@ -88,6 +88,8 @@ char *GetMODVersion(int id);
|
||||
#endif
|
||||
|
||||
char *GetMasterServerRules(void);
|
||||
|
||||
void Update_MS(void);
|
||||
#endif
|
||||
|
||||
void AddMServCommands(void);
|
||||
|
||||
Reference in new issue
Block a user