mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
0de3879998
* Add networksync on wake up * Attempt * Added log to screen * Better debug screen logging * I'm an idiot * Wake up client when waking up server * Set initial sector * Server use OnClientReceiveMessage * Cleanup * Prevent server from waking itself * Pass id values as number * Woops * Best I can do sorry * Revert "Best I can do sorry" This reverts commit f3f0fbdb2edb72365dd948775e377a3debd56411. * Ignore a bunch of sectors earlier * Cleanup * Message type enum * Some comments
19 lines
690 B
C#
19 lines
690 B
C#
using UnityEngine;
|
|
using UnityEngine.Networking;
|
|
|
|
namespace QSB {
|
|
// Extend this to create new message handlers.
|
|
// You'll also need to create a new message type (add it to the enum).
|
|
public abstract class MessageHandler: MonoBehaviour {
|
|
protected abstract MessageType type { get; }
|
|
|
|
void Awake () {
|
|
NetworkServer.RegisterHandler((short) type, OnServerReceiveMessage);
|
|
NetworkManager.singleton.client.RegisterHandler((short) type, OnClientReceiveMessage);
|
|
}
|
|
|
|
protected abstract void OnClientReceiveMessage (NetworkMessage netMsg);
|
|
protected abstract void OnServerReceiveMessage (NetworkMessage netMsg);
|
|
}
|
|
}
|