Esempio n. 1
0
        public void Initialize()
        {
            keyMap = new BoundKeyMap(_reflectionManager);
            keyMap.PopulateKeyFunctionsMap();

            LoadKeyFile(new ResourcePath("/keybinds.yml"));
            var path = new ResourcePath("/keybinds_content.yml");

            if (_resourceMan.ContentFileExists(path))
            {
                LoadKeyFile(path);
            }

            _netManager.RegisterNetMessage <MsgKeyFunctionStateChange>(MsgKeyFunctionStateChange.NAME);
        }
Esempio n. 2
0
        /// <inheritdoc />
        public void Initialize(int maxPlayers)
        {
            KeyMap = new BoundKeyMap(_reflectionManager);
            KeyMap.PopulateKeyFunctionsMap();

            MaxPlayers = maxPlayers;

            _network.RegisterNetMessage <MsgServerInfoReq>(MsgServerInfoReq.NAME, HandleWelcomeMessageReq);
            _network.RegisterNetMessage <MsgServerInfo>(MsgServerInfo.NAME);
            _network.RegisterNetMessage <MsgPlayerListReq>(MsgPlayerListReq.NAME, HandlePlayerListReq);
            _network.RegisterNetMessage <MsgPlayerList>(MsgPlayerList.NAME);

            _network.Connecting += OnConnecting;
            _network.Connected  += NewSession;
            _network.Disconnect += EndSession;
        }
Esempio n. 3
0
        /// <inheritdoc />
        public void Initialize()
        {
            NetworkBindMap = new BoundKeyMap(_reflectionManager);
            NetworkBindMap.PopulateKeyFunctionsMap();

            EngineContexts.SetupContexts(Contexts);

            Contexts.ContextChanged += OnContextChanged;

            var path = new ResourcePath("/keybinds.yml");

            if (_resourceMan.ContentFileExists(path))
            {
                LoadKeyFile(path);
            }
        }
Esempio n. 4
0
        /// <inheritdoc />
        public void Initialize(int maxPlayers)
        {
            keyMap = new BoundKeyMap(_reflectionManager);
            keyMap.PopulateKeyFunctionsMap();

            _sessions = new PlayerSession[maxPlayers];

            _network.RegisterNetMessage <MsgSession>(MsgSession.NAME);
            _network.RegisterNetMessage <MsgClGreet>(MsgClGreet.NAME, HandleClientGreet);
            _network.RegisterNetMessage <MsgServerInfoReq>(MsgServerInfoReq.NAME, HandleWelcomeMessageReq);
            _network.RegisterNetMessage <MsgServerInfo>(MsgServerInfo.NAME);
            _network.RegisterNetMessage <MsgPlayerListReq>(MsgPlayerListReq.NAME, HandlePlayerListReq);
            _network.RegisterNetMessage <MsgPlayerList>(MsgPlayerList.NAME);
            _network.RegisterNetMessage <MsgKeyFunctionStateChange>(MsgKeyFunctionStateChange.NAME, HandleKeyFunctionStateChange);

            _network.Connecting += OnConnecting;
            _network.Connected  += NewSession;
            _network.Disconnect += EndSession;
        }