Skip to content

Instantly share code, notes, and snippets.

@BrentFarris
Last active August 29, 2015 14:13
Show Gist options
  • Save BrentFarris/dea83f9b5e60b9a2d8e1 to your computer and use it in GitHub Desktop.
Save BrentFarris/dea83f9b5e60b9a2d8e1 to your computer and use it in GitHub Desktop.
Host a Server With Forge Networking
using UnityEngine;
using BeardedManStudios.Network;
public class StartServer : MonoBehaviour
{
public ushort port = 15937; // Port number
public Networking.TransportationProtocolType protocolType = Networking.TransportationProtocolType.UDP; // Communication method
public int playerCount = 31; // Maximum player count -- excluding this server
private void Start()
{
Networking.Host(port, protocolType, playerCount);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment