Fixed info command to print to client, not dedicated console.

This commit is contained in:
Jay Dolan 2006-01-15 16:55:08 +00:00
parent 3bb16e3349
commit 9d7ee224d2
4 changed files with 26 additions and 13 deletions

View File

@ -295,7 +295,7 @@ void SV_InitGame(void){
// dedicated servers are can't be single player and are usually DM
// so unless they explicity set coop, force it to deathmatch
if(dedicated->value){
if(!Cvar_VariableValue("coop"))
if(!coop->value)
Cvar_FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH);
}

View File

@ -871,7 +871,6 @@ void SV_UserinfoChanged(client_t *cl){
if(strlen(val)){
cl->messagelevel = atoi(val);
}
}

View File

@ -60,7 +60,7 @@ Sends text across to be displayed if the level passes
*/
void SV_ClientPrintf(client_t *cl, int level, char *fmt, ...){
va_list argptr;
char string[1024];
char string[MAX_STRING_CHARS];
if(level < cl->messagelevel)
return;
@ -83,7 +83,7 @@ Sends text to all active clients
*/
void SV_BroadcastPrintf(int level, char *fmt, ...){
va_list argptr;
char string[2048];
char string[MAX_STRING_CHARS];
client_t *cl;
int i;
@ -93,13 +93,13 @@ void SV_BroadcastPrintf(int level, char *fmt, ...){
// echo to console
if(dedicated->value){
char copy[1024];
int i;
char copy[MAX_STRING_CHARS];
int j;
// mask off high bits
for(i = 0; i < 1023 && string[i]; i++)
copy[i] = string[i] & 127;
copy[i] = 0;
for(j = 0; j < MAX_STRING_CHARS - 1 && string[j]; j++)
copy[j] = string[j] & 127;
copy[j] = 0;
Com_Printf("%s", copy);
}
@ -123,7 +123,7 @@ Sends text to all active clients
*/
void SV_BroadcastCommand(char *fmt, ...){
va_list argptr;
char string[1024];
char string[MAX_STRING_CHARS];
if(!sv.state)
return;

View File

@ -358,7 +358,6 @@ The client is going to disconnect, so remove the connection immediately
=================
*/
void SV_Disconnect_f(void){
// SV_EndRedirect();
SV_DropClient(sv_client);
}
@ -371,7 +370,22 @@ Dumps the serverinfo info string
==================
*/
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;
//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
svs.spawncount++; // make sure another doesn't sneak in