3.2 获取服务器列表

功能说明:

研发方调用该接口在游戏中获取服务器列表

接口形式:

public void getServerList(Context context,String rid , final RNCallback callback)

参数说明:

context:当前游戏context实例

rid:用户id

callback:结果回调

接口示例:

 RNSDK.getServerList(getBaseContext(),"xxx", new RNCallback() {
            @Override
            public void onCompleted(int code, String msg, Object data) {
                Log.e("rn_sdk", "getServerList Callback => [code = " + code + ", msg = " + msg + " ]" + ", Object = " + data + " ]");
                if (RNCode.OK == code && data != null) {
                    Log.i("rn_sdk", "getServerList---d:" + data);
                } else {
                    //请求失败
                }
            }
        });

返回结果示例:

{
    "code":0,
    "data":"",
    "ip":"183.47.42.58",
    "isBlueList":0,
    "isWhiteList":0,
    "list":[
        {
            "ServerTime":"2023-04-23",
            "desc":"游戏将在04月13日10:00—11:00进行停服更新,请勇者大大耐心等待",
            "developid":"70007",
            "host":"43.136.89.80:6001",
            "id":21306,
            "is_bonus":0,
            "is_hot":1,
            "is_new":1,
            "is_top":1,
            "mergedto":"",
            "name":"通服7服 亚必戈",
            "num":"7",
            "open_time":"1970-01-01 08:00:00",
            "sort_index":119,
            "status":1,
            "type":"all"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"游戏将在04月13日10:00—11:00进行停服更新,请勇者大大耐心等待",
            "developid":"70004",
            "host":"43.139.227.70:6001",
            "id":21295,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"通服4服 华利弗",
            "num":"4",
            "open_time":"2022-12-22 10:00:00",
            "sort_index":118,
            "status":1,
            "type":"all"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"游戏将在04月13日10:00—11:00进行停服更新,请勇者大大耐心等待",
            "developid":"70006",
            "host":"43.136.21.2:6001",
            "id":21297,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"通服6服 格莫瑞",
            "num":"6",
            "open_time":"2023-01-16 00:00:00",
            "sort_index":117,
            "status":1,
            "type":"all"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"游戏将在04月13日10:00—11:00进行停服更新,请勇者大大耐心等待",
            "developid":"70005",
            "host":"43.136.92.84:6001",
            "id":21296,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"通服5服 娜贝离诗",
            "num":"5",
            "open_time":"2023-01-16 00:00:00",
            "sort_index":116,
            "status":1,
            "type":"all"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"游戏将在04月13日10:00—11:00进行停服更新,请勇者大大耐心等待",
            "developid":"70003",
            "host":"43.139.3.6:6001",
            "id":118,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"通服3服 哈帕斯",
            "num":"3",
            "open_time":"2022-11-17 10:00:00",
            "sort_index":115,
            "status":1,
            "type":"all"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"游戏将在04月13日10:00—11:00进行停服更新,请勇者大大耐心等待",
            "developid":"60047",
            "host":"1.12.248.213:6001",
            "id":111,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"佛尔卡斯",
            "num":"47",
            "open_time":"2022-08-18 10:00:00",
            "sort_index":114,
            "status":1,
            "type":"android"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"亲爱的勇者:\n  由于服务器配置不足,现将整体停服进行服务器升配预计需要1个小时,请各位耐心等待",
            "developid":"90002",
            "host":"134.175.206.53:6102",
            "id":42,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"内网2服",
            "num":"90002",
            "open_time":"2019-10-01 00:00:00",
            "sort_index":109,
            "status":3,
            "type":"test_all"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"亲爱的勇者:\n  由于服务器配置不足,现将整体停服进行服务器升配预计需要1个小时,请各位耐心等待",
            "developid":"90001",
            "host":"134.175.206.53:6101",
            "id":17,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"内网1服",
            "num":"90001",
            "open_time":"2019-03-25 00:00:00",
            "sort_index":108,
            "status":3,
            "type":"test_all"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"游戏将在04月13日10:00—11:00进行停服更新,请勇者大大耐心等待",
            "developid":"70002",
            "host":"114.132.224.122:6001",
            "id":117,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"通服2服 芙法",
            "num":"2",
            "open_time":"2022-10-27 10:00:00",
            "sort_index":107,
            "status":1,
            "type":"all"
        },
        {
            "ServerTime":"2023-04-23",
            "desc":"游戏将在04月13日10:00—11:00进行停服更新,请勇者大大耐心等待",
            "developid":"70001",
            "host":"43.138.181.207:6001",
            "id":114,
            "is_bonus":0,
            "is_hot":0,
            "is_new":0,
            "is_top":0,
            "mergedto":"",
            "name":"通服1服 彼列",
            "num":"1",
            "open_time":"2022-09-21 13:30:30",
            "sort_index":105,
            "status":1,
            "type":"all"
        }
    ]
}

Last updated

Was this helpful?