Example #1
0
 public static void SV_Init( )
 {
     SV_CCMDS.SV_InitOperatorCommands();
     SV_MAIN.rcon_password = Cvar.Get("rcon_password", "", 0);
     Cvar.Get("skill", "1", 0);
     Cvar.Get("deathmatch", "0", Defines.CVAR_LATCH);
     Cvar.Get("coop", "0", Defines.CVAR_LATCH);
     Cvar.Get("dmflags", "" + Defines.DF_INSTANT_ITEMS, Defines.CVAR_SERVERINFO);
     Cvar.Get("fraglimit", "0", Defines.CVAR_SERVERINFO);
     Cvar.Get("timelimit", "0", Defines.CVAR_SERVERINFO);
     Cvar.Get("cheats", "0", Defines.CVAR_SERVERINFO | Defines.CVAR_LATCH);
     Cvar.Get("protocol", "" + Defines.PROTOCOL_VERSION, Defines.CVAR_SERVERINFO | Defines.CVAR_NOSET);
     SV_MAIN.maxclients             = Cvar.Get("maxclients", "1", Defines.CVAR_SERVERINFO | Defines.CVAR_LATCH);
     SV_MAIN.hostname               = Cvar.Get("hostname", "noname", Defines.CVAR_SERVERINFO | Defines.CVAR_ARCHIVE);
     SV_MAIN.timeout                = Cvar.Get("timeout", "125", 0);
     SV_MAIN.zombietime             = Cvar.Get("zombietime", "2", 0);
     SV_MAIN.sv_showclamp           = Cvar.Get("showclamp", "0", 0);
     SV_MAIN.sv_paused              = Cvar.Get("paused", "0", 0);
     SV_MAIN.sv_timedemo            = Cvar.Get("timedemo", "0", 0);
     SV_MAIN.sv_enforcetime         = Cvar.Get("sv_enforcetime", "0", 0);
     SV_MAIN.allow_download         = Cvar.Get("allow_download", "1", Defines.CVAR_ARCHIVE);
     SV_MAIN.allow_download_players = Cvar.Get("allow_download_players", "0", Defines.CVAR_ARCHIVE);
     SV_MAIN.allow_download_models  = Cvar.Get("allow_download_models", "1", Defines.CVAR_ARCHIVE);
     SV_MAIN.allow_download_sounds  = Cvar.Get("allow_download_sounds", "1", Defines.CVAR_ARCHIVE);
     SV_MAIN.allow_download_maps    = Cvar.Get("allow_download_maps", "1", Defines.CVAR_ARCHIVE);
     SV_MAIN.sv_noreload            = Cvar.Get("sv_noreload", "0", 0);
     SV_MAIN.sv_airaccelerate       = Cvar.Get("sv_airaccelerate", "0", Defines.CVAR_LATCH);
     SV_MAIN.public_server          = Cvar.Get("public", "0", 0);
     SV_MAIN.sv_reconnect_limit     = Cvar.Get("sv_reconnect_limit", "3", Defines.CVAR_ARCHIVE);
     SZ.Init(Globals.net_message, Globals.net_message_buffer, Globals.net_message_buffer.Length);
 }
Example #2
0
        public static void SV_CheckForSavegame( )
        {
            String     name;
            FileStream f;
            Int32      i;

            if (SV_MAIN.sv_noreload.value != 0)
            {
                return;
            }
            if (Cvar.VariableValue("deathmatch") != 0)
            {
                return;
            }
            name = FS.Gamedir() + "/save/current/" + sv.name + ".sav";
            try
            {
                f = File.OpenRead(name);
            }
            catch (Exception e)
            {
                return;
            }

            try
            {
                f.Close();
            }
            catch (Exception e1)
            {
                e1.PrintStackTrace();
            }

            SV_WORLD.SV_ClearWorld();
            SV_CCMDS.SV_ReadLevelFile();
            if (!sv.loadgame)
            {
                Int32 previousState;
                previousState = sv.state;
                sv.state      = Defines.ss_loading;
                for (i = 0; i < 100; i++)
                {
                    GameBase.G_RunFrame();
                }
                sv.state = previousState;
            }
        }