示例#1
0
 public void RegisterChannel(Strive.Network.Messages.CommunicationType communicationType, string name, MessageReceived callback)
 {
     if (!_registrations.Contains(CalculateChannelKey(communicationType, name)))
     {
         _registrations.Add(CalculateChannelKey(communicationType, name), callback);
     }
 }
示例#2
0
        public string CalculateChannelKey(Strive.Network.Messages.CommunicationType communicationType, string name)
        {
            string CalculateChannelKey_Return = communicationType.ToString();

            if (communicationType == Strive.Network.Messages.CommunicationType.Tell)
            {
                CalculateChannelKey_Return = name + " - Private conversation";
            }
            return(CalculateChannelKey_Return);
        }
示例#3
0
 public Chat(Strive.Network.Messages.CommunicationType communicationType, string characterName)
 {
     InitializeComponent();
     this.Text = Game.CurrentMainWindow.CurrentChannelManager.CalculateChannelKey(communicationType, characterName);
     Game.CurrentMainWindow.CurrentChannelManager.RegisterChannel(communicationType, characterName, new Channels.ChannelManager.MessageReceived(ProcessCommunication));
 }