add late-player catchup thingy

This commit is contained in:
Mister_Nebula 2021-03-29 23:41:12 +01:00
parent 67f278aa87
commit a48bbb8774
2 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,9 @@ namespace QSB.CampfireSync.WorldObjects
.GetMethod("StartRoasting", BindingFlags.NonPublic | BindingFlags.Instance)
.Invoke(AttachedObject, null);
public Campfire.State GetState()
=> AttachedObject.GetState();
public void SetState(Campfire.State newState)
=> AttachedObject.SetState(newState);
}

View File

@ -1,4 +1,5 @@
using OWML.Utils;
using QSB.CampfireSync.WorldObjects;
using QSB.Events;
using QSB.Messaging;
using QSB.QuantumSync;
@ -81,6 +82,11 @@ namespace QSB.Player.Events
{
QSBEventManager.FireEvent(EventNames.QSBQuantumAuthority, i, list[i].ControllingPlayer);
}
foreach (var campfire in QSBWorldSync.GetWorldObjects<QSBCampfire>())
{
QSBEventManager.FireEvent(EventNames.QSBCampfireState, campfire.ObjectId, campfire.GetState());
}
}
}
}