Пример #1
0
 public void SetBuyLimit(TSCGetPurchase msg)
 {
     if (!msg.HasUserResource || msg.UserResource.ResourceInfosCount <= 0)
     {
         foreach (var pair in mItemServerData)
         {
             pair.Value.boughtNum = 0;
         }
     }
     else
     {
         UserResource array = msg.UserResource;
         for (int i = 0; i < array.ResourceInfosCount; i++)
         {
             var data = array.GetResourceInfos(i);
             if (!mItemServerData.ContainsKey(data.ConfigId))
             {
                 mItemServerData[data.ConfigId] = new NItemServerData();
             }
             mItemServerData[data.ConfigId].boughtNum = data.Number;
         }
     }
 }
Пример #2
0
    void OnGetLimit(NetMsgDef msg)
    {
        TSCGetPurchase res = TSCGetPurchase.ParseFrom(msg.mBtsData);

        itemPackage.SetBuyLimit(res);
    }