예제 #1
0
 void OnRoarFetchFriendsComplete(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.Friend> > info)
 {
     whenLastFetched         = Time.realtimeSinceStartup;
     networkActionInProgress = false;
     isFetching  = false;
     friendsDict = info.data;
 }
예제 #2
0
 void OnRoarFetchLeaderboardComplete(Roar.CallbackInfo <Roar.Components.ILeaderboards> info)
 {
     //TODO: Handle errors!
     leaderboard             = info.data.GetLeaderboard(leaderboardId, page);
     isFetchingRankings      = false;
     networkActionInProgress = false;
 }
    void OnRoarLoginComplete(Roar.CallbackInfo <Roar.WebObjects.User.LoginResponse> info)
    {
        if (Debug.isDebugBuild)
        {
            Debug.Log(string.Format("OnRoarLoginComplete ({0}): {1}", info.code, info.msg));
            if (info.data != null)
            {
                Debug.Log(string.Format("OnRoarLoginComplete got auth_token {0}", info.data.auth_token));
                Debug.Log(string.Format("OnRoarLoginComplete got player_id {0}", info.data.player_id));
            }
            else
            {
                Debug.Log("OnRoarLogingComplete got null data");
            }
        }
        switch (info.code)
        {
        case IWebAPI.OK:         // (success)
            // fetch the player's properties after successful login
            networkActionInProgress = false;
            break;

        case 3:         // Invalid name or password
        default:
            //isError = true;
            status = info.msg;
            networkActionInProgress = false;
            break;
        }
    }
    void OnRoarFacebookLoginComplete(Roar.CallbackInfo <Roar.WebObjects.Facebook.LoginOauthResponse> info)
    {
        if (Debug.isDebugBuild)
        {
            Debug.Log(string.Format("OnRoarLoginComplete ({0}): {1}", info.code, info.msg));
            if (info.data != null)
            {
                Debug.Log(string.Format("OnRoarLoginComplete got auth_token {0}", info.data.auth_token));
                Debug.Log(string.Format("OnRoarLoginComplete got player_id {0}", info.data.player_id));
            }
            else
            {
                Debug.Log("OnRoarLogingComplete got null data");
            }
        }
        switch (info.code)
        {
        case IWebAPI.OK:         // (success)
            networkActionInProgress = false;
            break;

        case 3:         // Invalid name or password
        default:
            status = info.msg;
            networkActionInProgress = false;
            break;
        }
    }
    void OnRoarFacebookBindComplete(Roar.CallbackInfo <Roar.WebObjects.Facebook.BindOauthResponse> info)
    {
        if (Debug.isDebugBuild)
        {
            Debug.Log(string.Format("OnRoarBindComplete ({0}): {1}", info.code, info.msg));
            if (info.data != null)
            {
            }
            else
            {
                Debug.Log("OnRoarBindComplete got null data");
            }
        }

        switch (info.code)
        {
        case IWebAPI.OK:         // (success)
            this.enabled = false;
            // fetch the player's properties after successful login
            networkActionInProgress = false;
            break;

        case 3:         // Invalid name or password
            status = info.msg;
            break;

        default:
            status = info.msg;
            networkActionInProgress = false;
            break;
        }
    }
예제 #6
0
 void OnRoarFetchGiftsComplete(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.MailPackage> > info)
 {
     whenLastFetched         = Time.realtimeSinceStartup;
     networkActionInProgress = false;
     isFetching = false;
     mailDict   = info.data;
     Debug.Log("acceptable gifts count " + mailDict.Count);
 }
예제 #7
0
 void OnRoarPropertiesFetched(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.PlayerAttribute> > info)
 {
     networkActionInProgress = false;
     if (OnFullyLoggedIn != null)
     {
         OnFullyLoggedIn();
     }
 }
예제 #8
0
 static void onShopFetch(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.ShopEntry> > info)
 {
     Debug.Log("onShopFetch Called");
     Debug.Log(info);
     Debug.Log(info.code);
     Debug.Log(info.msg);
     Debug.Log(info.data);
 }
예제 #9
0
 void OnRoarInventoryConsumeComplete(Roar.CallbackInfo <Roar.WebObjects.Items.UseResponse> data)
 {
     networkActionInProgress = false;
     if (data.code == WebAPI.OK)
     {
         Fetch();
     }
 }
예제 #10
0
 public void OnRoarUserInfoComplete(Roar.CallbackInfo <Roar.WebObjects.Info.UserResponse> info)
 {
     if (info.code == WebAPI.OK)
     {
         networkActionInProgress = false;
         playerInfo = info.data.player;
         LoadPropertyData();
     }
 }
예제 #11
0
    static void onLogin(Roar.CallbackInfo <Roar.WebObjects.User.LoginResponse> info)
    {
        Debug.Log("onLogin Called");
        Debug.Log(info);
        Debug.Log(info.code);
        Debug.Log(info.msg);
        Debug.Log(info.data);
        IRoar roar = DefaultRoar.Instance;

        roar.Shop.Fetch(onShopFetch);
    }
예제 #12
0
 void OnRoarFacebookFetchOauthTokenComplete(Roar.CallbackInfo <Roar.WebObjects.Facebook.FetchOauthTokenResponse> info)
 {
     if (info.code == IWebAPI.OK)
     {
         Debug.Log("oauth fetched successfully");
         networkActionInProgress = false;
     }
     else
     {
         networkActionInProgress = false;
         status = "Error, " + info.msg;
     }
 }
예제 #13
0
 void OnRoarFriendsDeclineInvite(Roar.CallbackInfo <Roar.WebObjects.Friends.DeclineResponse> data)
 {
     if (data.code == WebAPI.OK)
     {
         friendsInviteList.Remove(inviteManipulated);
         networkActionInProgress = false;
         statusString            = "Invite sent successfully!";
     }
     else
     {
         networkActionInProgress = false;
         statusString            = "Invite sending failed. " + data.msg;
     }
 }
예제 #14
0
 void OnRoarFriendsRemove(Roar.CallbackInfo <Roar.WebObjects.Friends.RemoveResponse> data)
 {
     if (data.code == WebAPI.OK)
     {
         networkActionInProgress = false;
         statusString            = "Friend removed successfully!";
         Fetch();
     }
     else
     {
         networkActionInProgress = false;
         statusString            = "Friend remove failed. " + data.msg;
     }
 }
예제 #15
0
 void onRoarGiftsGiftAccepted(Roar.CallbackInfo <Roar.WebObjects.Mail.AcceptResponse> data)
 {
     networkActionInProgress = false;
     if (data.code == IWebAPI.OK)
     {
         section      = Section.Normal;
         statusString = "Gift accepted successfully!";
         Debug.Log("gift accepted " + data.msg);
     }
     else
     {
         statusString = "Gift acceptance Failed, Reason: " + data.msg;
         Debug.Log("gift accepted " + data.msg);
     }
 }
예제 #16
0
 void onRoarGiftsGiftSent(Roar.CallbackInfo <Roar.WebObjects.Mail.SendResponse> data)
 {
     networkActionInProgress = false;
     if (data.code == IWebAPI.OK)
     {
         statusString = "Gift sent succcessfully!";
         Debug.Log("Gift sent " + data.msg);
         selectedMailable = null;
     }
     else
     {
         statusString = "Gift sending failed. Reason: " + data.msg;
         Debug.Log("Gift sent " + data.msg);
     }
 }
예제 #17
0
 void OnRoarFriendsSendInvite(Roar.CallbackInfo <Roar.WebObjects.Friends.InviteResponse> data)
 {
     if (data.code == WebAPI.OK)
     {
         networkActionInProgress = false;
         statusString            = "Invite sent successfully!";
         messageToSend           = "";
         currentSection          = Section.Normal;
     }
     else
     {
         networkActionInProgress = false;
         statusString            = "Invite sending failed. " + data.msg;
     }
 }
예제 #18
0
    void OnRoarFetchShopComplete(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.FacebookShopEntry> > info)
    {
        whenLastFetched = Time.realtimeSinceStartup;
        isFetching      = false;
        shopEntries     = facebook.List();
        errorMessages   = new List <string>();

        if (info.code != IWebAPI.OK)
        {
            Debug.Log(string.Format("Error loading shop:{0}:{1}", info.code, info.msg));
            FlashError(info.msg);               //This updates the scroll bounds.
            return;
        }

        CalculateScrollBounds();
    }
예제 #19
0
 void OnRoarFetchListInvitesComplete(Roar.CallbackInfo <Roar.WebObjects.Friends.ListInvitesResponse> info)
 {
     if (info.code == WebAPI.OK)
     {
         whenLastFetched         = Time.realtimeSinceStartup;
         networkActionInProgress = false;
         isFetching        = false;
         friendsInviteList = info.data.invites;
     }
     else
     {
         networkActionInProgress = false;
         isFetching   = false;
         statusString = "Fetch failed. " + info.msg;
     }
 }
예제 #20
0
    void OnRoarAccountCreateComplete(Roar.CallbackInfo <Roar.WebObjects.User.CreateResponse> info)
    {
        if (Debug.isDebugBuild)
        {
            Debug.Log(string.Format("OnRoarAccountCreateComplete ({0}): {1}", info.code, info.msg));
        }
        switch (info.code)
        {
        case IWebAPI.OK:         // (success)
            status = "Account successfully created. You can now log in.";
            break;

        case 3:
        default:
            status = info.msg;
            break;
        }
        networkActionInProgress = false;
    }
예제 #21
0
    void OnRoarFetchLeaderboardsComplete(Roar.CallbackInfo <Roar.Components.ILeaderboards> cache)
    {
        networkActionInProgress = false;
        whenLastFetched         = Time.realtimeSinceStartup;
        isFetching   = false;
        leaderboards = boards.BoardList();

        // set default labels
        foreach (LeaderboardInfo leaderboard in leaderboards)
        {
            if (string.IsNullOrEmpty(leaderboard.label))
            {
                leaderboard.label = string.Format("Leaderboard{0} - {1}", leaderboard.board_id, leaderboard.ikey);
            }
        }

        ScrollViewContentHeight = leaderboards.Count * (leaderboardItemBounds.height + leaderboardItemSpacing);

        OnLeaderboardsFetchedComplete();
    }
예제 #22
0
    void OnRoarFacebookLoginComplete(Roar.CallbackInfo <Roar.WebObjects.Facebook.LoginOauthResponse> info)
    {
        if (Debug.isDebugBuild)
        {
            Debug.Log(string.Format("OnRoarLoginComplete ({0}): {1}", info.code, info.msg));
            if (info.data != null)
            {
                Debug.Log(string.Format("OnRoarLoginComplete got auth_token {0}", info.data.auth_token));
                Debug.Log(string.Format("OnRoarLoginComplete got player_id {0}", info.data.player_id));
            }
            else
            {
                Debug.Log("OnRoarLogingComplete got null data");
            }
        }
        switch (info.code)
        {
        case IWebAPI.OK:         // (success)
            // fetch the player's properties after successful login
            this.enabled = false;
            if (fetchPropertiesOnLogin)
            {
                DefaultRoar.Instance.Properties.Fetch(OnRoarPropertiesFetched);
            }
            else
            {
                networkActionInProgress = false;
            }

            break;

        case 3:         // Invalid name or password
        default:
            status = info.msg;
            networkActionInProgress = false;
            break;
        }
    }
예제 #23
0
 public void OnRequest(Roar.RequestResult info)
 {
     Prologue();
     if (info.code != IWebAPI.OK)
     {
         if (cb_ != null)
         {
             cb_.OnError(info);
         }
         OnFailure(info);
     }
     else
     {
         T result_data = converter_.Build(info.data);
         Roar.CallbackInfo <T> result = new Roar.CallbackInfo <T> (result_data, info.code, info.msg);
         if (cb_ != null)
         {
             cb_.OnSuccess(result);
         }
         OnSuccess(result);
     }
     Epilogue();
 }
예제 #24
0
    void OnRoarFacebookCreateComplete(Roar.CallbackInfo <Roar.WebObjects.Facebook.CreateOauthResponse> info)
    {
        switch (info.code)
        {
        case IWebAPI.OK:         // (success)
            this.enabled = false;
            // fetch the player's properties after successful login
            if (fetchPropertiesOnLogin)
            {
                DefaultRoar.Instance.Properties.Fetch(OnRoarPropertiesFetched);
            }
            else
            {
                networkActionInProgress = false;
            }
            break;

        case 3:         // Invalid name or password
        default:
            status = info.msg;
            networkActionInProgress = false;
            break;
        }
    }
예제 #25
0
 public void OnSuccess(Roar.CallbackInfo <DT> info)
 {
     model.isServerCalling = false;
     model.logger.DebugLog("onFetch got given: " + info.data.ToString());
     model.ProcessData(info.data, cb);
 }
예제 #26
0
 void OnRoarFetchTasksComplete(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.Task> > data)
 {
     isFetching = false;
 }
예제 #27
0
 public virtual void OnSuccess(Roar.CallbackInfo <T> info)
 {
 }
예제 #28
0
 protected void OnBuyComplete( CallbackInfo<Roar.WebObjects.Shop.BuyResponse> response )
 {
     isBuying = false;
     if( response.code!=WebAPI.OK )
     {
         FlashError( response.msg );
     }
 }
예제 #29
0
 void OnRoarFetchTasksComplete(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.Task> > data)
 {
     networkActionInProgress = false;
     isFetching = false;
 }
예제 #30
0
 void OnRoarFetchMailableGiftsComplete(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.Mailable> > info)
 {
     networkActionInProgress = false;
     mailableDict            = info.data;
     Debug.Log("sendable gifts count " + mailableDict.Count);
 }
예제 #31
0
 void OnRoarFetchInventoryComplete(Roar.CallbackInfo <IDictionary <string, Roar.DomainObjects.InventoryItem> > data)
 {
     networkActionInProgress = false;
     isFetching = false;
 }