You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
950 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
namespace Networking.Server {
[CreateAssetMenu(menuName = "Major Project/Networking/ClientList", order = 150)]
public class ServerObject : ScriptableObject
{
#region Inspector Fields
[Header("Server Settings")]
[SerializeField]
private int Port;
[Header("References")]
[SerializeField]
private ConnectionHandler LoginHandler;
#endregion Inspector Fields
#region ReadOnly Variables
public NetworkServerSimple server { get; private set;}
#endregion ReadOnly Variables
public void StartServer(int port)
{
Debug.Log("Starting Server on " + port);
server = new NetworkServerSimple();
LoginHandler.SetUp(this);
server.Listen(port);
}
}
}