Ejemplo n.º 1
0
        public override void Handle(Session Session)
        {
            DataGachaDraw dataGachaDraw = new DataGachaDraw();
            DataGachaDraw gachaDraw;

            if (((ClientChatter)Session.oRequest).headers.RequestPath.StartsWith("/dff/gacha/execute"))
            {
                gachaDraw = JsonConvert.DeserializeObject <DataGachaDraw>(Session.GetResponseBodyAsString());
            }
            else
            {
                DataGachaGemsDraw dataGachaGemsDraw = JsonConvert.DeserializeObject <DataGachaGemsDraw>(Session.GetResponseBodyAsString());
                gachaDraw            = dataGachaGemsDraw.Draw;
                gachaDraw.ServerTime = (ulong)dataGachaGemsDraw.ServerTime;
            }
            List <DataGachaDrawItem> gachaDrawItems = new List <DataGachaDrawItem>();

            foreach (KeyValuePair <string, JToken> dropItem in gachaDraw.DropItems)
            {
                try
                {
                    uint num = uint.Parse(dropItem.Key);
                    if (dropItem.Value.Type == JTokenType.Object)
                    {
                        DataGachaDrawItem dataGachaDrawItem = JsonConvert.DeserializeObject <DataGachaDrawItem>(JsonConvert.SerializeObject((object)dropItem.Value));
                        dataGachaDrawItem.ItemID = num;
                        gachaDrawItems.Add(dataGachaDrawItem);
                    }
                }
                catch
                {
                    FiddlerApplication.Log.LogString("HandleGachaDraw Error");
                }
            }
        }
Ejemplo n.º 2
0
 private int CallProcDrawItemEntry(
     MySqlConnection connection,
     MySqlTransaction transaction,
     DataGachaDraw draw,
     DataGachaDrawItem item,
     bool isJP,
     int totalRelics)
 {
     using (MySqlCommand mySqlCommand = new MySqlCommand("insert_relic_draw_entry", connection, transaction))
     {
         mySqlCommand.CommandType = CommandType.StoredProcedure;
         mySqlCommand.Parameters.AddWithValue("@servertime", (object)draw.ServerTime);
         mySqlCommand.Parameters.AddWithValue("@uhash", (object)draw.User.ID);
         mySqlCommand.Parameters.AddWithValue("@iid", (object)item.ItemID);
         mySqlCommand.Parameters.AddWithValue("@num", (object)item.DropNum);
         mySqlCommand.Parameters.AddWithValue("@irarity", (object)item.Rarity);
         mySqlCommand.Parameters.AddWithValue("@sid", (object)draw.GachaSeriesID);
         mySqlCommand.Parameters.AddWithValue("@isjp", (object)isJP);
         mySqlCommand.Parameters.AddWithValue("@total", (object)totalRelics);
         return(mySqlCommand.ExecuteNonQuery());
     }
 }