Inheritance: Connection, ISystem
Beispiel #1
0
        public GameServer(MonoServer renderServer)
        {
            _monoServer = renderServer;
            _bifrost = LookupSystem<BifrostServer>();
            _playerSys = LookupSystem<PlayerSystem>();

            PacketFactory.AddCallback<MonoLoginPacket>(OnLogin);

            _bifrost.OnDisconnect += _bifrost_OnDisconnect;

            JavascriptSystem jsSystem = new JavascriptSystem();
            AddSystem(jsSystem);

            jsSystem.Execute(@"test.js");
        }
Beispiel #2
0
 public bool Start()
 {
     _bifrost = LookupSystem<BifrostServer>();
     _bifrost.OnDisconnect += _bifrost_OnDisconnect;
     return true;
 }
Beispiel #3
0
        private void LoadConfig()
        {
            _netConfig = Config.Get<NetConfig>("network");
            _phyConfig = Config.Get<PhysicsConfig>("physics");
            _scriptConfig = Config.Get<ScriptConfig>("script");

            PathHelpers.SetBasePath(_scriptConfig.ScriptPath);

            _bifrost = new BifrostServer(_netConfig.Port, _netConfig.MaxConnections);
            RPCManager.SetConnection(_bifrost);
            AddInternalSystem(_bifrost, 0);
            PacketFactory.AddCallback<AckStatePacket>(OnAckState);
            PacketFactory.AddCallback<ClientStatePacket>(OnClientState);

            PlayerSystem ps = new PlayerSystem();
            AddEntitySystem(ps);
        }