mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-25 05:21:02 +00:00
- limited length of server CVAR name to 63 characters
Due to limitation of network protocol server CVARs with longer names cannot propogate changes of their values properly https://forum.zdoom.org/viewtopic.php?t=60729
This commit is contained in:
parent
0546c86716
commit
bff2c8cf74
1 changed files with 13 additions and 0 deletions
|
@ -67,6 +67,19 @@ int cvar_defflags;
|
|||
|
||||
FBaseCVar::FBaseCVar (const char *var_name, uint32_t flags, void (*callback)(FBaseCVar &))
|
||||
{
|
||||
if (var_name != nullptr && (flags & CVAR_SERVERINFO))
|
||||
{
|
||||
// This limitation is imposed by network protocol which uses only 6 bits
|
||||
// for name's length with terminating null character
|
||||
static const size_t NAME_LENGHT_MAX = 63;
|
||||
|
||||
if (strlen(var_name) > NAME_LENGHT_MAX)
|
||||
{
|
||||
I_FatalError("Name of the server console variable \"%s\" is too long.\n"
|
||||
"Its length should not exceed %zu characters.\n", var_name, NAME_LENGHT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
FBaseCVar *var;
|
||||
|
||||
var = FindCVar (var_name, NULL);
|
||||
|
|
Loading…
Reference in a new issue