Skip to content

Commit

Permalink
Merge branch 'main' into feat/quests
Browse files Browse the repository at this point in the history
  • Loading branch information
bernatvadell committed Aug 24, 2022
2 parents 0b551c8 + 9c68158 commit 0a9b642
Show file tree
Hide file tree
Showing 53 changed files with 12,634 additions and 49,801 deletions.
64 changes: 1 addition & 63 deletions ClientPacketSniffer/Services/PacketInspectorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,74 +196,12 @@ public static PacketParsed[] ParseRawPackets(PacketInfo[] rawPackets, out bool f

foreach (var packet in output)
{
if (packet.PacketInfo.Source == 0) continue;
sb.AppendLine($"// Packet ID: {packet.PacketInfo.Id}, Name: {packet.PacketInfo.Name}");
// sb.AppendLine(string.Join(", ", BitConverter.GetBytes(packet.PacketInfo.Id).Select(x => x.ToString()).ToArray()) + ", " + string.Join(", ", packet.Data.Select(x => x.ToString()).ToArray()));
sb.AppendLine($"// Packet ID: {packet.PacketInfo.Id}, Name: {packet.PacketInfo.Name} ({(packet.PacketInfo.Source == 0 ? "Client" : "Server")})");
sb.AppendLine($"网络连接.SendRaw({packet.PacketInfo.Id}, {packet.PacketInfo.Length}, new byte[] {{{ string.Join(", ", packet.Data.Select(x => x.ToString()).ToArray()) }}});");
sb.AppendLine($"@Buffer war {packet.PacketInfo.Id} {packet.PacketInfo.Length} {BitConverter.ToString(packet.Data).Replace("-", "").ToLowerInvariant()}");
}

var raw = sb.ToString();

// var packetData = output.Where(x => x.PacketInfo.Id == 142 && x.PacketInfo.Source == 1).First();

//var shopBuffer = packetData.Data.Skip(8).ToArray();

//Stream baseInputStream = new MemoryStream(shopBuffer);
//MemoryStream memoryStream = new MemoryStream();
//new InflaterInputStream(baseInputStream).CopyTo(memoryStream);

//var decompressedData = memoryStream.ToArray();

//memoryStream.Seek(0, SeekOrigin.Begin);


//var mask = BitConverter.ToInt32(packetData.Data, 0);
//var itemsCount = BitConverter.ToInt32(packetData.Data, 4);

//var br = new BinaryReader(memoryStream);

//for (var i = 0; i < itemsCount; i++)
//{
// var shopId = br.ReadInt32();
// var u1 = br.ReadBytes(64);
// var itemId = br.ReadInt32();
// var units = br.ReadInt32();
// var currencyType = br.ReadInt32();
// var price = br.ReadInt32();
// var u2 = br.ReadInt32(); //-1
// var u3 = br.ReadInt32(); //0
// var u4 = br.ReadInt32(); //-1
// var u5 = br.ReadInt32(); //0
// var u6 = br.ReadInt32(); //0
// var u7 = br.ReadInt32(); //0
// var recyclingType = br.ReadInt32();
// var u8 = br.ReadInt32(); //0
// var u9 = br.ReadInt32(); //0
// var u10 = br.ReadInt16(); //0
// var u11 = br.ReadInt32(); //255
// var u12 = br.ReadInt32(); //255

// var buff = u1.TakeWhile(x => x > 0).ToArray();
// var txt = Encoding.UTF8.GetString(buff);

// if (
// u2 == -1
// && u3 == 0
// && u4 == -1
// && u5 == 0 && u6 == 0 && u7 == 0 && u8 == 0 && u9 == 0 && u10 == 0 && u11 == -1 && u12 == -1)
// continue;

// var whatHappen = 0;
//}

//var querico = string.Join(", ", decompressedData.Select(x => x.ToString()).ToArray());



//var caca = output.Skip(3050).Take(100).ToArray();
//var test = output.Select((x, i) => new { i = i, packet = x }).Where((x) => x.packet.PacketInfo.Id == 150).ToList();

return output.ToArray();
}
}
Expand Down
61,392 changes: 11,872 additions & 49,520 deletions ClientPacketSniffer/WiresharkArrayC.cs

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions Database/System/Items/Common/39001-骑术.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Name":"RidingBook",
"Id":39001,
"MaxDura": 1,
"NeedLevel": 1,
"SalePrice": 500,
"AdditionalSkill": 4587,
"AdquireMount": 2,
"CanSold": true,
"ValuableObjects": true,
"Type": "技能书籍",
"NeedRace": "通用",
"PersistType": "堆叠",
"StoreType": "杂货"
}
16 changes: 8 additions & 8 deletions Database/System/Items/EquipmentStats/勋章.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
{
"StatId": 2001,
"Probability": 100,
"StatDescription": "最大攻击+1"
"StatDescription": "MaxDC+1"
},
{
"StatId": 2011,
"Probability": 10,
"StatDescription": "最大攻击+2"
"StatDescription": "MaxDC+2"
},
{
"StatId": 2021,
"Probability": 2,
"StatDescription": "最大攻击+3"
"StatDescription": "MaxDC+3"
},
{
"StatId": 2031,
"StatDescription": "最大攻击+4"
"StatDescription": "MaxDC+4"
},
{
"StatId": 3001,
Expand All @@ -62,21 +62,21 @@
{
"StatId": 4001,
"Probability": 100,
"StatDescription": "最大魔法+1"
"StatDescription": "MaxMC+1"
},
{
"StatId": 4011,
"Probability": 10,
"StatDescription": "最大魔法+2"
"StatDescription": "MaxMC+2"
},
{
"StatId": 4021,
"Probability": 2,
"StatDescription": "最大魔法+3"
"StatDescription": "MaxMC+3"
},
{
"StatId": 4031,
"StatDescription": "最大魔法+4"
"StatDescription": "MaxMC+4"
},
{
"StatId": 5001,
Expand Down
16 changes: 8 additions & 8 deletions Database/System/Items/EquipmentStats/头盔.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
{
"StatId": 2001,
"Probability": 100,
"StatDescription": "最大攻击+1"
"StatDescription": "MaxDC+1"
},
{
"StatId": 2011,
"Probability": 10,
"StatDescription": "最大攻击+2"
"StatDescription": "MaxDC+2"
},
{
"StatId": 2021,
"Probability": 2,
"StatDescription": "最大攻击+3"
"StatDescription": "MaxDC+3"
},
{
"StatId": 2031,
"StatDescription": "最大攻击+4"
"StatDescription": "MaxDC+4"
},
{
"StatId": 3001,
Expand All @@ -60,21 +60,21 @@
{
"StatId": 4001,
"Probability": 100,
"StatDescription": "最大魔法+1"
"StatDescription": "MaxMC+1"
},
{
"StatId": 4011,
"Probability": 10,
"StatDescription": "最大魔法+2"
"StatDescription": "MaxMC+2"
},
{
"StatId": 4021,
"Probability": 2,
"StatDescription": "最大魔法+3"
"StatDescription": "MaxMC+3"
},
{
"StatId": 4031,
"StatDescription": "最大魔法+4"
"StatDescription": "MaxMC+4"
},
{
"StatId": 5001,
Expand Down
16 changes: 8 additions & 8 deletions Database/System/Items/EquipmentStats/戒指.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
{
"StatId": 2001,
"Probability": 100,
"StatDescription": "最大攻击+1"
"StatDescription": "MaxDC+1"
},
{
"StatId": 2011,
"Probability": 10,
"StatDescription": "最大攻击+2"
"StatDescription": "MaxDC+2"
},
{
"StatId": 2021,
"Probability": 2,
"StatDescription": "最大攻击+3"
"StatDescription": "MaxDC+3"
},
{
"StatId": 2031,
"StatDescription": "最大攻击+4"
"StatDescription": "MaxDC+4"
},
{
"StatId": 3001,
Expand All @@ -64,21 +64,21 @@
{
"StatId": 4001,
"Probability": 100,
"StatDescription": "最大魔法+1"
"StatDescription": "MaxMC+1"
},
{
"StatId": 4011,
"Probability": 10,
"StatDescription": "最大魔法+2"
"StatDescription": "MaxMC+2"
},
{
"StatId": 4021,
"Probability": 2,
"StatDescription": "最大魔法+3"
"StatDescription": "MaxMC+3"
},
{
"StatId": 4031,
"StatDescription": "最大魔法+4"
"StatDescription": "MaxMC+4"
},
{
"StatId": 5001,
Expand Down
16 changes: 8 additions & 8 deletions Database/System/Items/EquipmentStats/手镯.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
{
"StatId": 2001,
"Probability": 100,
"StatDescription": "最大攻击+1"
"StatDescription": "MaxDC+1"
},
{
"StatId": 2011,
"Probability": 12,
"StatDescription": "最大攻击+2"
"StatDescription": "MaxDC+2"
},
{
"StatId": 2021,
"Probability": 3,
"StatDescription": "最大攻击+3"
"StatDescription": "MaxDC+3"
},
{
"StatId": 2031,
"Probability": 1,
"StatDescription": "最大攻击+4"
"StatDescription": "MaxDC+4"
},
{
"StatId": 3001,
Expand All @@ -66,22 +66,22 @@
{
"StatId": 4001,
"Probability": 100,
"StatDescription": "最大魔法+1"
"StatDescription": "MaxMC+1"
},
{
"StatId": 4011,
"Probability": 12,
"StatDescription": "最大魔法+2"
"StatDescription": "MaxMC+2"
},
{
"StatId": 4021,
"Probability": 3,
"StatDescription": "最大魔法+3"
"StatDescription": "MaxMC+3"
},
{
"StatId": 4031,
"Probability": 1,
"StatDescription": "最大魔法+4"
"StatDescription": "MaxMC+4"
},
{
"StatId": 5001,
Expand Down
16 changes: 8 additions & 8 deletions Database/System/Items/EquipmentStats/护肩.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
{
"StatId": 2001,
"Probability": 100,
"StatDescription": "最大攻击+1"
"StatDescription": "MaxDC+1"
},
{
"StatId": 2011,
"Probability": 10,
"StatDescription": "最大攻击+2"
"StatDescription": "MaxDC+2"
},
{
"StatId": 2021,
"Probability": 2,
"StatDescription": "最大攻击+3"
"StatDescription": "MaxDC+3"
},
{
"StatId": 2031,
"StatDescription": "最大攻击+4"
"StatDescription": "MaxDC+4"
},
{
"StatId": 3001,
Expand All @@ -58,21 +58,21 @@
{
"StatId": 4001,
"Probability": 100,
"StatDescription": "最大魔法+1"
"StatDescription": "MaxMC+1"
},
{
"StatId": 4011,
"Probability": 10,
"StatDescription": "最大魔法+2"
"StatDescription": "MaxMC+2"
},
{
"StatId": 4021,
"Probability": 2,
"StatDescription": "最大魔法+3"
"StatDescription": "MaxMC+3"
},
{
"StatId": 4031,
"StatDescription": "最大魔法+4"
"StatDescription": "MaxMC+4"
},
{
"StatId": 5001,
Expand Down
Loading

0 comments on commit 0a9b642

Please sign in to comment.