Exemplo n.º 1
0
        public static User ParseUserJoined(byte[] msg, int offset)
        {
            User user = new User();
            offset++;
            int endName = offset;
            StringBuilder sb = new StringBuilder();
            while (msg[offset] != 0)
                sb.Append((char)msg[offset++]);
            user.Name = sb.ToString();
            offset++;

            user.id = BitConverter.ToInt16(msg, offset);
            offset += 2;
            user.ping = BitConverter.ToInt32(msg, offset);
            offset += 4;
            user.connection = msg[offset];

            user.assignCategory();

            return user;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the tray event if the active window responds to any of the flag
        /// Only one event should be passed in at a time!
        /// </summary>
        /// <param name="flags"></param>
        public void handleTrayEvent(TrayFlags.PopValues flag, User targUser = null, string keyword = null)
        {
            if (!SettingsManager.getMgr().isNotifyEnabled(flag)) return;

            foreach (Window w in activeWindow)
            {
                if (!TrayFlags.handlesEvent(w, flag))
                {
                    log.Info("Received event: " + flag.ToString() + ". Ignoring - " + activeWindow.ToString() + " does not accept event");
                    continue;
                }

                

                currEvent = flag;
                this.targUser = targUser;
                this.keyword = keyword;

                string message = TrayFlags.trayLang[currEvent];
                message = message.Replace("#", targUser.Name);
                message = message.Replace("$", keyword);

                log.Info("Recieved tray event: " + flag.ToString() + ", with targUser: "******", message: " + message);

                kIcon.ShowBalloonTip("Kaillera Event", message, BalloonIcon.Info);
                return;
            }
        }
 public void sendPM(User user, string text)
 {
     mgr.sendPM(user, text);
 }
 public void addToBuddyList(User user)
 {
     if (user.Category.Equals("Buddies"))
     {
         user.Category = "Users";
         usersWindow.refreshList();
     }
     else
     {
         user.Category = "Buddies";
         usersWindow.refreshList();
     }
 }
Exemplo n.º 5
0
 public void sendPM(User user, string text)
 {
     while (text.Length >= 110)
     {
         string sendtext = text.Substring(0, 110);
         string txt = text.Substring(110, text.Length - 110);
         SendServerChatText("/msg " + user.id + " " + sendtext);
         text = txt;
     }
     SendServerChatText("/msg " + user.id + " " + text);
 }
Exemplo n.º 6
0
 internal static void UpdateGameText(User user, String text)
 {
 }
Exemplo n.º 7
0
 internal static void UpdateChatText(User user, String text)
 {
 }
Exemplo n.º 8
0
 public void RemoveUser(User user)
 {
     numUsers--;
     users.Remove(user);
 }
Exemplo n.º 9
0
 public void AddUser(User user)
 {
     numUsers++;
     users.Add(user);
 }