CodeMaid cleanup

This commit is contained in:
Mister_Nebula 2020-12-03 08:28:05 +00:00
parent 7925b637a0
commit 78f1c6e811
125 changed files with 231 additions and 155 deletions

View File

@ -29,6 +29,7 @@ namespace QSB.Animation
public AnimatorMirror Mirror { get; private set; }
public AnimationType CurrentType = AnimationType.PlayerUnsuited;
public Animator Animator
{
get { return _bodyAnim; }
@ -141,7 +142,9 @@ namespace QSB.Animation
}
private void OnJump() => _netAnim.SetTrigger("Jump");
private void OnBecomeGrounded() => _netAnim.SetTrigger("Grounded");
private void OnBecomeUngrounded() => _netAnim.SetTrigger("Ungrounded");
public void SendCrouch(float value = 0)
@ -199,23 +202,29 @@ namespace QSB.Animation
_unsuitedGraphics?.SetActive(false);
_suitedGraphics?.SetActive(true);
break;
case AnimationType.PlayerUnsuited:
controller = _unsuitedAnimController;
_unsuitedGraphics?.SetActive(true);
_suitedGraphics?.SetActive(false);
break;
case AnimationType.Chert:
controller = _chertController;
break;
case AnimationType.Esker:
controller = _eskerController;
break;
case AnimationType.Feldspar:
controller = _feldsparController;
break;
case AnimationType.Gabbro:
controller = _gabbroController;
break;
case AnimationType.Riebeck:
controller = _riebeckController;
break;

View File

@ -70,6 +70,7 @@ namespace QSB.Animation
}
_floatParams[fromParam.name].Target = _from.GetFloat(fromParam.name);
break;
case AnimatorControllerParameterType.Bool:
_to.SetBool(fromParam.name, _from.GetBool(fromParam.name));
break;

View File

@ -21,6 +21,7 @@ namespace QSB.Animation
}
private void HandleSuitUp() => SendEvent(CreateMessage(true));
private void HandleSuitDown() => SendEvent(CreateMessage(false));
private ToggleMessage CreateMessage(bool value) => new ToggleMessage

View File

@ -2,7 +2,7 @@
namespace QSB.Animation.Events
{
class QSBAnimationMessage : MessageBase
internal class QSBAnimationMessage : MessageBase
{
public NetworkInstanceId netId;
public int stateHash;

View File

@ -2,7 +2,7 @@
namespace QSB.Animation.Events
{
class QSBAnimationParametersMessage : MessageBase
internal class QSBAnimationParametersMessage : MessageBase
{
public NetworkInstanceId netId;
public byte[] parameters;

View File

@ -2,7 +2,7 @@
namespace QSB.Animation.Events
{
class QSBAnimationTriggerMessage : MessageBase
internal class QSBAnimationTriggerMessage : MessageBase
{
public NetworkInstanceId netId;
public int hash;

View File

@ -13,7 +13,7 @@ namespace QSB.Animation
_lookBase = lookBase;
}
void LateUpdate()
private void LateUpdate()
{
var bone = _attachedAnimator.GetBoneTransform(HumanBodyBones.Head);
// Get the camera's local rotation with respect to the player body

View File

@ -7,7 +7,7 @@ namespace QSB.Animation
{
// Cleaned up unity code. UNET is so broken I gave up and fixed it myself.
class QSBNetworkAnimator : QSBNetworkBehaviour
internal class QSBNetworkAnimator : QSBNetworkBehaviour
{
private static QSBAnimationMessage AnimationMessage = new QSBAnimationMessage();
private static QSBAnimationParametersMessage ParametersMessage = new QSBAnimationParametersMessage();
@ -182,9 +182,11 @@ namespace QSB.Animation
case AnimatorControllerParameterType.Int:
writer.WritePackedUInt32((uint)m_Animator.GetInteger(parameter.nameHash));
break;
case AnimatorControllerParameterType.Float:
writer.Write(m_Animator.GetFloat(parameter.nameHash));
break;
case AnimatorControllerParameterType.Bool:
writer.Write(m_Animator.GetBool(parameter.nameHash));
break;
@ -210,10 +212,12 @@ namespace QSB.Animation
var num = (int)reader.ReadPackedUInt32();
m_Animator.SetInteger(parameter.nameHash, num);
break;
case AnimatorControllerParameterType.Float:
var single = reader.ReadSingle();
m_Animator.SetFloat(parameter.nameHash, single);
break;
case AnimatorControllerParameterType.Bool:
var flag = reader.ReadBoolean();
m_Animator.SetBool(parameter.nameHash, flag);

View File

@ -142,4 +142,4 @@ namespace QSB.ConversationSync
return newBox;
}
}
}
}

View File

@ -111,4 +111,4 @@ namespace QSB.ConversationSync
QSB.Helper.HarmonyHelper.AddPrefix<CharacterAnimController>("OnZoneExit", typeof(ConversationPatches), nameof(OnZoneExit));
}
}
}
}

View File

@ -7,4 +7,4 @@
CloseCharacter,
ClosePlayer
}
}
}

View File

@ -30,9 +30,11 @@ namespace QSB.ConversationSync.Events
var translated = TextTranslation.Translate(message.Message).Trim();
ConversationManager.Instance.DisplayCharacterConversationBox(message.ObjectId, translated);
break;
case ConversationType.Player:
ConversationManager.Instance.DisplayPlayerConversationBox((uint)message.ObjectId, message.Message);
break;
case ConversationType.CloseCharacter:
if (message.ObjectId == -1)
{
@ -41,10 +43,11 @@ namespace QSB.ConversationSync.Events
var tree = WorldRegistry.OldDialogueTrees[message.ObjectId];
UnityEngine.Object.Destroy(ConversationManager.Instance.BoxMappings[tree]);
break;
case ConversationType.ClosePlayer:
UnityEngine.Object.Destroy(QSBPlayerManager.GetPlayer((uint)message.ObjectId).CurrentDialogueBox);
break;
}
}
}
}
}

View File

@ -25,4 +25,4 @@ namespace QSB.ConversationSync.Events
writer.Write(Message);
}
}
}
}

View File

@ -67,4 +67,4 @@ namespace QSB.ConversationSync.Events
}
}
}
}
}

View File

@ -25,4 +25,4 @@ namespace QSB.ConversationSync.Events
writer.Write(State);
}
}
}
}

View File

@ -30,4 +30,4 @@ namespace QSB.DeathSync.Events
public override void OnReceiveLocal(EnumMessage<DeathType> message) => OnReceiveRemote(message);
}
}
}

View File

@ -6,7 +6,6 @@ namespace QSB.DeathSync
{
public static class Necronomicon
{
private static readonly Dictionary<DeathType, string[]> DeathDictionary = new Dictionary<DeathType, string[]>
{
{ DeathType.Default, new[]
@ -100,6 +99,5 @@ namespace QSB.DeathSync
{
return DeathDictionary[deathType].OrderBy(x => Guid.NewGuid()).First();
}
}
}
}

View File

@ -40,4 +40,4 @@ namespace QSB.DeathSync
}
}
}
}
}

View File

@ -136,4 +136,4 @@ namespace QSB.DeathSync
.FirstOrDefault(spawnPoint => spawnPoint.GetSpawnLocation() == SpawnLocation.TimberHearth && spawnPoint.IsShipSpawn() == isShip);
}
}
}
}

View File

@ -35,4 +35,4 @@ namespace QSB.ElevatorSync
public int GetId(Elevator elevator) => _elevators.IndexOf(elevator);
}
}
}

View File

@ -19,4 +19,4 @@ namespace QSB.ElevatorSync
QSB.Helper.HarmonyHelper.AddPostfix<Elevator>("StartLift", typeof(ElevatorPatches), nameof(StartLift));
}
}
}
}

View File

@ -26,4 +26,4 @@ namespace QSB.ElevatorSync.Events
elevator?.RemoteCall(message.State);
}
}
}
}

View File

@ -54,4 +54,4 @@ namespace QSB.ElevatorSync
_interactVolume.DisableInteraction();
}
}
}
}

View File

@ -37,4 +37,4 @@
public static string QSBChangeAnimType = "QSBPlayInstrument";
public static string QSBServerSendPlayerStates = "QSBServerSendPlayerStates";
}
}
}

View File

@ -26,4 +26,4 @@
ConversationStartEnd,
PlayInstrument
}
}
}

View File

@ -3,6 +3,7 @@
public interface IQSBEvent
{
void SetupListener();
void CloseListener();
}
}
}

View File

@ -65,4 +65,4 @@ namespace QSB.EventsCore
OnReceiveRemote(message);
}
}
}
}

View File

@ -64,4 +64,4 @@ namespace QSB.EventsCore
_eventList = new List<IQSBEvent>();
}
}
}
}

View File

@ -33,4 +33,4 @@ namespace QSB.GeyserSync.Events
geyser?.SetState(message.State);
}
}
}
}

View File

@ -37,4 +37,4 @@ namespace QSB.GeyserSync
}
}
}
}
}

View File

@ -118,6 +118,7 @@ namespace QSB.Instruments
case AnimationType.Chert:
ChertDrum.SetActive(true);
break;
case AnimationType.PlayerSuited:
case AnimationType.PlayerUnsuited:
ChertDrum.SetActive(false);
@ -125,4 +126,4 @@ namespace QSB.Instruments
}
}
}
}
}

View File

@ -2,7 +2,7 @@
namespace QSB.Instruments.QSBCamera
{
class CameraController : MonoBehaviour
internal class CameraController : MonoBehaviour
{
private float _degreesX;
private float _degreesY;
@ -11,12 +11,13 @@ namespace QSB.Instruments.QSBCamera
// How far along the ray to move the camera. Avoids clipping into the walls.
private const float PercentToMove = 0.80f;
// Maximum distance for camera clipping
private const float RayLength = 5f;
public GameObject CameraObject;
void FixedUpdate()
private void FixedUpdate()
{
if (CameraManager.Instance.Mode != CameraMode.ThirdPerson)
{
@ -76,4 +77,4 @@ namespace QSB.Instruments.QSBCamera
transform.localRotation = localRotation;
}
}
}
}

View File

@ -111,4 +111,4 @@ namespace QSB.Instruments.QSBCamera
Mode = CameraMode.FirstPerson;
}
}
}
}

View File

@ -5,4 +5,4 @@
FirstPerson,
ThirdPerson
}
}
}

View File

@ -19,4 +19,4 @@ namespace QSB.MessagesCore
writer.Write((int)(object)Value);
}
}
}
}

View File

@ -12,6 +12,7 @@ namespace QSB.Messaging
public class MessageHandler<T> where T : MessageBase, new()
{
public event Action<T> OnClientReceiveMessage;
public event Action<T> OnServerReceiveMessage;
private readonly EventType _eventType;
@ -70,6 +71,5 @@ namespace QSB.Messaging
var message = netMsg.ReadMessage<T>();
OnServerReceiveMessage?.Invoke(message);
}
}
}
}

View File

@ -19,4 +19,4 @@ namespace QSB.Messaging
writer.Write(AboutId);
}
}
}
}

View File

@ -29,4 +29,4 @@ namespace QSB.OrbSync.Events
orbSlot?.SetState(message.State);
}
}
}
}

View File

@ -83,4 +83,4 @@ namespace QSB.OrbSync.Events
}
}
}
}
}

View File

@ -60,4 +60,4 @@ namespace QSB.OrbSync
QSB.Helper.HarmonyHelper.AddPrefix<NomaiInterfaceSlot>("CheckOrbCollision", typeof(OrbPatches), nameof(CheckOrbCollision));
}
}
}
}

View File

@ -35,4 +35,4 @@ namespace QSB.OrbSync
WorldRegistry.RaiseEvent(InterfaceSlot, ev);
}
}
}
}

View File

@ -6,4 +6,4 @@
public abstract void DoPatches();
}
}
}

View File

@ -46,4 +46,4 @@ namespace QSB.Patches
}
}
}
}
}

View File

@ -6,4 +6,4 @@
OnClientConnect,
OnNonServerClientConnect
}
}
}

View File

@ -36,4 +36,4 @@ namespace QSB.Player.Events
DebugLog.ToAll(text, MessageType.Info);
}
}
}
}

View File

@ -30,4 +30,4 @@ namespace QSB.Player.Events
message.NetIds.ToList().ForEach(netId => QSBNetworkManager.Instance.CleanupNetworkBehaviour(netId));
}
}
}
}

View File

@ -49,4 +49,4 @@ namespace QSB.Player.Events
}
}
}
}
}

View File

@ -48,6 +48,5 @@ namespace QSB.Player.Events
QSB.Helper.Events.Unity.RunWhen(() => transformSync?.SyncedTransform != null,
() => transformSync?.SetReferenceSector(sector));
}
}
}
}

View File

@ -31,4 +31,4 @@ namespace QSB.Player.Events
writer.Write(SectorName);
}
}
}
}

View File

@ -32,4 +32,4 @@ namespace QSB.Player.Events
}
}
}
}
}

View File

@ -37,4 +37,4 @@ namespace QSB.Player.Events
() => QSBPlayerManager.HandleFullStateMessage(message));
}
}
}
}

View File

@ -54,6 +54,5 @@ namespace QSB.Player
Destroy(_markerTarget.gameObject);
Destroy(this);
}
}
}
}

View File

@ -16,10 +16,12 @@ namespace QSB.Player
// Body Objects
public GameObject Camera { get; set; }
public GameObject Body { get; set; }
// Tools
public GameObject ProbeBody { get; set; }
public QSBProbe Probe { get; set; }
public QSBFlashlight FlashLight => Camera?.GetComponentInChildren<QSBFlashlight>();
public QSBTool Signalscope => GetToolByType(ToolType.Signalscope);
@ -28,10 +30,12 @@ namespace QSB.Player
// Conversation
public int CurrentDialogueID { get; set; }
public GameObject CurrentDialogueBox { get; set; }
// Animation
public AnimationSync AnimationSync => QSBPlayerManager.GetSyncObject<AnimationSync>(PlayerId);
public bool PlayingInstrument => AnimationSync.CurrentType != AnimationType.PlayerSuited
&& AnimationSync.CurrentType != AnimationType.PlayerUnsuited;

View File

@ -9,4 +9,4 @@ namespace QSB.Player
public uint PreviousPlayerId { get; set; }
public PlayerInfo Player => QSBPlayerManager.GetPlayer(PlayerId);
}
}
}

View File

@ -96,7 +96,7 @@ namespace QSB.Player
syncObject.PreviousPlayerId = uint.MaxValue;
return uint.MaxValue;
}
// If the player list count is not the same as the count of the same type syncobject (eg. 3 players and 4 PlayerTransformSyncs)
// If the player list count is not the same as the count of the same type syncobject (eg. 3 players and 4 PlayerTransformSyncs)
// and the highest ID below the syncobject's id is the same as the highest player id.
if (PlayerList.Count != PlayerSyncObjects.Count(x => x.GetType() == syncObject.GetType()) && lowerBound == playerIds.Max())
{
@ -146,4 +146,4 @@ namespace QSB.Player
return Enumerable.Range((int)player.PlayerId, count).Select(x => (uint)x).ToList();
}
}
}
}

View File

@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -48,9 +48,11 @@ namespace QSB
case LogType.Assert:
DebugLog.DebugWrite($"Assert - {condition}", MessageType.Message);
break;
case LogType.Log:
DebugLog.DebugWrite($"Log - {condition}", MessageType.Message);
break;
case LogType.Warning:
DebugLog.DebugWrite($"Warning - {condition}", MessageType.Warning);
break;
@ -69,8 +71,8 @@ namespace QSB
QSBPatchManager.DoPatchType(QSBPatchTypes.OnModStart);
// Turns out these are very finicky about what order they go. QSBNetworkManager seems to
// want to go first-ish, otherwise the NetworkManager complains about the PlayerPrefab being
// Turns out these are very finicky about what order they go. QSBNetworkManager seems to
// want to go first-ish, otherwise the NetworkManager complains about the PlayerPrefab being
// null (even though it isn't...)
gameObject.AddComponent<QSBNetworkManager>();
gameObject.AddComponent<QSBNetworkManagerHUD>();
@ -87,7 +89,7 @@ namespace QSB
Helper.HarmonyHelper.EmptyMethod(typeof(OWTime).GetMethod("Pause"));
}
void Update()
private void Update()
{
QSBNetworkIdentity.UNetStaticUpdate();
}
@ -103,4 +105,4 @@ namespace QSB
DebugMode = config.GetSettingsValue<bool>("debugMode");
}
}
}
}

View File

@ -9,10 +9,15 @@ namespace QSB
public static QSBInputManager Instance;
public static event InputEvent ChertTaunt;
public static event InputEvent EskerTaunt;
public static event InputEvent RiebeckTaunt;
public static event InputEvent GabbroTaunt;
public static event InputEvent FeldsparTaunt;
public static event InputEvent ExitTaunt;
public void Awake() => Instance = this;
@ -51,4 +56,4 @@ namespace QSB
}
}
}
}
}

View File

@ -67,4 +67,4 @@ namespace QSB
}
}
}
}
}

View File

@ -30,6 +30,7 @@ namespace QSB
public static QSBNetworkManager Instance { get; private set; }
public event Action OnNetworkManagerReady;
public bool IsReady { get; private set; }
private QSBNetworkLobby _lobby;

View File

@ -11,6 +11,7 @@ namespace QSB
public static bool IsInUniverse => InUniverse(CurrentScene);
public static event Action<OWScene, bool> OnSceneLoaded;
public static event Action<OWScene> OnUniverseSceneLoaded;
static QSBSceneManager()
@ -33,4 +34,4 @@ namespace QSB
private static bool InUniverse(OWScene scene)
=> scene == OWScene.SolarSystem || scene == OWScene.EyeOfTheUniverse;
}
}
}

View File

@ -2,7 +2,7 @@
namespace QSB.QuantumUNET
{
class QSBCRCMessage : MessageBase
internal class QSBCRCMessage : MessageBase
{
public override void Deserialize(NetworkReader reader)
{
@ -29,4 +29,4 @@ namespace QSB.QuantumUNET
public QSBCRCMessageEntry[] scripts;
}
}
}

View File

@ -1,9 +1,9 @@
namespace QSB.QuantumUNET
{
struct QSBCRCMessageEntry
internal struct QSBCRCMessageEntry
{
public string name;
public byte channel;
}
}
}

View File

@ -5,7 +5,7 @@ using UnityEngine.Networking;
namespace QSB.QuantumUNET
{
class QSBChannelBuffer : IDisposable
internal class QSBChannelBuffer : IDisposable
{
public QSBChannelBuffer(QSBNetworkConnection conn, int bufferSize, byte cid, bool isReliable, bool isSequenced)
{
@ -426,4 +426,4 @@ namespace QSB.QuantumUNET
private bool readingFragment = false;
}
}
}

View File

@ -4,7 +4,7 @@ using UnityEngine.Networking;
namespace QSB.QuantumUNET
{
struct QSBChannelPacket
internal struct QSBChannelPacket
{
public QSBChannelPacket(int packetSize, bool isReliable)
{
@ -79,4 +79,4 @@ namespace QSB.QuantumUNET
private bool m_IsReliable;
}
}
}

View File

@ -2,7 +2,7 @@
namespace QSB.QuantumUNET
{
class QSBClientAuthorityMessage : MessageBase
internal class QSBClientAuthorityMessage : MessageBase
{
public override void Deserialize(NetworkReader reader)
{
@ -20,4 +20,4 @@ namespace QSB.QuantumUNET
public bool authority;
}
}
}

View File

@ -4,7 +4,7 @@ using UnityEngine.Networking;
namespace QSB.QuantumUNET
{
class QSBLocalClient : QSBNetworkClient
internal class QSBLocalClient : QSBNetworkClient
{
public override void Disconnect()
{

View File

@ -3,7 +3,7 @@ using UnityEngine;
namespace QSB.QuantumUNET
{
class QSBNetBuffer
internal class QSBNetBuffer
{
public QSBNetBuffer()
{
@ -195,4 +195,4 @@ namespace QSB.QuantumUNET
private const int k_BufferSizeWarning = 134217728;
}
}
}

View File

@ -550,17 +550,44 @@ namespace QSB.QuantumUNET
}
}
public virtual void PreStartClient() { }
public virtual void OnNetworkDestroy() { }
public virtual void OnStartServer() { }
public virtual void OnStartClient() { }
public virtual void OnStartLocalPlayer() { }
public virtual void OnStartAuthority() { }
public virtual void OnStopAuthority() { }
public virtual void PreStartClient()
{
}
public virtual void OnNetworkDestroy()
{
}
public virtual void OnStartServer()
{
}
public virtual void OnStartClient()
{
}
public virtual void OnStartLocalPlayer()
{
}
public virtual void OnStartAuthority()
{
}
public virtual void OnStopAuthority()
{
}
public virtual bool OnRebuildObservers(HashSet<QSBNetworkConnection> observers, bool initialize) => false;
public virtual void OnSetLocalVisibility(bool vis) { }
public virtual void OnSetLocalVisibility(bool vis)
{
}
public virtual bool OnCheckObserver(QSBNetworkConnection conn) => true;
public virtual int GetNetworkChannel() => 0;
public virtual float GetNetworkSendInterval() => 0.1f;
private float m_LastSendTime;
@ -608,4 +635,4 @@ namespace QSB.QuantumUNET
internal static string GetErrorCode(this SocketException e) => e.ErrorCode.ToString();
}
}
}

View File

@ -164,4 +164,4 @@ namespace QSB.QuantumUNET
private bool m_ScriptCRCCheck;
}
}
}

View File

@ -802,10 +802,12 @@ namespace QSB.QuantumUNET
case ConnectState.Resolving:
case ConnectState.Disconnected:
return;
case ConnectState.Resolved:
m_AsyncConnect = ConnectState.Connecting;
ContinueConnect();
return;
case ConnectState.Failed:
GenerateConnectError(11);
m_AsyncConnect = ConnectState.Disconnected;
@ -853,6 +855,7 @@ namespace QSB.QuantumUNET
m_MsgReader.SeekZero();
m_Connection.TransportReceive(m_MsgBuffer, numBytes, channelId);
break;
case NetworkEventType.ConnectEvent:
if (LogFilter.logDebug)
{
@ -865,6 +868,7 @@ namespace QSB.QuantumUNET
m_AsyncConnect = ConnectState.Connected;
m_Connection.InvokeHandlerNoData(32);
break;
case NetworkEventType.DisconnectEvent:
if (LogFilter.logDebug)
{
@ -884,8 +888,10 @@ namespace QSB.QuantumUNET
m_Connection.InvokeHandlerNoData(33);
}
break;
case NetworkEventType.Nothing:
break;
default:
if (LogFilter.logError)
{
@ -1190,4 +1196,4 @@ namespace QSB.QuantumUNET
Failed
}
}
}
}

View File

@ -557,4 +557,4 @@ namespace QSB.QuantumUNET
public int bytes;
}
}
}
}

View File

@ -86,8 +86,6 @@ namespace QSB.QuantumUNET
}
}
public ReadOnlyCollection<QSBNetworkConnection> Observers
{
get
@ -975,6 +973,7 @@ namespace QSB.QuantumUNET
[SerializeField]
private bool m_LocalPlayerAuthority;
private bool m_IsServer;
private QSBNetworkBehaviour[] m_NetworkBehaviours;

View File

@ -256,4 +256,4 @@ namespace QSB.QuantumUNET
private bool m_ShowServer;
}
}
}

View File

@ -1710,4 +1710,4 @@ namespace QSB.QuantumUNET
private static string s_Address;
}
}
}

View File

@ -37,4 +37,4 @@ namespace QSB.QuantumUNET
public int channelId;
}
}
}

View File

@ -1,4 +1,4 @@
namespace QSB.QuantumUNET
{
public delegate void QSBNetworkMessageDelegate(QSBNetworkMessage netMsg);
}
}

View File

@ -3,7 +3,7 @@ using UnityEngine;
namespace QSB.QuantumUNET
{
class QSBNetworkMessageHandlers
internal class QSBNetworkMessageHandlers
{
internal void RegisterHandlerSafe(short msgType, QSBNetworkMessageDelegate handler)
{
@ -86,4 +86,4 @@ namespace QSB.QuantumUNET
private Dictionary<short, QSBNetworkMessageDelegate> m_MsgHandlers = new Dictionary<short, QSBNetworkMessageDelegate>();
}
}
}

View File

@ -1064,4 +1064,4 @@ namespace QSB.QuantumUNET
public List<PendingPlayerInfo> players;
}
}
}
}

View File

@ -5,7 +5,7 @@ using UnityEngine.Networking;
namespace QSB.QuantumUNET
{
class QSBNetworkScene
internal class QSBNetworkScene
{
private Dictionary<NetworkInstanceId, QSBNetworkIdentity> m_LocalObjects = new Dictionary<NetworkInstanceId, QSBNetworkIdentity>();

View File

@ -2037,4 +2037,4 @@ namespace QSB.QuantumUNET
private QSBNetworkServer m_Server;
}
}
}
}

View File

@ -320,14 +320,18 @@ namespace QSB.QuantumUNET
case NetworkEventType.DataEvent:
this.HandleData(connectionId, channelId, receivedSize, b);
break;
case NetworkEventType.ConnectEvent:
this.HandleConnect(connectionId, b);
break;
case NetworkEventType.DisconnectEvent:
this.HandleDisconnect(connectionId, b);
break;
case NetworkEventType.Nothing:
break;
default:
if (LogFilter.logError)
{
@ -580,4 +584,4 @@ namespace QSB.QuantumUNET
private QSBNetworkMessageHandlers m_MessageHandlers = new QSBNetworkMessageHandlers();
}
}
}

View File

@ -2,7 +2,7 @@
namespace QSB.QuantumUNET
{
class QSBObjectDestroyMessage : MessageBase
internal class QSBObjectDestroyMessage : MessageBase
{
public override void Deserialize(NetworkReader reader)
{
@ -16,4 +16,4 @@ namespace QSB.QuantumUNET
public NetworkInstanceId netId;
}
}
}

View File

@ -2,7 +2,7 @@
namespace QSB.QuantumUNET
{
class QSBObjectSpawnFinishedMessage : MessageBase
internal class QSBObjectSpawnFinishedMessage : MessageBase
{
public override void Deserialize(NetworkReader reader)
{
@ -16,4 +16,4 @@ namespace QSB.QuantumUNET
public uint state;
}
}
}

View File

@ -3,7 +3,7 @@ using UnityEngine.Networking;
namespace QSB.QuantumUNET
{
class QSBObjectSpawnMessage : MessageBase
internal class QSBObjectSpawnMessage : MessageBase
{
public override void Deserialize(NetworkReader reader)
{
@ -37,4 +37,4 @@ namespace QSB.QuantumUNET
public Quaternion rotation;
}
}
}

View File

@ -3,7 +3,7 @@ using UnityEngine.Networking;
namespace QSB.QuantumUNET
{
class QSBObjectSpawnSceneMessage : MessageBase
internal class QSBObjectSpawnSceneMessage : MessageBase
{
public override void Deserialize(NetworkReader reader)
{
@ -29,4 +29,4 @@ namespace QSB.QuantumUNET
public byte[] payload;
}
}
}

View File

@ -2,7 +2,7 @@
namespace QSB.QuantumUNET
{
class QSBOwnerMessage : MessageBase
internal class QSBOwnerMessage : MessageBase
{
public override void Deserialize(NetworkReader reader)
{
@ -20,4 +20,4 @@ namespace QSB.QuantumUNET
public short playerControllerId;
}
}
}

View File

@ -37,4 +37,4 @@ namespace QSB.QuantumUNET
public const int MaxPlayersPerClient = 32;
}
}
}

View File

@ -16,4 +16,4 @@ namespace QSB.QuantumUNET
public short playerControllerId;
}
}
}

View File

@ -2,7 +2,7 @@
namespace QSB.QuantumUNET
{
class QSBULocalConnectionToClient : QSBNetworkConnection
internal class QSBULocalConnectionToClient : QSBNetworkConnection
{
public QSBULocalConnectionToClient(QSBLocalClient localClient)
{
@ -64,4 +64,4 @@ namespace QSB.QuantumUNET
private QSBLocalClient m_LocalClient;
}
}
}

View File

@ -3,7 +3,7 @@ using UnityEngine.Networking;
namespace QSB.QuantumUNET
{
class QSBULocalConnectionToServer : QSBNetworkConnection
internal class QSBULocalConnectionToServer : QSBNetworkConnection
{
public QSBULocalConnectionToServer(QSBNetworkServer localServer)
{
@ -65,4 +65,4 @@ namespace QSB.QuantumUNET
private QSBNetworkServer m_LocalServer;
}
}
}

View File

@ -60,4 +60,4 @@ namespace QSB.QuantumUNET
private static Dictionary<NetworkID, NetworkAccessToken> s_dictTokens = new Dictionary<NetworkID, NetworkAccessToken>();
}
}
}

View File

@ -17,4 +17,4 @@ namespace QSB.SectorSync
ObjectId = id;
}
}
}
}

View File

@ -23,6 +23,7 @@ namespace QSB.SectorSync
QSBSceneManager.OnUniverseSceneLoaded += (OWScene scene) => RebuildSectors();
DebugLog.DebugWrite("Sector Manager ready.", MessageType.Success);
}
private void OnDestroy()
{
QSBSceneManager.OnUniverseSceneLoaded -= (OWScene scene) => RebuildSectors();
@ -50,4 +51,4 @@ namespace QSB.SectorSync
.First();
}
}
}
}

View File

@ -46,4 +46,4 @@ namespace QSB.SectorSync
GlobalMessenger<uint, QSBSector>.FireEvent(EventNames.QSBSectorChange, id, sector);
}
}
}
}

View File

@ -24,4 +24,4 @@ namespace QSB.TimeSync.Events
WakeUpSync.LocalInstance.OnClientReceiveMessage(message);
}
}
}
}

View File

@ -22,4 +22,4 @@ namespace QSB.TimeSync
}
}
}
}
}

View File

@ -6,4 +6,4 @@
Pausing,
Fastforwarding
}
}
}

View File

@ -5,7 +5,7 @@ using UnityEngine.UI;
namespace QSB.TimeSync
{
class TimeSyncUI : MonoBehaviour
internal class TimeSyncUI : MonoBehaviour
{
public static TimeSyncUI Instance;
@ -42,6 +42,7 @@ namespace QSB.TimeSync
}
public static void Start(TimeSyncType type) => QSB.Helper.Events.Unity.RunWhen(() => Instance._isSetUp, () => Instance.StartTimeSync(type));
public static void Stop() => QSB.Helper.Events.Unity.RunWhen(() => Instance._isSetUp, () => Instance.EndTimeSync());
private void StartTimeSync(TimeSyncType type)
@ -78,6 +79,7 @@ namespace QSB.TimeSync
+ Environment.NewLine
+ "Fast-forwarding to match server time...";
break;
case TimeSyncType.Pausing:
text = "Pausing to match server time...";
break;

View File

@ -20,4 +20,4 @@ namespace QSB.TimeSync
QSB.Helper.HarmonyHelper.AddPrefix<PlayerCameraEffectController>("OnStartOfTimeLoop", typeof(WakeUpPatches), nameof(OnStartOfTimeLoopPrefix));
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More