Example #1
0
    // Token: 0x06001145 RID: 4421 RVA: 0x001E79F8 File Offset: 0x001E5BF8
    public void RecvCastleUnlockdata(MessagePacket Mp)
    {
        GUIManager.Instance.BuildingData.CastleID = Mp.ReadByte(-1);
        byte b = Mp.ReadByte(-1);

        if (this.CastleSwitch == null || this.CastleSwitch.Length < (int)b)
        {
            this.CastleSwitch = new byte[(int)b];
        }
        byte b2 = Mp.ReadByte(-1);

        if (this.CastleEnhance == null || this.CastleEnhance.Length < (int)(b * 8))
        {
            this.CastleEnhance = new byte[(int)(b * 8)];
        }
        this.LoadCastleSkinSave();
        Mp.ReadBlock(this.CastleSwitch, 0, (int)b, -1);
        int num = 0;

        if (b2 > 0)
        {
            for (int i = 0; i < this.CastleSwitch.Length; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    if (((int)this.CastleSwitch[i] & 1 << j) > 0)
                    {
                        int num2 = i * 8 + j;
                        this.CastleEnhance[num2] = Mp.ReadByte(-1);
                        if (this.CastleEnhance[num2] > 5)
                        {
                            this.CastleEnhance[num2] = 5;
                        }
                        this.SetSelect((byte)(num2 + 1));
                        num++;
                        if (num == (int)b2)
                        {
                            break;
                        }
                    }
                }
                if (num == (int)b2)
                {
                    break;
                }
            }
        }
        this.UpdateExclamationCount();
        this.SortDirty();
        this.SetUnlock(1);
        this.UnlockMall();
        GUIManager.Instance.UpdateUI(EGUIWindow.UI_CastleSkin, 0, 0);
        DataManager.Instance.AttribVal.UpdateAttrVal(UpdateAttrKind.CastleSkin);
        GUIManager.Instance.UpdateUI(EGUIWindow.UI_CastleStrengthen, 4, 0);
    }
Example #2
0
    // Token: 0x060008C1 RID: 2241 RVA: 0x000B4228 File Offset: 0x000B2428
    public static void RecvInitBattle(MessagePacket MP)
    {
        DataManager instance = DataManager.Instance;

        GUIManager.Instance.HideUILock(EUILock.Battle);
        BATTLEINIT_RESULT battleinit_RESULT = (BATTLEINIT_RESULT)MP.ReadByte(-1);

        if (battleinit_RESULT == BATTLEINIT_RESULT.BATTLEINIT_RESULT_SUCCESS)
        {
            instance.BattleSeqID = MP.ReadULong(-1);
            byte   b          = MP.ReadByte(-1);
            ushort num        = MP.ReadUShort(-1);
            ushort randomSeed = MP.ReadUShort(-1);
            byte   randomGap  = MP.ReadByte(-1);
            DataManager.StageDataController.UpdateRoleAttrMorale(MP.ReadUShort(-1));
            for (int i = 0; i < 5; i++)
            {
                instance.heroBattleData[i].HeroID = MP.ReadUShort(-1);
            }
            for (int j = 0; j < 5; j++)
            {
                instance.heroBattleData[j].AttrData.SkillLV1 = MP.ReadByte(-1);
                instance.heroBattleData[j].AttrData.SkillLV2 = MP.ReadByte(-1);
                instance.heroBattleData[j].AttrData.SkillLV3 = MP.ReadByte(-1);
                instance.heroBattleData[j].AttrData.SkillLV4 = MP.ReadByte(-1);
                instance.heroBattleData[j].AttrData.LV       = MP.ReadByte(-1);
                instance.heroBattleData[j].AttrData.Star     = MP.ReadByte(-1);
                instance.heroBattleData[j].AttrData.Enhance  = MP.ReadByte(-1);
                instance.heroBattleData[j].AttrData.Equip    = MP.ReadByte(-1);
            }
            MP.ReadBlock(instance.RewardLen, 0, 4, -1);
            instance.RewardCount = (int)(instance.RewardLen[0] + instance.RewardLen[1] + instance.RewardLen[2] + instance.RewardLen[3]);
            for (int k = 0; k < instance.RewardCount; k++)
            {
                instance.RewardData[k] = MP.ReadUShort(-1);
            }
            instance.battleInfo.RandomSeed    = randomSeed;
            instance.battleInfo.RandomGap     = (ushort)randomGap;
            instance.battleInfo.BattleType    = 1;
            BattleNetwork.SendBattleEndStatus = 0;
            GameManager.OnRefresh(NetworkNews.Refresh, null);
            if (!BattleNetwork.bReplay)
            {
                GUIManager.Instance.UpdateUI(EGUIWindow.UI_BattleHeroSelect, 0, 0);
            }
            else
            {
                BattleNetwork.bReplay = false;
                GUIManager.Instance.pDVMgr.NextTransitions(eTrans.BEGIN, eTransFunc.BattleReplay);
                AudioManager.Instance.LoadAndPlayBGM(BGMType.War, 1, false);
            }
        }
        else if (!BattleNetwork.bReplay)
        {
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_BattleHeroSelect, 1, 0);
            uint id = (uint)((byte)660 + battleinit_RESULT);
            GUIManager.Instance.AddHUDMessage(instance.mStringTable.GetStringByID(id), 2, true);
        }
        else
        {
            BattleNetwork.bReplay = false;
            uint id2 = (uint)((byte)660 + battleinit_RESULT);
            GUIManager.Instance.AddHUDMessage(instance.mStringTable.GetStringByID(id2), 2, true);
        }
    }