cleanup...

This commit is contained in:
Mister_Nebula 2020-11-03 21:33:48 +00:00
parent 093c594ba8
commit 3249ce33af
40 changed files with 72 additions and 35 deletions

View File

@ -1,5 +1,6 @@
using OWML.ModHelper.Events; using OWML.ModHelper.Events;
using QSB.Events; using QSB.Events;
using QSB.Player;
using System; using System;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
namespace QSB.Animation.Events namespace QSB.Animation.Events
{ {

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
namespace QSB.Animation namespace QSB.Animation
{ {

View File

@ -1,6 +1,7 @@
using OWML.Common; using OWML.Common;
using OWML.ModHelper.Events; using OWML.ModHelper.Events;
using QSB.Events; using QSB.Events;
using QSB.Player;
using QSB.Utility; using QSB.Utility;
using QSB.WorldSync; using QSB.WorldSync;
using System.Collections.Generic; using System.Collections.Generic;

View File

@ -1,4 +1,5 @@
using OWML.Common; using OWML.Common;
using QSB.Player;
using QSB.Utility; using QSB.Utility;
using QSB.WorldSync; using QSB.WorldSync;
using System.Collections.Generic; using System.Collections.Generic;

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
using QSB.WorldSync; using QSB.WorldSync;
namespace QSB.ConversationSync.Events namespace QSB.ConversationSync.Events

View File

@ -1,6 +1,7 @@
using OWML.Common; using OWML.Common;
using OWML.ModHelper.Events; using OWML.ModHelper.Events;
using QSB.Events; using QSB.Events;
using QSB.Player;
using QSB.Utility; using QSB.Utility;
using QSB.WorldSync; using QSB.WorldSync;
using System.Linq; using System.Linq;

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
using QSB.Utility; using QSB.Utility;
namespace QSB.DeathSync.Events namespace QSB.DeathSync.Events

View File

@ -1,11 +1,13 @@
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
using QSB.Player.Events;
using UnityEngine.Networking; using UnityEngine.Networking;
namespace QSB.Events namespace QSB.Events
{ {
public class PlayerState : NetworkBehaviour public class PlayerStateEvent : NetworkBehaviour
{ {
public static PlayerState LocalInstance { get; private set; } public static PlayerStateEvent LocalInstance { get; private set; }
private MessageHandler<PlayerStateMessage> _messageHandler; private MessageHandler<PlayerStateMessage> _messageHandler;

View File

@ -1,4 +1,5 @@
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
using QSB.TransformSync; using QSB.TransformSync;
using UnityEngine.Networking; using UnityEngine.Networking;

View File

@ -7,6 +7,7 @@ using QSB.ElevatorSync.Events;
using QSB.GeyserSync.Events; using QSB.GeyserSync.Events;
using QSB.Instruments.Events; using QSB.Instruments.Events;
using QSB.OrbSync.Events; using QSB.OrbSync.Events;
using QSB.Player.Events;
using QSB.TimeSync.Events; using QSB.TimeSync.Events;
using QSB.Tools.Events; using QSB.Tools.Events;
using QSB.TransformSync; using QSB.TransformSync;

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
using QSB.Utility; using QSB.Utility;
using System; using System;

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Instruments.QSBCamera; using QSB.Instruments.QSBCamera;
using QSB.Player;
using UnityEngine; using UnityEngine;
namespace QSB.Instruments namespace QSB.Instruments

View File

@ -1,8 +1,9 @@
using OWML.Common; using OWML.Common;
using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Utility; using QSB.Utility;
namespace QSB.Events namespace QSB.Player.Events
{ {
public class PlayerJoinEvent : QSBEvent<PlayerJoinMessage> public class PlayerJoinEvent : QSBEvent<PlayerJoinMessage>
{ {

View File

@ -1,6 +1,7 @@
using UnityEngine.Networking; using QSB.Messaging;
using UnityEngine.Networking;
namespace QSB.Messaging namespace QSB.Player.Events
{ {
public class PlayerJoinMessage : PlayerMessage public class PlayerJoinMessage : PlayerMessage
{ {

View File

@ -1,9 +1,10 @@
using OWML.Common; using OWML.Common;
using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Utility; using QSB.Utility;
using System.Linq; using System.Linq;
namespace QSB.Events namespace QSB.Player.Events
{ {
public class PlayerLeaveEvent : QSBEvent<PlayerLeaveMessage> public class PlayerLeaveEvent : QSBEvent<PlayerLeaveMessage>
{ {

View File

@ -1,8 +1,9 @@
using System; using QSB.Messaging;
using System;
using System.Linq; using System.Linq;
using UnityEngine.Networking; using UnityEngine.Networking;
namespace QSB.Messaging namespace QSB.Player.Events
{ {
public class PlayerLeaveMessage : PlayerMessage public class PlayerLeaveMessage : PlayerMessage
{ {

View File

@ -1,10 +1,11 @@
using OWML.Common; using OWML.Common;
using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.TransformSync; using QSB.TransformSync;
using QSB.Utility; using QSB.Utility;
using System.Linq; using System.Linq;
namespace QSB.Events namespace QSB.Player.Events
{ {
public class PlayerReadyEvent : QSBEvent<ToggleMessage> public class PlayerReadyEvent : QSBEvent<ToggleMessage>
{ {
@ -30,7 +31,7 @@ namespace QSB.Events
return; return;
} }
QSBPlayerManager.GetPlayer(message.AboutId).IsReady = message.ToggleValue; QSBPlayerManager.GetPlayer(message.AboutId).IsReady = message.ToggleValue;
PlayerState.LocalInstance.Send(); PlayerStateEvent.LocalInstance.Send();
} }
public override void OnReceiveRemote(ToggleMessage message) public override void OnReceiveRemote(ToggleMessage message)

View File

@ -1,6 +1,7 @@
using UnityEngine.Networking; using QSB.Messaging;
using UnityEngine.Networking;
namespace QSB.Messaging namespace QSB.Player.Events
{ {
public class PlayerStateMessage : PlayerMessage public class PlayerStateMessage : PlayerMessage
{ {

View File

@ -1,9 +1,10 @@
using QSB.Messaging; using QSB.Events;
using QSB.Messaging;
using QSB.TransformSync; using QSB.TransformSync;
using QSB.Utility; using QSB.Utility;
using System.Linq; using System.Linq;
namespace QSB.Events namespace QSB.Player.Events
{ {
public class PlayerStatesRequestEvent : QSBEvent<PlayerMessage> public class PlayerStatesRequestEvent : QSBEvent<PlayerMessage>
{ {
@ -23,7 +24,7 @@ namespace QSB.Events
public override void OnServerReceive(PlayerMessage message) public override void OnServerReceive(PlayerMessage message)
{ {
DebugLog.DebugWrite($"[S] Get state request from {message.FromId}"); DebugLog.DebugWrite($"[S] Get state request from {message.FromId}");
PlayerState.LocalInstance.Send(); PlayerStateEvent.LocalInstance.Send();
foreach (var item in QSBPlayerManager.GetSyncObjects<TransformSync.TransformSync>() foreach (var item in QSBPlayerManager.GetSyncObjects<TransformSync.TransformSync>()
.Where(x => x != null && x.IsReady && x.ReferenceSector != null)) .Where(x => x != null && x.IsReady && x.ReferenceSector != null))
{ {

View File

@ -6,7 +6,7 @@ using QSB.Utility;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
namespace QSB namespace QSB.Player
{ {
public class PlayerInfo public class PlayerInfo
{ {

View File

@ -1,6 +1,6 @@
using UnityEngine.Networking; using UnityEngine.Networking;
namespace QSB namespace QSB.Player
{ {
public abstract class PlayerSyncObject : NetworkBehaviour public abstract class PlayerSyncObject : NetworkBehaviour
{ {

View File

@ -1,5 +1,6 @@
using OWML.Common; using OWML.Common;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player.Events;
using QSB.TransformSync; using QSB.TransformSync;
using QSB.Utility; using QSB.Utility;
using System.Collections.Generic; using System.Collections.Generic;
@ -7,7 +8,7 @@ using System.Diagnostics;
using System.Linq; using System.Linq;
using UnityEngine.Networking; using UnityEngine.Networking;
namespace QSB namespace QSB.Player
{ {
public static class QSBPlayerManager public static class QSBPlayerManager
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace QSB namespace QSB.Player
{ {
[Flags] [Flags]
public enum State public enum State

View File

@ -159,32 +159,32 @@
<Compile Include="OrbSync\Events\OrbUserEvent.cs" /> <Compile Include="OrbSync\Events\OrbUserEvent.cs" />
<Compile Include="OrbSync\QSBOrbSlot.cs" /> <Compile Include="OrbSync\QSBOrbSlot.cs" />
<Compile Include="Patches\QSBPatchManager.cs" /> <Compile Include="Patches\QSBPatchManager.cs" />
<Compile Include="PlayerSyncObject.cs" /> <Compile Include="Player\PlayerSyncObject.cs" />
<Compile Include="QSBNetworkLobby.cs" /> <Compile Include="QSBNetworkLobby.cs" />
<Compile Include="Patches\QSBPatch.cs" /> <Compile Include="Patches\QSBPatch.cs" />
<Compile Include="Patches\QSBPatchTypes.cs" /> <Compile Include="Patches\QSBPatchTypes.cs" />
<Compile Include="QSBSceneManager.cs" /> <Compile Include="QSBSceneManager.cs" />
<Compile Include="TimeSync\WakeUpPatches.cs" /> <Compile Include="TimeSync\WakeUpPatches.cs" />
<Compile Include="Tools\Events\PlayerFlashlightEvent.cs" /> <Compile Include="Tools\Events\PlayerFlashlightEvent.cs" />
<Compile Include="Events\PlayerJoinEvent.cs" /> <Compile Include="Player\Events\PlayerJoinEvent.cs" />
<Compile Include="Events\PlayerLeaveEvent.cs" /> <Compile Include="Player\Events\PlayerLeaveEvent.cs" />
<Compile Include="Tools\Events\PlayerProbeEvent.cs" /> <Compile Include="Tools\Events\PlayerProbeEvent.cs" />
<Compile Include="Events\PlayerReadyEvent.cs" /> <Compile Include="Player\Events\PlayerReadyEvent.cs" />
<Compile Include="TransformSync\NomaiOrbTransformSync.cs" /> <Compile Include="TransformSync\NomaiOrbTransformSync.cs" />
<Compile Include="TransformSync\PlayerSectorEvent.cs" /> <Compile Include="TransformSync\PlayerSectorEvent.cs" />
<Compile Include="Events\PlayerStatesRequestEvent.cs" /> <Compile Include="Player\Events\PlayerStatesRequestEvent.cs" />
<Compile Include="Animation\PlayerSuitEvent.cs" /> <Compile Include="Animation\Events\PlayerSuitEvent.cs" />
<Compile Include="TimeSync\Events\ServerTimeEvent.cs" /> <Compile Include="TimeSync\Events\ServerTimeEvent.cs" />
<Compile Include="GeyserSync\Events\GeyserEvent.cs" /> <Compile Include="GeyserSync\Events\GeyserEvent.cs" />
<Compile Include="GeyserSync\GeyserManager.cs" /> <Compile Include="GeyserSync\GeyserManager.cs" />
<Compile Include="GeyserSync\QSBGeyser.cs" /> <Compile Include="GeyserSync\QSBGeyser.cs" />
<Compile Include="DeathSync\Events\PlayerDeathMessage.cs" /> <Compile Include="DeathSync\Events\PlayerDeathMessage.cs" />
<Compile Include="Messaging\PlayerLeaveMessage.cs" /> <Compile Include="Player\Events\PlayerLeaveMessage.cs" />
<Compile Include="Tools\Events\PlayerProbeLauncherEvent.cs" /> <Compile Include="Tools\Events\PlayerProbeLauncherEvent.cs" />
<Compile Include="Tools\Events\PlayerSignalscopeEvent.cs" /> <Compile Include="Tools\Events\PlayerSignalscopeEvent.cs" />
<Compile Include="Tools\Events\PlayerTranslatorEvent.cs" /> <Compile Include="Tools\Events\PlayerTranslatorEvent.cs" />
<Compile Include="Events\QSBEvent.cs" /> <Compile Include="Events\QSBEvent.cs" />
<Compile Include="Messaging\PlayerJoinMessage.cs" /> <Compile Include="Player\Events\PlayerJoinMessage.cs" />
<Compile Include="Messaging\ToggleMessage.cs" /> <Compile Include="Messaging\ToggleMessage.cs" />
<Compile Include="TransformSync\QSBSector.cs" /> <Compile Include="TransformSync\QSBSector.cs" />
<Compile Include="TransformSync\QSBSectorManager.cs" /> <Compile Include="TransformSync\QSBSectorManager.cs" />
@ -200,18 +200,18 @@
<Compile Include="TransformSync\PlayerProbeSync.cs" /> <Compile Include="TransformSync\PlayerProbeSync.cs" />
<Compile Include="Utility\DebugActions.cs" /> <Compile Include="Utility\DebugActions.cs" />
<Compile Include="Events\QSBEventManager.cs" /> <Compile Include="Events\QSBEventManager.cs" />
<Compile Include="Messaging\PlayerStateMessage.cs" /> <Compile Include="Player\Events\PlayerStateMessage.cs" />
<Compile Include="Events\PlayerState.cs" /> <Compile Include="Events\PlayerStateEvent.cs" />
<Compile Include="DeathSync\Necronomicon.cs" /> <Compile Include="DeathSync\Necronomicon.cs" />
<Compile Include="Utility\DebugLog.cs" /> <Compile Include="Utility\DebugLog.cs" />
<Compile Include="Messaging\PlayerMessage.cs" /> <Compile Include="Messaging\PlayerMessage.cs" />
<Compile Include="Messaging\MessageHandler.cs" /> <Compile Include="Messaging\MessageHandler.cs" />
<Compile Include="Messaging\EventType.cs" /> <Compile Include="Messaging\EventType.cs" />
<Compile Include="PlayerInfo.cs" /> <Compile Include="Player\PlayerInfo.cs" />
<Compile Include="State.cs" /> <Compile Include="Player\State.cs" />
<Compile Include="DeathSync\PreventShipDestruction.cs" /> <Compile Include="DeathSync\PreventShipDestruction.cs" />
<Compile Include="DeathSync\RespawnOnDeath.cs" /> <Compile Include="DeathSync\RespawnOnDeath.cs" />
<Compile Include="QSBPlayerManager.cs" /> <Compile Include="Player\QSBPlayerManager.cs" />
<Compile Include="TransformSync\PlayerCameraSync.cs" /> <Compile Include="TransformSync\PlayerCameraSync.cs" />
<Compile Include="Utility\FlagsHelper.cs" /> <Compile Include="Utility\FlagsHelper.cs" />
<Compile Include="TransformSync\PlayerHUDMarker.cs" /> <Compile Include="TransformSync\PlayerHUDMarker.cs" />

View File

@ -8,6 +8,7 @@ using QSB.Events;
using QSB.GeyserSync; using QSB.GeyserSync;
using QSB.OrbSync; using QSB.OrbSync;
using QSB.Patches; using QSB.Patches;
using QSB.Player;
using QSB.TimeSync; using QSB.TimeSync;
using QSB.TransformSync; using QSB.TransformSync;
using QSB.Utility; using QSB.Utility;
@ -101,7 +102,7 @@ namespace QSB
channels.Add(QosType.Reliable); channels.Add(QosType.Reliable);
channels.Add(QosType.Unreliable); channels.Add(QosType.Unreliable);
gameObject.AddComponent<Events.PlayerState>(); gameObject.AddComponent<Events.PlayerStateEvent>();
} }
public override void OnStartServer() public override void OnStartServer()

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
namespace QSB.Tools.Events namespace QSB.Tools.Events
{ {

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
namespace QSB.Tools.Events namespace QSB.Tools.Events
{ {

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
namespace QSB.Tools.Events namespace QSB.Tools.Events
{ {

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
namespace QSB.Tools.Events namespace QSB.Tools.Events
{ {

View File

@ -1,5 +1,6 @@
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
namespace QSB.Tools.Events namespace QSB.Tools.Events
{ {

View File

@ -1,4 +1,5 @@
using OWML.ModHelper.Events; using OWML.ModHelper.Events;
using QSB.Player;
using QSB.Utility; using QSB.Utility;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;

View File

@ -1,4 +1,5 @@
using QSB.Events; using QSB.Events;
using QSB.Player;
using QSB.Tools; using QSB.Tools;
using QSB.Utility; using QSB.Utility;
using UnityEngine; using UnityEngine;

View File

@ -1,4 +1,5 @@
using UnityEngine; using QSB.Player;
using UnityEngine;
namespace QSB.TransformSync namespace QSB.TransformSync
{ {

View File

@ -1,4 +1,5 @@
using OWML.Common; using OWML.Common;
using QSB.Player;
using QSB.Tools; using QSB.Tools;
using QSB.Utility; using QSB.Utility;
using UnityEngine; using UnityEngine;

View File

@ -1,6 +1,7 @@
using OWML.Common; using OWML.Common;
using QSB.Events; using QSB.Events;
using QSB.Messaging; using QSB.Messaging;
using QSB.Player;
using QSB.Utility; using QSB.Utility;
using QSB.WorldSync; using QSB.WorldSync;

View File

@ -1,4 +1,5 @@
using QSB.Animation; using QSB.Animation;
using QSB.Player;
using UnityEngine; using UnityEngine;
namespace QSB.TransformSync namespace QSB.TransformSync

View File

@ -1,4 +1,5 @@
using QSB.Events; using QSB.Events;
using QSB.Player;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;

View File

@ -1,4 +1,5 @@
using UnityEngine; using QSB.Player;
using UnityEngine;
namespace QSB.TransformSync namespace QSB.TransformSync
{ {

View File

@ -1,4 +1,5 @@
using OWML.Common; using OWML.Common;
using QSB.Player;
using QSB.Utility; using QSB.Utility;
using UnityEngine; using UnityEngine;