Exemple #1
0
        public void OnServerConnect(Player player)
        {
            var mymod = ModHelpersMod.Instance;

            this.HasSyncedWorldData = true;
            this.IsSynced           = true;     // Technically this should only be set upon sync receipt of player's 'old' uid...

            CustomLoadHooks.TriggerHook(PlayerLogic.ServerConnectHookValidator, PlayerLogic.MyValidatorKey, player.whoAmI);

            PlayerOldIdProtocol.QuickRequestToClient(player.whoAmI);
            PlayerNewIdProtocol.QuickRequestToClient(player.whoAmI);
        }
Exemple #2
0
        public void OnCurrentClientEnterWorld(Player player)
        {
            var mymod = ModHelpersMod.Instance;

            if (!this.HasLoadedOldUID)
            {
                LogHelpers.Alert("No (old) UID for " + player.name + " (" + player.whoAmI + ") to send to server");
                this.HasLoadedOldUID = true;                    // Ugly failsafe; don't really know why data from ModPlayer.Load isn't available here
            }

            // Send
            PlayerOldIdProtocol.QuickSendToServer();
            PlayerDataProtocol.SyncToEveryone(this.PermaBuffsById, this.HasBuffIds, this.EquipSlotsToItemTypes);

            // Receive
            WorldDataProtocol.QuickRequest();
        }