static void ConnectToRecSuccess(ref ConnectToMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity != null) { (entity as MyLaserAntenna).DoConnectTo(msg.TargetEntityId); } }
static void ConnectToRecRequest(ref ConnectToMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity != null) { if ((entity as MyLaserAntenna).ConnectTo(msg.TargetEntityId)) { Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); } } }
/*static void ChangeModeFailure(ref ChangeLaserAntennaMode msg, MyNetworkClient sender) * { * //TODO * }*/ #endregion change mode #region change dest public void ConnectToRec(long TgtReceiver) { if (!Sync.MultiplayerActive) { m_Parent.ConnectTo(TgtReceiver); } else { var msg = new ConnectToMsg(); msg.EntityId = m_Parent.EntityId; //msg.ModeByte = SetmodeByte(Mode); msg.TargetEntityId = TgtReceiver; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); } }
static void ConnectToRecSuccess(ref ConnectToMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity != null) { (entity as MyLaserAntenna).DoConnectTo(msg.TargetEntityId); } }
static void ConnectToRecRequest(ref ConnectToMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity != null) { if ((entity as MyLaserAntenna).ConnectTo(msg.TargetEntityId)) Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); } }
/*static void ChangeModeFailure(ref ChangeLaserAntennaMode msg, MyNetworkClient sender) { //TODO }*/ #endregion change mode #region change dest public void ConnectToRec(long TgtReceiver) { if (!Sync.MultiplayerActive) m_Parent.ConnectTo(TgtReceiver); else { var msg = new ConnectToMsg(); msg.EntityId = m_Parent.EntityId; //msg.ModeByte = SetmodeByte(Mode); msg.TargetEntityId = TgtReceiver; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); } }