Пример #1
0
    public void Gem(int amount)
    {
#if BLACK_ADMIN
        BlackContext.instance.AddFreeGem((uint)amount);
        BlackLogManager.Add(BlackLogEntry.Type.GemAddAdmin, 2, amount);
#endif
    }
Пример #2
0
    public void ManyGold()
    {
#if BLACK_ADMIN
        BlackContext.instance.SetGold(UInt128.MaxValue);
        BlackLogManager.Add(BlackLogEntry.Type.GoldAddAdmin, 1, UInt128.MaxValue.ToClampedLong());
#endif
    }
Пример #3
0
    public void GemToZero()
    {
#if BLACK_ADMIN
        BlackContext.instance.SetGemZero();
        BlackLogManager.Add(BlackLogEntry.Type.GemToZero, 0, 0);
#endif
    }
Пример #4
0
 void OnEnable()
 {
     if (BlackContext.instance != null)
     {
         BlackContext.instance.CheatMode = true;
         BlackLogManager.Add(BlackLogEntry.Type.GameCheatEnabled, 0, 0);
     }
 }
Пример #5
0
    static bool SaveBlackSaveData(BlackSaveData blackSaveData)
    {
        //ConDebug.LogFormat("Start Saving JSON Data: {0}", JsonUtility.ToJson(blackSaveData));
        var saveDataArray = MessagePackSerializer.Serialize(blackSaveData, Data.DefaultOptions);

        ConDebug.LogFormat("Saving path: {0}", SaveFileName);
        if (lastSaveDataArray != null && lastSaveDataArray.SequenceEqual(saveDataArray))
        {
            ConDebug.LogFormat("Saving skipped since there is no difference made compared to last time saved.");
        }
        else
        {
            try
            {
                // 진짜 쓰자!!
                WriteAllBytesAtomically(SaveFileName, saveDataArray);

                // 마지막 저장 데이터 갱신
                lastSaveDataArray = saveDataArray;
                ConDebug.Log($"{SaveFileName} Saved. (written to disk)");

                // 유저 서비스를 위해 필요할 수도 있으니까 개발 중일 때는 base64 인코딩 버전 세이브 파일도 저장한다.
                // 실서비스 버전에서는 불필요한 기능이다.
                if (Application.isEditor)
                {
                    var base64Path = SaveFileName + ".base64.txt";
                    ConDebug.LogFormat("Saving path (base64): {0}", base64Path);
                    File.WriteAllText(base64Path, Convert.ToBase64String(saveDataArray));
                    ConDebug.Log($"{base64Path} Saved. (written to disk)");
                }

                IncreaseSaveDataSlotAndWrite();
                var lastBlackLevel = blackSaveData.lastClearedStageId;
                var gem            = (blackSaveData.freeGemScUInt128 + blackSaveData.paidGemScUInt128).ToUInt128()
                                     .ToClampedLong();
                BlackLogManager.Add(BlackLogEntry.Type.GameSaved, lastBlackLevel, gem);
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                Debug.LogError("Writing to disk failed!!!");
                ConfirmPopup.instance.Open("Writing to disk failed!!!");
                BlackLogManager.Add(BlackLogEntry.Type.GameSaveFailure, 0, 0);
                return(false);
            }
        }

        return(true);
    }
Пример #6
0
 // 유저가 직접 공지사항을 확인하려고 할 때 호출된다.
 // 공지사항 창이 열린다.
 public void Open()
 {
     BlackLogManager.Add(BlackLogEntry.Type.GameOpenNotice, 0, 0);
     //StopAllCoroutines();
     StartCoroutine(CheckNoticeCoro(false, null, null, null));
 }