This commit is contained in:
2025-12-14 01:45:02 +01:00
parent 60d509344c
commit f03e13236f
30 changed files with 260 additions and 2480 deletions

View File

@@ -1,9 +1,8 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace KCM.Packets.Game
{
@@ -12,30 +11,18 @@ namespace KCM.Packets.Game
public override ushort packetId => (int)Enums.Packets.SetSpeed;
public int speed { get; set; }
public bool isPaused { get; set; }
public override void HandlePacketClient()
{
if (clientId == KCClient.client.Id) // Prevent speed softlock
return;
try
{
Main.helper.Log($"Received SetSpeed packet: speed={speed}, isPaused={isPaused}");
// Simply apply the speed - SpeedControlUISetSpeedHook will handle this correctly
// since we're coming from a packet (PacketHandler.IsHandlingPacket will be true)
SpeedControlUI.inst.SetSpeed(speed);
}
catch (Exception e)
{
Main.helper.Log("Error handling SetSpeed packet: " + e.Message);
}
SpeedControlUI.inst.SetSpeed(speed);
}
public override void HandlePacketServer()
{
// Server relay is handled automatically by PacketHandler unless [NoServerRelay] is used.
//throw new NotImplementedException();
}
}
}