mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-22 12:39:51 +00:00
stuff idk
This commit is contained in:
parent
c4c3a54905
commit
d8d1bc8395
@ -3,7 +3,7 @@ CRC: 2815158869
|
|||||||
Hashes:
|
Hashes:
|
||||||
AssetFileHash:
|
AssetFileHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: b0dab33ce9502b8c920c956269fa585e
|
Hash: 81bbcd8775249928cc67d7ff90ff9047
|
||||||
TypeTreeHash:
|
TypeTreeHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: 4d6a73cb377370ba69c96eb5da1b5028
|
Hash: 4d6a73cb377370ba69c96eb5da1b5028
|
||||||
|
Binary file not shown.
@ -1,9 +1,9 @@
|
|||||||
ManifestFileVersion: 0
|
ManifestFileVersion: 0
|
||||||
CRC: 561788810
|
CRC: 3775067745
|
||||||
Hashes:
|
Hashes:
|
||||||
AssetFileHash:
|
AssetFileHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: 2ed408e0c9f6147e341c9606eb7228c3
|
Hash: 3a9598581da083f242daab94ed0741fb
|
||||||
TypeTreeHash:
|
TypeTreeHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: 47ee499ae8022a6b96ca6a5fd541f154
|
Hash: 47ee499ae8022a6b96ca6a5fd541f154
|
||||||
@ -27,6 +27,7 @@ Assets:
|
|||||||
- Assets/NetworkPlayer.prefab
|
- Assets/NetworkPlayer.prefab
|
||||||
- Assets/NetworkCameraRoot.prefab
|
- Assets/NetworkCameraRoot.prefab
|
||||||
- Assets/NetworkProbe.prefab
|
- Assets/NetworkProbe.prefab
|
||||||
|
- Assets/NetworkOrb.prefab
|
||||||
- Assets/NetworkManager.prefab
|
- Assets/NetworkManager.prefab
|
||||||
- Assets/NetworkShip.prefab
|
- Assets/NetworkShip.prefab
|
||||||
Dependencies: []
|
Dependencies: []
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using QSB.DeathSync;
|
using QSB.DeathSync;
|
||||||
using QSB.ElevatorSync;
|
using QSB.ElevatorSync;
|
||||||
using QSB.GeyserSync;
|
using QSB.GeyserSync;
|
||||||
|
using QSB.OrbSync;
|
||||||
using QSB.TimeSync;
|
using QSB.TimeSync;
|
||||||
using QSB.Tools;
|
using QSB.Tools;
|
||||||
using QSB.TransformSync;
|
using QSB.TransformSync;
|
||||||
@ -37,7 +38,8 @@ namespace QSB.Events
|
|||||||
new ElevatorEvent(),
|
new ElevatorEvent(),
|
||||||
new GeyserEvent(),
|
new GeyserEvent(),
|
||||||
new ServerTimeEvent(),
|
new ServerTimeEvent(),
|
||||||
new AnimTriggerEvent()
|
new AnimTriggerEvent(),
|
||||||
|
new OrbSlotEvent()
|
||||||
};
|
};
|
||||||
|
|
||||||
_eventList.ForEach(ev => ev.SetupListener());
|
_eventList.ForEach(ev => ev.SetupListener());
|
||||||
|
@ -29,5 +29,6 @@
|
|||||||
public static string QSBStartLift = "QSBStartLift";
|
public static string QSBStartLift = "QSBStartLift";
|
||||||
public static string QSBGeyserState = "QSBGeyserState";
|
public static string QSBGeyserState = "QSBGeyserState";
|
||||||
public static string QSBAnimTrigger = "QSBAnimTrigger";
|
public static string QSBAnimTrigger = "QSBAnimTrigger";
|
||||||
|
public static string QSBOrbSlot = "QSBOrbSlot";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ namespace QSB.Events
|
|||||||
{
|
{
|
||||||
var message = new PlayerStateMessage
|
var message = new PlayerStateMessage
|
||||||
{
|
{
|
||||||
AboutId = player.NetId,
|
AboutId = player.PlayerId,
|
||||||
PlayerName = player.Name,
|
PlayerName = player.Name,
|
||||||
PlayerReady = player.IsReady,
|
PlayerReady = player.IsReady,
|
||||||
PlayerState = player.State
|
PlayerState = player.State
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using QSB.Events;
|
using QSB.Events;
|
||||||
using QSB.Messaging;
|
using QSB.Messaging;
|
||||||
|
using QSB.Utility;
|
||||||
using QSB.WorldSync;
|
using QSB.WorldSync;
|
||||||
|
|
||||||
namespace QSB.GeyserSync
|
namespace QSB.GeyserSync
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
PlayerReady,
|
PlayerReady,
|
||||||
ProbeActiveChange,
|
ProbeActiveChange,
|
||||||
Elevator,
|
Elevator,
|
||||||
Geyser
|
Geyser,
|
||||||
|
OrbSlot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
39
QSB/OrbSync/OrbSlotEvent.cs
Normal file
39
QSB/OrbSync/OrbSlotEvent.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
using QSB.Events;
|
||||||
|
using QSB.Messaging;
|
||||||
|
using QSB.Utility;
|
||||||
|
using QSB.WorldSync;
|
||||||
|
|
||||||
|
namespace QSB.OrbSync
|
||||||
|
{
|
||||||
|
public class OrbSlotEvent : QSBEvent<OrbSlotMessage>
|
||||||
|
{
|
||||||
|
public override EventType Type => EventType.OrbSlot;
|
||||||
|
|
||||||
|
public override void SetupListener()
|
||||||
|
{
|
||||||
|
GlobalMessenger<int, bool>.AddListener(EventNames.QSBOrbSlot, Handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void CloseListener()
|
||||||
|
{
|
||||||
|
GlobalMessenger<int, bool>.RemoveListener(EventNames.QSBOrbSlot, Handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Handler(int id, bool state) => SendEvent(CreateMessage(id, state));
|
||||||
|
|
||||||
|
private OrbSlotMessage CreateMessage(int id, bool state) => new OrbSlotMessage
|
||||||
|
{
|
||||||
|
AboutId = LocalPlayerId,
|
||||||
|
ObjectId = id,
|
||||||
|
State = state
|
||||||
|
};
|
||||||
|
|
||||||
|
public override void OnReceiveRemote(OrbSlotMessage message)
|
||||||
|
{
|
||||||
|
|
||||||
|
var orbSlot = WorldRegistry.GetObject<QSBOrbSlot>(message.ObjectId);
|
||||||
|
DebugLog.ToConsole($"GET ORB MESSAGE {message.ObjectId} : {message.State}");
|
||||||
|
orbSlot?.SetState(message.State);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
32
QSB/OrbSync/OrbSlotManager.cs
Normal file
32
QSB/OrbSync/OrbSlotManager.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
using QSB.WorldSync;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace QSB.OrbSync
|
||||||
|
{
|
||||||
|
public class OrbSlotManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
public static OrbSlotManager Instance { get; private set; }
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
Instance = this;
|
||||||
|
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
||||||
|
{
|
||||||
|
var orbSlots = Resources.FindObjectsOfTypeAll<NomaiInterfaceSlot>();
|
||||||
|
for (var id = 0; id < orbSlots.Length; id++)
|
||||||
|
{
|
||||||
|
var qsbOrbSlot = WorldRegistry.GetObject<QSBOrbSlot>(id) ?? new QSBOrbSlot();
|
||||||
|
qsbOrbSlot.Init(orbSlots[id], id);
|
||||||
|
WorldRegistry.AddObject(qsbOrbSlot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StopChecking()
|
||||||
|
{
|
||||||
|
QSB.Helper.HarmonyHelper.AddPrefix<NomaiInterfaceSlot>("CheckOrbCollision", typeof(OrbSlotPatches), nameof(OrbSlotPatches.CheckOrbCollisionSkip));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
QSB/OrbSync/OrbSlotMessage.cs
Normal file
22
QSB/OrbSync/OrbSlotMessage.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using QSB.WorldSync;
|
||||||
|
using UnityEngine.Networking;
|
||||||
|
|
||||||
|
namespace QSB.OrbSync
|
||||||
|
{
|
||||||
|
public class OrbSlotMessage : WorldObjectMessage
|
||||||
|
{
|
||||||
|
public bool State { get; set; }
|
||||||
|
|
||||||
|
public override void Deserialize(NetworkReader reader)
|
||||||
|
{
|
||||||
|
base.Deserialize(reader);
|
||||||
|
State = reader.ReadBoolean();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Serialize(NetworkWriter writer)
|
||||||
|
{
|
||||||
|
base.Serialize(writer);
|
||||||
|
writer.Write(State);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
QSB/OrbSync/OrbSlotPatches.cs
Normal file
13
QSB/OrbSync/OrbSlotPatches.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using OWML.ModHelper.Events;
|
||||||
|
using QSB.Events;
|
||||||
|
|
||||||
|
namespace QSB.OrbSync
|
||||||
|
{
|
||||||
|
public static class OrbSlotPatches
|
||||||
|
{
|
||||||
|
public static bool CheckOrbCollisionSkip()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
60
QSB/OrbSync/QSBOrbSlot.cs
Normal file
60
QSB/OrbSync/QSBOrbSlot.cs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
using OWML.ModHelper.Events;
|
||||||
|
using QSB.Events;
|
||||||
|
using QSB.Utility;
|
||||||
|
using QSB.WorldSync;
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using UnityEngine.Networking;
|
||||||
|
|
||||||
|
namespace QSB.OrbSync
|
||||||
|
{
|
||||||
|
public class QSBOrbSlot : WorldObject
|
||||||
|
{
|
||||||
|
private NomaiInterfaceSlot _interfaceSlot;
|
||||||
|
|
||||||
|
public void Init(NomaiInterfaceSlot slot, int id)
|
||||||
|
{
|
||||||
|
ObjectId = id;
|
||||||
|
_interfaceSlot = slot;
|
||||||
|
|
||||||
|
_interfaceSlot.OnSlotActivated += (slotInstance) => HandleEvent(slotInstance, true);
|
||||||
|
_interfaceSlot.OnSlotDeactivated += (slotInstance) => HandleEvent(slotInstance, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleEvent(NomaiInterfaceSlot instance, bool state)
|
||||||
|
{
|
||||||
|
if (NetworkServer.active)
|
||||||
|
{
|
||||||
|
DebugLog.ToConsole($"FIRE ORB EVENT {ObjectId} : {state} ({instance.name})");
|
||||||
|
GlobalMessenger<int, bool>.FireEvent(EventNames.QSBOrbSlot, ObjectId, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetState(bool state)
|
||||||
|
{
|
||||||
|
DebugLog.ToConsole($"Setting state of slot {_interfaceSlot.name} to {state}");
|
||||||
|
if (state)
|
||||||
|
{
|
||||||
|
RaiseEvent(_interfaceSlot, "OnSlotActivated");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RaiseEvent(_interfaceSlot, "OnSlotDeactivated");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void RaiseEvent(object instance, string eventName)
|
||||||
|
{
|
||||||
|
var type = instance.GetType();
|
||||||
|
var staticFlags = BindingFlags.Instance | BindingFlags.NonPublic;
|
||||||
|
var fieldInfo = type.GetField(eventName, staticFlags);
|
||||||
|
var multDelegate = fieldInfo.GetValue(instance) as MulticastDelegate;
|
||||||
|
var delegateList = multDelegate.GetInvocationList();
|
||||||
|
foreach (var delegateMethod in delegateList)
|
||||||
|
{
|
||||||
|
delegateMethod.DynamicInvoke(instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -9,7 +9,7 @@ namespace QSB
|
|||||||
{
|
{
|
||||||
public class PlayerInfo
|
public class PlayerInfo
|
||||||
{
|
{
|
||||||
public uint NetId { get; }
|
public uint PlayerId { get; }
|
||||||
public GameObject Camera { get; set; }
|
public GameObject Camera { get; set; }
|
||||||
public GameObject ProbeBody { get; set; }
|
public GameObject ProbeBody { get; set; }
|
||||||
public QSBProbe Probe { get; set; }
|
public QSBProbe Probe { get; set; }
|
||||||
@ -24,7 +24,7 @@ namespace QSB
|
|||||||
|
|
||||||
public PlayerInfo(uint id)
|
public PlayerInfo(uint id)
|
||||||
{
|
{
|
||||||
NetId = id;
|
PlayerId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateState(State state, bool value)
|
public void UpdateState(State state, bool value)
|
||||||
@ -53,8 +53,8 @@ namespace QSB
|
|||||||
Translator?.ChangeEquipState(FlagsHelper.IsSet(State, State.Translator));
|
Translator?.ChangeEquipState(FlagsHelper.IsSet(State, State.Translator));
|
||||||
ProbeLauncher?.ChangeEquipState(FlagsHelper.IsSet(State, State.ProbeLauncher));
|
ProbeLauncher?.ChangeEquipState(FlagsHelper.IsSet(State, State.ProbeLauncher));
|
||||||
Signalscope?.ChangeEquipState(FlagsHelper.IsSet(State, State.Signalscope));
|
Signalscope?.ChangeEquipState(FlagsHelper.IsSet(State, State.Signalscope));
|
||||||
QSB.Helper.Events.Unity.RunWhen(() => PlayerRegistry.GetSyncObject<AnimationSync>(NetId) != null,
|
QSB.Helper.Events.Unity.RunWhen(() => PlayerRegistry.GetSyncObject<AnimationSync>(PlayerId) != null,
|
||||||
() => PlayerRegistry.GetSyncObject<AnimationSync>(NetId).SetSuitState(FlagsHelper.IsSet(State, State.Suit)));
|
() => PlayerRegistry.GetSyncObject<AnimationSync>(PlayerId).SetSuitState(FlagsHelper.IsSet(State, State.Suit)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetState(State state)
|
public bool GetState(State state)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using QSB.Messaging;
|
using QSB.Messaging;
|
||||||
using QSB.TransformSync;
|
using QSB.TransformSync;
|
||||||
using QSB.Utility;
|
using QSB.Utility;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
@ -10,8 +11,6 @@ namespace QSB
|
|||||||
{
|
{
|
||||||
public static class PlayerRegistry
|
public static class PlayerRegistry
|
||||||
{
|
{
|
||||||
public const int NetworkObjectCount = 4;
|
|
||||||
|
|
||||||
public static uint LocalPlayerId => PlayerTransformSync.LocalInstance.GetComponent<NetworkIdentity>()?.netId.Value ?? 0;
|
public static uint LocalPlayerId => PlayerTransformSync.LocalInstance.GetComponent<NetworkIdentity>()?.netId.Value ?? 0;
|
||||||
public static PlayerInfo LocalPlayer => GetPlayer(LocalPlayerId);
|
public static PlayerInfo LocalPlayer => GetPlayer(LocalPlayerId);
|
||||||
public static List<PlayerInfo> PlayerList { get; } = new List<PlayerInfo>();
|
public static List<PlayerInfo> PlayerList { get; } = new List<PlayerInfo>();
|
||||||
@ -20,7 +19,7 @@ namespace QSB
|
|||||||
|
|
||||||
public static PlayerInfo GetPlayer(uint id)
|
public static PlayerInfo GetPlayer(uint id)
|
||||||
{
|
{
|
||||||
var player = PlayerList.FirstOrDefault(x => x.NetId == id);
|
var player = PlayerList.FirstOrDefault(x => x.PlayerId == id);
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
return player;
|
return player;
|
||||||
@ -39,7 +38,7 @@ namespace QSB
|
|||||||
|
|
||||||
public static bool PlayerExists(uint id)
|
public static bool PlayerExists(uint id)
|
||||||
{
|
{
|
||||||
return PlayerList.Any(x => x.NetId == id);
|
return PlayerList.Any(x => x.PlayerId == id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HandleFullStateMessage(PlayerStateMessage message)
|
public static void HandleFullStateMessage(PlayerStateMessage message)
|
||||||
@ -77,7 +76,19 @@ namespace QSB
|
|||||||
|
|
||||||
public static List<uint> GetPlayerNetIds(PlayerInfo player)
|
public static List<uint> GetPlayerNetIds(PlayerInfo player)
|
||||||
{
|
{
|
||||||
return Enumerable.Range((int)player.NetId, NetworkObjectCount).Select(x => (uint)x).ToList();
|
return Enumerable.Range((int)player.PlayerId, PlayerSyncObjects.DistinctBy(x => x.NetId).Count(x => x.PlayerId == player.PlayerId)).Select(x => (uint)x).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
|
||||||
|
{
|
||||||
|
HashSet<TKey> seenKeys = new HashSet<TKey>();
|
||||||
|
foreach (TSource element in source)
|
||||||
|
{
|
||||||
|
if (seenKeys.Add(keySelector(element)))
|
||||||
|
{
|
||||||
|
yield return element;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ using OWML.ModHelper;
|
|||||||
using QSB.DeathSync;
|
using QSB.DeathSync;
|
||||||
using QSB.ElevatorSync;
|
using QSB.ElevatorSync;
|
||||||
using QSB.GeyserSync;
|
using QSB.GeyserSync;
|
||||||
|
using QSB.OrbSync;
|
||||||
using QSB.Tools;
|
using QSB.Tools;
|
||||||
using QSB.TransformSync;
|
using QSB.TransformSync;
|
||||||
using QSB.Utility;
|
using QSB.Utility;
|
||||||
@ -43,6 +44,7 @@ namespace QSB
|
|||||||
gameObject.AddComponent<DebugActions>();
|
gameObject.AddComponent<DebugActions>();
|
||||||
gameObject.AddComponent<ElevatorManager>();
|
gameObject.AddComponent<ElevatorManager>();
|
||||||
gameObject.AddComponent<GeyserManager>();
|
gameObject.AddComponent<GeyserManager>();
|
||||||
|
gameObject.AddComponent<OrbSlotManager>();
|
||||||
gameObject.AddComponent<QSBSectorManager>();
|
gameObject.AddComponent<QSBSectorManager>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +136,11 @@
|
|||||||
<Compile Include="Events\EventNames.cs" />
|
<Compile Include="Events\EventNames.cs" />
|
||||||
<Compile Include="DeathSync\PlayerDeathEvent.cs" />
|
<Compile Include="DeathSync\PlayerDeathEvent.cs" />
|
||||||
<Compile Include="Events\IQSBEvent.cs" />
|
<Compile Include="Events\IQSBEvent.cs" />
|
||||||
|
<Compile Include="OrbSync\OrbSlotManager.cs" />
|
||||||
|
<Compile Include="OrbSync\OrbSlotMessage.cs" />
|
||||||
|
<Compile Include="OrbSync\OrbSlotEvent.cs" />
|
||||||
|
<Compile Include="OrbSync\OrbSlotPatches.cs" />
|
||||||
|
<Compile Include="OrbSync\QSBOrbSlot.cs" />
|
||||||
<Compile Include="PlayerSyncObject.cs" />
|
<Compile Include="PlayerSyncObject.cs" />
|
||||||
<Compile Include="QSBNetworkLobby.cs" />
|
<Compile Include="QSBNetworkLobby.cs" />
|
||||||
<Compile Include="QSBSceneManager.cs" />
|
<Compile Include="QSBSceneManager.cs" />
|
||||||
@ -145,6 +150,7 @@
|
|||||||
<Compile Include="Events\PlayerLeaveEvent.cs" />
|
<Compile Include="Events\PlayerLeaveEvent.cs" />
|
||||||
<Compile Include="Tools\PlayerProbeEvent.cs" />
|
<Compile Include="Tools\PlayerProbeEvent.cs" />
|
||||||
<Compile Include="Events\PlayerReadyEvent.cs" />
|
<Compile Include="Events\PlayerReadyEvent.cs" />
|
||||||
|
<Compile Include="TransformSync\NomaiOrbTransformSync.cs" />
|
||||||
<Compile Include="TransformSync\PlayerSectorEvent.cs" />
|
<Compile Include="TransformSync\PlayerSectorEvent.cs" />
|
||||||
<Compile Include="Events\PlayerStatesRequestEvent.cs" />
|
<Compile Include="Events\PlayerStatesRequestEvent.cs" />
|
||||||
<Compile Include="Animation\PlayerSuitEvent.cs" />
|
<Compile Include="Animation\PlayerSuitEvent.cs" />
|
||||||
|
@ -3,6 +3,7 @@ using QSB.Animation;
|
|||||||
using QSB.DeathSync;
|
using QSB.DeathSync;
|
||||||
using QSB.Events;
|
using QSB.Events;
|
||||||
using QSB.GeyserSync;
|
using QSB.GeyserSync;
|
||||||
|
using QSB.OrbSync;
|
||||||
using QSB.TimeSync;
|
using QSB.TimeSync;
|
||||||
using QSB.TransformSync;
|
using QSB.TransformSync;
|
||||||
using QSB.Utility;
|
using QSB.Utility;
|
||||||
@ -27,6 +28,7 @@ namespace QSB
|
|||||||
private GameObject _shipPrefab;
|
private GameObject _shipPrefab;
|
||||||
private GameObject _cameraPrefab;
|
private GameObject _cameraPrefab;
|
||||||
private GameObject _probePrefab;
|
private GameObject _probePrefab;
|
||||||
|
public GameObject OrbPrefab;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
@ -56,7 +58,21 @@ namespace QSB
|
|||||||
spawnPrefabs.Add(_probePrefab);
|
spawnPrefabs.Add(_probePrefab);
|
||||||
DebugLog.LogState("ProbePrefab", _probePrefab);
|
DebugLog.LogState("ProbePrefab", _probePrefab);
|
||||||
|
|
||||||
|
OrbPrefab = _assetBundle.LoadAsset<GameObject>("assets/networkorb.prefab");
|
||||||
|
spawnPrefabs.Add(OrbPrefab);
|
||||||
|
DebugLog.LogState("OrbPrefab", OrbPrefab);
|
||||||
|
|
||||||
ConfigureNetworkManager();
|
ConfigureNetworkManager();
|
||||||
|
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSceneLoaded(OWScene scene, bool inUniverse)
|
||||||
|
{
|
||||||
|
var orbs = Resources.FindObjectsOfTypeAll<NomaiInterfaceOrb>();
|
||||||
|
foreach (var orb in orbs)
|
||||||
|
{
|
||||||
|
DebugLog.ToConsole($"{orb.name}, {orb.transform.root.name}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ConfigureNetworkManager()
|
private void ConfigureNetworkManager()
|
||||||
@ -95,6 +111,7 @@ namespace QSB
|
|||||||
{
|
{
|
||||||
gameObject.AddComponent<Events.PlayerState>();
|
gameObject.AddComponent<Events.PlayerState>();
|
||||||
GeyserManager.Instance.EmptyUpdate();
|
GeyserManager.Instance.EmptyUpdate();
|
||||||
|
OrbSlotManager.Instance.StopChecking();
|
||||||
WakeUpPatches.AddPatches();
|
WakeUpPatches.AddPatches();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,10 +135,10 @@ namespace QSB
|
|||||||
EventList.Reset();
|
EventList.Reset();
|
||||||
PlayerRegistry.PlayerList.ForEach(player => player.HudMarker?.Remove());
|
PlayerRegistry.PlayerList.ForEach(player => player.HudMarker?.Remove());
|
||||||
|
|
||||||
foreach (var player in PlayerRegistry.PlayerList.Where(x => x.NetId != PlayerRegistry.LocalPlayerId).ToList())
|
foreach (var player in PlayerRegistry.PlayerList.Where(x => x.PlayerId != PlayerRegistry.LocalPlayerId).ToList())
|
||||||
{
|
{
|
||||||
PlayerRegistry.GetPlayerNetIds(player).ForEach(CleanupNetworkBehaviour);
|
PlayerRegistry.GetPlayerNetIds(player).ForEach(CleanupNetworkBehaviour);
|
||||||
PlayerRegistry.RemovePlayer(player.NetId);
|
PlayerRegistry.RemovePlayer(player.PlayerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
_lobby.CanEditName = true;
|
_lobby.CanEditName = true;
|
||||||
|
11
QSB/TransformSync/NomaiOrbTransformSync.cs
Normal file
11
QSB/TransformSync/NomaiOrbTransformSync.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace QSB.TransformSync
|
||||||
|
{
|
||||||
|
class NomaiOrbTransformSync
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,6 @@
|
|||||||
"name": "Quantum Space Buddies",
|
"name": "Quantum Space Buddies",
|
||||||
"description": "Adds online multiplayer to the game.",
|
"description": "Adds online multiplayer to the game.",
|
||||||
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
|
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
|
||||||
"version": "0.5.1",
|
"version": "0.6.0",
|
||||||
"owmlVersion": "0.7.3"
|
"owmlVersion": "0.7.3"
|
||||||
}
|
}
|
||||||
|
96
UnityProject/Assets/NetworkOrb.prefab
Normal file
96
UnityProject/Assets/NetworkOrb.prefab
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1001 &100100000
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications: []
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_ParentPrefab: {fileID: 0}
|
||||||
|
m_RootGameObject: {fileID: 1252242529042024}
|
||||||
|
m_IsPrefabParent: 1
|
||||||
|
--- !u!1 &1252242529042024
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
serializedVersion: 5
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 4745039063230268}
|
||||||
|
- component: {fileID: 114872848302743272}
|
||||||
|
- component: {fileID: 114240702864939342}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: NetworkOrb
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &4745039063230268
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1252242529042024}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &114240702864939342
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1252242529042024}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: -1768714887, guid: dc443db3e92b4983b9738c1131f555cb, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_TransformSyncMode: 1
|
||||||
|
m_SendInterval: 0.09090909
|
||||||
|
m_SyncRotationAxis: 0
|
||||||
|
m_RotationSyncCompression: 0
|
||||||
|
m_SyncSpin: 0
|
||||||
|
m_MovementTheshold: 0.001
|
||||||
|
m_VelocityThreshold: 0.0001
|
||||||
|
m_SnapThreshold: 5
|
||||||
|
m_InterpolateRotation: 1
|
||||||
|
m_InterpolateMovement: 1
|
||||||
|
--- !u!114 &114872848302743272
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1252242529042024}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 372142912, guid: dc443db3e92b4983b9738c1131f555cb, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_SceneId:
|
||||||
|
m_Value: 0
|
||||||
|
m_AssetId:
|
||||||
|
i0: 16
|
||||||
|
i1: 54
|
||||||
|
i2: 85
|
||||||
|
i3: 231
|
||||||
|
i4: 191
|
||||||
|
i5: 68
|
||||||
|
i6: 98
|
||||||
|
i7: 228
|
||||||
|
i8: 25
|
||||||
|
i9: 191
|
||||||
|
i10: 115
|
||||||
|
i11: 12
|
||||||
|
i12: 196
|
||||||
|
i13: 32
|
||||||
|
i14: 194
|
||||||
|
i15: 197
|
||||||
|
m_ServerOnly: 0
|
||||||
|
m_LocalPlayerAuthority: 1
|
8
UnityProject/Assets/NetworkOrb.prefab.meta
Normal file
8
UnityProject/Assets/NetworkOrb.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 103655e7bf4462e419bf730cc420c2c5
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName: network
|
||||||
|
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user