示例#1
0
        public BannedUser(IClientObject client, DateTime?banTill) : base(client)
        {
            MessageReadonly ro = new MessageReadonly();

            ro.client = this.client;
            Handlers  = new IHandlerModule[] {
                new Logout(),
                new Info(),
                ro,
                new Private()
            };
            this.client = client;

            if (banTill != null || banTill != DateTime.MaxValue)
            {
                Task.Factory.StartNew(async() => {
                    TimeSpan taskRunTime = banTill.Value.Subtract(DateTime.Now);
                    if (taskRunTime.TotalMilliseconds > 0)
                    {
                        await Task.Delay(taskRunTime);
                    }
                    TrackBlackList(client.Username);
                });
            }
        }
示例#2
0
        public Admin(IClientObject clnt) : base(clnt)
        {
            RoomObserver ro = new RoomObserver();

            ro.client = clnt;
            Handlers  = new IHandlerModule[] {
                new Logout(),
                new Info(),
                new HistoryModule(),
                ro,
                new Private(),
                new Room(),
                new AdminModule()
            };
        }
示例#3
0
        public User(IClientObject clnt) : base(clnt)
        {
            RoomObserver messageModule = new RoomObserver();

            messageModule.client = clnt;

            Handlers = new IHandlerModule[] {
                new HistoryModule(),
                messageModule,
                new Logout(),
                new Info(),
                new Private(),
                new Room()
            };
        }
示例#4
0
 public UnknownUser(IClientObject clnt) : base(clnt)
 {
     Handlers = new IHandlerModule[] {
         new AuthModule()
     };
 }