private void ReplayLastBattleOrReplay()
        {
            CurrentBattle       currentBattle       = Service.Get <BattleController>().GetCurrentBattle();
            ReplayMapDataLoader replayMapDataLoader = Service.Get <ReplayMapDataLoader>();
            BattleRecord        battleRecord        = Service.Get <BattleRecordController>().BattleRecord;
            BattleEntry         battleEntry         = currentBattle.Clone();

            replayMapDataLoader.InitializeFromData(battleEntry, battleRecord);
            BattlePlaybackState.GoToBattlePlaybackState(battleRecord, battleEntry, replayMapDataLoader);
            this.LogReplayViewed(battleEntry.RecordID, battleEntry.Defender.PlayerId, battleEntry.SharerPlayerId);
        }
        public void OnReplayLoaded(GetReplayResponse response, object cookie)
        {
            ProcessingScreen.Hide();
            this.replayResponseData = response;
            BattlePlaybackState.GoToBattlePlaybackState(this);
            BattleRecord replayData = response.ReplayData;
            BattleEntry  entryData  = response.EntryData;

            replayData.RecordId      = entryData.RecordID;
            entryData.SharerPlayerId = this.replayOwnerPlayerId;
            bool flag = Service.Get <CurrentPlayer>().PlayerId == entryData.AttackerID || this.replayOwnerPlayerId == entryData.AttackerID;

            entryData.Won = (flag ? (entryData.EarnedStars > 0) : (entryData.EarnedStars == 0));
            Service.Get <EventManager>().SendEvent(EventId.BattleRecordRetrieved, this.replayResponseData);
        }