void D_SendServerInfoChange (const FBaseCVar *cvar, UCVarValue value, ECVarType type)
{
    size_t namelen;

    namelen = strlen (cvar->GetName ());

    Net_WriteByte (DEM_SINFCHANGED);
    Net_WriteByte ((BYTE)(namelen | (type << 6)));
    Net_WriteBytes ((BYTE *)cvar->GetName (), (int)namelen);
    switch (type)
    {
    case CVAR_Bool:
        Net_WriteByte (value.Bool);
        break;
    case CVAR_Int:
        Net_WriteLong (value.Int);
        break;
    case CVAR_Float:
        Net_WriteFloat (value.Float);
        break;
    case CVAR_String:
        Net_WriteString (value.String);
        break;
    default:
        break; // Silence GCC
    }
}
示例#2
0
void D_SendServerFlagChange (const FBaseCVar *cvar, int bitnum, bool set)
{
	int namelen;

	namelen = (int)strlen (cvar->GetName ());

	Net_WriteByte (DEM_SINFCHANGEDXOR);
	Net_WriteByte ((BYTE)namelen);
	Net_WriteBytes ((BYTE *)cvar->GetName (), namelen);
	Net_WriteByte (BYTE(bitnum | (set << 5)));
}