Beispiel #1
0
        private void Self_OnGroupChatJoin(object sender, GroupChatJoinedEventArgs e)
        {
            if (e.SessionID != session && e.TmpSessionID != session)
            {
                return;
            }

            if (e.Success)
            {
                WaitForSessionStart.Set();

                BeginInvoke(new MethodInvoker(delegate()
                {
                    try
                    {
                        label1.Visible = false;
                    }
                    catch {; }
                }));
            }
            else
            {
                //BeginInvoke(new MethodInvoker(Group_JoinError));
                BeginInvoke(new MethodInvoker(delegate()
                {
                    try
                    {
                        label1.Text = "Failed to join the requested group chat";
                    }
                    catch {; }
                }));
            }
        }
Beispiel #2
0
        void Self_GroupChatJoined(object sender, GroupChatJoinedEventArgs e)
        {
            if (e.SessionID != SessionId && e.TmpSessionID != SessionId)
            {
                return;
            }

            if (InvokeRequired)
            {
                if (!instance.MonoRuntime || IsHandleCreated)
                {
                    Invoke(new MethodInvoker(() => Self_GroupChatJoined(sender, e)));
                }
                return;
            }

            if (e.Success)
            {
                TextManager.TextPrinter.PrintTextLine("Join Group Chat Success!", Color.Green);
                WaitForSessionStart.Set();
            }
            else
            {
                TextManager.TextPrinter.PrintTextLine("Join Group Chat failed.", Color.Red);
            }
        }
Beispiel #3
0
 private static void onJoinGroupChat(object sender, GroupChatJoinedEventArgs e)
 {
     if (e.Success)
     {
         GroupJoinWaiter.Set();
     }
 }
Beispiel #4
0
 protected virtual void GroupchatJoinHandler(object sender, GroupChatJoinedEventArgs e)
 {
     if (active_group_chat_sessions.Contains(e.SessionID) == false)
     {
         if (e.Success == true)
         {
             active_group_chat_sessions.Add(e.SessionID);
         }
     }
 }
Beispiel #5
0
        public void Self_GroupChatJoined(object sender, GroupChatJoinedEventArgs e)
        {
            Hashtable message = new Hashtable();

            message.Add("MessageType", "GroupChatJoin");
            message.Add("GroupChatSessionID", e.SessionID);
            message.Add("TmpSessionID", e.TmpSessionID);
            message.Add("SessionName", e.SessionName);
            message.Add("Success", e.Success);
            enqueue(message);
        }
Beispiel #6
0
 void Self_GroupChatJoined(object sender, GroupChatJoinedEventArgs e)
 {
     if (e.Success)
     {
         Console.WriteLine("Joined {0} Group Chat Success!", e.SessionName);
         WaitForSessionStart.Set();
     }
     else
     {
         Console.WriteLine("Join Group Chat failed :(");
     }
 }
Beispiel #7
0
 private static void OnJoinGroupChat(object o, GroupChatJoinedEventArgs e)
 {
     lock (pendingGroupchatJoins)
     {
         List <TaskCompletionSource <bool> > list;
         if (pendingGroupchatJoins.TryGetValue(e.SessionID, out list))
         {
             list.ForEach(i => i.SetResult(e.Success));
             pendingGroupchatJoins.Remove(e.SessionID);
         }
     }
 }
Beispiel #8
0
 void Self_GroupChatJoined(object?sender, GroupChatJoinedEventArgs e)
 {
     if (e.Success)
     {
         DebugUtilities.WriteInfo(session.ToString() + " " + MethodName + "Joined {0} Group Chat Success!");
         WaitForSessionStart.Set();
     }
     else
     {
         DebugUtilities.WriteInfo(session.ToString() + " " + MethodName + "Join Group Chat failed :(");
     }
 }
Beispiel #9
0
 protected virtual void GroupchatJoinHandler(object sender, GroupChatJoinedEventArgs e)
 {
     if (active_group_chat_sessions.Contains(e.SessionID) == false)
     {
         if (e.Success == true)
         {
             active_group_chat_sessions.Add(e.SessionID);
         }
     }
     if (await_events.ContainsKey("groupchatjoin") == true)
     {
         List <string> PurgeAwaiters = new List <string>();
         foreach (KeyValuePair <string, KeyValuePair <CoreCommand, string[]> > await_reply in await_events["groupchatjoin"])
         {
             // eventid
             // KeyValuePair<CommandLink,Args>
             // Args: Group, Message
             if (await_reply.Value.Value.Length == 2)
             {
                 if (UUID.TryParse(await_reply.Value.Value[0], out UUID test_group) == true)
                 {
                     if (test_group == e.SessionID)
                     {
                         // oh shit its for me
                         PurgeAwaiters.Add(await_reply.Key);
                         await_reply.Value.Key.Callback(await_reply.Value.Value, e);
                     }
                 }
             }
         }
         foreach (string eventid in PurgeAwaiters)
         {
             await_event_ages.Remove(eventid);
             await_event_idtolistener.Remove(eventid);
             await_events["groupchatjoin"].Remove(eventid);
         }
     }
 }