Пример #1
0
        public Server()
        {
            Instance = this;

            _battles = new List<ServerBattle>();
            _parties = new List<ServerParty>();
            _regions = new List<ServerRegion>();
            _players = new List<ServerPlayer>();

            messagequeue = new BlockingQueue<ServerQueuedMessage>();

            //Console.WriteLine(Utils.GetCRC32("lol"));
            //Console.ReadLine();
        }
Пример #2
0
        static int Main(string[] args)
        {
            //uint dwMode = Utils.SetErrorMode(Utils.SEM_NOGPFAULTERRORBOX);
            //Utils.SetErrorMode(dwMode | Utils.SEM_NOGPFAULTERRORBOX);
            //Console.OutputEncoding = System.Text.Encoding.UTF8;

            for (int i = 0; i < args.Length; i++)
            {
                string s = args[i].Substring(1);
                int index = s.IndexOf(":");
                string arg = s.Substring(0, index).ToLower();
                string value = s.Substring(index+1);

                if (arg.Equals("gameport"))
                {
                    Settings.GamePort = Utils.StringToInt(value);
                }

                if (arg.Equals("playerlimit"))
                {
                    Settings.MaxPlayers = Utils.StringToInt(value);
                }

                if (arg.Equals("loglevel"))
                {
                    Settings.LogLevel = Utils.StringToInt(value);
                }
            }

            if (!Utils.IsRunningOnMono())
            {
                Utils.SetErrorMode(Utils.SEM_NOGPFAULTERRORBOX | Utils.SEM_FAILCRITICALERRORS);
            }

            Server myServer = new Server();

            return myServer.Run();
        }
Пример #3
0
 public ServerParty(UInt32 ID, Server server)
 {
     this._ID = ID;
     this._server = server;
     this._members = new ServerPlayer[Settings.MaxPartySize];
 }