Skip to content

Commit

Permalink
fix(server): add missing packet handler
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMcAssey committed Jan 12, 2025
1 parent d934c51 commit cff82fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions GLOKON.Baiters.Core/BaitersServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ public void SendPacket(Packet packet, DataChannel channel, ulong? steamId = null

if (steamId.HasValue)
{
Log.Debug("Sending {0} packet on {1} to single player {2}", packet.Type, channel, steamId.Value);
Log.Verbose("Sending {0} packet on {1} to single player {2}", packet.Type, channel, steamId.Value);
SendPacketTo(data, channel, steamId.Value);
}
else
{
Log.Debug("Sending {0} packet on {1} to all players", packet.Type, channel);
Log.Verbose("Sending {0} packet on {1} to all players", packet.Type, channel);
SendPacketTo(data, channel);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using GLOKON.Baiters.Core.Models.Networking;

namespace GLOKON.Baiters.Core.Packets.Handlers
{
internal class ActorAnimationUpdateHandler(BaitersServer server) : IPacketHandler

Check warning on line 5 in GLOKON.Baiters.Core/Packets/Handlers/ActorAnimationUpdateHandler.cs

View workflow job for this annotation

GitHub Actions / build_and_release

Parameter 'server' is unread.

Check warning on line 5 in GLOKON.Baiters.Core/Packets/Handlers/ActorAnimationUpdateHandler.cs

View workflow job for this annotation

GitHub Actions / Build Server (windows-latest, win-x64) / build-server

Parameter 'server' is unread.

Check warning on line 5 in GLOKON.Baiters.Core/Packets/Handlers/ActorAnimationUpdateHandler.cs

View workflow job for this annotation

GitHub Actions / Build Server (ubuntu-latest, linux-x64) / build-server

Parameter 'server' is unread.
{
public void Handle(ulong sender, Packet packet)
{
// TODO: Do we need to do anything?
}
}
}
3 changes: 2 additions & 1 deletion GLOKON.Baiters.Core/Packets/PacketManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public void Setup()
handlers.Add("new_player_join", new NewPlayerJoinHandler(server, options.JoinMessage));
handlers.Add("instance_actor", new InstanceActorHandler(server));
handlers.Add("actor_update", new ActorUpdateHandler(server));
handlers.Add("actor_animation_update", new ActorAnimationUpdateHandler(server));
handlers.Add("request_ping", new RequestPingHandler(server));
handlers.Add("actor_action", new ActorActionHandler(server));
handlers.Add("request_actors", new RequestActorsHandler(server));
Expand All @@ -33,7 +34,7 @@ public void Setup()

private void Server_OnPacket(ulong sender, Packet packet)
{
Log.Debug("Handling packet {0} for {1}", packet.Type, sender);
Log.Verbose("Handling packet {0} for {1}", packet.Type, sender);

if (handlers.TryGetValue(packet.Type, out var handler) && handler != null)
{
Expand Down

0 comments on commit cff82fe

Please sign in to comment.