mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-22 20:21:38 +00:00
bah, I broke connecting to old servers :(
remove *qsg_version and *cap on disconnect set *qsg_version and *cap after connection but only if the server presents *qsg_version (it will have big enough info buffers if this key exists). Doesn't yet send the updated values to the server as there is currently no way to do so :( I started out creating a setfulluserinfo, but ran into design/security problems with that approach. What's needed is to either find a secure way to update these two star keys (however, special casing is ugly) or make them non-star keys (I don't like that either: too easy to fiddle with). Another possiblity is to force a reconnect after they are set.
This commit is contained in:
parent
87be5c56ca
commit
46cbb108da
1 changed files with 17 additions and 5 deletions
|
@ -466,7 +466,7 @@ void CL_Disconnect (void)
|
|||
|
||||
connect_time = -1;
|
||||
|
||||
VID_SetCaption(PROGRAM ": disconnected");
|
||||
VID_SetCaption(PROGRAM ": disconnected");
|
||||
|
||||
// stop sounds (especially looping!)
|
||||
S_StopAllSounds (true);
|
||||
|
@ -488,6 +488,9 @@ void CL_Disconnect (void)
|
|||
cls.state = ca_disconnected;
|
||||
|
||||
cls.demoplayback = cls.demorecording = cls.timedemo = false;
|
||||
|
||||
Info_RemoveKey (cls.userinfo, "*cap");
|
||||
Info_RemoveKey (cls.userinfo, "*qsg_version");
|
||||
}
|
||||
Cam_Reset();
|
||||
|
||||
|
@ -655,6 +658,19 @@ void CL_FullServerinfo_f (void)
|
|||
} else {
|
||||
allowskybox = false;
|
||||
}
|
||||
if ((p = Info_ValueForKey (cl.serverinfo, "*qsg_version")) && *p) {
|
||||
char cap[100] = ""; // max of 98 or so flags
|
||||
// set the capabilities info. single char flags (possibly with
|
||||
// modifiefs)
|
||||
// defined capabilities:
|
||||
#ifdef HAVE_ZLIB
|
||||
// z client can accept gzipped files.
|
||||
strcat (cap, "z");
|
||||
#endif
|
||||
Info_SetValueForStarKey (cls.userinfo, "*cap", cap, MAX_INFO_STRING);
|
||||
Info_SetValueForStarKey (cls.userinfo, "*qsg_version", QSG_VERSION,
|
||||
MAX_SERVERINFO_STRING);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1142,10 +1158,6 @@ void CL_Init (void)
|
|||
sprintf (st, "%s", QW_VERSION);
|
||||
Info_SetValueForStarKey (cls.userinfo, "*ver", st, MAX_INFO_STRING);
|
||||
Info_SetValueForStarKey (cls.userinfo, "stdver", QSG_VERSION, MAX_INFO_STRING);
|
||||
// set the capabilities info. single char flags (possibly with modifiefs)
|
||||
// defined capabilities:
|
||||
// z client can accept gzipped files.
|
||||
Info_SetValueForStarKey (cls.userinfo, "*cap", "z", MAX_INFO_STRING);
|
||||
|
||||
CL_InitInput ();
|
||||
CL_InitTEnts ();
|
||||
|
|
Loading…
Reference in a new issue