Exemple #1
0
    /// <summary>
    /// Create a group
    /// </summary>
    void OnCreateGroup(NetMsgDef msg)
    {
        TSCCreateGroup res = TSCCreateGroup.ParseFrom(msg.mBtsData);

        userPackage.SetGroupID(res.GroupId);
        LoadNextScene();
    }
Exemple #2
0
    void OnGetJoinGroupResult(NetMsgDef msg)
    {
        TSCApplyGroup res     = TSCApplyGroup.ParseFrom(msg.mBtsData);
        string        title   = "加入失败";
        string        content = "";

        if (!res.Exist)
        {
            FacadeSingleton.Instance.OverlayerPanel("UIMsgBoxPanel");
            NDictionary args = new NDictionary();
            content = "该ID不存在";
            args.Add("title", title);
            args.Add("content", content);
            SendEvent("OpenMsgBox", args);
            return;
        }
        if (res.Full)
        {
            FacadeSingleton.Instance.OverlayerPanel("UIMsgBoxPanel");
            NDictionary args = new NDictionary();
            content = "该庄园人员上限已满";
            args.Add("title", title);
            args.Add("content", content);
            SendEvent("OpenMsgBox", args);
            return;
        }
        UserPackage userPackage = FacadeSingleton.Instance.RetrieveData(ConstVal.Package_User) as UserPackage;

        userPackage.SetGroupID(res.GroupId);
        SceneLoader.LoadScene("SLoading");
    }
Exemple #3
0
    void OnLoginSuccussed(NetMsgDef msg)
    {
        userPackage = FacadeSingleton.Instance.RetrieveData(ConstVal.Package_User) as UserPackage;
        PlayerPrefs.SetString("username", userName.value);
        TSCLogin login = TSCLogin.ParseFrom(msg.mBtsData);

        userPackage.SetUserID(login.Uid);
        GlobalFunction.GetTimeDelta(login.SystemCurrentTime);
        NetSingleton.Instance.StartHeartBeat();
        //check if need to create or join a sanctuary
        if (login.GroupId == 0)
        {
            //new player
            FacadeSingleton.Instance.OverlayerPanel("UISelectGroupPanel");
        }
        else
        {
            userPackage.SetGroupID(login.GroupId);
            LoadNextScene();
        }
    }