예제 #1
0
        public void Receive(string name, byte[] message, object custom)
        {
            var logItem = new MessageLogItem(DateTime.UtcNow, name, message, custom);

            MessageHistory.Add(logItem);

            if (!MessageBindAccess.AnyBind(name))
            {
                if (ThrowNoneBinds)
                {
                    throw new MessageNotBindedException("Received not binded message: " + name, name, message);
                }
                else
                {
                    return;
                }
            }

            var binds = MessageBindAccess.GetBinds(name);

            for (int i = 0; i < binds.Count; i++)
            {
                binds[i].BindAction(custom);
            }
        }
예제 #2
0
 private void CommandList(params string[] _)
 {
     foreach (Command cmd in Commands)
     {
         MessageHistory.Add(new Message(cmd.Keyword + " " + GetArgsInfo(cmd) + " (" + cmd.Description + ")", Color.GreenYellow));
     }
 }
예제 #3
0
 public void AddToHistory(UserMessage newMessage, bool SaveChange = true)
 {
     MessageHistory.Add(newMessage);
     if (SaveChange)
     {
         SaveChanges();
     }
 }
예제 #4
0
 public override void NotifyConversationUsers(string message)
 {
     MessageHistory.Add(message);
     foreach (var attendee in Attendees)
     {
         attendee.Notify(Id, "New Notification!! " + message);
     }
 }
예제 #5
0
        private void SetFOV(params string[] args)
        {
            bool success = Int32.TryParse(args[0], out int fov);

            if (!success)
            {
                MessageHistory.Add(new Message("Invalid argument: " + args[0], new Color(1.0f, 0, 0)));
                return;
            }
            _game.Camera.FieldOfView = fov;
        }
예제 #6
0
        public void Receive(string name, byte[] message, object custom)
        {
            var logItem = new MessageLogItem(DateTime.UtcNow, name, message, custom);

            MessageHistory.Add(logItem);

            if (!MessageBindAccess.AnyBind(name))
            {
                throw new MessageNotBindedException("Received not binded message: " + name, name, message);
            }

            var binds = MessageBindAccess.GetBinds(name);

            for (int i = 0; i < binds.Count; i++)
            {
                var messageDeserialized = SerializationProvider.Deserialize(binds[i].MessageType, message);
                logItem.AddMessage(messageDeserialized);
                binds[i].BindAction(messageDeserialized);
            }
        }
예제 #7
0
 public void ArchiveMessages()
 {
     MessageHistory.Add(TodaysMessages);
     TodaysMessages = new List <Message>();
 }