public APNSPushConnection(PushService service, AppleConfig config)
        {
            Service = service;
            Config  = config;

            _notificationIdentifier = 0;
            _isAvailable            = false;
            _lockObject             = new object();
        }
Exemplo n.º 2
0
        public Apple()
        {
            _severInfo = new ServerInformation
            {
                ServerStarted = DateTime.Now,
                ServerVersion = new Version("2.0.0"),
                Author        = "Josh Hallow",
                Title         = "Apple Server",
                Developers    = new List <string> {
                    "Josh Hallow"
                }
            };

            _log = LogManager.GetLogger(typeof(Apple));
            _log.Info("Apple server is loading.");

            _appleConfig = new AppleConfig("config.ini");

            SocketSettings socketSettings = new SocketSettings
            {
                EndPoint      = new IPEndPoint(IPAddress.Any, int.Parse(_appleConfig.GetConfigElement("game.socket.port"))),
                SocketBacklog = ushort.Parse(_appleConfig.GetConfigElement("game.socket.backlog")),
                _log          = LogManager.GetLogger(typeof(SocketManager))
            };

            _socketManager = new SocketManager(socketSettings);
            _appleEncoding = new AppleEncoding();
            _packetManager = new PacketManager();
            _gameManager   = new GameManager();

            string interval = _appleConfig.GetConfigElement("console.timer.interval");

            _consoleWorker = new ConsoleWorker(ushort.Parse(interval));
            _consoleWorker.UpdateConsoleTitle();

            _log.Info(_severInfo.Title + " is ready.");
        }