Example #1
0
 /// <summary>
 /// Sends a message to the counterpart component on the server side
 /// </summary>
 /// <param name="component">Sending component</param>
 /// <param name="method">Net Delivery Method</param>
 /// <param name="messageParams">Parameters</param>
 public void SendComponentNetworkMessage(IComponent component, NetDeliveryMethod method,
                                         params object[] messageParams)
 {
     if (component.NetID == null)
     {
         throw new ArgumentException("Component has no Net ID and cannot be used across the network.");
     }
     EntityNetworkManager.SendComponentNetworkMessage(this, component.NetID.Value, NetDeliveryMethod.ReliableUnordered,
                                                      messageParams);
 }
Example #2
0
 /// <summary>
 /// Sends a message to the counterpart component on the server side
 /// </summary>
 /// <param name="component">Sending component</param>
 /// <param name="method">Net Delivery Method</param>
 /// <param name="recipient">The intended recipient netconnection (if null send to all)</param>
 /// <param name="messageParams">Parameters</param>
 public void SendDirectedComponentNetworkMessage(Component component, NetDeliveryMethod method,
                                                 NetConnection recipient, params object[] messageParams)
 {
     if (!Initialized)
     {
         return;
     }
     EntityNetworkManager.SendDirectedComponentNetworkMessage(this, component.Family,
                                                              method, recipient,
                                                              messageParams);
 }
Example #3
0
        /// <summary>
        /// Sends a message to the counterpart component on the server side
        /// </summary>
        /// <param name="component">Sending component</param>
        /// <param name="method">Net Delivery Method</param>
        /// <param name="recipient">The intended recipient netconnection (if null send to all)</param>
        /// <param name="messageParams">Parameters</param>
        public void SendDirectedComponentNetworkMessage(IComponent component, NetDeliveryMethod method,
                                                        NetConnection recipient, params object[] messageParams)
        {
            if (component.NetID == null)
            {
                throw new ArgumentException("Component has no Net ID and cannot be used across the network.");
            }

            if (!Initialized)
            {
                return;
            }

            EntityNetworkManager.SendDirectedComponentNetworkMessage(this, component.NetID.Value,
                                                                     method, recipient,
                                                                     messageParams);
        }
Example #4
0
 /// <summary>
 /// Sends a message to the counterpart component on the server side
 /// </summary>
 /// <param name="component">Sending component</param>
 /// <param name="method">Net Delivery Method</param>
 /// <param name="messageParams">Parameters</param>
 public void SendComponentNetworkMessage(Component component, NetDeliveryMethod method,
                                         params object[] messageParams)
 {
     EntityNetworkManager.SendComponentNetworkMessage(this, component.Family, NetDeliveryMethod.ReliableUnordered,
                                                      messageParams);
 }
Example #5
0
 private void DispatchInputCommand(FullInputCmdMessage message)
 {
     _stateManager.InputCommandDispatched(message);
     EntityNetworkManager.SendSystemNetworkMessage(message, message.InputSequence);
 }
 private void Awake()
 {
     Instance = this;
 }
Example #7
0
 protected IncomingEntityMessage ProcessNetMessage(NetIncomingMessage msg)
 {
     return(EntityNetworkManager.HandleEntityNetworkMessage(msg));
 }