Hi guys got connecting buy photon have my client app connecting to my server app via photon but get this error:
//Script with error:
public class SystemConnect : Photon.MonoBehaviour {
public static float LogginAttempt = 0;
public static float RegisterAttempt = 0;
public static float AccountLoaded = 0;
public static string Username = "";
public static int XP = 0;
public static int Gold = 0;
public static int Level = 0;
public static int Fighter01 = 0;
public static int Fighter02 = 0;
public static int Fighter03 = 0;
public static int Fighter04 = 0;
public static int Fighter05 = 0;
public static int Fighter06 = 0;
public static int Fighter07 = 0;
public static int Fighter08 = 0;
// Register Attempt
public static string RegisterUsernameAttempt = "";
public static string RegisterPasswordAttempt = "";
public static string LogginUsernameAttempt = "";
public static string LogginPasswordAttempt = "";
//LogginAttempt
//________________________________________________________________________________________________________________________________________
//________________________________________________________________________________________________________________________________________
// Update is called once per frame
void Update () {
if(RegisterAttempt > 0){
ClientConnect.myPhotonView.RPC("RegisterAttemptRPC", RPCMode.AllBuffered, null);
RegisterAttempt -= -1;
} else {
Debug.Log("No Attempt Made");
}
if(LogginAttempt > 0){
ClientConnect.myPhotonView.RPC("LogginAttemptRPC", RPCMode.AllBuffered, null);
LogginAttempt -= -1;
} else {
Debug.Log("No Loggin Attempt Made");
}
if(AccountLoaded > 0) {
ClientConnect.myPhotonView.RPC("DISAccount", RPCMode.AllBuffered, null);
}
else {
Debug.Log("Awaiting Logging Attempt");
}
}
//________________________________________________________________________________________________________________________________________
[PunRPC]
public void LogginAttemptRPC () {
// Gather Username and Acount Details Input from User.
LogginUsernameAttempt = ClientLogginRegister.UsernameClient;
LogginPasswordAttempt = ClientLogginRegister.PasswrodClient;
LogginAttempt += + 1; // make 1 Attempt to logg in with username and password.
Debug.Log("Attempting First Loggin Pass");
}
//________________________________________________________________________________________________________________________________________
[PunRPC] // send Account information to the server from Client.
public void RegisterAttemptRPC () {
// Gather Username and Acount Details Input from User.
RegisterUsernameAttempt = ClientLogginRegister.UsernameClient;
RegisterPasswordAttempt = ClientLogginRegister.PasswrodClient;
RegisterAttempt += + 1; // make 1 Register Attempt to Register New Account.
Debug.Log("Attempting First Register Pass");
}
//________________________________________________________________________________________________________________________________________
[PunRPC] // send Account information to the server from Client.
public void DISAccount (){
XP = ServerSideLogginRegister.XP;
Gold = ServerSideLogginRegister.Gold;
Level = ServerSideLogginRegister.Level;
Fighter01 = ServerSideLogginRegister.Fighter01;
Fighter02 = ServerSideLogginRegister.Fighter02;
Fighter03 = ServerSideLogginRegister.Fighter02;
Fighter04 = ServerSideLogginRegister.Fighter02;
Fighter05 = ServerSideLogginRegister.Fighter02;
Fighter06 = ServerSideLogginRegister.Fighter02;
Username = ServerSideLogginRegister.Username;
ClientLogginRegister.LoggedIn += +1;
}
} // End Class
// Script to connect:
using UnityEngine;
using System.Collections;
public class ClientConnect : MonoBehaviour {
public static PhotonView myPhotonView;
// Use this for initialization
public void Start()
{
PhotonNetwork.ConnectUsingSettings("0.1");
}
public void OnJoinedLobby()
{
Debug.Log("JoinRandom");
PhotonNetwork.JoinRandomRoom();
}
public void OnConnectedToMaster()
{
// when AutoJoinLobby is off, this method gets called when PUN finished the connection (instead of OnJoinedLobby())
PhotonNetwork.JoinRandomRoom();
}
public void OnPhotonRandomJoinFailed()
{
Debug.Log("Could Not Connect To Server");
}
public void OnJoinedRoom()
{
}
} // End Class.