Beispiel #1
0
    private void OnAck_GetRoleList(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        RoleListAck            ack = Serializer.Deserialize <RoleListAck>(ms);

        for (int i = 0; i < ack.RoleList.Count; i++)
        {
            RoleItem   item = ack.RoleList[i];
            XCharacter data = new XCharacter();
            data.Id    = item.RoleType;
            data.GUID  = item.ID;
            data.Level = item.Level;
            data.Name  = item.Name;
            DataDBSRole.Update(data.Id, data);
        }

        GTLauncher.Instance.LoadScene(GTSceneKey.SCENE_Role);
    }
Beispiel #2
0
    private void OnAck_GetRoleList(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        RoleListAck            ack = Serializer.Deserialize <RoleListAck>(ms);

        if (GTItemHelper.ShowNetworkError(ack.RetCode) == false)
        {
            return;
        }
        for (int i = 0; i < ack.RoleList.Count; i++)
        {
            RoleItem   item = ack.RoleList[i];
            XCharacter data = new XCharacter();
            data.Carrer = item.Carrer;
            data.Id     = ReadCfgRole.GetDataById(item.Carrer).ActorID;
            data.GUID   = item.RoleID;
            data.Level  = item.Level;
            data.Name   = item.Name;
            data.Type   = (int)EActorType.PLAYER;
            data.Camp   = (int)EBattleCamp.CT_PVE_PLAYER;
            DataDBSCharacter.Update(data.Carrer, data);
        }
        GTLauncher.Instance.LoadScene(GTCopyKey.SCENE_Role);
    }