- Code: Select all
import playerio.*
stop()
//Connect and join the room
var connection:Connection;
var gameID:String = "[My Game Id is here Here]"
PlayerIO.connect(stage, gameID, "public", "User" + Math.floor(Math.random()*1000).toString(), "", handleConnect, function(){trace("connect error")} ); //This connects us to our game server
function handleConnect(client:Client){ // Called on successful connection
trace("Connected to server")
client.multiplayer.createJoinRoom("main", "Player.IO Main Cluster", false, {}, {}, handleJoin, function(error){trace(error)} ); //Makes us join or create the room "main"
nextFrame();
}
//called when a user joins the room
function handleJoin(conn:Connection){
trace("joined")
connection = conn
//This will call gotMessage every time we receive any message
connection.addMessageHandler("*",gotMessage);
}
I get this error:
Error: The game run doesn't have server type with the name: "Player.IO Main Cluster". The available server types are []