mm
This commit is contained in:
@@ -46,16 +46,10 @@ namespace BoneSync.Sync.Components
|
|||||||
{
|
{
|
||||||
SyncLogger.Msg("Setting owner for " + _syncId + " to " + ownerId);
|
SyncLogger.Msg("Setting owner for " + _syncId + " to " + ownerId);
|
||||||
_ownerId = ownerId;
|
_ownerId = ownerId;
|
||||||
if (!isOwner)
|
|
||||||
{
|
|
||||||
_simpleEventQueue.Clear();
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
TryCatchUpSimpleEvents();
|
|
||||||
}
|
|
||||||
FindAndUpdateComponents();
|
FindAndUpdateComponents();
|
||||||
MelonCoroutines.Start(SyncCoroutineAsync());
|
MelonCoroutines.Start(SyncCoroutineAsync());
|
||||||
UpdateKinematic();
|
UpdateKinematic();
|
||||||
|
TryCatchUpSimpleEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ClientSpawningAllowed()
|
public bool ClientSpawningAllowed()
|
||||||
@@ -149,6 +143,11 @@ namespace BoneSync.Sync.Components
|
|||||||
|
|
||||||
private void TryCatchUpSimpleEvents()
|
private void TryCatchUpSimpleEvents()
|
||||||
{
|
{
|
||||||
|
if (Registered && !isOwner)
|
||||||
|
{
|
||||||
|
_simpleEventQueue.Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (_simpleEventQueue.Count > 0 && Registered && isOwner)
|
if (_simpleEventQueue.Count > 0 && Registered && isOwner)
|
||||||
{
|
{
|
||||||
byte[] eventData = _simpleEventQueue.Dequeue();
|
byte[] eventData = _simpleEventQueue.Dequeue();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace BoneSync.Sync.Components
|
|||||||
byte index = (byte)Array.IndexOf(buttonToggles, toggle);
|
byte index = (byte)Array.IndexOf(buttonToggles, toggle);
|
||||||
RegisterSyncable();
|
RegisterSyncable();
|
||||||
if (!isOwner && Registered) return false;
|
if (!isOwner && Registered) return false;
|
||||||
AddSimpleEventToQueue(eventType, index);
|
AddSimpleEventToQueue(eventType, index, (byte)buttonToggles.Length);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool ButtonOnPress(ButtonToggle toggle)
|
bool ButtonOnPress(ButtonToggle toggle)
|
||||||
|
|||||||
Reference in New Issue
Block a user