refactor: channel response test packet

This commit is contained in:
Timothy Schenk 2023-11-13 21:16:02 +01:00
parent 98aa813f65
commit a9f382963b

View file

@ -71,39 +71,44 @@ public class ChannelSelectionHandler : IPacketHandler<ChannelSelectionPacket>
} }
else else
{ {
responsePacket = new ChannelSelectionResponsePacket responsePacket = CreateTestChannelSelectionResponsePacket();
{
ChannelIsFullFlag = 0,
Endpoint = "127.0.0.1",
Port = 12345,
Characters = new[]
{
new CharacterData
{
Name = "Test243",
Job = new JobData { FirstJob = 1, SecondJob = 0, ThirdJob = 0, FourthJob = 0 },
Gender = Gender.None,
Level = ushort.MaxValue - 1,
Experience = 255,
Stats = new BaseStats
{
Strength = 5,
Dexterity = 5,
Intelligence = 5,
Vitality = 5,
Luck = 5,
Wisdom = 5
},
Health = int.MaxValue - 1,
Mana = int.MaxValue - 1,
EquippedItems = Enumerable.Repeat((ushort)25, 20).ToArray(),
EquippedCashItems = Enumerable.Repeat((ushort)25, 20).ToArray()
},
},
};
} }
authSession.Send(responsePacket); authSession.Send(responsePacket);
return Task.CompletedTask; return Task.CompletedTask;
} }
private static ChannelSelectionResponsePacket CreateTestChannelSelectionResponsePacket()
{
return new ChannelSelectionResponsePacket
{
ChannelIsFullFlag = 0,
Endpoint = "127.0.0.1",
Port = 12345,
Characters = new[]
{
new CharacterData
{
Name = "Test243",
Job = new JobData { FirstJob = 1, SecondJob = 0, ThirdJob = 0, FourthJob = 0 },
Gender = Gender.None,
Level = ushort.MaxValue - 1,
Experience = 255,
Stats = new BaseStats
{
Strength = 5,
Dexterity = 5,
Intelligence = 5,
Vitality = 5,
Luck = 5,
Wisdom = 5
},
Health = int.MaxValue - 1,
Mana = int.MaxValue - 1,
EquippedItems = Enumerable.Repeat((ushort)25, 20).ToArray(),
EquippedCashItems = Enumerable.Repeat((ushort)25, 20).ToArray()
},
},
};
}
} }