Beispiel #1
0
        public Program()
        {
            _data = new DataManager();
            _listener = new Listener();
            _coroutine = new Coroutine();
            _context = new ServerContext(_listener, _data, _coroutine);

            _listener.Port = _data.World.Config.port;
            _listener.RegisterHandler(new PacketHandler(_context));

            _coroutine.AddEntry(_context.SaveContextEntry);
        }
Beispiel #2
0
        internal ServerContext(Listener listener, DataManager data, Coroutine coroutine)
        {
            _listener = listener;
            _data = data;
            _coroutine = coroutine;

            _npcAi = new NpcAi(this);

            LoadObjectsFromStore();
            if (_gameObjects.Count > 0)
            {
                _objectId = _gameObjects.Values.Select(e => e.ObjectId).Max() + 1;
            }
        }