Exemplo n.º 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);
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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());
     }
 }
Exemplo n.º 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());
     }
 }
Exemplo n.º 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());
     }
 }