-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
charselect, enterworld, system messages
- Loading branch information
Showing
21 changed files
with
204 additions
and
175 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
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
7 changes: 7 additions & 0 deletions
7
...Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/Auth/EnterWorldPacket.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,7 @@ | ||
public class EnterWorldPacket : ClientPacket | ||
{ | ||
public EnterWorldPacket() : base((byte)GameClientPacketType.EnterWorld) | ||
{ | ||
BuildPacket(); | ||
} | ||
} |
File renamed without changes.
6 changes: 0 additions & 6 deletions
6
.../Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/Auth/LoadWorldPacket.cs
This file was deleted.
Oops, something went wrong.
12 changes: 10 additions & 2 deletions
12
.../Networking/ClientLibrary/Packet/Gameserver/ClientPackets/Auth/RequestCharSelectPacket.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,6 +1,14 @@ | ||
public class RequestCharSelectPacket : ClientPacket { | ||
public RequestCharSelectPacket(int slot) : base((byte)GameClientPacketType.RequestCharSelect) { | ||
public class RequestCharSelectPacket : ClientPacket | ||
{ | ||
public RequestCharSelectPacket(int slot) : base((byte)GameClientPacketType.RequestCharSelect) | ||
{ | ||
WriteB((byte)slot); | ||
WriteB(0); | ||
WriteB(0); | ||
WriteI(0); | ||
WriteI(0); | ||
WriteI(0); | ||
WriteI(0); | ||
BuildPacket(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
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
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
137 changes: 137 additions & 0 deletions
137
...ripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/Auth/CharSelectedPacket.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,137 @@ | ||
using UnityEngine; | ||
using System; | ||
|
||
public class CharSelectedPacket : ServerPacket | ||
{ | ||
public struct PlayerInfo | ||
{ | ||
public NetworkIdentity Identity { get; set; } | ||
public PlayerStatus Status { get; set; } | ||
public PlayerStats Stats { get; set; } | ||
public PlayerAppearance Appearance { get; set; } | ||
public bool Running { get; set; } | ||
} | ||
|
||
private PlayerInfo _info; | ||
public PlayerInfo PacketPlayerInfo { get { return _info; } } | ||
|
||
|
||
public CharSelectedPacket(byte[] d) : base(d) | ||
{ | ||
_info = new PlayerInfo(); | ||
_info.Identity = new NetworkIdentity(); | ||
_info.Status = new PlayerStatus(); | ||
_info.Stats = new PlayerStats(); | ||
_info.Appearance = new PlayerAppearance(); | ||
_info.Appearance = new PlayerAppearance(); | ||
Parse(); | ||
} | ||
|
||
public override void Parse() | ||
{ | ||
try | ||
{ | ||
_info.Identity.Name = ReadS(); | ||
_info.Identity.Id = ReadI(); | ||
_info.Identity.Title = ReadS(); | ||
ReadI(); //sessionId | ||
ReadI(); //clanId | ||
|
||
ReadI(); | ||
|
||
_info.Appearance.Sex = (byte)ReadI(); | ||
_info.Appearance.Race = (byte)ReadI(); | ||
_info.Identity.PlayerClass = (byte)ReadI(); | ||
|
||
ReadI(); | ||
|
||
_info.Identity.SetPosZ(ReadI() / 52.5f); | ||
_info.Identity.SetPosX(ReadI() / 52.5f); | ||
_info.Identity.SetPosY(ReadI() / 52.5f); | ||
_info.Status.Hp = (int)ReadD(); | ||
_info.Status.Mp = (int)ReadD(); | ||
_info.Stats.Sp = ReadI(); | ||
_info.Stats.Exp = (int)ReadL(); | ||
_info.Stats.Level = ReadI(); | ||
_info.Stats.Karma = ReadI(); | ||
_info.Stats.PkKills = ReadI(); | ||
_info.Stats.Int = ReadB(); | ||
_info.Stats.Str = ReadB(); | ||
_info.Stats.Con = ReadB(); | ||
_info.Stats.Men = ReadB(); | ||
_info.Stats.Dex = ReadB(); | ||
_info.Stats.Wit = ReadB(); | ||
|
||
for (int i = 0; i < 30; i++) | ||
{ | ||
ReadI(); | ||
} | ||
|
||
ReadI(); | ||
ReadI(); | ||
|
||
ReadI(); //Game time | ||
|
||
ReadI(); | ||
|
||
_info.Identity.PlayerClass = (byte)ReadI(); | ||
_info.Identity.IsMage = CharacterClassParser.IsMage((CharacterClass)_info.Identity.PlayerClass); | ||
// _info.Identity.Heading = ReadF(); | ||
_info.Identity.Owned = true; | ||
|
||
ReadI(); | ||
ReadI(); | ||
ReadI(); | ||
ReadI(); | ||
|
||
|
||
// // Status | ||
// _info.Stats.MaxHp = ReadI(); | ||
// _info.Stats.MaxMp = ReadI(); | ||
// _info.Status.Cp = ReadI(); | ||
// _info.Stats.MaxCp = ReadI(); | ||
// // Combat | ||
// _info.Stats.RunSpeed = ReadI(); | ||
// _info.Stats.WalkSpeed = ReadI(); | ||
// _info.Stats.PAtkSpd = ReadI(); | ||
// _info.Stats.MAtkSpd = ReadI(); | ||
// _info.Stats.AttackRange = ReadF(); | ||
// _info.Stats.PAtk = ReadI(); | ||
// _info.Stats.PDef = ReadI(); | ||
// _info.Stats.PEvasion = ReadI(); | ||
// _info.Stats.PAccuracy = ReadI(); | ||
// _info.Stats.MEvasion = ReadI(); | ||
// _info.Stats.MAccuracy = ReadI(); | ||
// _info.Stats.PCritical = ReadI(); | ||
// _info.Stats.MCritical = ReadI(); | ||
// _info.Stats.MAtk = ReadI(); | ||
// _info.Stats.MDef = ReadI(); | ||
// // Stats | ||
// _info.Stats.MaxExp = ReadI(); | ||
// _info.Stats.CurrWeight = ReadI(); | ||
// _info.Stats.MaxWeight = ReadI(); | ||
// // Social | ||
// _info.Stats.PvpKills = ReadI(); | ||
// _info.Status.PvpFlag = ReadL(); | ||
// // Appearance | ||
// _info.Appearance.CollisionHeight = ReadF(); | ||
// _info.Appearance.CollisionRadius = ReadF(); | ||
// _info.Appearance.Face = ReadB(); | ||
// _info.Appearance.HairStyle = ReadB(); | ||
// _info.Appearance.HairColor = ReadB(); | ||
// // Gear | ||
// _info.Appearance.LHand = ReadI(); | ||
// _info.Appearance.RHand = ReadI(); | ||
// _info.Appearance.Chest = ReadI(); | ||
// _info.Appearance.Legs = ReadI(); | ||
// _info.Appearance.Gloves = ReadI(); | ||
// _info.Appearance.Feet = ReadI(); | ||
|
||
// _info.Running = ReadI() == 1; | ||
} | ||
catch (Exception e) | ||
{ | ||
Debug.LogError(e); | ||
} | ||
} | ||
} |
File renamed without changes.
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.