コード例 #1
0
        public void Player(string playerId, OnUserDataResultDelegate <playerWr> callback)
        {
            WWWForm form = new WWWForm();

            form.AddField("token", token);
            CallWWW_resultData_async("Player/" + playerId, form, callback, RequestType.Player);
        }
コード例 #2
0
        public void CancelQuest(string questId, string playerId, OnUserDataResultDelegate <cancelQuestWr> callback)
        {
            WWWForm form = new WWWForm();

            form.AddField("token", token);
            form.AddField("player_id", playerId);
            CallWWW_resultData_async("Quest/" + questId + "/cancel", form, callback, RequestType.CancelQuest);
        }
コード例 #3
0
        public void Rule(string playerId, string action, OnUserDataResultDelegate <ruleWr> callback)
        {
            WWWForm form = new WWWForm();

            form.AddField("token", token);
            form.AddField("player_id", playerId);
            form.AddField("action", action);

            CallWWW_resultData_async("Engine/rule", form, callback, RequestType.Rule);
        }
コード例 #4
0
 public void playerPublic(string playerId, OnUserDataResultDelegate <playerPublicWr> callback)
 {
                 #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnPlayerPublicResult.userCallback = callback;
     _playerPublic(playerId, OnPlayerPublicResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("playerPublic", playerId, new OnPlayerPublicResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.PlayerPublic(playerId, callback);
                 #endif
 }
コード例 #5
0
 public void pointOfPlayer(string playerId, string pointName, OnUserDataResultDelegate <pointRWr> callback)
 {
                 #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnPointOfPlayerResult.userCallback = callback;
     _pointOfPlayer(playerId, pointName, OnPointOfPlayerResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("pointOfPlayer", playerId, pointName, new OnPointOfPlayerResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.PointOfPlayer(playerId, pointName, callback);
                 #endif
 }
コード例 #6
0
 public void quizRandom(string playerId, OnUserDataResultDelegate <quizBasicWr> callback)
 {
                 #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnQuizRandomResult.userCallback = callback;
     _quizRandom(playerId, OnQuizRandomResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("quizRandom", playerId, new OnQuizRandomResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.QuizRandom(playerId, callback);
                 #endif
 }
コード例 #7
0
 public void quizPendingList(string playerId, int limit, OnUserDataResultDelegate <List <quizPendingWr> > callback)
 {
                 #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnQuizPendingListResult.userCallback = callback;
     _quizPendingList(playerId, limit, OnQuizPendingListResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("quizPendingList", playerId, limit, new OnQuizPendingListResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.QuizPendingList(playerId, limit, callback);
                 #endif
 }
コード例 #8
0
 public void rule(string playerId, string action, OnUserDataResultDelegate <ruleWr> callback)
 {
                 #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnRuleResult.userCallback = callback;
     _rule(playerId, action, OnRuleResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("rule", playerId, action, new OnRuleResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.Rule(playerId, action, callback);
                 #endif
 }
コード例 #9
0
 public void badges(OnUserDataResultDelegate <badgesWr> callback)
 {
         #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnBadgesResult.userCallback = callback;
     _badges(OnBadgesResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("badges", new OnBadgesResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.Badges(callback);
                 #endif
 }
コード例 #10
0
 public void goodsInfoList(string playerId, OnUserDataResultDelegate <goodsInfoListWr> callback)
 {
         #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnGoodsInfoListResult.userCallback = callback;
     _goodsInfoList(playerId, OnGoodsInfoListResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("goodsInfoList", playerId, new OnGoodsInfoListResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.GoodsInfoList(playerId, callback);
                 #endif
 }
コード例 #11
0
 public void questInfoList(OnUserDataResultDelegate <questInfoListWr> callback)
 {
         #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnQuestInfoListResult.userCallback = callback;
     _questInfoList(OnQuestInfoListResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("questInfoList", new OnQuestInfoListResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.QuestInfoList(callback);
                 #endif
 }
コード例 #12
0
 public void missionInfo(string questId, string missionId, OnUserDataResultDelegate <missionInfoWr> callback)
 {
         #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnMissionInfoResult.userCallback = callback;
     _missionInfo(questId, missionId, OnMissionInfoResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("missionInfo", questId, missionId, new OnMissionInfoResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.MissionInfo(questId, missionId, callback);
                 #endif
 }
コード例 #13
0
 public void questAvailableForPlayer(string questId, string playerId, OnUserDataResultDelegate <questAvailableForPlayerWr> callback)
 {
         #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnQuestAvailableForPlayerResult.userCallback = callback;
     _questAvailableForPlayer(questId, playerId, OnQuestAvailableForPlayerResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("questAvailableForPlayer", questId, playerId, new OnQuestAvailableForPlayerResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.QuestAvailableForPlayer(questId, playerId, callback);
                 #endif
 }
コード例 #14
0
 public void cancelQuest(string questId, string playerId, OnUserDataResultDelegate <cancelQuestWr> callback)
 {
         #if UNITY_IOS || UNITY_STANDALONE_OSX && !DEBUG_DESKTOP
     OnCancelQuestResult.userCallback = callback;
     _cancelQuest(questId, playerId, OnCancelQuestResult.onDataResult);
                 #elif UNITY_ANDROID
     playbasis.Call("cancelQuest", questId, playerId, new OnCancelQuestResult(callback));
                 #elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || DEBUG_DESKTOP
     this.DesktopNet.CancelQuest(questId, playerId, callback);
                 #endif
 }
コード例 #15
0
        IEnumerator CallWWW_resultData_asyncCR <T>(string address, WWWForm data, OnUserDataResultDelegate <T> callback, RequestType type)
            where T : class
        {
            string fullAddress = BASE_URL + address + (address.Contains("?") ? "&" + apiKeyParam : "?" + apiKeyParam);

            Debug.Log("Making async request to " + fullAddress);

            WWW client = null;

            if (data != null)
            {
                client = new WWW(fullAddress, data.data, data.headers);
                yield return(client);
            }
            else
            {
                client = new WWW(fullAddress);
                yield return(client);
            }

            // if there was error then return immediately
            if (IsError(client))
            {
                if (callback != null)
                {
                    callback(null, 0);
                }
            }
            else
            {
                T   dataReturn = null;
                int errorCode  = 0;
                if (HandleRequest <T>(type, ref dataReturn, ref errorCode, client))
                {
                    if (callback != null)
                    {
                        callback <T>(dataReturn, -1);
                    }
                }
                else
                {
                    if (callback != null)
                    {
                        callback <T>(null, errorCode);
                    }
                }
            }
        }
コード例 #16
0
 public static void dataResultCallback(OnUserDataResultDelegate <T> userCallback, IntPtr result, int errorCode)
 {
     if (result != IntPtr.Zero)
     {
         if (userCallback != null)
         {
             userCallback(onSuccess_user(result), -1);
         }
     }
     else
     {
         if (userCallback != null)
         {
             userCallback(new T(), errorCode);
         }
     }
 }
コード例 #17
0
 public OnCancelQuestResult(OnUserDataResultDelegate <cancelQuestWr> callback) : base(callback)
 {
 }
コード例 #18
0
 public OnQuizAnswerResult(OnUserDataResultDelegate <questionAnsweredWr> callback) : base(callback)
 {
 }
コード例 #19
0
 /// make async request for data type result
 private void CallWWW_resultData_async <T>(string address, WWWForm data, OnUserDataResultDelegate <T> callback, RequestType type)
     where T : class
 {
     MonoUtil.GetMainObj().StartCoroutine(CallWWW_resultData_asyncCR <T>(address, data, callback, type));
 }
コード例 #20
0
 public OnQuizDoneListResult(OnUserDataResultDelegate <List <quizDoneWr> > callback) : base(callback)
 {
 }
コード例 #21
0
 public OnQuizPendingListResult(OnUserDataResultDelegate <List <quizPendingWr> > callback) : base(callback)
 {
 }
コード例 #22
0
 public OnBadgesResult(OnUserDataResultDelegate <badgesWr> callback) : base(callback)
 {
 }
コード例 #23
0
 public OnRuleResult(OnUserDataResultDelegate <ruleWr> callback) : base(callback)
 {
 }
コード例 #24
0
 public OnQuestInfoResult(OnUserDataResultDelegate <questInfoWr> callback) : base(callback)
 {
 }
コード例 #25
0
 public OnGoodsInfoListResult(OnUserDataResultDelegate <goodsInfoListWr> callback) : base(callback)
 {
 }
コード例 #26
0
 public OnMissionInfoResult(OnUserDataResultDelegate <missionInfoWr> callback) : base(callback)
 {
 }
コード例 #27
0
 public OnQuestInfoListForPlayerResult(OnUserDataResultDelegate <questInfoListWr> callback) : base(callback)
 {
 }
コード例 #28
0
 public OnQuestAvailableForPlayerResult(OnUserDataResultDelegate <questAvailableForPlayerWr> callback) : base(callback)
 {
 }
コード例 #29
0
 public OnJoinQuestResult(OnUserDataResultDelegate <joinQuestWr> callback) : base(callback)
 {
 }
コード例 #30
0
 public OnDataResult(OnUserDataResultDelegate <T> callback) : base("com.playbasis.android.playbasissdk.api.OnResult")
 {
     userCallback = callback;
 }