Example #1
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////
        /// <summary>
        /// Generic constructor
        /// </summary>
        public Team(Arena owner, ZoneServer server)
        {
            _arena  = owner;
            _server = server;

            _players    = new List <Player>();
            _tInventory = new Dictionary <int, TeamInventoryItem>();

            _currentGameKills  = 0;
            _currentGameDeaths = 0;
        }
Example #2
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////
        /// <summary>
        /// Generic constructor
        /// </summary>
        public Arena(ZoneServer server)
        {
            _server = server;

            _players = new List <Player>();
            _teams   = new Dictionary <string, Team>();

            _vehicles       = new Dictionary <ushort, Vehicle>();
            _lastVehicleKey = (ushort)ZoneServer.maxPlayers;                    //The first vehicle key will naturally start
            //at the edge of the player base vehicles.
            _items       = new Dictionary <ushort, ItemDrop>();
            _lastItemKey = 0;
        }
Example #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Initializing logger..");

            //Initialize the logging system
            if (!Log.init())
            {                   //Abort..
                Console.WriteLine("Logger initialization failed, exiting..");
                Thread.Sleep(10000);
                return;
            }

            DdMonitor.bNoSync        = false;
            DdMonitor.bEnabled       = false;
            DdMonitor.DefaultTimeout = -1;

            //Register our catch-all exception handler
            Thread.GetDomain().UnhandledException += onException;

            //Create a logging client for the main server thread
            LogClient handlerLogger = Log.createClient("ServerHandler");

            Log.assume(handlerLogger);

            //Set a handler for if we recieve Ctrl+C or Ctrl+BREAK
            Console.CancelKeyPress += new ConsoleCancelEventHandler(Exit);

            //Allow functions to pre-register
            Logic.Registrar.register();

            //Create our zone server
            server = new InfServer.Game.ZoneServer();

            //Initialize everything..
            if (!server.init())
            {
                Log.write(TLog.Error, "ZoneServer initialization failed, exiting..");
                Thread.Sleep(10000);
                return;
            }

            //Good to go!
            Log.write("");
            Log.write("Starting server..");
            server.begin();
        }