Esempio n. 1
0
        void LOGIN(User user, string prms)
        {
            string[] splitted = prms.Split(' ');
            if (splitted.Count() < 2)
            {
                throw new FormatException("LOGIN <name> <password>");
            }
            string name     = splitted[0];
            string password = splitted[1];

            if (register.Contains(name) && register.Check(name, password))
            {
                user.name = name;
                user.SendError("055");
                userList.SendNamesToAll();
                userList.SendMessageToAll("MSG " + name + " вернулся к нам!");
                user.SendYouAre();
                Log.Write(name + " зашёл.");
                userList.OnListChanged();
            }
            else
            {
                user.SendError("054");
            }
        }
Esempio n. 2
0
        void NICK(User user, string prms)
        {
            rndNick.Remove(user.name);
            string newName = rndNick.GetNew();

            Log.Write(user.name + " changed nick to " + newName);
            userList.SendMessageToAll(("MSG " + user.name + " изменил ник на " + newName));
            user.name = newName;
            user.SendError("050");
            userList.SendNamesToAll();
            user.SendYouAre();
            userList.OnListChanged();
        }