Overhaul to console structure, a bit

This commit is contained in:
iikorni
2026-08-30 00:50:23 -05:00
parent de75b014b3
commit 216dd1aecd
70 changed files with 2081 additions and 2260 deletions
+20 -20
View File
@@ -164,7 +164,7 @@ const char *NET_QSocketGetAddressString(const qsocket_t *s) {
static void NET_Listen_f(void) {
if (command::argc() != 2) {
Con_Printf("\"listen\" is \"%d\"\n", listening ? 1 : 0);
console::info("\"listen\" is \"%d\"\n", listening ? 1 : 0);
return;
}
@@ -182,12 +182,12 @@ static void MaxPlayers_f(void) {
int n;
if (command::argc() != 2) {
Con_Printf("\"maxplayers\" is \"%d\"\n", svs.maxclients);
console::info("\"maxplayers\" is \"%d\"\n", svs.maxclients);
return;
}
if (sv.active) {
Con_Printf("maxplayers can not be changed while a server is running.\n");
console::info("maxplayers can not be changed while a server is running.\n");
return;
}
@@ -196,7 +196,7 @@ static void MaxPlayers_f(void) {
n = 1;
if (n > svs.maxclientslimit) {
n = svs.maxclientslimit;
Con_Printf("\"maxplayers\" set to \"%d\"\n", n);
console::info("\"maxplayers\" set to \"%d\"\n", n);
}
if ((n == 1) && listening)
@@ -217,13 +217,13 @@ static void NET_Port_f(void) {
int n;
if (command::argc() != 2) {
Con_Printf("\"port\" is \"%d\"\n", net_hostport);
console::info("\"port\" is \"%d\"\n", net_hostport);
return;
}
n = std::atoi(command::argv(1)->c_str());
if (n < 1 || n > 65534) {
Con_Printf("Bad value, must be between 1 and 65534\n");
console::info("Bad value, must be between 1 and 65534\n");
return;
}
@@ -239,8 +239,8 @@ static void NET_Port_f(void) {
static void PrintSlistHeader(void) {
Con_Printf("Server Map Users\n");
Con_Printf("--------------- --------------- -----\n");
console::info("Server Map Users\n");
console::info("--------------- --------------- -----\n");
slistLastShown = 0;
}
@@ -250,10 +250,10 @@ static void PrintSlist(void) {
for (n = slistLastShown; n < hostCacheCount; n++) {
if (hostcache[n].maxusers)
Con_Printf("%-15.15s %-15.15s %2u/%2u\n", hostcache[n].name, hostcache[n].map, hostcache[n].users,
console::info("%-15.15s %-15.15s %2u/%2u\n", hostcache[n].name, hostcache[n].map, hostcache[n].users,
hostcache[n].maxusers);
else
Con_Printf("%-15.15s %-15.15s\n", hostcache[n].name, hostcache[n].map);
console::info("%-15.15s %-15.15s\n", hostcache[n].name, hostcache[n].map);
}
slistLastShown = n;
}
@@ -261,9 +261,9 @@ static void PrintSlist(void) {
static void PrintSlistTrailer(void) {
if (hostCacheCount)
Con_Printf("== end list ==\n\n");
console::info("== end list ==\n\n");
else
Con_Printf("No Quake servers found.\n\n");
console::info("No Quake servers found.\n\n");
}
@@ -272,7 +272,7 @@ void NET_Slist_f(void) {
return;
if (!slistSilent) {
Con_Printf("Looking for Quake servers...\n");
console::info("Looking for Quake servers...\n");
PrintSlistHeader();
}
@@ -414,7 +414,7 @@ qsocket_t *NET_Connect(const char *host) {
if (hostCacheCount != 1)
return NULL;
host = hostcache[0].cname;
Con_Printf("Connecting to...\n%s @ %s\n\n", hostcache[0].name, host);
console::info("Connecting to...\n%s @ %s\n\n", hostcache[0].name, host);
}
if (hostCacheCount) {
@@ -436,7 +436,7 @@ JustDoIt:
}
if (host) {
Con_Printf("\n");
console::info("\n");
PrintSlistHeader();
PrintSlist();
PrintSlistTrailer();
@@ -509,7 +509,7 @@ int NET_GetMessage(qsocket_t *sock) {
return -1;
if (sock->disconnected) {
Con_Printf("NET_GetMessage: disconnected socket\n");
console::info("NET_GetMessage: disconnected socket\n");
return -1;
}
@@ -557,7 +557,7 @@ int NET_SendMessage(qsocket_t *sock, sizebuf_t *data) {
return -1;
if (sock->disconnected) {
Con_Printf("NET_SendMessage: disconnected socket\n");
console::info("NET_SendMessage: disconnected socket\n");
return -1;
}
@@ -577,7 +577,7 @@ int NET_SendUnreliableMessage(qsocket_t *sock, sizebuf_t *data) {
return -1;
if (sock->disconnected) {
Con_Printf("NET_SendMessage: disconnected socket\n");
console::info("NET_SendMessage: disconnected socket\n");
return -1;
}
@@ -743,10 +743,10 @@ void NET_Init(void) {
}
if (*my_ipx_address) {
Con_DPrintf("IPX address %s\n", my_ipx_address);
console::debug("IPX address %s\n", my_ipx_address);
}
if (*my_tcpip_address) {
Con_DPrintf("TCP/IP address %s\n", my_tcpip_address);
console::debug("TCP/IP address %s\n", my_tcpip_address);
}
}