public void Eat(string nick, BBConversation conversation)
      {
         // Create a message
         BBMessage msg = new BBMessage();
         msg.MsgEat("", PList.GetPlayer(nick, OurID).Carac.ActorID);
         msg.Conversation = conversation;

         // Send use the ReliableUnordered channel; ie. it WILL arrive, but not necessarily in order
         Client.SendMessage(msg.GetNetMessage(), NetChannel.ReliableUnordered);
      }
      public void PrivateMessage(BBConversation convers, string text, string actualnick)
      {
         if (convers != null)
         {
            Player player = PList.GetPlayer(actualnick, OurID);
            if (player != null)
            {
               // Create a message
               BBMessage msg = new BBMessage();
               msg.Conversation = convers;
               msg.PlayerCarac = player.Carac;
               msg.MsgPrivateMessage(text, actualnick);
               msg.Message = text;

               if (msg.PlayerCarac != null)
                  // Send use the ReliableUnordered channel; ie. it WILL arrive, but not necessarily in order
                  Client.SendMessage(msg.GetNetMessage(), NetChannel.ReliableUnordered);
            }
         }
      }
Example #3
0
 internal static void PrivateMessage(BBConversation bBConversation, string p, string p_3)
 {
    Program.ChatApplicationBusiness.PrivateMessage(bBConversation, p, p_3);
 }
      /// <summary>
      /// Vérifie que l'utilisateur fait partie de la conversation
      /// </summary>
      /// <param name="conversation"></param>
      /// <returns></returns>
      private bool IsPartOfConversation(BBConversation conversation)
      {
         if (conversation == null)
            return true;

         foreach (string play in conversation.Players)
         {
            if (PList.GetPlayer(play, OurID) != null)
            {
               if (OurID == PList.GetPlayer(play, OurID).Carac.ActorID)
                  return true;
            }
         }

         return false;
      }
Example #5
0
 public void MsgChatHelper(string text, PlayerCarac player, BBMessage message)
 {
    MsgType = BBMsgType.CHAT;
    Conversation = message.Conversation;
    PlayerCarac = player;
    Message = text;
    Param1 = text;         
 }
Example #6
0
 internal static void LeaveConversation(BBConversation BBConversation, string p)
 {
    Program.ChatApplicationBusiness.LeaveConversation(BBConversation, p);
 }
Example #7
0
 static void _chatApplicationBusiness_UserTyping(PlayerCarac playerCarac, BBConversation conversation, bool isTyping)
 {
    if (conversation == null)
       MainForm.UserIsTypingMsg(playerCarac.Nick, isTyping);
    else
       MainForm.UserIsTypingMsg(playerCarac.Nick, isTyping, conversation);
 }
      public BBConversation StartPrivateConversation(List<string> users)
      {
         BBConversation conversation = new BBConversation(users);

         //BBMessage msg = new BBMessage();
         //msg.Conversation = conversation;
         foreach (string str in users)
         {
            this.JoinConversation(conversation, str);
         }

         return conversation;
      }
Example #9
0
      /// <summary>
      /// Création d'un tabpage
      /// </summary>
      /// <param name="message"></param>
      /// <returns></returns>
      private TabPage CreateTabPage(BBConversation conversation)
      {
         if (conversation != null)
         {
            this.tabControl1.TabPages.Add(conversation.ConversGUID.ToString(), conversation.ToString());

            if (this.tabControl1.TabPages.ContainsKey(conversation.ConversGUID.ToString()))
            {
               TabPage tabPage = this.tabControl1.TabPages[conversation.ConversGUID.ToString()];
               if (tabPage != null)
               {
                  RichTextBox richTextBox = new RichTextBox();
                  richTextBox.ReadOnly = true;
                  richTextBox.Dock = DockStyle.Fill;
                  richTextBox.BackColor = Color.White;
                  tabPage.BorderStyle = BorderStyle.FixedSingle;
                  tabPage.Controls.Add(richTextBox);

                  //Le tag de la tabpage correspond à la conversation
                  tabPage.Tag = conversation;

                  return tabPage;
               }
               else
                  return null;
            }
            else
               return null;
         }
         else
            return null;
      }
Example #10
0
      public void UserIsTypingMsg(string nick, bool isTyping, BBConversation convers)
      {
         if ((this.tabControl1.SelectedTab.Tag != null) && (this.tabControl1.SelectedTab.Tag is BBConversation))
         {
            if (convers.ConversGUID == ((BBConversation)this.tabControl1.SelectedTab.Tag).ConversGUID)
            {
               DataGridViewRow dgvr = this.GetRowByUserName(nick);
               if (dgvr != null)
               {
                  if (isTyping)
                  {
                     dgvr.Cells[this.LogoColumn.Index].Value = this.imageList_user.Images[1];
                  }
                  else
                  {
                     dgvr.Cells[this.LogoColumn.Index].Value = this.imageList_user.Images[0];
                  }

               }
            }
         }
      }
Example #11
0
 private void AddPlayerIntoConversation(BBConversation conversation, string player)
 {
    if ((conversation != null) && (!conversation.Players.Contains(player)))
    {
       conversation.Players.Add(player);
       Program.JoinConversation(conversation, player);
    }
 }
Example #12
0
 public void MsgChatBash(string text, PlayerCarac player, bool toDisplay, BBMessage message)
 {
    MsgType = BBMsgType.BASH;
    Conversation = message.Conversation;
    PlayerCarac = player;
    Message = text;
    Param1 = text;
    Param2 = toDisplay;
 }
Example #13
0
 public void MsgChatPendu(string text, PlayerCarac player, bool alert, BBMessage message)
 {
    MsgType = BBMsgType.PENDU;
    Conversation = message.Conversation;
    PlayerCarac = player;
    Message = text;
    Param1 = text;
    Param2 = alert;
 }
      public void LeaveConversation(BBConversation convers, string actualnick)
      {
         if (convers != null)
         {
            if (convers.Players.Contains(actualnick))
            {
               convers.Players.Remove(actualnick);

               if (PList.GetPlayer(actualnick, OurID) != null)
               {
                  BBMessage msg = new BBMessage();
                  msg.Conversation = convers;

                  msg.MsgLeaveConversationPlayer(PList.GetPlayer(actualnick, OurID).Carac.ActorID, string.Empty);

                  Client.SendMessage(msg.GetNetMessage(), NetChannel.ReliableUnordered);
               }
            }
         }
      }
Example #15
0
 internal static void Eat(string str, BBConversation conversation)
 {
    Program.ChatApplicationBusiness.Eat(str, conversation);
 }
      public void JoinConversation(BBConversation convers, string actualnick)
      {
         if (convers != null)
         {
            BBMessage msg = new BBMessage();
            msg.Conversation = convers;

            msg.MsgJoinConversationPlayer(PList.GetPlayer(actualnick, OurID), true);

            Client.SendMessage(msg.GetNetMessage(), NetChannel.ReliableUnordered);
         }
      }
Example #17
0
 internal static void JoinConversation(BBConversation conversation, string player)
 {
    Program.ChatApplicationBusiness.JoinConversation(conversation, player);
 }
 private void OnUserTyping(PlayerCarac player, BBConversation conversation, bool isTyping)
 {
    if (this.UserTyping != null)
       this.UserTyping(player, conversation, isTyping);
 }
Example #19
0
 public void MsgChatVDM(string text, PlayerCarac player, bool displayMessage, BBMessage message)
 {
    MsgType = BBMsgType.VDM;
    Conversation = message.Conversation;
    PlayerCarac = player;
    Message = text;
    Param1 = text;
    Param2 = displayMessage;
 }