Merge branch 'main' of https://git.devbeni.lol/devbeni/K-C-Multiplayer
This commit is contained in:
@@ -81,7 +81,7 @@ namespace KCM.Packets.Game
|
||||
|
||||
public override void HandlePacketServer()
|
||||
{
|
||||
// Server doesn't need to handle this packet
|
||||
// Server relay is handled automatically by PacketHandler unless [NoServerRelay] is used.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -117,6 +117,14 @@ namespace KCM.Packets.Lobby
|
||||
{
|
||||
Main.SetMultiplayerSaveLoadInProgress(false);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
RunPostLoadRebuild("Save transfer complete");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
Broadcast.OnLoadedEvent.Broadcast(new OnLoadedEvent());
|
||||
|
||||
try
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace KCM.Packets.Lobby
|
||||
|
||||
try
|
||||
{
|
||||
int desiredSpeed = 1;
|
||||
if (!LobbyManager.loadingSave)
|
||||
{
|
||||
SpeedControlUI.inst.SetSpeed(0);
|
||||
@@ -39,31 +40,13 @@ namespace KCM.Packets.Lobby
|
||||
Main.helper.Log(ex.ToString());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
GameState.inst.SetNewMode(GameState.inst.playingMode);
|
||||
Main.helper.Log("StartGame: forced playing mode");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Main.helper.Log("StartGame: failed forcing playing mode");
|
||||
Main.helper.Log(ex.ToString());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Main.RunPostLoadRebuild("StartGame");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user