-
Notifications
You must be signed in to change notification settings - Fork 16
Home
CreateProxy(options, serverList)
Proxy(serverSettings, serverList)
Returns a Proxy object and starts listening.
-
An object containing options for the
Serverclass.
All the options are listed in the node-minecraft-protocol documentation on this.
NOTE: ThekeepAliveoptions will not work beacause the real client and server are supposed to send an respond to keep-alive packets -
An object formatted like this:
{ 'serverName': { host: 'example.com' port: '25565', isDefault: true, // this indicates if a player should be redirected to this server on their first connection, there should be only one default server isFallback: true // this indicates if a player should be redirected to this server in the event of a disconnection from other servers }, 'serverName2': { host: 'localhost', port: 25566 } }
Example
{ hub: { host: 'localhost', port: 25565, isDefault: true, isFallback: true }, minigames: { host: 'localhost', port: 25566 } }
The Proxy class. This class extends the Server class from node-minecraft-protocol.
More information about the Server class can be found here.
-
An object with the arguments for the
Serverclass. The options for this class are explained in the node-minecraft-protocol documentation. -
A serverList object. See above for more info.
-
ServerList
This is the server list that has been passed as an argument on the creation of the proxy. The server list can be modified here. - All the variables eredited from the node-minecraft-protocol
Serverclass
-
Move the client with the specified
ClientIdto the server with the specifiednewServerNameArguments
-
remoteClientId
The id of the client. The client object is eredited from theServerclass. -
newServerName
The name of the new server to wich the client will be connected. This name should be present in the serverList.
-
-
Move the client with the specified
ClientIdto the fallback server (obtained using getFallBackServer())Arguments
- remoteClientId
The id of the client. The client object is eredited from theServerclass.
- remoteClientId
-
Returns the
serverNameof the fallback server -
Returns the
serverNameof the default server -
All the methods eredited from the node-minecraft-protocol
Serverclass
-
Called when an error occurs. Parameters:
-
error: the error object
-
-
Called when a player is moving from a server to another (whether the player is being moved normally or is falling back to another server). Parameters
-
playerId: the id of the client that is being moved -
oldServerName: the id of the server from wich the player is being moved -
newServerName: the id of the server to wich the player is being moved
-
-
Called when a player has been moved from a server to another (whether the player was moved normally or was falling back to another server). Parameters
-
playerId: the id of the client that was moved -
oldServerName: the id of the server from wich the player was moved -
newServerName: the id of the server to wich the player was moved
-
-
Called when a player has failed to move from a server to another (whether the player was moved normally or was falling back to another server, normally called together with the
errorevent). Parameters-
error: the error that prevented the move of the player -
playerId: the id of the client that was being moved -
oldServerName: the id of the server from wich the player was being moved -
newServerName: the id of the server to wich the player was being moved
-
-
Called when a player is falling back from a server to another (normally called together with the
playerMovingevent). Parameters-
playerId: the id of the client that is being moved -
oldServerName: the id of the server from wich the player is being moved -
newServerName: the id of the server to wich the player is being moved
-
-
All the evets eredited from the node-minecraft-protocol
Serverclass