예제 #1
0
        internal static ClientAcceptanceStatus ClientConnected(NetworkClient Client)
        {
            var ban = ProscriptionList.IsBanned(Client.IPString);

            if (ban.Banned)
            {
                Core.LogError("Rejected connection from " + Client.IPString + ". Matched ban " + ban.SourceBan.Glob + " Reason: " + ban.SourceBan.Reason);
                return(ClientAcceptanceStatus.Rejected);
            }

            ClientLock.WaitOne();

            var dummyPlayer = new MudObject();

            dummyPlayer.Actor();
            dummyPlayer.SetProperty("command handler", new LoginCommandHandler());
            Core.TiePlayerToClient(Client, dummyPlayer);

            Core.SendMessage(Client, Core.SettingsObject.Banner);
            Core.SendMessage(Client, Core.SettingsObject.MessageOfTheDay);

            ConnectedClients.Add(Client);

            Core.SendPendingMessages();

            ClientLock.ReleaseMutex();

            return(ClientAcceptanceStatus.Accepted);
        }