/// <summary>
 /// 服务器被选中处理
 /// </summary>
 /// <param name="data"></param>
 private void MSvr_OnSelectHandler(BaseUI me, ServerItemVo data)
 {
     if (OnSelectHandler != null)
     {
         OnSelectHandler(this, data);
         this.gameObject.SetActive(false);
     }
 }
    private void SelectServerUI_OnParseHandler(byte moduleCode, byte opCode, ExitGames.Client.Photon.OperationResponse response)
    {
        //处理获得当前服务器
        HandlerManager.GetInstance().Remove((byte)Module.ServerList, (byte)ServerListOperation.FetchAllServer);
        string json = response.Parameters[(byte)1].ToString();

        //Json序列化成类
        ServerItemVo vo = JsonReader.Deserialize <ServerItemVo>(json);

        //临时存储服务器信息
        Global.GetInstance().mCurrentServerInfo = vo;

        //显示界面
        txtServerTitle.text = (vo.id < 10 ? "0" + vo.id : vo.id + "") + ". " + vo.title;
    }
Exemple #3
0
    /// <summary>
    /// 初始化
    /// </summary>
    public void Init()
    {
        //初始化UI的根容器
        m_UIRoot = this.transform.Find("UI");

        mCurrentServerInfo = new ServerItemVo();

        //初始化管理器
        HandlerManager.GetInstance().Init();

        UIManager.GetInstance().Init();
        ResManager.GetInstance().Init();
        UIManager.GetInstance().SwitchScene("LoadingUI", "LoginUI");

        NetManager.GetInstance().Init();
    }
Exemple #4
0
    /// <summary>
    /// 初始化
    /// </summary>
    public void Init()
    {
        //初始化UI的根容器
        m_UIRoot = this.transform.Find("UI");

        mCurrentServerInfo = new ServerItemVo();

        //初始化管理器
        HandlerManager.GetInstance().Init();

        UIManager.GetInstance().Init();
        SceneManager.GetInstance().Init();
        ResManager.GetInstance().Init();

        NetManager.GetInstance().Init();
        SceneManager.GetInstance().GotoUIScene("LoginUI");
        //SceneManager.GetInstance().GotoScene("MainCity");
    }
Exemple #5
0
        public override void Parse(UserClient user, byte moduleCode, byte operationCode, OperationRequest operationRequest, SendParameters sendParameters)
        {
            ServerItemVo currentServer = new ServerItemVo();

            currentServer.id     = 1;
            currentServer.title  = "天府情缘";
            currentServer.host   = "192.168.1.35:4531";
            currentServer.status = 2;


            S2CMessage msg = new S2CMessage((byte)moduleCode, (byte)operationCode);

            msg.Add(1, JsonMapper.ToJson(currentServer));

            OperationResponse response = new OperationResponse((byte)moduleCode, msg);

            user.SendOperationResponse(response, sendParameters);

            Global.Info("获取当前服务器列表");
        }
 private void Mlist_OnSelectHandler(BaseUI me, ServerItemVo vo)
 {
     //显示界面
     txtServerTitle.text = (vo.id < 10 ? "0" + vo.id : vo.id + "") + ". " + vo.title;
     Destroy(me.gameObject);
 }
Exemple #7
0
 public void SetServerData(ServerItemVo vo)
 {
     data          = vo;
     txtTitle.text = (vo.id < 10? "0" + vo.id: vo.id + "") + ". " + vo.title;
 }