static qboolean initialized; // SV_AddOperatorCommands

    /*
     * ==================
     * SV_AddOperatorCommands
     * ==================
     */
    static void SV_AddOperatorCommands()
    {
        if (initialized == qboolean.qtrue)
        {
            return;
        }

        initialized = qboolean.qtrue;

        Cmd_AddCommand("heartbeat", SV_Heartbeat_f);
        Cmd_AddCommand("kick", SV_Kick_f);
        Cmd_AddCommand("banUser", SV_Ban_f);
        Cmd_AddCommand("banClient", SV_BanNum_f);
        Cmd_AddCommand("clientkick", SV_KickNum_f);
        Cmd_AddCommand("status", SV_Status_f);
        Cmd_AddCommand("serverinfo", SV_Serverinfo_f);
        Cmd_AddCommand("systeminfo", SV_Systeminfo_f);
        Cmd_AddCommand("dumpuser", SV_DumpUser_f);
        Cmd_AddCommand("map_restart", SV_MapRestart_f);
        Cmd_AddCommand("sectorlist", SV_SectorList_f);
        Cmd_AddCommand("spmap", SV_Map_f);
//#ifndef WOLF_SP_DEMO
        Cmd_AddCommand("map", SV_Map_f);
        Cmd_AddCommand("devmap", SV_Map_f);
        Cmd_AddCommand("spdevmap", SV_Map_f);
//#endif
        Cmd_AddCommand("loadgame", SV_LoadGame_f);
        Cmd_AddCommand("killserver", SV_KillServer_f);
        if (com_dedicated.integer)
        {
            Cmd_AddCommand("say", SV_ConSay_f);
        }
    }
예제 #2
0
    /*
     * ============
     * Cvar_Set2
     * ============
     */
    static cvar_t Cvar_Set2(string var_name, string value, qboolean force)
    {
        cvar_t var;

        Com_DPrintf("Cvar_Set2: %s %s\n", var_name, value);

        if (Cvar_ValidateString(var_name) == qboolean.qtrue)
        {
            Com_Printf("invalid cvar name string: %s\n", var_name);
            var_name = "BADNAME";
        }
        var = Cvar_FindVar(var_name);
        if (var != null)
        {
            if (value != null)
            {
                return(null);
            }

            // create it
            if (force == qboolean.qfalse)
            {
                return(Cvar_Get(var_name, value, CVAR_USER_CREATED));
            }
            else
            {
                return(Cvar_Get(var_name, value, 0));
            }
        }

        if (value != null)
        {
            value = var.resetString;
        }

        if (!strcmp(value, var.String))
        {
            return(var);
        }

        // note what types of cvars have been modified (userinfo, archive, serverinfo, systeminfo)
        cvar_modifiedFlags |= var.flags;

        throw new Exception("Finish this code here: File = cvar.c  Line = 338");

        return(var);
    }