Exemplo n.º 1
0
        /*============================================================================================
         * Constructor for the class which sets
         * up some initial pieces of data
         *============================================================================================*/
        public ChatServer(MainWindow m)
        {
            mw      = m;
            localIP = GetLocalIP();
            if (mw.localPort > 0)
            {
                localPort = mw.localPort;
            }
            if (mw.timeOut > 0)
            {
                timeOut = mw.timeOut;
            }
            RequireHello = mw.useHello;

            RegistrationCommands = new CommandsForRegistration(this);
            RoomCommands         = new CommandsForRooms(this, RegistrationCommands);
            UserCommands         = new CommandsForUsers(this);
        }
Exemplo n.º 2
0
        public CommandsForRooms(ChatServer cserver, CommandsForRegistration rgclass)
        {
            chatServer = cserver;
            userReg    = rgclass.userRegistration;

            ClassRooms r = new ClassRooms("*", "LOBBY", "");

            roomHash.Add("LOBBY", r);

            // do we care about certain words in the room names?
            if (File.Exists(cserver.LocalPath + "RoomBlackList.txt"))
            {
                cusswords = File.ReadLines("c:\\file.txt").ToArray();
                for (int i = 0; i < cusswords.Length; i++)
                {
                    cusswords[i] = cusswords[i].ToLower();
                }
            }
        }