Closed dounai2333 closed 5 months ago
I have done it by myself. I'll leave this issue open so you may consider to add this feature in future.
[HarmonyPatch(typeof(ShipBuildModeManager), "StoreShipObjectClientRpc")]
[HarmonyPostfix]
private static void StoreShipObjectClientRpcPostfix(int unlockableID)
{
UnlockableItem unlockableItem = StartOfRound.Instance.unlockablesList.unlockables[unlockableID];
if (unlockableItem.inStorage && unlockableItem.unlockableName == "Television" && TVIndex != 0)
{
if (ConfigManager.enableLogging.Value) { BestestTVModPlugin.Log.LogInfo("Resetting play sequence..."); }
SetTVIndex();
}
}
I will implement this into the next version but as a config option like so:
[HarmonyPatch(typeof(ShipBuildModeManager), "StoreShipObjectClientRpc")]
[HarmonyPostfix]
private static void StoreShipObjectClientRpcPostfix(int unlockableID)
{
if (ConfigManager.storingResets.Value)
{
UnlockableItem unlockableItem = StartOfRound.Instance.unlockablesList.unlockables[unlockableID];
if (unlockableItem.inStorage && unlockableItem.unlockableName == "Television" && TVIndex != 0)
{
if (ConfigManager.enableLogging.Value) { BestestTVModPlugin.Log.LogInfo("Resetting play sequence..."); }
SetTVIndex();
}
}
}
Thanks for posting the issue and the solution!
Since the current mod didn't support RPC even if all the players share the same video contents, and if there is any late-join player, his play sequence will desync with current players. So the idea is: When TV has been stored (Aim to TV, press B and press X), everyone got their play sequence reset to default, so all the players can enjoy same video at same time.