- Home /
Question by
Albert-han · Jun 27, 2014 at 01:58 AM ·
errorparsingunexpected
Unexpected error
Hi guys ive got a error with this script.They say parser error line 31 but i cant figure out what's wrong with the code.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class NetworkManager : MonoBehaviour {
public string PlayerName;
public string MatchName;
public static NetworkManager Instance;
public List<Player>PLayerList = new List<Player>();
// Use this for initialization
void Start () {
Instance = this;
}
// Update is called once per frame
void Update () {
}
public void StartServer(string ServerName, int MaxPlayers){
Network.InitializeSecurity ();
Network.InitializeServer (MaxPlayers,25565);
MasterServer.RegisterHost ("Tut", ServerName);
Debug.Log ("Started Server");
}
}
[System.Serializable]
public class Player
public string PlayerName
}
Comment
Answer by Jeff-Kesselman · Jun 27, 2014 at 02:00 AM
I give you a heent....
Look at line 30
What is missing at the end?
my updated code but still geting parsing error
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Network$$anonymous$$anager : $$anonymous$$onoBehaviour {
public string PlayerName;
public string $$anonymous$$atchName;
public static Network$$anonymous$$anager Instance;
public List<Player>PLayerList = new List<Player>();
// Use this for initialization
void Start () {
Instance = this;
DontDestroyOnLoad (gameObject);
}
// Update is called once per frame
void Update () {
}
public void StartServer(string ServerName, int $$anonymous$$axPlayers){
Network.InitializeSecurity ();
Network.InitializeServer ($$anonymous$$axPlayers,25565,true);
$$anonymous$$asterServer.RegisterHost ("Tut", ServerName,"");
Debug.Log("Started Server");
}
}
[System.Serializable]
public class Player
public string PlayerName;
}
This should do it
public class Player **{**
public string PlayerName**;**
}