start improving message sending system (60%)

This commit is contained in:
Gurge44 committed 2026-05-09 13:45:32 +02:00
1 parent 9d8cbf3746
commit b14b491c0a
41 files changed
+402 -196

No files matched your search

@@ -169,4 +169,4 @@ public abstract class GameOptionsSender
protected static bool ForceWaitFrame;
#endregion
}
}
@@ -38,7 +38,7 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
}
}
public static void SendImmediately(byte playerId)
public static void ForceSendImmediately(byte playerId)
{
for (var index = 0; index < AllSenders.Count; index++)
{
@@ -54,6 +54,22 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
}
}
public static void SendAllImmediately()
{
ForceWaitFrame = true;
for (var index = 0; index < AllSenders.Count; index++)
{
GameOptionsSender allSender = AllSenders[index];
if (allSender is PlayerGameOptionsSender { IsDirty: true } sender)
{
sender.SendGameOptions();
sender.IsDirty = false;
}
}
}
public static void SetDirtyToAll()
{
for (var index = 0; index < AllSenders.Count; index++)
@@ -106,11 +122,11 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
IsDirty = true;
}
protected override void SendGameOptions()
{
if (player.AmOwner)
{
IGameOptions opt = BuildGameOptions();
protected override void SendGameOptions()
{
if (player.AmOwner)
{
IGameOptions opt = BuildGameOptions();
if (GameManager.Instance?.LogicComponents != null)
{
@@ -127,11 +143,11 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
base.SendGameOptions();
}
protected override IEnumerator SendGameOptionsAsync()
{
if (player.AmOwner)
{
IGameOptions opt = BuildGameOptions();
protected override IEnumerator SendGameOptionsAsync()
{
if (player.AmOwner)
{
IGameOptions opt = BuildGameOptions();
if (GameManager.Instance?.LogicComponents != null)
{