Ejemplo n.º 1
0
    private void OnAck_ChangePartner(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckChangePartner       ack = Serializer.Deserialize <AckChangePartner>(ms);

        XCharacter role = GTGlobal.Main;

        switch (ack.Pos)
        {
        case 1:
            role.Partner1 = ack.ID;
            break;

        case 2:
            role.Partner2 = ack.ID;
            break;
        }
        DataDBSCharacter.Update(role.Carrer, role);
        if (!DataDBSPartner.ContainsKey(ack.ID))
        {
            XPartner xp = new XPartner();
            xp.Id      = ack.ID;
            xp.Level   = 1;
            xp.Star    = 0;
            xp.Wake    = 0;
            xp.Advance = 1;
            xp.Exp     = 0;
            DataDBSPartner.Insert(ack.ID, xp);
        }

        GTWorld.Instance.SyncMainPlayerData(ESyncDataType.TYPE_BASEATTR);
        GTEventCenter.FireEvent(GTEventID.TYPE_PARTNER_CHANGE, ack.Pos, ack.ID);
        GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_FIGHTVALUE);
    }
Ejemplo n.º 2
0
    private void OnAck_SetMount(MessageRecv obj)
    {
        System.IO.MemoryStream ms   = new System.IO.MemoryStream(obj.Data);
        AckSetMount            ack  = Serializer.Deserialize <AckSetMount>(ms);
        XCharacter             role = GTGlobal.Main;

        role.Mount = ack.MountID;
        DataDBSCharacter.Update(role.Carrer, role);
        GTEventCenter.FireEvent(GTEventID.TYPE_MOUNT_DRESSMOUNT);
    }
Ejemplo n.º 3
0
    private void OnAck_BattlePet(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckBattlePet           ack = Serializer.Deserialize <AckBattlePet>(ms);

        XCharacter role = GTGlobal.Main;

        role.PetID = ack.ID;
        DataDBSCharacter.Update(role.Carrer, role);

        GTWorld.Instance.SyncMainPlayerData(ESyncDataType.TYPE_BASEATTR);
        GTEventCenter.FireEvent(GTEventID.TYPE_PET_BATTLE);
        GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_FIGHTVALUE);
    }
Ejemplo n.º 4
0
    private void OnAck_UnloadRelics(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckUnloadRelics        ack = Serializer.Deserialize <AckUnloadRelics>(ms);

        XCharacter role = GTGlobal.Main;

        role.Relic = 0;
        DataDBSCharacter.Update(role.Carrer, role);

        GTWorld.Instance.SyncMainPlayerData(ESyncDataType.TYPE_BASEATTR);
        GTEventCenter.FireEvent(GTEventID.TYPE_RELICS_UNLOAD, ack.RelicsID);
        GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_FIGHTVALUE);
    }
Ejemplo n.º 5
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);
    }