Beispiel #1
0
 public void OnChooseServer(GameObject go)
 {
     if (go)
     {
         ServerListInfo infos;
         foreach (var item in eachGroupList.Values)
         {
             infos = item.Find((ServerListInfo info) => { return(info.server_name == go.transform.name); });
             if (infos != null)
             {
                 LoginIDManager.SetPlatServerID(infos.server_id);
                 LoginIDManager.SetPlatDisplayServerID(infos.display_server_id);
                 LoginIDManager.SetPlatServerName(infos.server_name);
                 LoginIDManager.SetLastLevel(infos.level);
                 //LoginIDManager.SetServerState(infos.load);
                 _ui.lblServerLabel.text = infos.server_name;
                 //NGUITools.SetActive(loginServerPopup.gameObject, false);
                 //NGUITools.Destroy(loginServerPopup.gameObject);
                 SetDisplayServerLabel(infos.display_server_id, infos.server_name);
                 popupAnimator.enabled = true;
                 popupAnimator.SetBool("Close", true);
             }
         }
     }
 }
Beispiel #2
0
    static int SetPlatServerID(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 1);

        LoginIDManager.SetPlatServerID(arg0);
        return(0);
    }
Beispiel #3
0
    public void SetDefaultServer(List <ServerListInfo> infos, uint last_server_id)
    {
        Debug.Log("DefaultServer -------------");
        if (infos == null)
        {
            Debug.LogError("info is null");
        }
        if (infos.Count <= 0)
        {
            return;
        }

        ServerListInfo defaultServer = null;
        ServerListInfo curServer     = null;

        foreach (var server in infos)
        {
            Debug.Log("Server name:" + server.name + " default:" + server.default_server);
            if (server.server_id == last_server_id)
            {
                curServer = server;
                break;
            }
            if (server.default_server == 1)
            {
                defaultServer = server;
            }
        }
        if (curServer == null)
        {
            curServer = defaultServer;
        }
        LoginIDManager.SetPlatServerID(curServer.server_id);
        LoginIDManager.SetPlatDisplayServerID(curServer.display_server_id);
        LoginIDManager.SetPlatServerName(curServer.server_name);
        LoginIDManager.SetLastLevel(curServer.level);
        _ui.lblServerLabel.text = curServer.server_name;
        SetDisplayServerLabel(curServer.display_server_id, curServer.server_name);
    }