Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
baughj committed May 5, 2024
2 parents 6a97dac + 402d0fb commit 5f0e9f4
Showing 1 changed file with 19 additions and 41 deletions.
60 changes: 19 additions & 41 deletions hybrasyl/Packet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,10 @@ public ClientPacket(byte[] buffer)
}
}

public override EncryptMethod EncryptMethod
public override EncryptMethod EncryptMethod
{
get
{
var opcode = Opcode;
switch (Opcode)
{
case 0x00:
Expand Down Expand Up @@ -652,44 +651,25 @@ public override EncryptMethod EncryptMethod
{
get
{
var opcode = Opcode;
if (opcode <= 0x56)
{
if (opcode <= 0x0A)
switch (opcode)
{
case 0x00:
case 0x03:
break;
case 0x01:
case 0x02:
return EncryptMethod.Normal;
default:
return opcode != 0x0A ? EncryptMethod.MD5Key : EncryptMethod.Normal;
}
else if (opcode != 0x40) return opcode != 0x56 ? EncryptMethod.MD5Key : EncryptMethod.Normal;
}
else if (opcode <= 0x66)
{
switch (opcode)
{
case 0x60:
case 0x62:
return EncryptMethod.Normal;
case 0x63:
return EncryptMethod.MD5Key;
default:
return opcode != 0x66 ? EncryptMethod.MD5Key : EncryptMethod.Normal;
}
}
else
switch (Opcode)
{
if (opcode == 0x6F) return EncryptMethod.Normal;
if (opcode != 0x7E) return EncryptMethod.MD5Key;
case 0x00:
case 0x03:
case 0x40:
case 0x7E:
return EncryptMethod.None;
case 0x01:
case 0x02:
case 0x0A:
case 0x56:
case 0x60:
case 0x62:
case 0x66:
case 0x6F:
return EncryptMethod.Normal;
default:
return EncryptMethod.MD5Key;
}

//if (opcode == 0x1a) return EncryptMethod.Normal;
return EncryptMethod.None;
}
}

Expand Down Expand Up @@ -848,6 +828,4 @@ public ServerPacket Clone()
var f = ToArray();
return new ServerPacket(f);
}


}
}

0 comments on commit 5f0e9f4

Please sign in to comment.