mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-14 05:41:02 +00:00
Update presence when maxplayers is changed
This commit is contained in:
parent
83192827dc
commit
d163f67700
2 changed files with 13 additions and 5 deletions
|
@ -3261,8 +3261,11 @@ consvar_t cv_allownewplayer = {"allowjoin", "On", CV_SAVE|CV_NETVAR, CV_OnOff, N
|
|||
#ifdef VANILLAJOINNEXTROUND
|
||||
consvar_t cv_joinnextround = {"joinnextround", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done
|
||||
#endif
|
||||
|
||||
static void MaxPlayers_OnChange(void);
|
||||
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE|CV_NETVAR, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE|CV_NETVAR|CV_CALL, maxplayers_cons_t, MaxPlayers_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_resynchattempts = {"resynchattempts", "5", CV_SAVE, resynchattempts_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL };
|
||||
consvar_t cv_blamecfail = {"blamecfail", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL };
|
||||
|
@ -3279,6 +3282,15 @@ consvar_t cv_downloadspeed = {"downloadspeed", "16", CV_SAVE, downloadspeed_cons
|
|||
static void Got_AddPlayer(UINT8 **p, INT32 playernum);
|
||||
static void Got_RemovePlayer(UINT8 **p, INT32 playernum);
|
||||
|
||||
static void MaxPlayers_OnChange(void)
|
||||
{
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
DRPC_UpdatePresence();
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
// called one time at init
|
||||
void D_ClientServerInit(void)
|
||||
{
|
||||
|
|
|
@ -111,10 +111,6 @@ static void DRPC_HandleError(int err, const char *msg)
|
|||
--------------------------------------------------*/
|
||||
static void DRPC_HandleJoin(const char *secret)
|
||||
{
|
||||
// Yes, this is called a "secret", but we send & use it
|
||||
// directly, because if you're hosting SRB2, then you've
|
||||
// already made your IP address totally public.
|
||||
|
||||
CONS_Printf("Connecting to %s via Discord\n", secret);
|
||||
COM_BufAddText(va("connect \"%s\"\n", secret));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue