Skip to content

Commit

Permalink
Fixed length of GuildInfoRequest; Version 0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Dec 6, 2024
1 parent 10f0433 commit 164bdb7
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/Packets/C1-66-GuildInfoRequest_by-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ The server sends a response which includes the guild name and emblem.
| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 6 | Packet header - length of the packet |
| 1 | 1 | Byte | 8 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x66 | Packet header - packet type identifier |
| 4 | 4 | IntegerLittleEndian | | GuildId |
4 changes: 2 additions & 2 deletions src/Network/MUnique.OpenMU.Network.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
MUnique.OpenMU.Network contains all what's required to connect from and to a MU Online game, connect or chat server. It implements the MU Online network protocol.
It also contains several the encryption algorithms and keys which were used until a few years ago up to Season 6 Episode 3.
</Description>
<PackageVersion>0.9.0</PackageVersion>
<Version>0.9.0</Version>
<PackageVersion>0.9.3</PackageVersion>
<Version>0.9.3</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12021,7 +12021,7 @@ private GuildInfoRequest(Memory<byte> data, bool initialize)
/// <summary>
/// Gets the initial length of this data packet. When the size is dynamic, this value may be bigger than actually needed.
/// </summary>
public static int Length => 6;
public static int Length => 8;

/// <summary>
/// Gets the header of this packet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@
<HeaderType>C1Header</HeaderType>
<Code>66</Code>
<Name>GuildInfoRequest</Name>
<Length>6</Length>
<Length>8</Length>
<Direction>ClientToServer</Direction>
<SentWhen>A player gets another player into view range which is in a guild, and the guild identifier is unknown (=not cached yet by previous requests) to him.</SentWhen>
<CausedReaction>The server sends a response which includes the guild name and emblem.</CausedReaction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11896,7 +11896,7 @@ private GuildInfoRequestRef(Span<byte> data, bool initialize)
/// <summary>
/// Gets the initial length of this data packet. When the size is dynamic, this value may be bigger than actually needed.
/// </summary>
public static int Length => 6;
public static int Length => 8;

/// <summary>
/// Gets the header of this packet.
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Packets/MUnique.OpenMU.Network.Packets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<PackageTags>MUnique OpenMU MUOnline Network Packets</PackageTags>
<PackageId>MUnique.OpenMU.Network.Packets</PackageId>
<Description>This package contains message structs for the MMORPG "MU Online", which are primarily focused on the english version of Season 6 Episode 3.</Description>
<PackageVersion>0.9.0</PackageVersion>
<Version>0.9.0</Version>
<PackageVersion>0.9.3</PackageVersion>
<Version>0.9.3</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
44 changes: 44 additions & 0 deletions src/Network/Packets/ServerToClient/ConnectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,50 @@ int WritePacket()
await connection.SendAsync(WritePacket).ConfigureAwait(false);
}

/// <summary>
/// Sends a <see cref="ObjectWalkedExtended" /> to this connection.
/// </summary>
/// <param name="connection">The connection.</param>
/// <param name="headerCode">The header code.</param>
/// <param name="objectId">The object id.</param>
/// <param name="sourceX">The source x.</param>
/// <param name="sourceY">The source y.</param>
/// <param name="targetX">The target x.</param>
/// <param name="targetY">The target y.</param>
/// <param name="targetRotation">The target rotation.</param>
/// <param name="stepCount">The step count.</param>
/// <param name="stepData">The step data.</param>
/// <remarks>
/// Is sent by the server when: An object in the observed scope (including the own player) walked to another position.
/// Causes reaction on client side: The object is animated to walk to the new position.
/// </remarks>
public static async ValueTask SendObjectWalkedExtendedAsync(this IConnection? connection, byte @headerCode, ushort @objectId, byte @sourceX, byte @sourceY, byte @targetX, byte @targetY, byte @targetRotation, byte @stepCount, Memory<byte> @stepData)
{
if (connection is null)
{
return;
}

int WritePacket()
{
var length = ObjectWalkedExtendedRef.GetRequiredSize(stepData.Length);
var packet = new ObjectWalkedExtendedRef(connection.Output.GetSpan(length)[..length]);
packet.HeaderCode = @headerCode;
packet.ObjectId = @objectId;
packet.SourceX = @sourceX;
packet.SourceY = @sourceY;
packet.TargetX = @targetX;
packet.TargetY = @targetY;
packet.TargetRotation = @targetRotation;
packet.StepCount = @stepCount;
@stepData.Span.CopyTo(packet.StepData);

return packet.Header.Length;
}

await connection.SendAsync(WritePacket).ConfigureAwait(false);
}

/// <summary>
/// Sends a <see cref="ObjectWalked075" /> to this connection.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/PlugIns/MUnique.OpenMU.PlugIns.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<Description>
MUnique.OpenMU.PlugIns contains all what's required to create plugins extension points and own plugins for dependent applications.
</Description>
<PackageVersion>0.9.0</PackageVersion>
<Version>0.9.0</Version>
<PackageVersion>0.9.3</PackageVersion>
<Version>0.9.3</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
4 changes: 2 additions & 2 deletions src/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.9.2.0")]
[assembly: AssemblyFileVersion("0.9.2.0")]
[assembly: AssemblyVersion("0.9.3.0")]
[assembly: AssemblyFileVersion("0.9.3.0")]

0 comments on commit 164bdb7

Please sign in to comment.