AAAAAA
This commit is contained in:
@@ -37,7 +37,7 @@ namespace BoneSync.Networking.Messages
|
|||||||
{
|
{
|
||||||
Syncable syncable = ObjectSyncCache.GetSyncable(magazineData.syncId);
|
Syncable syncable = ObjectSyncCache.GetSyncable(magazineData.syncId);
|
||||||
if (!syncable) return;
|
if (!syncable) return;
|
||||||
syncable.ApplyMagazineData(magazineData.magazineData);
|
syncable.ApplyMagazineData(magazineData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,13 +31,6 @@ namespace BoneSync.Patching
|
|||||||
allowPatchedMethodCall = false;
|
allowPatchedMethodCall = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Despawn(Poolee poolee)
|
|
||||||
{
|
|
||||||
allowPatchedMethodCall = true;
|
|
||||||
poolee.Despawn();
|
|
||||||
allowPatchedMethodCall = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Poolee InstantiatePoolee(Pool pool, Vector3 position, Quaternion rotation, Vector3 scale)
|
public static Poolee InstantiatePoolee(Pool pool, Vector3 position, Quaternion rotation, Vector3 scale)
|
||||||
{
|
{
|
||||||
allowPatchedMethodCall = true;
|
allowPatchedMethodCall = true;
|
||||||
|
|||||||
@@ -39,4 +39,13 @@ namespace BoneSync.Patching
|
|||||||
MelonLogger.Msg("Plug exited: " + __instance.transform.GetPath() + " Plug: " + plug.transform.GetPath() + " ID: " + plugId + " Socket ID: " + socketId);
|
MelonLogger.Msg("Plug exited: " + __instance.transform.GetPath() + " Plug: " + plug.transform.GetPath() + " ID: " + plugId + " Socket ID: " + socketId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class PlugPatches
|
||||||
|
{
|
||||||
|
/*[HarmonyPatch(typeof(Plug))]
|
||||||
|
public class PlugPatches
|
||||||
|
{
|
||||||
|
[HarmonyPatch(nameof(Plug.)), HarmonyPostfix]
|
||||||
|
}*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,9 +216,10 @@ namespace BoneSync.Sync.Components
|
|||||||
{
|
{
|
||||||
if (!this) return; // if object is destroyed, don't do anything
|
if (!this) return; // if object is destroyed, don't do anything
|
||||||
bool isRegistered = Registered;
|
bool isRegistered = Registered;
|
||||||
MelonLogger.Msg("Discarding syncable: " + transform.GetPath() + " force: " + force + " isRegistered: " + isRegistered + " despawn: " + despawn);
|
|
||||||
if (isRegistered)
|
if (isRegistered)
|
||||||
{
|
{
|
||||||
|
MelonLogger.Msg("Discarding syncable: " + transform.GetPath() + " force: " + force + " isRegistered: " + isRegistered + " despawn: " + despawn);
|
||||||
//MelonLogger.Warning("Discarding registered syncable: " + transform.GetPath() + " force: " + force);
|
//MelonLogger.Warning("Discarding registered syncable: " + transform.GetPath() + " force: " + force);
|
||||||
|
|
||||||
bool isowner = isOwner;
|
bool isowner = isOwner;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace BoneSync.Sync.Components
|
|||||||
{
|
{
|
||||||
MelonLogger.Msg("Setting owner for " + _syncId + " to " + ownerId);
|
MelonLogger.Msg("Setting owner for " + _syncId + " to " + ownerId);
|
||||||
_ownerId = ownerId;
|
_ownerId = ownerId;
|
||||||
|
FindAndUpdateComponents();
|
||||||
MelonCoroutines.Start(SyncCoroutineAsync());
|
MelonCoroutines.Start(SyncCoroutineAsync());
|
||||||
UpdateKinematic();
|
UpdateKinematic();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,17 @@ namespace BoneSync.Sync.Components
|
|||||||
{
|
{
|
||||||
public partial class Syncable : MonoBehaviour
|
public partial class Syncable : MonoBehaviour
|
||||||
{
|
{
|
||||||
public void ApplyMagazineData(MagazineData magazineData)
|
|
||||||
|
private void _SendAttributeSync()
|
||||||
{
|
{
|
||||||
|
if (!isOwner) return;
|
||||||
|
_SendMagazineData();
|
||||||
|
}
|
||||||
|
public void ApplyMagazineData(MagazineSyncData magazineSyncData)
|
||||||
|
{
|
||||||
|
if (!magazine) return; // If the magazine is null, return
|
||||||
|
MagazineData magazineData = magazineSyncData.magazineData;
|
||||||
if (!magazineData) return;
|
if (!magazineData) return;
|
||||||
if (!magazine) return;
|
|
||||||
magazine.magazineData.AmmoSlots = magazineData.AmmoSlots;
|
magazine.magazineData.AmmoSlots = magazineData.AmmoSlots;
|
||||||
magazine.magazineData.cartridgeType = magazineData.cartridgeType;
|
magazine.magazineData.cartridgeType = magazineData.cartridgeType;
|
||||||
magazine.magazineData.weight = magazineData.weight;
|
magazine.magazineData.weight = magazineData.weight;
|
||||||
@@ -28,5 +35,13 @@ namespace BoneSync.Sync.Components
|
|||||||
data.magazineData = magazine.magazineData;
|
data.magazineData = magazine.magazineData;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _SendMagazineData()
|
||||||
|
{
|
||||||
|
if (!magazine) return;
|
||||||
|
MagazineSyncData data = GetMagazineData();
|
||||||
|
MagazineSyncMessage message = new MagazineSyncMessage(data);
|
||||||
|
message.Broadcast();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user