1
Fork 0
mirror of https://github.com/Steffo99/better-tee.git synced 2024-11-22 07:14:19 +00:00
better-tee/Assets/Code/ServerMainController.cs

25 lines
962 B
C#
Raw Normal View History

2019-09-15 22:28:36 +00:00
using UnityEngine;
using System.Collections.Generic;
using Mirror;
public class ServerMainController : MonoBehaviour
{
2019-09-15 23:07:27 +00:00
[Header("Status")]
2019-09-15 22:28:36 +00:00
public bool isListening = false;
2019-09-15 23:07:27 +00:00
[Header("Constants")]
public const int MAX_CONNECTIONS = 32;
2019-09-15 22:28:36 +00:00
public void ServerStart() {
NetworkServer.Listen(MAX_CONNECTIONS);
2019-09-15 23:07:27 +00:00
NetworkServer.RegisterHandler<NetMessages.PlayerConnectionMessage>(OnPlayerConnect);
NetworkServer.RegisterHandler<NetMessages.ViewerConnectionMessage>(OnViewerConnect);
NetworkServer.RegisterHandler<NetMessages.ActResultsMessage>(OnActResults);
2019-09-15 22:28:36 +00:00
isListening = true;
}
2019-09-15 23:07:27 +00:00
public void OnPlayerConnect(NetworkConnection connection, NetMessages.PlayerConnectionMessage message) {}
public void OnViewerConnect(NetworkConnection connection, NetMessages.ViewerConnectionMessage message) {}
public void OnActResults(NetworkConnection connection, NetMessages.ActResultsMessage message) {}
2019-09-15 22:28:36 +00:00
}