public static void SetReady() { if (!IsMasterClient) { // Notify the server that we are done with loading the game networkProvider.SendPacket(new SyncComplete()); InGamePopup.FadeOut(); } // Finally we add the local player components to the player character GameMain.mainPlayer.gameObject.AddComponentIfMissing <LocalPlayerMovement>(); GameMain.mainPlayer.gameObject.AddComponentIfMissing <LocalPlayerAnimation>(); }
public static void SetReady() { if (!IsMasterClient) { // Notify the server that we are done with loading the game networkProvider.SendPacket(new SyncComplete()); InGamePopup.FadeOut(); } // Finally we add the local player components to the player character GameMain.mainPlayer.gameObject.AddComponentIfMissing <LocalPlayerMovement>(); GameMain.mainPlayer.gameObject.AddComponentIfMissing <LocalPlayerAnimation>(); if (!IsMasterClient) { //Subscribe for the local star events LocalPlayer.SendPacket(new PlayerUpdateLocalStarId(GameMain.data.localStar.id)); PatchLocks["GalacticTransport"] = false; // after inital sync we need to set this back to false } }
public static void SendPacket <T>(T packet) where T : class, new() { networkProvider?.SendPacket(packet); }
public static void SendPacket <T>(T packet, DeliveryMethod deliveryMethod = DeliveryMethod.ReliableOrdered) where T : class, new() { networkProvider?.SendPacket(packet, deliveryMethod); }