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

        DStore db   = ReadCfgStore.GetDataById(ack.StoreID);
        GTItem data = new GTItem(db.ItemID, db.ItemNum * ack.Num);

        GTItemHelper.ShowAwardTip(data);
        GTDataManager.Instance.AddNewItem(db.ItemID, db.ItemNum * ack.Num);
        GTDataManager.Instance.UseMoney(db.CostMoneyID, db.CostMoneyNum * ack.Num);

        GTEventCenter.FireEvent(GTEventID.TYPE_STORE_BUYSUCCESS);
    }
Beispiel #2
0
 public void AddNewItemList(List <GTItem> list, bool showAward = true)
 {
     if (list == null)
     {
         return;
     }
     for (int i = 0; i < list.Count; i++)
     {
         AddNewItem(list[i].Id, list[i].Num);
     }
     if (showAward)
     {
         GTItemHelper.ShowAwardTip(list);
     }
 }
Beispiel #3
0
    private void OnAck_ComposeChip(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckComposeChip         ack = Serializer.Deserialize <AckComposeChip>(ms);

        int srcPos = ack.SrcPos;
        int num    = ack.Num;

        XItem item   = DataDBSBagChip.Dict[srcPos];
        DItem itemDB = ReadCfgItem.GetDataById(item.Id);

        GTDataManager.Instance.AddNewItem(itemDB.Data2, num);
        GTDataManager.Instance.UseItemById(item.Id, itemDB.Data1 * num);

        GTItem data = new GTItem(itemDB.Data2, num);

        GTItemHelper.ShowAwardTip(data);

        GTEventCenter.FireEvent(GTEventID.TYPE_BAG_COMPOSE_CHIP, srcPos);
    }