示例#1
0
        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>();
        }
示例#2
0
        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
            }
        }
示例#3
0
 public static void SendPacket <T>(T packet) where T : class, new()
 {
     networkProvider?.SendPacket(packet);
 }
示例#4
0
 public static void SendPacket <T>(T packet, DeliveryMethod deliveryMethod = DeliveryMethod.ReliableOrdered) where T : class, new()
 {
     networkProvider?.SendPacket(packet, deliveryMethod);
 }