mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-31 06:32:55 +00:00
fix some stuff
This commit is contained in:
parent
b4c8f451cb
commit
03944057cd
@ -34,9 +34,8 @@ namespace QSB.OrbSync
|
||||
{
|
||||
var fromPlayer = (NetworkServer.connections.First(x => x.playerControllers[0].gameObject.GetComponent<PlayerTransformSync>().netId.Value == message.FromId));
|
||||
DebugLog.DebugWrite($"[S] Setting orb {message.ObjectId} to auth id {message.FromId}");
|
||||
var orbIdentity = WorldRegistry.OrbList
|
||||
.First(x => x.AttachedOrb == WorldRegistry.OldOrbList[message.ObjectId])
|
||||
.GetComponent<NetworkIdentity>();
|
||||
var orb = WorldRegistry.OrbList.First(x => x.AttachedOrb == WorldRegistry.OldOrbList[message.ObjectId]);
|
||||
var orbIdentity = orb.GetComponent<NetworkIdentity>();
|
||||
orbIdentity.RemoveClientAuthority(orbIdentity.clientAuthorityOwner);
|
||||
orbIdentity.AssignClientAuthority(fromPlayer);
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ using QSB.WorldSync;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace QSB.OrbSync
|
||||
{
|
||||
@ -15,17 +14,14 @@ namespace QSB.OrbSync
|
||||
{
|
||||
ObjectId = id;
|
||||
_interfaceSlot = slot;
|
||||
_interfaceSlot.OnSlotActivated += (slotInstance) => HandleEvent(slotInstance, true);
|
||||
_interfaceSlot.OnSlotDeactivated += (slotInstance) => HandleEvent(slotInstance, false);
|
||||
_interfaceSlot.OnSlotActivated += (slotInstance) => HandleEvent(true);
|
||||
_interfaceSlot.OnSlotDeactivated += (slotInstance) => HandleEvent(false);
|
||||
}
|
||||
|
||||
private void HandleEvent(NomaiInterfaceSlot instance, bool state)
|
||||
{
|
||||
if (NetworkServer.active)
|
||||
private void HandleEvent(bool state)
|
||||
{
|
||||
GlobalMessenger<int, bool>.FireEvent(EventNames.QSBOrbSlot, ObjectId, state);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetState(bool state)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user