Here is my connection code, when I connect the player shows up on the statistics page as connected and I can see the ping and connection timer, but, when I attempt to send an RPC or verify the client connection I get the following error:
“Can’t send RPC because no connection was made”.
Server:
void launchMasterServer ()
{
if (ipAddress != "")
{
MasterServer.ipAddress = ipAddress;
}
Network.InitializeSecurity ();
Network.InitializeServer (int.Parse (maxConnections), int.Parse (listenPort), !Network.HavePublicAddress ());
networkCore.GetComponent<NET_networkCore> ().Server = true;
}
void launchGameServer ()
{
MasterServer.RegisterHost (gameType, gameName);
GameObject sCore = networkCore.GetComponent<OBJ_networkCore> ().factoryServerCore (gameName);
serverCore = sCore;
}
Client:
void serverList()
{
HostData[] hostList = MasterServer.PollHostList();
foreach (HostData host in hostList)
{
GUILayout.BeginHorizontal();
GUILayout.Box (host.gameName);
if (GUILayout.Button ("Connect"))
{
Network.Connect (host);
networkCore.GetComponent<NET_networkCore>().sendRPC ("Server", networkCore.networkView.owner, networkCore.networkView.owner, "Verify Connection", "None", "");
if (Network.isClient)
{
messageString = "Required Fields Denoted By *";
messageState = true;
serverListState = false;
registerState = true;
initRect ();
}
}
GUILayout.EndHorizontal();
}
}
Any advice?
Sean