Exemplo n.º 1
0
        private async void HandleWelcomeMessageReq(MsgServerInfoReq message)
        {
            var channel = message.MsgChannel;
            var netMsg  = channel.CreateNetMessage <MsgServerInfo>();

            netMsg.ServerName       = _baseServer.ServerName;
            netMsg.ServerMaxPlayers = _baseServer.MaxPlayers;
            netMsg.TickRate         = _timing.TickRate;

            IPlayerSession?session;

            while (!TryGetSessionByChannel(channel, out session))
            {
                await Task.Delay(10);

                if (!channel.IsConnected)
                {
                    return;
                }
            }

            netMsg.PlayerSessionId = session.SessionId;

            channel.SendMessage(netMsg);
        }
Exemplo n.º 2
0
        private void HandleWelcomeMessageReq(MsgServerInfoReq message)
        {
            var channel = message.MsgChannel;
            var netMsg  = channel.CreateNetMessage <MsgServerInfo>();

            netMsg.ServerName       = _baseServer.ServerName;
            netMsg.ServerMaxPlayers = _baseServer.MaxPlayers;
            netMsg.TickRate         = _timing.TickRate;

            channel.SendMessage(netMsg);
        }
Exemplo n.º 3
0
        private void HandleWelcomeMessageReq(MsgServerInfoReq message)
        {
            var session = GetSessionByChannel(message.MsgChannel);

            var netMsg = message.MsgChannel.CreateNetMessage <MsgServerInfo>();

            netMsg.ServerName       = _baseServer.ServerName;
            netMsg.ServerMaxPlayers = _baseServer.MaxPlayers;
            netMsg.PlayerSessionId  = session.SessionId;

            message.MsgChannel.SendMessage(netMsg);
        }
        private void HandleWelcomeMessageReq(MsgServerInfoReq message)
        {
            var session = GetSessionByChannel(message.MsgChannel);

            var netMsg = message.MsgChannel.CreateNetMessage <MsgServerInfo>();

            netMsg.ServerName           = _baseServer.ServerName;
            netMsg.ServerPort           = _network.Port;
            netMsg.ServerWelcomeMessage = _baseServer.Motd;
            netMsg.ServerMaxPlayers     = _baseServer.MaxPlayers;
            netMsg.ServerMapName        = _baseServer.MapName;
            netMsg.GameMode             = _baseServer.GameModeName;
            netMsg.ServerPlayerCount    = PlayerCount;
            netMsg.PlayerSessionId      = session.SessionId;

            message.MsgChannel.SendMessage(netMsg);
        }