This commit is contained in:
2025-12-13 20:21:25 +01:00
parent 0f8f3ce818
commit a2d87106ba
4 changed files with 96 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ namespace KCM.Packets.Game
public override void HandlePacketServer()
{
//throw new NotImplementedException();
// Server relay is handled automatically by PacketHandler unless [NoServerRelay] is used.
}
}
}

View File

@@ -15,6 +15,14 @@ namespace KCM.Packets.Handlers
{
public class PacketHandler
{
[ThreadStatic]
private static bool isHandlingPacket;
public static bool IsHandlingPacket
{
get { return isHandlingPacket; }
}
public static Dictionary<ushort, PacketRef> Packets = new Dictionary<ushort, PacketRef>();
public class PacketRef
{
@@ -183,6 +191,7 @@ namespace KCM.Packets.Handlers
{
try
{
isHandlingPacket = true;
packet.HandlePacketClient();
}
catch (Exception ex)
@@ -205,6 +214,10 @@ namespace KCM.Packets.Handlers
Main.helper.Log(ex.InnerException.StackTrace);
}
}
finally
{
isHandlingPacket = false;
}
}
/* if (PacketHandlers.TryGetValue(id, out PacketHandlerDelegate handler))

View File

@@ -25,6 +25,7 @@ namespace KCM.Packets.Lobby
try
{
int desiredSpeed = 1;
if (!LobbyManager.loadingSave)
{
SpeedControlUI.inst.SetSpeed(0);
@@ -39,12 +40,13 @@ namespace KCM.Packets.Lobby
Main.helper.Log(ex.ToString());
}
SpeedControlUI.inst.SetSpeed(0);
SpeedControlUI.inst.SetSpeed(desiredSpeed);
}
else
{
LobbyManager.loadingSave = false;
GameState.inst.SetNewMode(GameState.inst.playingMode);
SpeedControlUI.inst.SetSpeed(desiredSpeed);
}
}
catch (Exception ex)