How to get user online status?

0 votes

Hi,

I am using App42 and Appwarp in same game with Cocos2d-x.

Now i want to get pertucular User's status that whether User is logged in game or not?

I can see one method that getOnlineUsers But that is not useful for live game. As game might have big active users.

I think it will be great if we can have method to check online status with given Usernames vector.

Thanks.

asked May 16, 2016 in Cocos2D-X by smitpatel88 (33 points)

1 Answer

+1 vote
 
Best answer

Hi Smit,

You can use getLiveUserInfo API to retrieve user information. You will get acallBack in onGetLiveUserInfoDone method of ZoneListener. You can handle the same in following manner :

 @Override
    public void onGetLiveUserInfoDone(LiveUserInfoEvent event) {        
     if(event.getResult() == WarpResponseResultCode.SUCCESS){
             System.out.println("User in OnLine");
         }
         else{
             System.out.println("User in OffLine");
         }
    }

Let me know if it helps.

Thanks

Vishnu Garg

answered May 16, 2016 by Vishnu Garg (674 points)
selected May 16, 2016 by smitpatel88
Thanks, will try.
Thanks, that worked.
May i know is there anything we can do something like when User comes online or goes offline then friends will get notified? Any work around for this?
I am handling all user profiles through App42 and that profile name using to connect Appwarp.
Any help will be great.
Thanks.
Yes, It can be done using AppWarpS2. where you can override existing functionality of AppWarp and can notify friends when users comes online or offline.You can go through with http://appwarps2.shephertz.com/dev-center/
Ok.
I always got confused with AppWarpS2 that do i need my own server for that?
Or is that same as AppWarp with server coding?
Your videos of S2 is not helpful.
Yes, That is your own server where you can write own business logic.
hmm thats not feasible for me.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...