Hello,
i want to setup some fixed dedicated Gameserver. Should i setup a lobby and register gameserver to it, and after i did this, i can see the server in my serverlist?
Or should register channels in the gameserver? If its so, how can i setup fixed channels?
//EDIT: Ok, i got how to setup fixed channels.
Here a small snippet, i hope it's ok.
using UnityEngine;
using System.Collections;
using System;
using TNet;
public class CreateFixedChannel : MonoBehaviour {
// Use this for initialization
void Start () {
TNManager.Connect("YOUR IP", YOUR PORT);
}
private string channelname ="";
private string channelmaxplayer = "8";
private string channelpw = "";
void OnGUI()
{
if (TNManager.isConnected)
{
GUI
.Label(new Rect
(20,
20,
100,
50),
"Channelname:"); channelname
= GUI
.TextField(new Rect
(120,
20,
200,
20),channelname
);
GUI
.Label(new Rect
(20,
50,
100,
50),
"Max Player:"); channelmaxplayer
= GUI
.TextField(new Rect
(120,
50,
200,
20), channelmaxplayer
);
GUI
.Label(new Rect
(20,
80,
100,
50),
"Passwort:"); channelpw
= GUI
.TextField(new Rect
(120,
80,
200,
20), channelpw
);
if (GUILayout.Button("Create Channel"))
{
TNManager.CreateChannel(channelname, true, Convert.ToInt32(channelmaxplayer), channelpw);
}
}
}
}