Skip to content

Server List ​

  • Optional. After the player logs in, before entering the game, the player can switch the server. Calling this method will pull up the SDK server list page. If the game uses its own server list page, this method can not be called.

Image ​

  • 伺服器列表圖示

Method ​

java
public static void gamedreamerServerList(Context context, HashMap<String,String> map,GamedreamerServerListListener gamedreamerServerListListener)

Parameters ​

ParameterDescription
contextContext object.
mapThe map need to pass a parameter: the key of the parameter is GDValues.USER_ID, the value is Gamedreamer User’s Id.
gamedreamerServerListListenerServer list listener.

Callback Description ​

GamedreamerServerListListener.onServertList()) callback method description:

  • This method is called after the player selects the server on the server list page.
  • Return parameter description:
parameterdescription
paramServerServer object that player selected.

Example Code ​

java
HashMap<String, String> map = new HashMap<String, String>();
map.put(GDValues.USER_ID, loginUser.getUserId());
GDSDK.gamedreamerServerList(this, map, new GamedreamerServerListListener() {
				
	@Override
	public void onServerList(Server paramServer) {
		loginServer = paramServer;
	}
});