Esempio n. 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);
                });
            }
        }
Esempio n. 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()
            };
        }
Esempio n. 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()
            };
        }
Esempio n. 4
0
 public UnknownUser(IClientObject clnt) : base(clnt)
 {
     Handlers = new IHandlerModule[] {
         new AuthModule()
     };
 }