mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
17 lines
581 B
C#
17 lines
581 B
C#
using UnityEngine;
|
|
using UnityEngine.Networking;
|
|
|
|
namespace QSB {
|
|
public abstract class MessageHandler: MonoBehaviour {
|
|
protected abstract short type { get; }
|
|
|
|
public MessageHandler () {
|
|
NetworkServer.RegisterHandler(MessageType.Sector, OnServerReceiveMessage);
|
|
NetworkManager.singleton.client.RegisterHandler(MessageType.Sector, OnClientReceiveMessage);
|
|
}
|
|
|
|
protected abstract void OnClientReceiveMessage (NetworkMessage netMsg);
|
|
protected abstract void OnServerReceiveMessage (NetworkMessage netMsg);
|
|
}
|
|
}
|