-
Notifications
You must be signed in to change notification settings - Fork 8
Omegga API
The following fields, methods, and events are available to omegga.plugin.js
plugins
Kind: global class
-
Omegga
-
instance
- ._tempSaveCounter
- ._tempSavePrefix
- .players
- .host
- .version
- .started
- .starting
-
.start() ⇒
Promise
-
.stop() ⇒
Promise
- .copyAuthFiles()
- .broadcast(...messages)
- .whisper(...target)
-
.getPlayers() ⇒
players
-
.getRoleSetup() ⇒
object
-
.getRoleAssignments() ⇒
object
-
.getBanList() ⇒
object
-
.getNameCache() ⇒
object
-
.getPlayer(arg) ⇒
Player
-
.getServerStatus() ⇒
Promise.<Object>
-
.getAllPlayerPositions() ⇒
Array.<Object>
-
.getMinigames() ⇒
Array.<Object>
-
.findPlayerByName(name) ⇒
Player
-
.getHostId() ⇒
String
- .clearBricks(target, quiet)
- .clearAllBricks(quiet)
- .saveBricks(name)
- .loadBricks(name)
-
.getSaves() ⇒
Array.<String>
-
.getSavePath(name) ⇒
String
- .writeSaveData(name, data)
-
.readSaveData(name) ⇒
SaveData
-
.loadSaveData(data) ⇒
Promise
-
.getSaveData() ⇒
Promise.<SaveData>
- static
-
instance
The save counter prevents omegga from saving over the same file
Kind: instance property of Omegga
The save prefix is prepended to all temporary saves
Kind: instance property of Omegga
list of online players
Kind: instance property of Omegga
host player info {id: uuid, name: player name}
Kind: instance property of Omegga
current game version - may later be turned into CL#### versions
Kind: instance property of Omegga
whether server has started
Kind: instance property of Omegga
whether server is starting up
Kind: instance property of Omegga
start webserver, load plugins, start the brickadia server this should not be called by a plugin
Kind: instance method of Omegga
unload plugins and stop the server this should not be called by a plugin
Kind: instance method of Omegga
Copies auth files from home config dir this should never be called by a plugin
Kind: instance method of Omegga
broadcast messages to chat messages are broken by new line multiple arguments are additional lines all messages longer than 512 characters are deleted automatically, though omegga wouldn't have sent them anyway
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
...messages | messages |
unescaped chat messages to send. may need to wrap messages with quotes |
whisper messages to chat messages are broken by new line multiple arguments are additional lines all messages longer than 512 characters are deleted automatically, though omegga wouldn't have sent them anyway
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
...target | messages |
unescaped chat messages to send. may need to wrap messages with quotes |
get a list of players
Kind: instance method of Omegga
Returns: players
- - list of players {id: uuid, name: name} objects
Get up-to-date role setup from RoleSetup.json
Kind: instance method of Omegga
Get up-to-date role assignments from RoleAssignment.json
Kind: instance method of Omegga
Get up-to-date ban list from BanList.json
Kind: instance method of Omegga
Get up-to-date name cache from PlayerNameCache.json
Kind: instance method of Omegga
find a player by name, id, controller, or state
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
arg | String |
name, id, controller, or state |
Get a server status object containing bricks, time, players, player ping, player roles, etc
Kind: instance method of Omegga
Returns: Promise.<Object>
- - Server Status
get every player's position and alive states
Kind: instance method of Omegga
get all minigames and their players (and the player's teams)
Kind: instance method of Omegga
find a player by rough name, prioritize exact matches and get fuzzier
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
name | String |
player name, fuzzy |
get the host's ID
Kind: instance method of Omegga
Returns: String
- - Host Id
clear a user's bricks (by uuid, name, controller, or player object)
Kind: instance method of Omegga
Param | Type | Default | Description |
---|---|---|---|
target |
String | Object
|
player or player identifier | |
quiet | Boolean |
false |
quietly clear bricks |
Clear all bricks on the server
Kind: instance method of Omegga
Param | Type | Default | Description |
---|---|---|---|
quiet | Boolean |
false |
quietly clear bricks |
Save bricks under a name
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
name | String |
save file name |
Load bricks on the server
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
name | String |
save name |
Number |
world X offset | |
Number |
world Y offset | |
Number |
world Z offset | |
Boolean |
quiet mode |
get all saves in the save folder and child folders
Kind: instance method of Omegga
Checks if a save exists and returns an absolute path
Kind: instance method of Omegga
Returns: String
- - Path to string
Param | Type | Description |
---|---|---|
name | String |
Save filename |
unsafely load save data (wrap in try/catch)
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
name | String |
save file name |
data | SaveData |
BRS JS Save data |
unsafely read save data (wrap in try/catch)
Kind: instance method of Omegga
Returns: SaveData
- - BRS JS Save Data
Param | Type | Description |
---|---|---|
name | String |
save file name |
load bricks from save data and resolve when game finishes loading
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
data | SaveData |
BRS JS Save data |
Number |
save load X offset | |
Number |
save load Y offset | |
Number |
save load Z offset | |
Boolean |
quiet mode |
get current bricks as save data
Kind: instance method of Omegga
Returns: Promise.<SaveData>
- - BRS JS Save Data
send a console log to the readline terminal or stdout
Kind: static method of Omegga
Param | Type | Description |
---|---|---|
...args | args |
things to print out |
send a console error to the readline terminal or stderr
Kind: static method of Omegga
Param | Type | Description |
---|---|---|
...args | args |
things to print out |
send a console warn to the readline terminal or stdout
Kind: static method of Omegga
Param | Type | Description |
---|---|---|
...args | args |
things to print out |
send a console log to the readline terminal or console
Kind: static method of Omegga
Param | Type | Description |
---|---|---|
...term | args |
things to print out |
Kind: global class
-
Player
- new Player(omegga, name, id, controller, state)
-
instance
-
.clone() ⇒
Player
-
.raw() ⇒
Array.<String>
-
.isHost() ⇒
Boolean
- .clearBricks(quiet)
-
.getRoles() ⇒
Array.<String>
-
.getPermissions() ⇒
Object
-
.getNameColor() ⇒
String
-
.getPosition() ⇒
Promise.<List.<Number>>
-
.clone() ⇒
-
static
-
.getRoles(omegga, id) ⇒
Array.<String>
-
.getPermissions(omegga, id) ⇒
Object
-
.getRoles(omegga, id) ⇒
players are not to be constructed
Param | Type | Description |
---|---|---|
omegga | Omegga |
Omegga Instance |
name | String |
Player Name |
id | String |
Player Id |
controller | String |
Player Controller |
state | String |
Player State |
player.clone() ⇒ Player
Clone a player
Kind: instance method of Player
Get raw player info (to feed into a constructor)
Kind: instance method of Player
true if the player is the host
Kind: instance method of Player
clear this player's bricks
Kind: instance method of Player
Param | Type | Default | Description |
---|---|---|---|
quiet | Boolean |
false |
quiet mode |
get a player's roles, if any
Kind: instance method of Player
get a player's permissions in a map like {"Bricks.ClearOwn": true, ...}
Kind: instance method of Player
Returns: Object
- - permissions map
get player's name color
Kind: instance method of Player
Returns: String
- - 6 character hex string
get player's position
Kind: instance method of Player
Returns: Promise.<List.<Number>>
- - [x, y, z] coordinates
get a player's roles, if any
Kind: static method of Player
Returns: Array.<String>
- - list of roles
Param | Type | Description |
---|---|---|
omegga | Omegga |
omegga instance |
id | String |
player uuid |
get a player's permissions in a map like {"Bricks.ClearOwn": true, ...}
Kind: static method of Player
Returns: Object
- - permissions map
Param | Type | Description |
---|---|---|
omegga | Omegga |
Omegga instance |
id | String |
player uuid |