More conversion

This commit is contained in:
iikorni
2026-08-29 19:17:46 -05:00
parent 0404d430dc
commit 70e5c02355
72 changed files with 13308 additions and 14309 deletions
+60 -60
View File
@@ -57,35 +57,35 @@ jmp_buf host_abortserver;
byte *host_colormap;
cvar_t host_framerate = {"host_framerate","0",CVAR_NONE}; // set for slow motion
cvar_t host_speeds = {"host_speeds","0",CVAR_NONE}; // set for running times
cvar_t host_maxfps = {"host_maxfps", "72", CVAR_ARCHIVE}; //johnfitz
cvar_t host_timescale = {"host_timescale", "0", CVAR_NONE}; //johnfitz
cvar_t max_edicts = {"max_edicts", "8192", CVAR_NONE}; //johnfitz //ericw -- changed from 2048 to 8192, removed CVAR_ARCHIVE
convar host_framerate = {"host_framerate","0"}; // set for slow motion
convar host_speeds = {"host_speeds","0"}; // set for running times
convar host_maxfps = {"host_maxfps", "72", {.archive = true}}; //johnfitz
convar host_timescale = {"host_timescale", "0"}; //johnfitz
convar max_edicts = {"max_edicts", "8192"}; //johnfitz //ericw -- changed from 2048 to 8192, removed CVAR_ARCHIVE
cvar_t sys_ticrate = {"sys_ticrate","0.05",CVAR_NONE}; // dedicated server
cvar_t serverprofile = {"serverprofile","0",CVAR_NONE};
convar sys_ticrate = {"sys_ticrate","0.05"}; // dedicated server
convar serverprofile = {"serverprofile","0"};
cvar_t fraglimit = {"fraglimit","0",CVAR_NOTIFY|CVAR_SERVERINFO};
cvar_t timelimit = {"timelimit","0",CVAR_NOTIFY|CVAR_SERVERINFO};
cvar_t teamplay = {"teamplay","0",CVAR_NOTIFY|CVAR_SERVERINFO};
cvar_t samelevel = {"samelevel","0",CVAR_NONE};
cvar_t noexit = {"noexit","0",CVAR_NOTIFY|CVAR_SERVERINFO};
cvar_t skill = {"skill","1",CVAR_NONE}; // 0 - 3
cvar_t deathmatch = {"deathmatch","0",CVAR_NONE}; // 0, 1, or 2
cvar_t coop = {"coop","0",CVAR_NONE}; // 0 or 1
convar fraglimit = {"fraglimit","0",{.notify = true, .server_info = true}};
convar timelimit = {"timelimit","0", {.notify = true, .server_info = true}};
convar teamplay = {"teamplay","0",{.notify = true, .server_info = true}};
convar samelevel = {"samelevel","0"};
convar noexit = {"noexit","0",{.notify = true, .server_info = true}};
convar skill = {"skill","1"}; // 0 - 3
convar deathmatch = {"deathmatch","0"}; // 0, 1, or 2
convar coop = {"coop","0"}; // 0 or 1
cvar_t pausable = {"pausable","1",CVAR_NONE};
convar pausable = {"pausable","1"};
cvar_t developer = {"developer","0",CVAR_NONE};
convar developer = {"developer","0"};
cvar_t temp1 = {"temp1","0",CVAR_NONE};
convar temp1 = {"temp1","0"};
cvar_t devstats = {"devstats","0",CVAR_NONE}; //johnfitz -- track developer statistics that vary every frame
convar devstats = {"devstats","0"}; //johnfitz -- track developer statistics that vary every frame
cvar_t campaign = {"campaign","0",CVAR_NONE}; // for the 2021 rerelease
cvar_t horde = {"horde","0",CVAR_NONE}; // for the 2021 rerelease
cvar_t sv_cheats = {"sv_cheats","0",CVAR_NONE}; // for the 2021 rerelease
convar campaign = {"campaign","0"}; // for the 2021 rerelease
convar horde = {"horde","0"}; // for the 2021 rerelease
convar sv_cheats = {"sv_cheats","0"}; // for the 2021 rerelease
devstats_t dev_stats, dev_peakstats;
overflowtimes_t dev_overflows; //this stores the last time overflow messages were displayed, not the last time overflows occured
@@ -95,7 +95,7 @@ overflowtimes_t dev_overflows; //this stores the last time overflow messages wer
Max_Edicts_f -- johnfitz
================
*/
static void Max_Edicts_f (cvar_t *var)
static void Max_Edicts_f (convar *var)
{
//TODO: clamp it here?
if (cls.state == ca_connected || sv.active)
@@ -107,7 +107,7 @@ static void Max_Edicts_f (cvar_t *var)
Max_Fps_f -- ericw
================
*/
static void Max_Fps_f (cvar_t *var)
static void Max_Fps_f (convar *var)
{
if (var->value > 72)
Con_Warning ("host_maxfps above 72 breaks physics.\n");
@@ -227,9 +227,9 @@ void Host_FindMaxClients (void)
svs.clients = (struct client_s *) Hunk_AllocName (svs.maxclientslimit*sizeof(client_t), "clients");
if (svs.maxclients > 1)
Cvar_SetQuick (&deathmatch, "1");
deathmatch.set("1");
else
Cvar_SetQuick (&deathmatch, "0");
deathmatch.set("0");
}
void Host_Version_f (void)
@@ -240,10 +240,10 @@ void Host_Version_f (void)
}
/* cvar callback functions : */
void Host_Callback_Notify (cvar_t *var)
void Host_Callback_Notify (convar *var)
{
if (sv.active)
SV_BroadcastPrintf ("\"%s\" changed to \"%s\"\n", var->name, var->string);
SV_BroadcastPrintf ("\"%s\" changed to \"%s\"\n", var->name.c_str(), var->string);
}
/*
@@ -253,45 +253,45 @@ Host_InitLocal
*/
void Host_InitLocal (void)
{
Cmd_AddCommand ("version", Host_Version_f);
command::add ("version", Host_Version_f);
Host_InitCommands ();
Cvar_RegisterVariable (&host_framerate);
Cvar_RegisterVariable (&host_speeds);
Cvar_RegisterVariable (&host_maxfps); //johnfitz
Cvar_SetCallback (&host_maxfps, Max_Fps_f);
Cvar_RegisterVariable (&host_timescale); //johnfitz
host_framerate.inscribe();
host_speeds.inscribe();
host_maxfps.inscribe(); //johnfitz
host_maxfps.set_callback(Max_Fps_f);
host_timescale.inscribe(); //johnfitz
Cvar_RegisterVariable (&max_edicts); //johnfitz
Cvar_SetCallback (&max_edicts, Max_Edicts_f);
Cvar_RegisterVariable (&devstats); //johnfitz
max_edicts.inscribe(); //johnfitz
max_edicts.set_callback(Max_Edicts_f);
devstats.inscribe(); //johnfitz
Cvar_RegisterVariable (&sys_ticrate);
Cvar_RegisterVariable (&sys_throttle);
Cvar_RegisterVariable (&serverprofile);
sys_ticrate.inscribe();
sys_throttle.inscribe();
serverprofile.inscribe();
Cvar_RegisterVariable (&fraglimit);
Cvar_RegisterVariable (&timelimit);
Cvar_RegisterVariable (&teamplay);
Cvar_SetCallback (&fraglimit, Host_Callback_Notify);
Cvar_SetCallback (&timelimit, Host_Callback_Notify);
Cvar_SetCallback (&teamplay, Host_Callback_Notify);
Cvar_RegisterVariable (&samelevel);
Cvar_RegisterVariable (&noexit);
Cvar_SetCallback (&noexit, Host_Callback_Notify);
Cvar_RegisterVariable (&skill);
Cvar_RegisterVariable (&developer);
Cvar_RegisterVariable (&coop);
Cvar_RegisterVariable (&deathmatch);
fraglimit.inscribe();
timelimit.inscribe();
teamplay.inscribe();
fraglimit.set_callback(Host_Callback_Notify);
timelimit.set_callback(Host_Callback_Notify);
teamplay.set_callback(Host_Callback_Notify);
samelevel.inscribe();
noexit.inscribe();
noexit.set_callback(Host_Callback_Notify);
skill.inscribe();
developer.inscribe();
coop.inscribe();
deathmatch.inscribe();
Cvar_RegisterVariable (&campaign);
Cvar_RegisterVariable (&horde);
Cvar_RegisterVariable (&sv_cheats);
campaign.inscribe();
horde.inscribe();
sv_cheats.inscribe();
Cvar_RegisterVariable (&pausable);
pausable.inscribe();
Cvar_RegisterVariable (&temp1);
temp1.inscribe();
Host_FindMaxClients ();
}
@@ -661,7 +661,7 @@ void Host_ServerFrame (void)
if (active > 600 && dev_peakstats.edicts <= 600)
Con_DWarning ("%i edicts exceeds standard limit of 600 (max = %d).\n", active, sv.max_edicts);
dev_stats.edicts = active;
dev_peakstats.edicts = q_max(active, dev_peakstats.edicts);
dev_peakstats.edicts = std::max(active, dev_peakstats.edicts);
}
//johnfitz
@@ -832,7 +832,7 @@ void Host_Init (void)
Memory_Init (host_parms->membase, host_parms->memsize);
Cbuf_Init ();
Cmd_Init ();
command::init ();
LOG_Init (host_parms);
Cvar_Init (); //johnfitz
COM_Init ();