示例#1
0
    public static void SaveDeviceWhenJoinGame()
    {
        string str = "";

        if (StoreGame.Contains(StoreGame.EType.PLAY_THE_SAME_DEVICE))
        {
            str = StoreGame.LoadString(StoreGame.EType.PLAY_THE_SAME_DEVICE) + DATA_ROW;
        }
        str += GameManager.Instance.mInfo.username + DATA_SAPCE + GameManager.Instance.selectedLobby.gameId;

        Debug.LogWarning("IsCanJoinGameplay SAVED: " + str);

        StoreGame.SaveString(StoreGame.EType.PLAY_THE_SAME_DEVICE, str);
        StoreGame.Save();
    }
示例#2
0
    public static void ClearCache()
    {
        if (!Application.isWebPlayer)
        {
            return;
        }

        if (GameManager.CurrentScene == ESceneName.GameplayChan)
        {
            return;
        }

        if (StoreGame.Contains(StoreGame.EType.PLAY_THE_SAME_DEVICE))
        {
            string   newValue = "";
            string[] arrays   = StoreGame.LoadString(StoreGame.EType.PLAY_THE_SAME_DEVICE).Split(DATA_ROW.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            Debug.LogWarning(StoreGame.LoadString(StoreGame.EType.PLAY_THE_SAME_DEVICE) + "\n" + arrays.Length);

            foreach (string str in arrays)
            {
                string[] arr = str.Split(DATA_SAPCE.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arr[0] == GameManager.Instance.mInfo.username)
                {
                    Debug.LogWarning("IsCanJoinGameplay Remove: " + str);
                    continue;
                }
                newValue += str + DATA_ROW;
            }

            if (newValue != StoreGame.LoadString(StoreGame.EType.PLAY_THE_SAME_DEVICE))
            {
                if (string.IsNullOrEmpty(newValue))
                {
                    StoreGame.Remove(StoreGame.EType.PLAY_THE_SAME_DEVICE);
                }
                else
                {
                    StoreGame.SaveString(StoreGame.EType.PLAY_THE_SAME_DEVICE, newValue);
                }
                StoreGame.Save();
            }
        }
    }
示例#3
0
 public static void Clear()
 {
     StoreGame.Remove(StoreGame.EType.PLAY_THE_SAME_DEVICE);
     StoreGame.Save();
 }