Esempio n. 1
0
 public void OnMessageReceived(HoloNetMessage newMessage)
 {
     if (_isPaused && !overrideMuteMessageTypes.Contains(newMessage.GetType()))
     {
         Debug.Log($"[HOLONET] Messaging - Message received and put to queue: {newMessage.GetType().Name}");
         _objectMessageQueue.Add(newMessage);
     }
     else
     {
         Debug.Log($"[HOLONET] Messaging - Message received: {newMessage.GetType().Name}");
         ApplyMessage(newMessage);
     }
 }
Esempio n. 2
0
 public void SendMessage(HoloNetMessage message, HoloNetPlayer player, bool isReliable)
 {
     Debug.Log($"[HOLONET] Messaging - Sending message {message.GetType().Name}");
     message.sendTime = HoloNetAppModule.instance.provider.GetServerTime();
     if (player.isLocal)
     {
         ApplyMessage(message);
     }
     else
     {
         HoloNetAppModule.instance.provider.SendMessage(message, player, isReliable);
         HoloNetAppModule.instance.objectPool.Push(message);
     }
 }
Esempio n. 3
0
        public void SendMessage(HoloNetMessage message, DestinationGroup group, bool isReliable)
        {
            Debug.Log($"[HOLONET] Messaging - Sending message {message.GetType().Name}");
            message.sendTime = HoloNetAppModule.instance.provider.GetServerTime();
            if (group == DestinationGroup.All)
            {
                HoloNetAppModule.instance.provider.SendMessage(message, DestinationGroup.Others, isReliable);
                ApplyMessage(message);
            }
            else if (group == DestinationGroup.Self || (group == DestinationGroup.Server && HoloNetPlayer.Local.isServer))
            {
                ApplyMessage(message);
            }
            else
            {
                HoloNetAppModule.instance.provider.SendMessage(message, group, isReliable);
            }

            HoloNetAppModule.instance.objectPool.Push(message);
        }