-
Notifications
You must be signed in to change notification settings - Fork 8
Omegga Server API
Kind: global class
-
Omegga
- new Omegga()
-
instance
- ._tempSaveCounter
- ._tempSavePrefix
-
.players :
Array.<Player>
- .host
-
.version :
String
-
.started :
Boolean
-
.starting :
Boolean
-
.currentMap :
String
-
.start() ⇒
Promise
-
.stop() ⇒
Promise
- .copyAuthFiles()
- .broadcast(...messages)
- .whisper(target, ...messages)
-
.getPlayers() ⇒
players
-
.getRoleSetup() ⇒
object
-
.getRoleAssignments() ⇒
object
-
.getBanList() ⇒
object
-
.getNameCache() ⇒
object
-
.getPlayer(arg) ⇒
Player
-
.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, nobricks) ⇒
SaveData
-
.loadSaveData(data) ⇒
Promise
-
.getSaveData() ⇒
Promise.<SaveData>
-
.changeMap(map) ⇒
Promise
-
.getServerStatus() ⇒
Promise.<Object>
-
.getAllPlayerPositions() ⇒
Promise.<Array.<Object>>
-
.getMinigames() ⇒
Promise.<Array.<Object>>
- static
Omegga 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
current map
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 | String |
unescaped chat messages to send. may need to wrap messages with quotes |
whisper messages to a player's 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 | String |
player identifier or player object |
...messages | String |
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 |
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 | Default | Description |
---|---|---|---|
name | String |
save file name | |
nobricks | Boolean |
false |
only read save header data |
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
Change server map
Kind: instance method of Omegga
Param | Type | Description |
---|---|---|
map | String |
Map name |
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
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 |