-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gameserver authentication: protocolversion+key packets
- Loading branch information
Showing
20 changed files
with
244 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/PingPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
public class PingPacket : ClientPacket { | ||
public PingPacket() : base((byte)GameClientPacketType.Ping) { | ||
SetData(new byte[] { (byte)GameClientPacketType.Ping, 0x02}); | ||
BuildPacket(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/ProtocolVersionPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class ProtocolVersionPacket : ClientPacket | ||
{ | ||
public ProtocolVersionPacket(int version) : base((byte)GameClientPacketType.ProtocolVersion) { | ||
WriteI(version); | ||
|
||
BuildPacket(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...r/ServerPackets/AuhRespondePacket.cs.meta → ...ientPackets/ProtocolVersionPacket.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 11 additions & 10 deletions
21
l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameClientPacketType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
public enum GameClientPacketType : byte | ||
{ | ||
Ping = 0x00, | ||
AuthRequest = 0x01, | ||
SendMessage = 0x02, | ||
RequestMove = 0x03, | ||
LoadWorld = 0x04, | ||
RequestRotate = 0x05, | ||
RequestAnim = 0x06, | ||
RequestAttack = 0x07, | ||
RequestMoveDirection = 0x08, | ||
RequestSetTarget = 0x09, | ||
RequestAutoAttack = 0x0A | ||
ProtocolVersion = 0x01, | ||
AuthRequest = 0x02, | ||
SendMessage = 0x03, | ||
RequestMove = 0x04, | ||
LoadWorld = 0x05, | ||
RequestRotate = 0x06, | ||
RequestAnim = 0x07, | ||
RequestAttack = 0x08, | ||
RequestMoveDirection = 0x09, | ||
RequestSetTarget = 0x0A, | ||
RequestAutoAttack = 0x0B | ||
} |
39 changes: 20 additions & 19 deletions
39
l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameServerPacketType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
public enum GameServerPacketType : byte | ||
{ | ||
Ping = 0, | ||
AuthResponse = 1, | ||
MessagePacket = 2, | ||
SystemMessage = 3, | ||
PlayerInfo = 4, | ||
ObjectPosition = 5, | ||
RemoveObject = 6, | ||
ObjectRotation = 7, | ||
ObjectAnimation = 8, | ||
ApplyDamage = 9, | ||
NpcInfo = 0x0A, | ||
ObjectMoveTo = 0x0B, | ||
UserInfo = 0x0C, | ||
ObjectMoveDirection = 0x0D, | ||
GameTime = 0x0E, | ||
EntitySetTarget = 0x0F, | ||
AutoAttackStart = 0x10, | ||
AutoAttackStop = 0x11, | ||
ActionFailed = 0x12 | ||
Ping = 0x00, | ||
Key = 0x01, | ||
CharSelectionInfo = 0x02, | ||
MessagePacket = 0x03, | ||
SystemMessage = 0x04, | ||
PlayerInfo = 0x05, | ||
ObjectPosition = 0x06, | ||
RemoveObject = 0x07, | ||
ObjectRotation = 0x08, | ||
ObjectAnimation = 0x09, | ||
ApplyDamage = 0x0A, | ||
NpcInfo = 0x0B, | ||
ObjectMoveTo = 0x0C, | ||
UserInfo = 0x0D, | ||
ObjectMoveDirection = 0x0E, | ||
GameTime = 0x0F, | ||
EntitySetTarget = 0x10, | ||
AutoAttackStart = 0x11, | ||
AutoAttackStop = 0x12, | ||
ActionFailed = 0x13 | ||
} |
24 changes: 0 additions & 24 deletions
24
...ets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/AuhRespondePacket.cs
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...nity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/KeyPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class KeyPacket : ServerPacket { | ||
public byte[] BlowFishKey { get; private set; } | ||
public bool AuthAllowed { get; private set; } | ||
|
||
public KeyPacket(byte[] d) : base(d) { | ||
Parse(); | ||
} | ||
|
||
public override void Parse() { | ||
byte blowFishKeyLength = ReadB(); | ||
BlowFishKey = ReadB(blowFishKeyLength); | ||
AuthAllowed = ReadB() == 1; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/KeyPacket.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.