- Konuyu başlatan
- #21
Uzman Üye
o zaman biraz değişiklik yapmamız gerekliKopyaladım
uygulamayı tamamen silip fiddler script bölümüne kadar adımları tekrar uygula
script bölümüne geldiğinde kodların en üstünde bulunan import un altına şunları yapıştır
Kod:
var Bloodweb = true;
var GetAll = true;
var Market = true;
daha sonra kodların yazılı olduğu bölümün üstünde go to: yazan bir kutucuk göreceksin oraya tıklayıp on before request e tıkla
sana belirttiği yerin altına şunları yapıştır
Kod:
if (Bloodweb && oSession.uriContains("api/v1/dbd-character-data/bloodweb")) {
var filePath = "C:\\Rules\\CharsPrestige.txt";
var bloodwebPath = "C:\\Rules\\Bloodweb";
if (!System.IO.File.Exists(bloodwebPath)) return;
if (!System.IO.File.Exists(filePath)) {
oSession.LoadResponseFromFile(bloodwebPath);
return;
}
var charsPrestige = Fiddler.WebFormats.JSON.JsonDecode(System.IO.File.ReadAllText(filePath));
oSession.utilDecodeRequest();
var oJson = Fiddler.WebFormats.JSON.JsonDecode(oSession.GetRequestBodyAsString());
var characterSelected = oJson.JSONObject["characterName"];
if (!isNaN(charsPrestige.JSONObject[characterSelected.ToString()])) {
var bloodwebJson = Fiddler.WebFormats.JSON.JsonDecode(System.IO.File.ReadAllText(bloodwebPath));
bloodwebJson.JSONObject["bloodWebLevel"] = 50;
bloodwebJson.JSONObject["prestigeLevel"] = parseInt(charsPrestige.JSONObject[characterSelected.ToString()]);
bloodwebJson.JSONObject["legacyPrestigeLevel"] = Math.round((charsPrestige.JSONObject[characterSelected.ToString()] % 1) * 10);
oSession.utilSetResponseBody(Fiddler.WebFormats.JSON.JsonEncode(bloodwebJson.JSONObject));
}
}
if (GetAll && oSession.uriContains("api/v1/dbd-character-data/get-all")){
var filePath = "C:\\Rules\\CharsPrestige.txt";
var getallPath = "C:\\Rules\\GetAll";
if (!System.IO.File.Exists(getallPath)) return;
if (!System.IO.File.Exists(filePath)) {
oSession.LoadResponseFromFile(getallPath);
return;
}
var getallJson = Fiddler.WebFormats.JSON.JsonDecode(System.IO.File.ReadAllText(getallPath));
var characters = Fiddler.WebFormats.JSON.JsonDecode(System.IO.File.ReadAllText(filePath));
FiddlerObject.log(getallJson.JSONObject["list"].Count);
FiddlerObject.log(characters.JSONObject.Count);
for (var i=0; i<getallJson.JSONObject["list"].Count; i++){
for (var character in characters.JSONObject) {
if(getallJson.JSONObject["list"][i]["characterName"] == character.Key){
getallJson.JSONObject["list"][i]["bloodWebLevel"] = 50
if(isNaN(character.Value)) break;
getallJson.JSONObject["list"][i]["prestigeLevel"] = parseInt(character.Value);
getallJson.JSONObject["list"][i]["legacyPrestigeLevel"] = Math.round((character.Value % 1) * 10);
break;
}
}
}
oSession.utilSetResponseBody(Fiddler.WebFormats.JSON.JsonEncode(getallJson.JSONObject));
}
if (Market && oSession.uriContains("api/v1/inventories")) {
var filePath = "C:\\Rules\\List.txt";
if (System.IO.File.Exists(filePath)){
var fileContent = System.IO.File.ReadAllText(filePath);
var itemsToAdd = fileContent.split("\r\n");
oSession.utilDecodeResponse();
var jsonString = oSession.GetResponseBodyAsString();
var oJson = Fiddler.WebFormats.JSON.JsonDecode(jsonString);
var currentDate = DateTime.UtcNow;
var unixTimeStamp = parseInt((currentDate.Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc))).TotalSeconds);
for (var i = 0; i < itemsToAdd.length; i++) {
var oElement = new System.Collections.Hashtable();
oElement.Add("lastUpdateAt", unixTimeStamp);
oElement.Add("objectId", itemsToAdd[i]);
oElement.Add("quantity", 1);
oJson.JSONObject["data"]["inventory"].Add(oElement);
}
var oString = Fiddler.WebFormats.JSON.JsonEncode(oJson.JSONObject);
oSession.utilSetResponseBody(oString);
}
}
}
ayrıca sana verdiğim rules klasörünün c klasöründe olmasına dikkat et
bu adımları uyguladığında sorun çıkmaması gerekli