libgdx facebook integration with my contacts that created room

0 votes
I'm developing a cross platform multiplayer game using libgdx and your appwarp taking example of your superjumper.
All I want to implement is that in case I want to play against a know player then how would I implement that.
Meaning: When I click multiplayer it joins a random with random person. All I want is to make a contact list or facebook integration and get list of person in my contact/fb list that have created any room so that I can finally play with them. Is there any API or library that explains my requirement?
 
Any help will be highly appreciated. And I've many plans of multiplayer games so need this as my starting point.
 
asked Jun 7, 2014 in Discuss & suggest API by mayankarora10 (10 points)

1 Answer

0 votes
There is no first class API for doing something like this. You can achieve it by doing the following

1) When a player wants to play with his/her FB friends, he can get the list of friends fb ids who have the app installed using FB SDK.

2) Check which one of these friends is online right now -> calling getLiveUserInfo for each of the users in the list.

3) You will get a callback for each of the friends (onGetLiveUserInfoDone) -> success meaning they are online and you will also get the room data of the room they are in. failure means the friend is offline.

4) With the information from step 3, you can either automatically join one of the rooms or present the user with a list of online friends so they can choose whom to play with.

OR

1) When a player creates a room, they add a property to it "fbid" and value as the user's fb id who is calling createRoom.

2) When a player wants to play with his/her FB friends, he can get the list of friends fb ids who have the app installed using FB SDK.

3) Call joinRoomWithProperties with the matching fbid property based on step 2's result. Call this API one-by-one for each of these till it joins a room successfully.
answered Jun 9, 2014 by dhruvc (1,099 points)
I understand your point. I too thought the same way its just assigning the user id i.e there facebook id instead of a random string used in superjumper example and later on using his friends ids to check if any of them are present or have created a room to start game.
But how to get this facebook id?? Where to store it? App42? Does App42 support libgdx?

Just in case if there's something like this that exists with marmalade or any other sdk then that would be a great help.
Thanks
To get the Facebook id, you need to use the facebook sdk. Your usage of 3rd party ID providers such as facebook, google+ etc. is independent of usage of AppWarp SDK.
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
...