Example #1
0
 protected virtual void ServerOnMessageReceived(object sender, NetworkMessage message)
 {
     if (Parse(message))
     {
         Send(message.MessageId, message.Data);
         Logger.Info("[Received] {0} : {1}", message.MessageId, message.GetType().Name);
     }
 }
Example #2
0
 private void Dispatch(object sender, NetworkMessage message)
 {
     foreach (var method in methods)
     {
         foreach (var attribute in method.Attributes)
         {
             if (attribute.MessageId == message.MessageId || attribute.MessageType == message.GetType())
             {
                 method.Invoke(message);
             }
         }
     }
 }