Hi Shephertz,
I m trying to fetch all online players using getOnlineUsers() mehod, but after tring from last two days, didnt get any result, i have authenticated user using app42 cloud api, this is android projects and using both Appwarp and App42cloud api.
please check this code which i wrote:
UserList.java
package com.shiv.onlineplayers;
import java.util.ArrayList;
import com.shephertz.app42.gaming.multiplayer.client.WarpClient;
import com.shephertz.app42.gaming.multiplayer.client.command.WarpResponseResultCode;
import com.shephertz.app42.gaming.multiplayer.client.events.AllRoomsEvent;
import com.shephertz.app42.gaming.multiplayer.client.events.AllUsersEvent;
import com.shephertz.app42.gaming.multiplayer.client.events.LiveUserInfoEvent;
import com.shephertz.app42.gaming.multiplayer.client.events.RoomEvent;
import com.shephertz.app42.gaming.multiplayer.client.listener.ZoneRequestListener;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.ActionBarActivity;
public class UserList extends ActionBarActivity implements ZoneRequestListener{
Handler UIThreadHandler = new Handler();
private ProgressDialog progressDialog;
private ArrayList<String> userList = new ArrayList<String>();
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user_list);
AsyncApp42ServiceApi.getMyWarpClient().addZoneRequestListener(this);
AsyncApp42ServiceApi.getMyWarpClient().getOnlineUsers();
}
@Override
public void onCreateRoomDone(RoomEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void onDeleteRoomDone(RoomEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void onGetAllRoomsDone(AllRoomsEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void onGetLiveUserInfoDone(LiveUserInfoEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void onGetOnlineUsersDone(AllUsersEvent arg0) {
if(arg0.getResult() == WarpResponseResultCode.SUCCESS){
AsyncApp42ServiceApi.getMyWarpClient().getOnlineUsers();
}
}
@Override
public void onSetCustomUserDataDone(LiveUserInfoEvent arg0) {
// TODO Auto-generated method stub
}
}
Please let me know how to fetch..
Thanks.