Multiplayer Reference
Class BasePlayer
Namespace: PlayerIO.GameLibrary
Language: C# / .NET
The base class you inherit from for your Player class.
Properties
|
| public IConnection |
For internal usage
|
| public string |
The UserId that was originally used when the client called PlayerIO.Connect(...)
|
| public int |
Every time a client connects, an Id is assigned that uniquely identifies them in the room as long as they remain connected.
|
| public IPAddress |
The ip address the player is connected from
|
| public Dictionary<string, string> |
The data supplied by the client when the room was joined. That is, when the JoinRoom(...) or CreateJoinRoom(...) methods were called.
|
| public PartnerPay |
The PartnerPay object of the connected player
|
| public PayVault |
The PayVault vault of the connected player
|
| public DatabaseObject |
The PlayerObject of the connected player in the "PlayerObjects" BigDB table.
|
Methods
|
| public void |
Disconnects the client from the room.
|
| public virtual Dictionary<string, string> |
Override this method to provide custom debug data for the playerlist in the development server.
|
| public void |
Gets the PlayerObject (from the BigDB PlayerObjects table) for the connected player. The object
is loaded from BigDB on first load, then reused for subsequent GetPlayerObject requests, which means that subsequent calls
to GetPlayerObjects will call the callback instantly.
|
| public void |
Reloads the PlayerObject from the BigDB PlayerObjects table
|
| public void |
Send a message to the connected client
|
| public void |
| Send |
(string type, params object[] parameters) |
Send a message to the connected client without first having to construct a Message object.
|
BasePlayer.Connection
For internal usage
BasePlayer.ConnectUserId
The UserId that was originally used when the client called PlayerIO.Connect(...)
BasePlayer.Id
Every time a client connects, an Id is assigned that uniquely identifies them in the room as long as they remain connected.
BasePlayer.IPAddress
The ip address the player is connected from
BasePlayer.JoinData
| public Dictionary<string, string> |
|
The data supplied by the client when the room was joined. That is, when the JoinRoom(...) or CreateJoinRoom(...) methods were called.
BasePlayer.PartnerPay
The PartnerPay object of the connected player
BasePlayer.PayVault
The PayVault vault of the connected player
BasePlayer.PlayerObject
The PlayerObject of the connected player in the "PlayerObjects" BigDB table.
This object is loaded via the GetPlayerObject() method or automatically when a player joins the game if the Game.PreloadPlayerObjects property is set to true.
BasePlayer.Disconnect
Disconnects the client from the room.
BasePlayer.GetDebugValues
| public virtual Dictionary<string, string> |
|
Override this method to provide custom debug data for the playerlist in the development server.
Each key-value pair is displayed in the playerlist as a column value, instead of the
default one-column-per-property.
Example
This is how you'd override the method and provide two values for each player, that will
show up in the development server.
BasePlayer.GetPlayerObject
Gets the PlayerObject (from the BigDB PlayerObjects table) for the connected player. The object
is loaded from BigDB on first load, then reused for subsequent GetPlayerObject requests, which means that subsequent calls
to GetPlayerObjects will call the callback instantly.
Arguments
| Callback<DatabaseObject> |
callback |
|
A callback that will be called with the loaded PlayerObject |
BasePlayer.RefreshPlayerObject
Reloads the PlayerObject from the BigDB PlayerObjects table
Arguments
| Callback |
callback |
|
A callback that will be called when the new playerobject is loaded. |
BasePlayer.Send
Send a message to the connected client
Arguments
| Message |
message |
|
The message to send |
BasePlayer.Send
| public void |
| Send |
(string type, params object[] parameters) |
|
Send a message to the connected client without first having to construct a Message object.
Arguments
| string |
type |
|
The type of message to send |
| params object[] |
parameters |
|
The data to put in the message to send |