Question by
luckie12 · Nov 07, 2016 at 06:51 PM ·
networkingnetwork
Master Server Table not found during query or row removal
Hello,
I have a problem, i finally was able to build the Master Server and Nat Facilitator in VC2008. But now when i try to connect i get on my master server:
Table _TEST_SERVER_2K16_YAY_WOO not found during query or row removal from (ip)
Now, this worked when i used the unity master servers
this is the code i am using:
using UnityEngine;
using System.Collections;
using UnityEngine.Rendering;
using UnityEngine.Networking;
public class ServerSetup : NetworkBehaviour{
bool IsHeadless()
{
return SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null;
}
void Awake()
{
MasterServer.ipAddress = "*";
MasterServer.port = 23466;
Network.natFacilitatorIP = "*";
Network.natFacilitatorPort = 50005;
if (IsHeadless())
{
print("headless mode detected");
Debug.Log("I am headless (server)");
StartServer();
}
if (!IsHeadless())
{
GetServers();
Debug.Log("I am a client!");
}
}
void StartServer () {
Network.InitializeServer(32, 7777, !Network.HavePublicAddress());
MasterServer.RegisterHost("_TEST_SERVER_2K16_YAY_WOO", "MultiShot", "l33t game for all");
}
void GetServers()
{
MasterServer.RequestHostList("_TEST_SERVER_2K16_YAY_WOO");
Debug.Log("Trying to get servers");
}
void OnServerInitialized()
{
Debug.Log("Server initialized and ready");
}
void OnGUI()
{
HostData[] data = MasterServer.PollHostList();
foreach (var element in data)
{
GUILayout.BeginHorizontal();
var name = element.gameName + " " + element.connectedPlayers + " / " + element.playerLimit;
GUILayout.Label(name);
GUILayout.Space(5);
string hostInfo;
hostInfo = "[";
foreach (var host in element.ip)
hostInfo = hostInfo + host + ":" + element.port + " ";
hostInfo = hostInfo + "]";
GUILayout.Label(hostInfo);
GUILayout.Space(5);
GUILayout.Label(element.comment);
GUILayout.Space(5);
GUILayout.FlexibleSpace();
if (GUILayout.Button("Connect"))
{
Network.Connect(element);
MasterServer.ClearHostList();
}
GUILayout.EndHorizontal();
}
}
}
PS: Im using a headless client as you can see :)
Thanks!
Comment