예제 #1
0
 /// <summary>
 /// Will ban a given user with optional reason
 /// </summary>
 /// <param name="cc"></param>
 /// <param name="reason"></param>
 public void Ban(ChatClient cc, string reason="banned from server")
 {
     bans.Add(cc.GetBase());
     Kick(cc, reason);
 }
예제 #2
0
 /// <summary>
 /// Client requests Private Message to another client
 /// </summary>
 /// <param name="me"></param>
 /// <param name="target"></param>
 void c_PrivateMessageEvent(ChatClient me, Common.ChatClientMessageWrapper target)
 {
     string targetUID = target.UniqueID;
     ChatClient targ = null;
     foreach (ChatClient cc in clients)
         if (cc.UniqueID == targetUID)
             targ = cc;
     if (targ == null)
         me.SendError("invalid client");
     else
     {
         Common.ChatClientMessageWrapper ccmw = new Common.ChatClientMessageWrapper(me.GetBase(), target.Message);
         targ.PrivateMessage(ccmw);
         PrivateMessageEvent.Invoke(me, targ);
     }
 }
예제 #3
0
 /// <summary>
 /// A client sent a public chatmessage
 /// </summary>
 /// <param name="me"></param>
 /// <param name="s"></param>
 void c_GlobalMessageEvent(ChatClient me, string s)
 {
     GlobalMessageEvent.Invoke(me, s);
     Common.ChatClientMessageWrapper ccmw = new Common.ChatClientMessageWrapper(me.GetBase(), s);
     foreach (ChatClient cc in clients)
     {
         cc.PublicMessage(ccmw);
     }
 }
예제 #4
0
 /// <summary>
 /// Client Disconnected for whatever reason
 /// </summary>
 /// <param name="me"></param>
 /// <param name="s"></param>
 void c_DisconnectedEvent(ChatClient me, string s)
 {
     DisconnectedEvent.Invoke(me, s);
     foreach (ChatClient cc in clients)
     {
         cc.ClientLeft(me.GetBase());
     }
 }
예제 #5
0
 /// <summary>
 /// Client Successfully authenticated as client
 /// </summary>
 /// <param name="me"></param>
 void c_AuthenticatedEvent(ChatClient me)
 {
     AuthenticatedEvent.Invoke(me);
     foreach (ChatClient cc in clients)
     {
         cc.ClientJoined(me.GetBase());
     }
 }
예제 #6
0
 /// <summary>
 /// Used to call an client-update if permissions were changed
 /// </summary>
 /// <param name="cc"></param>
 public void ClientUpdate(ChatClient me)
 {
     foreach (ChatClient cc in clients)
     {
         cc.ClientUpdate(me.GetBase());
     }
 }