mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +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;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace QSB.Events
|
||||
namespace QSB.Events
|
||||
{
|
||||
public abstract class BaseQSBEvent : IQSBEvent
|
||||
{
|
||||
protected static int _msgType = 0;
|
||||
internal static int _msgType;
|
||||
|
||||
public abstract void SetupListener();
|
||||
public abstract void CloseListener();
|
||||
|
@ -5,4 +5,4 @@
|
||||
void SetupListener();
|
||||
void CloseListener();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using OWML.Common;
|
||||
using QSB.ClientServerStateSync;
|
||||
using QSB.Messaging;
|
||||
using QSB.Player;
|
||||
@ -6,8 +7,6 @@ using QSB.Player.Events;
|
||||
using QSB.Player.TransformSync;
|
||||
using QSB.Utility;
|
||||
using QuantumUNET.Components;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.Events
|
||||
{
|
||||
@ -29,11 +28,6 @@ namespace QSB.Events
|
||||
_eventHandler.OnServerReceiveMessage += message => OnReceive(true, message);
|
||||
}
|
||||
|
||||
~QSBEvent()
|
||||
{
|
||||
_msgType--;
|
||||
}
|
||||
|
||||
public virtual void OnReceiveRemote(bool isHost, T message) { }
|
||||
public virtual void OnReceiveLocal(bool isHost, T message) { }
|
||||
|
||||
@ -114,4 +108,4 @@ namespace QSB.Events
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ namespace QSB.Events
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
BaseQSBEvent._msgType = 0;
|
||||
_eventList = new List<IQSBEvent>
|
||||
{
|
||||
// Player
|
||||
|
Loading…
Reference in New Issue
Block a user