private void OnReq_RoleLogin(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        RoleLoginReq           req = Serializer.Deserialize <RoleLoginReq>(ms);

        foreach (var current in DataDBSCharacter.Dict)
        {
            XCharacter c = current.Value;
            if (c.GUID == req.RoleID)
            {
                RoleLoginAck ack = new RoleLoginAck();
                ack.RoleID = c.GUID;
                ack.Name   = c.Name;
                ack.Carrer = c.Carrer;
                ack.Level  = c.Level;
                ack.Exp    = c.CurExp;
                GTDataManager.Instance.LoadRoleData(c.Carrer);
                NetworkManager.Instance.Send(MessageID.MSG_ROLE_LOGIN_ACK, ack, 0, 0);


                NotifyIntoScene ntf = new NotifyIntoScene();
                ntf.CopyID   = GTGlobal.LastCityID;
                ntf.CopyGuid = 0;
                ntf.RoleID   = c.GUID;
                ntf.ServerID = MLLogin.Instance.GetCurrServerID();
                NetworkManager.Instance.Send(MessageID.MSG_NOTIFY_INTO_SCENE, ntf, 0, 0);
                break;
            }
        }
    }
Exemple #2
0
    private void OnAck_NotifyIntoScene(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        NotifyIntoScene        ack = Serializer.Deserialize <NotifyIntoScene>(ms);
        EnterSceneReq          req = new EnterSceneReq();

        req.RoleID = ack.RoleID;
        NetworkManager.Instance.Send(MessageID.MSG_ENTER_SCENE_REQ, req, (UInt64)ack.CopyID, (UInt32)ack.ServerID);
    }
Exemple #3
0
    private void OnAck_NotifyIntoScene(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        NotifyIntoScene        ack = Serializer.Deserialize <NotifyIntoScene>(ms);

        GTLauncher.Instance.LoadScene(ack.CopyID, () =>
        {
            GTNetworkSend.Instance.TryEnterScene(ack.RoleID, ack.CopyID, ack.CopyGuid, ack.ServerID);
        });
    }