mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
fix event msg types being broken when disconnecting/reconnecting
This commit is contained in:
parent
49996f50f9
commit
cd48c916fc
@ -1,14 +1,8 @@
|
|||||||
using System;
|
namespace QSB.Events
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace QSB.Events
|
|
||||||
{
|
{
|
||||||
public abstract class BaseQSBEvent : IQSBEvent
|
public abstract class BaseQSBEvent : IQSBEvent
|
||||||
{
|
{
|
||||||
protected static int _msgType = 0;
|
internal static int _msgType;
|
||||||
|
|
||||||
public abstract void SetupListener();
|
public abstract void SetupListener();
|
||||||
public abstract void CloseListener();
|
public abstract void CloseListener();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using OWML.Common;
|
using System;
|
||||||
|
using OWML.Common;
|
||||||
using QSB.ClientServerStateSync;
|
using QSB.ClientServerStateSync;
|
||||||
using QSB.Messaging;
|
using QSB.Messaging;
|
||||||
using QSB.Player;
|
using QSB.Player;
|
||||||
@ -6,8 +7,6 @@ using QSB.Player.Events;
|
|||||||
using QSB.Player.TransformSync;
|
using QSB.Player.TransformSync;
|
||||||
using QSB.Utility;
|
using QSB.Utility;
|
||||||
using QuantumUNET.Components;
|
using QuantumUNET.Components;
|
||||||
using System;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace QSB.Events
|
namespace QSB.Events
|
||||||
{
|
{
|
||||||
@ -29,11 +28,6 @@ namespace QSB.Events
|
|||||||
_eventHandler.OnServerReceiveMessage += message => OnReceive(true, message);
|
_eventHandler.OnServerReceiveMessage += message => OnReceive(true, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
~QSBEvent()
|
|
||||||
{
|
|
||||||
_msgType--;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnReceiveRemote(bool isHost, T message) { }
|
public virtual void OnReceiveRemote(bool isHost, T message) { }
|
||||||
public virtual void OnReceiveLocal(bool isHost, T message) { }
|
public virtual void OnReceiveLocal(bool isHost, T message) { }
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ namespace QSB.Events
|
|||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
BaseQSBEvent._msgType = 0;
|
||||||
_eventList = new List<IQSBEvent>
|
_eventList = new List<IQSBEvent>
|
||||||
{
|
{
|
||||||
// Player
|
// Player
|
||||||
|
Loading…
Reference in New Issue
Block a user