Exemplo n.º 1
0
        protected override void ReceiveReply()
        {
            var mymod    = RewardsMod.Instance;
            var myworld  = ModContent.GetInstance <RewardsWorld>();
            var myplayer = (RewardsPlayer)TmlHelpers.SafelyGetModPlayer(Main.LocalPlayer, mymod, "RewardsPlayer");

            KillData plrData = myworld.Logic.GetPlayerData(Main.LocalPlayer);
            KillData wldData = myworld.Logic.WorldData;

            if (plrData == null || wldData == null)
            {
                LogHelpers.Alert("Could not process reply. " + (plrData == null) + ", " + (wldData == null));
                return;
            }

            wldData.ResetAll(Main.LocalPlayer);
            wldData.AddToMe(this.WorldData);

            plrData.ResetAll(Main.LocalPlayer);
            plrData.AddToMe(this.PlayerData, Main.LocalPlayer);

            myplayer.FinishLocalSync();
        }