setting your own masterserver up

I have downloaded the latest masterserver from the unity website: Game Development Software: Build a Multiplayer Game | Unity.

However i tried to follow that topic:

i added that codes:

private var MasterServer.ipAddress = "";
private var MasterServer.port = 23466; 
private var Network.natFacilitatorIP = "";
private var Network.natFacilitatorPort = 50005;

and i got that error in this line:
private var MasterServer.ipAddress = “”;

Assets/Networking Scripts/ConnectGuiMasterServer.js(22,25): BCE0043: Unexpected token: …

Please can anyone help!

The issue is that you are trying to redefine an already defined variable.

Lets say unity has a variable transform.position, what you are essentially trying to say is private var transform.position =, when in reality you’re supposed to leave out the “private var” part.

Take out all of those “private var” 's, and your problem might be solved.

Well, I can definitely say that the Unexpected token is “.”, which means that it MUST be the period between MasterServer and ipAddress, since the other ones are in quotation marks and would be ignored since periods can be used within “String”-types.

A little more info while I’m at it:

You cannot define a variable like this:

private var a.b : float = 1;

this is because the “.” is used as an address, you can make a class A with variable b, then a variable a of class A and finally describe b in a, but you cannot do the aforementioned move all in one go.

thus for the same reason you cannot do:

private var MasterServer.ipAddress : String = "";

because you are using a “.” in the middle.

Furthermore even if you could “MasterServer.ipAddress” (and “MasterServer” for that matter) already exists, so Unity would say no regardless.

it should just be
MasterServer.ipAddress = “”;
since MasterServer.ipAddress is already defined and you want to just change it.