Пример #1
0
        protected override void challengerHandler(UserThread client, CSMessage msg)
        {
            try
            {
                CSUser user = (CSUser)msg.get(MessageType.USER);

                if (msg.get(MessageType.REQUEST) != null)
                {
                    client.Froms.Add(user);
                    if (view.isOpened())
                    {
                        view.requestHandler(user);
                    }
                }
                else if ((msg.get(MessageType.ABORT) != null))
                {
                    if (user.Equals(client.To))
                    {
                        client.To = null;
                        if (view.isOpened())
                        {
                            view.abortHandler(user, true);
                        }
                    }
                    else
                    {
                        client.Froms.Remove(user);
                        if (view.isOpened())
                        {
                            view.abortHandler(user, false);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                log(Severiry.ERROR, "Controller [Challenging] - " + e.Message);
            }
        }