Fixed info command to print to client, not dedicated console.
This commit is contained in:
parent
3bb16e3349
commit
9d7ee224d2
|
@ -295,7 +295,7 @@ void SV_InitGame(void){
|
||||||
// dedicated servers are can't be single player and are usually DM
|
// dedicated servers are can't be single player and are usually DM
|
||||||
// so unless they explicity set coop, force it to deathmatch
|
// so unless they explicity set coop, force it to deathmatch
|
||||||
if(dedicated->value){
|
if(dedicated->value){
|
||||||
if(!Cvar_VariableValue("coop"))
|
if(!coop->value)
|
||||||
Cvar_FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH);
|
Cvar_FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -871,7 +871,6 @@ void SV_UserinfoChanged(client_t *cl){
|
||||||
if(strlen(val)){
|
if(strlen(val)){
|
||||||
cl->messagelevel = atoi(val);
|
cl->messagelevel = atoi(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ Sends text across to be displayed if the level passes
|
||||||
*/
|
*/
|
||||||
void SV_ClientPrintf(client_t *cl, int level, char *fmt, ...){
|
void SV_ClientPrintf(client_t *cl, int level, char *fmt, ...){
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
char string[1024];
|
char string[MAX_STRING_CHARS];
|
||||||
|
|
||||||
if(level < cl->messagelevel)
|
if(level < cl->messagelevel)
|
||||||
return;
|
return;
|
||||||
|
@ -83,7 +83,7 @@ Sends text to all active clients
|
||||||
*/
|
*/
|
||||||
void SV_BroadcastPrintf(int level, char *fmt, ...){
|
void SV_BroadcastPrintf(int level, char *fmt, ...){
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
char string[2048];
|
char string[MAX_STRING_CHARS];
|
||||||
client_t *cl;
|
client_t *cl;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -93,13 +93,13 @@ void SV_BroadcastPrintf(int level, char *fmt, ...){
|
||||||
|
|
||||||
// echo to console
|
// echo to console
|
||||||
if(dedicated->value){
|
if(dedicated->value){
|
||||||
char copy[1024];
|
char copy[MAX_STRING_CHARS];
|
||||||
int i;
|
int j;
|
||||||
|
|
||||||
// mask off high bits
|
// mask off high bits
|
||||||
for(i = 0; i < 1023 && string[i]; i++)
|
for(j = 0; j < MAX_STRING_CHARS - 1 && string[j]; j++)
|
||||||
copy[i] = string[i] & 127;
|
copy[j] = string[j] & 127;
|
||||||
copy[i] = 0;
|
copy[j] = 0;
|
||||||
Com_Printf("%s", copy);
|
Com_Printf("%s", copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ Sends text to all active clients
|
||||||
*/
|
*/
|
||||||
void SV_BroadcastCommand(char *fmt, ...){
|
void SV_BroadcastCommand(char *fmt, ...){
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
char string[1024];
|
char string[MAX_STRING_CHARS];
|
||||||
|
|
||||||
if(!sv.state)
|
if(!sv.state)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -358,7 +358,6 @@ The client is going to disconnect, so remove the connection immediately
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void SV_Disconnect_f(void){
|
void SV_Disconnect_f(void){
|
||||||
// SV_EndRedirect();
|
|
||||||
SV_DropClient(sv_client);
|
SV_DropClient(sv_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,7 +370,22 @@ Dumps the serverinfo info string
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
void SV_ShowServerinfo_f(void){
|
void SV_ShowServerinfo_f(void){
|
||||||
Info_Print(Cvar_Serverinfo());
|
cvar_t *cvar;
|
||||||
|
char line[MAX_STRING_CHARS];
|
||||||
|
|
||||||
|
if(!sv_client){ //print to server console
|
||||||
|
Info_Print(Cvar_Serverinfo());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(cvar = cvar_vars; cvar; cvar = cvar->next){
|
||||||
|
|
||||||
|
if(!(cvar->flags & CVAR_SERVERINFO))
|
||||||
|
continue; //only print serverinfo cvars
|
||||||
|
|
||||||
|
snprintf(line, MAX_STRING_CHARS, "%s %s\n", cvar->name, cvar->string);
|
||||||
|
SV_ClientPrintf(sv_client, PRINT_MEDIUM, line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -379,7 +393,7 @@ void SV_Nextserver(void){
|
||||||
char *v;
|
char *v;
|
||||||
|
|
||||||
//ZOID, ss_pic can be nextserver'd in coop mode
|
//ZOID, ss_pic can be nextserver'd in coop mode
|
||||||
if(sv.state == ss_game ||(sv.state == ss_pic && !Cvar_VariableValue("coop")))
|
if(sv.state == ss_game ||(sv.state == ss_pic && !coop->value))
|
||||||
return; // can't nextserver while playing a normal game
|
return; // can't nextserver while playing a normal game
|
||||||
|
|
||||||
svs.spawncount++; // make sure another doesn't sneak in
|
svs.spawncount++; // make sure another doesn't sneak in
|
||||||
|
|
Loading…
Reference in New Issue