Пример #1
0
 void   ReadRoleData()
 {
     DataDBSBagItem.Read(GetDataPath(GTDataKey.Data_BagItems), EDataKeyType.Pos);
     DataDBSEquip.Read(GetDataPath(GTDataKey.Data_Equips), EDataKeyType.Instance);
     DataDBSDressEquip.Read(GetDataPath(GTDataKey.Data_DressEquips), EDataKeyType.Pos);
     DataDBSMoney.Read(GetDataPath(GTDataKey.Data_Moneys), EDataKeyType.Id);
     DataDBSAction.Read(GetDataPath(GTDataKey.Data_Actions), EDataKeyType.Id);
     DataDBSSoul.Read(GetDataPath(GTDataKey.Data_Souls), EDataKeyType.Id);
     DataDBSBagGem.Read(GetDataPath(GTDataKey.Data_BagGems), EDataKeyType.Pos);
     DataDBSGem.Read(GetDataPath(GTDataKey.Data_Gems), EDataKeyType.Instance);
     DataDBSDressGem.Read(GetDataPath(GTDataKey.Data_DressGems), EDataKeyType.Pos);
     DataDBSBagChip.Read(GetDataPath(GTDataKey.Data_BagChips), EDataKeyType.Pos);
     DataDBSBagFashion.Read(GetDataPath(GTDataKey.Data_BagFashions), EDataKeyType.Pos);
     DataDBSBagRune.Read(GetDataPath(GTDataKey.Data_BagRunes), EDataKeyType.Pos);
     DataDBSDressRune.Read(GetDataPath(GTDataKey.Data_DressRunes), EDataKeyType.Pos);
     DataDBSDressFashion.Read(GetDataPath(GTDataKey.Data_DressFashions), EDataKeyType.Pos);
     DataDBSRune.Read(GetDataPath(GTDataKey.Data_Runes), EDataKeyType.Instance);
     DataDBSCopy.Read(GetDataPath(GTDataKey.Data_Copys), EDataKeyType.Id);
     DataDBSMainChapter.Read(GetDataPath(GTDataKey.Data_MainChapters), EDataKeyType.Id);
     DataDBSRaid.Read(GetDataPath(GTDataKey.Data_Raid), EDataKeyType.Id);
     DataDBSPartner.Read(GetDataPath(GTDataKey.Data_Partners), EDataKeyType.Id);
     DataDBSMount.Read(GetDataPath(GTDataKey.Data_Mounts), EDataKeyType.Id);
     DataDBSRelics.Read(GetDataPath(GTDataKey.Data_Relics), EDataKeyType.Id);
     DataDBSPet.Read(GetDataPath(GTDataKey.Data_Pets), EDataKeyType.Id);
     DataDBSGuide.Read(GetDataPath(GTDataKey.Data_Guides), EDataKeyType.Id);
     DataDBSThreadTask.Read(GetDataPath(GTDataKey.Data_MainTasks), EDataKeyType.Id);
     DataDBSBranchTask.Read(GetDataPath(GTDataKey.Data_BranchTasks), EDataKeyType.Id);
     DataDBSDailyTask.Read(GetDataPath(GTDataKey.Data_DailyTasks), EDataKeyType.Id);
 }
Пример #2
0
    void   DumpRoleData()
    {
        DataDBSMoney.Clear();
        DataDBSAction.Clear();
        DataDBSSoul.Clear();

        DataDBSBagItem.Clear();
        DataDBSBagGem.Clear();
        DataDBSBagChip.Clear();
        DataDBSBagRune.Clear();
        DataDBSBagFashion.Clear();

        DataDBSDressEquip.Clear();
        DataDBSDressFashion.Clear();
        DataDBSDressGem.Clear();
        DataDBSDressRune.Clear();

        DataDBSEquip.Clear();
        DataDBSGem.Clear();
        DataDBSRune.Clear();
        DataDBSMainChapter.Clear();
        DataDBSCopy.Clear();
        DataDBSRaid.Clear();

        DataDBSRelics.Clear();
        DataDBSMount.Clear();
        DataDBSPartner.Clear();
        DataDBSPet.Clear();
        DataDBSGuide.Clear();

        DataDBSThreadTask.Clear();
        DataDBSBranchTask.Clear();
        DataDBSDailyTask.Clear();
    }
Пример #3
0
 static void CalcAllGemPropertys(Dictionary <EAttr, int> dict)
 {
     Dictionary <int, XItem> .Enumerator em = DataDBSDressGem.Dict.GetEnumerator();
     while (em.MoveNext())
     {
         int dressPos = em.Current.Key;
         int index    = MLGem.Instance.GetIndexByDressGemPos(dressPos);
         if (!DataDBSDressEquip.ContainsKey(index))
         {
             continue;
         }
         int instanceID = em.Current.Value.Instance;
         if (!DataDBSGem.ContainsKey(instanceID))
         {
             continue;
         }
         XGem gem = DataDBSGem.GetDataById(instanceID);
         Dictionary <EAttr, int> .Enumerator em2 = GetPropertys(gem).GetEnumerator();
         while (em2.MoveNext())
         {
             dict[em2.Current.Key] += em2.Current.Value;
         }
         em2.Dispose();
     }
     em.Dispose();
 }
Пример #4
0
    public static Dictionary <EAttr, int> GetAllGemPropertysByIndex(int index)
    {
        if (!DataDBSDressEquip.ContainsKey(index))
        {
            return(New());
        }
        Dictionary <EAttr, int> attrValues = New();

        for (int i = 1; i <= 5; i++)
        {
            int   gemPos = MLGem.Instance.GetDressGemPosByIndexAndTargetPos(index, i);
            XItem item   = DataDBSDressGem.GetDataById(gemPos);
            if (item == null)
            {
                continue;
            }
            XGem gem = DataDBSGem.GetDataById(item.Instance);
            if (gem != null)
            {
                continue;
            }
            CalcGemStrenthLevel(attrValues, gem);
        }
        CalcMaxAttrValue(ref attrValues);
        return(attrValues);
    }
Пример #5
0
    private void OnAck_DressEquip(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckDressEquip          ack = Serializer.Deserialize <AckDressEquip>(ms);
        int srcPos = ack.SrcPos;
        int tarPos = ack.TarPos;

        XItem  bagEquip   = DataDBSBagItem.GetDataById(srcPos);
        DEquip equipDB    = ReadCfgEquip.GetDataById(bagEquip.Id);
        XItem  dressEquip = DataDBSDressEquip.GetDataById(equipDB.Pos);

        if (dressEquip != null)
        {
            int bagInstance = bagEquip.Instance;
            int bagId       = bagEquip.Id;

            bagEquip.Id       = dressEquip.Id;
            bagEquip.Instance = dressEquip.Instance;
            bagEquip.PosType  = (int)EPosType.BagItem;

            dressEquip.Instance = bagInstance;
            dressEquip.PosType  = (int)EPosType.RoleEquip;
            dressEquip.Id       = bagId;
            DataDBSDressEquip.Update(equipDB.Pos, dressEquip);
            DataDBSBagItem.Update(srcPos, bagEquip);
        }
        else
        {
            dressEquip          = new XItem();
            dressEquip.Instance = bagEquip.Instance;
            dressEquip.Pos      = equipDB.Pos;
            dressEquip.PosType  = (int)EPosType.RoleEquip;
            dressEquip.Id       = bagEquip.Id;
            dressEquip.Num      = 1;
            DataDBSDressEquip.Insert(equipDB.Pos, dressEquip);
            DataDBSBagItem.Delete(srcPos);
        }

        GTWorld.Instance.SyncMainPlayerData(ESyncDataType.TYPE_EQUIP);

        GTEventCenter.FireEvent(GTEventID.TYPE_BAG_DRESS_EQUIP, srcPos, tarPos);
        GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_FIGHTVALUE);
    }
Пример #6
0
    private void OnAck_UnloadEquip(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckUnloadEquip         ack = Serializer.Deserialize <AckUnloadEquip>(ms);

        int newPos = ack.NewPos;
        int tarPos = ack.TarPos;

        XItem dressEquip = DataDBSDressEquip.GetDataById(tarPos);
        XItem bagItem    = new XItem();

        bagItem.Instance = dressEquip.Instance;
        bagItem.Pos      = newPos;
        bagItem.PosType  = (int)EPosType.BagItem;
        bagItem.Id       = dressEquip.Id;
        bagItem.Num      = 1;
        DataDBSBagItem.Insert(newPos, bagItem);
        DataDBSDressEquip.Delete(tarPos);

        GTWorld.Instance.SyncMainPlayerData(ESyncDataType.TYPE_EQUIP);

        GTEventCenter.FireEvent(GTEventID.TYPE_BAG_UNLOAD_EQUIP, newPos, tarPos);
        GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_FIGHTVALUE);
    }