diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 86166b6cd..126fcd4fb 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -1228,7 +1228,7 @@ qboolean PR_UserCmd(char *s) #ifdef Q2SERVER if (ge) { - SV_BeginRedirect (RD_CLIENT); + SV_BeginRedirect (RD_CLIENT, host_client->language); ge->ClientCommand(host_client->q2edict); SV_EndRedirect (); return true; //the dll will convert it to chat. @@ -1656,7 +1656,7 @@ Writes new values for v_forward, v_up, and v_right based on angles makevectors(vector) ============== */ -void PF_makevectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void PF_makevectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) { AngleVectors (G_VECTOR(OFS_PARM0), P_VEC(v_forward), P_VEC(v_right), P_VEC(v_up)); } @@ -1759,7 +1759,7 @@ void PF_setmodel (progfuncs_t *prinst, struct globalvars_s *pr_globals) } } } - + e->v.model = PR_SetString(prinst, sv.model_precache[i]); e->v.modelindex = i; @@ -5924,7 +5924,9 @@ void PF_readcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) static char output[8000]; extern char outputbuf[]; extern redirect_t sv_redirected; + extern int sv_redirectedlang; redirect_t old; + int oldl; s = PR_GetStringOfs(prinst, OFS_PARM0); @@ -5932,16 +5934,17 @@ void PF_readcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) Cbuf_AddText (s, RESTRICT_LOCAL); old = sv_redirected; + oldl = sv_redirectedlang; if (old != RD_NONE) SV_EndRedirect(); - SV_BeginRedirect(RD_OBLIVION); + SV_BeginRedirect(RD_OBLIVION, LANGDEFAULT); Cbuf_Execute(); Q_strncpyz(output, outputbuf, sizeof(output)); SV_EndRedirect(); if (old != RD_NONE) - SV_BeginRedirect(old); + SV_BeginRedirect(old, oldl); G_INT(OFS_RETURN) = (int)PR_SetString(prinst, output); diff --git a/engine/server/server.h b/engine/server/server.h index 06b0bb67e..766c29ebb 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -900,8 +900,8 @@ void SVM_Think(int port); // // svonly.c // -typedef enum {RD_NONE, RD_CLIENT, RD_PACKET, RD_OBLIVION} redirect_t; -void SV_BeginRedirect (redirect_t rd); +typedef enum {RD_NONE, RD_CLIENT, RD_PACKET, RD_OBLIVION} redirect_t; //oblivion is provided so people can read the output before the buffer is wiped. +void SV_BeginRedirect (redirect_t rd, int lang); void SV_EndRedirect (void); // diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index e32ec83e3..24e372f25 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -650,7 +650,7 @@ void SVC_Status (void) int slots=0; Cmd_TokenizeString ("status", false, false); - SV_BeginRedirect (RD_PACKET); + SV_BeginRedirect (RD_PACKET, LANGDEFAULT); Con_Printf ("%s\n", svs.info); for (i=0 ; idrate = atoi(val); else - cl->drate = 2500; + cl->drate = cl->rate; // msg command val = Info_ValueForKey (cl->userinfo, "msg"); diff --git a/engine/server/sv_send.c b/engine/server/sv_send.c index 406d065c5..aa81d47d1 100644 --- a/engine/server/sv_send.c +++ b/engine/server/sv_send.c @@ -40,6 +40,7 @@ Con_Printf redirection char outputbuf[8000]; redirect_t sv_redirected; +int sv_redirectedlang; extern func_t getplayerstat[MAX_CL_STATS]; extern func_t getplayerstati[MAX_CL_STATS]; @@ -108,15 +109,17 @@ SV_BeginRedirect instead of the console ================== */ -void SV_BeginRedirect (redirect_t rd) +void SV_BeginRedirect (redirect_t rd, int lang) { sv_redirected = rd; + sv_redirectedlang = lang; outputbuf[0] = 0; } void SV_EndRedirect (void) { SV_FlushRedirect (); + sv_redirectedlang = 0; //clenliness rather than functionality. Shouldn't be needed. sv_redirected = RD_NONE; } @@ -165,7 +168,7 @@ void Con_TPrintf (translation_t stringnum, ...) // add to redirected message if (sv_redirected) { - fmt = languagetext[stringnum][host_client->language]; + fmt = languagetext[stringnum][sv_redirectedlang]; va_start (argptr,stringnum); _vsnprintf (msg,sizeof(msg)-1, fmt,argptr); va_end (argptr); @@ -701,13 +704,22 @@ void SV_StartSound (edict_t *entity, int channel, char *sample, int volume, qboolean reliable = false; if (volume < 0 || volume > 255) - SV_Error ("SV_StartSound: volume = %i", volume); + { + Con_Printf ("SV_StartSound: volume = %i", volume); + return; + } if (attenuation < 0 || attenuation > 4) - SV_Error ("SV_StartSound: attenuation = %f", attenuation); + { + Con_Printf ("SV_StartSound: attenuation = %f", attenuation); + return; + } if (channel < 0 || channel > 15) - SV_Error ("SV_StartSound: channel = %i", channel); + { + Con_Printf ("SV_StartSound: channel = %i", channel); + return; + } // find precache number for sound for (sound_num=1 ; sound_numlanguage); u->func (); host_client = oldhost; SV_EndRedirect (); @@ -2867,7 +2867,7 @@ void SV_ExecuteUserCommand (char *s, qboolean fromQC) Con_Printf ("cmd from %s:\n%s\n" , host_client->name, net_message.data+4); - SV_BeginRedirect (RD_CLIENT); + SV_BeginRedirect (RD_CLIENT, host_client->language); remaining[0] = 0; @@ -3278,13 +3278,13 @@ void SVNQ_ExecuteUserCommand (char *s) if (!u->func) { - SV_BeginRedirect (RD_CLIENT); + SV_BeginRedirect (RD_CLIENT, host_client->language); Con_Printf("Command was disabled\n"); SV_EndRedirect (); } else { - SV_BeginRedirect (RD_CLIENT); + SV_BeginRedirect (RD_CLIENT, host_client->language); u->func (); SV_EndRedirect (); } @@ -3810,7 +3810,7 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse) movevars.ktjump = pm_ktjump.value; movevars.slidefix = (pm_slidefix.value != 0); movevars.airstep = (pm_airstep.value != 0); - movevars.walljump = (pm_walljump.value != 0); + movevars.walljump = (pm_walljump.value); if (sv_player->v.hasted) movevars.maxspeed*=sv_player->v.hasted;