public void PasteCoordinates(string coords) { if (!Sync.MultiplayerActive) { m_Parent.DoPasteCoords(coords); } else { var msg = new CoordinatesPasted(); msg.EntityId = m_Parent.EntityId; msg.Coordinates = coords; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Success); } }
static void PasteCoordinatesSuccess(ref CoordinatesPasted msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyLaserAntenna la = (entity as MyLaserAntenna); if (la == null) { return; } la.DoPasteCoords(msg.Coordinates); if (Sync.IsServer) { Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); } }
public void PasteCoordinates(string coords) { if (!Sync.MultiplayerActive) m_Parent.DoPasteCoords(coords); else { var msg = new CoordinatesPasted(); msg.EntityId = m_Parent.EntityId; msg.Coordinates = coords; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Success); } }
static void PasteCoordinatesSuccess(ref CoordinatesPasted msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyLaserAntenna la=(entity as MyLaserAntenna); if (la==null) return; la.DoPasteCoords(msg.Coordinates); if (Sync.IsServer) Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); }