Пример #1
0
        private bool checkGameDataNeedSend(GameDataKey key)
        {
            switch (key)
            {
            case GameDataKey.MainVersion:
            case GameDataKey.SubVersion:
            case GameDataKey.Scene:
            case GameDataKey.FPSTarget:
            case GameDataKey.PictureQuality:
            case GameDataKey.EffectQuality:
            case GameDataKey.Resolution:
            case GameDataKey.RoleCount:
            case GameDataKey.NetDelay:
            case GameDataKey.RoleOutline:
            case GameDataKey.MTR:
            case GameDataKey.SceneType:
            case GameDataKey.PictureStyle:
            case GameDataKey.AntiAliasing:
            case GameDataKey.Shadow:
                return(true);

            default:
                return(false);
            }
        }
Пример #2
0
        public void UpdateGameInfo(GameDataKey key, int value)
        {
#if UNITY_IOS
            if (CanWork && checkGameDataNeedSend(key))
            {
                _UpdateGameInfoII((int)key, value);
            }
#endif
        }
Пример #3
0
    public string GetStringGameData(GameDataKey key, string defaultValue)
    {
        if (_gameData.ContainsKey(key))
        {
            return(_gameData[key]);
        }

        return(defaultValue);
    }
Пример #4
0
        private void _UpdateGameInfo(GameDataKey key, int value)
        {
#if UNITY_ANDROID
            if (IsOK && CanWork)
            {
                performanceAjuster.Call("updateGameInfo", (int)key, value);
            }
#endif
        }
Пример #5
0
    public float GetFloatGameData(GameDataKey key, float defaultValue)
    {
        if (_gameData.ContainsKey(key))
        {
            float value;
            if (float.TryParse(_gameData[key], out value))
            {
                return(value);
            }
        }

        return(defaultValue);
    }
Пример #6
0
    public int GetIntGameData(GameDataKey key, int defaultValue)
    {
        if (_gameData.ContainsKey(key))
        {
            int value;
            if (Int32.TryParse(_gameData[key], out value))
            {
                return(value);
            }
        }

        return(defaultValue);
    }
Пример #7
0
        static GameDataKey SplitKeyString(string keyString)
        {
            var parts = keyString.Split('/');

            if (parts.Length != 3)
            {
                throw new System.Exception("Invalid key format.");
            }
            uint reverseIndex = uint.Parse(parts[2]);
            var  key          = new GameDataKey()
            {
                UserId = Guid.Parse(parts[0]),
                GameId = parts[1],
                Index  = uint.MaxValue - reverseIndex
            };

            return(key);
        }
Пример #8
0
        static string MakeKeyString(GameDataKey key)
        {
            uint reverseIndex = uint.MaxValue - key.Index;

            return(string.Format("{0}/{1}/{2:D16}", key.UserId, key.GameId, reverseIndex));
        }
Пример #9
0
 public static void UpdateGameInfo(GameDataKey key, int value)
 {
     getPlatformService().UpdateGameInfo(key, value);
 }
Пример #10
0
 public void UpdateGameInfo(GameDataKey key, int value)
 {
     _UpdateGameInfo(key, value);
 }
Пример #11
0
 public void UpdateGameInfo(GameDataKey key, string value)
 {
     _UpdateGameInfo(key, value);
 }
Пример #12
0
 public void SetGameData(GameDataKey key, string value)
 {
     _gameData[key] = value;
     _gameDataPreview.RefreshGameData();
 }
Пример #13
0
 public void SetGameData(GameDataKey key, float value)
 {
     SetGameData(key, value.ToString(CultureInfo.InvariantCulture));
 }
Пример #14
0
 public void SetGameData(GameDataKey key, int value)
 {
     SetGameData(key, value.ToString());
 }