Namespace: playerio
Language: ActionScript 3
Provides access to the Multiplayer services provided by Player.IO.
Properties | |||
|---|---|---|---|
| public |
If defined the system will connect to a local development server instead of a live server. |
||
Methods | |||
| public |
Creates or joins a room of the specified server type. |
||
| public |
Creates a room of the specified server type. |
||
| public |
Joins an already existing room |
||
| public |
List all room instances of a specific server type |
||
If defined the system will connect to a local development server instead of a live server.
The following example connects to a development server running on localhost on port 8184
Creates or joins a room of the specified server type.
| String | roomId |
| The id of the room, if set to null the room is assigned a random id | |
| String | roomType |
| The type of room we should start | |
| Boolean | visible |
| If the room should be returned when doing a listRooms request | |
| Object | roomData |
| Init data, this init data can be read on by server: {Name:"MyRoom", Level:3} | |
| Object | joinData |
| User join data, this join data can be read by the server: {Name:"Chris", Type:"Sniper"} | |
| Function | callback |
| Method executed when the createJoinRoom call executed successfully: function(connection:Connection):void{...} | |
| Function | errorHandler |
| Method executed if the createJoinRoom request failed: function(error:PlayerIOError):void{...} |
Creates a room of the specified server type.
| String | roomId |
| The id of the room, if set to null the room is assigned a random id | |
| String | roomType |
| The type of room we should start | |
| Boolean | visible |
| If the room should be returned when doing a listRooms request | |
| Object | roomData |
| Init data, this init data can be read by server: {Name:"MyRoom", Level:3} | |
| Function | callback |
| Method executed when the createRoom call executed successfully, returns the id of the created room: function(roomId:String):void{...} | |
| Function | errorHandler |
| Method executed if the joinRoom request failed: function(error:PlayerIOError):void{...} |
Joins an already existing room
| String | roomId |
| The id of the room we wish to join | |
| Object | joinData |
| User join data, this join data can be read by the server: {Name:"Chris", Type:"Sniper"} | |
| Function | callback |
| Method executed when the joinRoom call executed successfully: function(connection:Connection):void{...} | |
| Function | errorHandler |
| Method executed if the joinRoom request failed: function(error:PlayerIOError):void{...} |
List all room instances of a specific server type
| String | roomType |
| The type of room we should list | |
| Object | searchCriteria |
| Compares the properties of the parsed object to properties on the roomData object and returns only perfect matches. Passing the object {level:"3"} returns only rooms which have level defined as 3 on the roomData object. To use search criteria you must first define what properties are searchable under the Multiplayer menu option for your game. | |
| int | resultLimit |
| How many room instances should we load from the server | |
| int | resultOffset |
| At what offset should we list from | |
| Function | callback |
| Method executed when the listRooms call executed successfully: function(rooms:Array<RoomInfo>):void{...} | |
| Function | errorHandler |
| Method executed if the listRooms request failed: function(error:PlayerIOError):void{...} |