Skip to content

Omegga Server API

Isaac Hirschfeld edited this page Feb 14, 2021 · 1 revision

Omegga

Kind: global class

new Omegga()

Omegga instance

omegga._tempSaveCounter

The save counter prevents omegga from saving over the same file

Kind: instance property of Omegga

omegga._tempSavePrefix

The save prefix is prepended to all temporary saves

Kind: instance property of Omegga

omegga.players : Array.<Player>

list of online players

Kind: instance property of Omegga

omegga.host

host player info {id: uuid, name: player name}

Kind: instance property of Omegga

omegga.version : String

current game version - may later be turned into CL#### versions

Kind: instance property of Omegga

omegga.started : Boolean

whether server has started

Kind: instance property of Omegga

omegga.starting : Boolean

whether server is starting up

Kind: instance property of Omegga

omegga.currentMap : String

current map

Kind: instance property of Omegga

omegga.start() ⇒ Promise

start webserver, load plugins, start the brickadia server this should not be called by a plugin

Kind: instance method of Omegga

omegga.stop() ⇒ Promise

unload plugins and stop the server this should not be called by a plugin

Kind: instance method of Omegga

omegga.copyAuthFiles()

Copies auth files from home config dir this should never be called by a plugin

Kind: instance method of Omegga

omegga.broadcast(...messages)

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

omegga.whisper(target, ...messages)

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

omegga.getPlayers() ⇒ players

get a list of players

Kind: instance method of Omegga Returns: players - - list of players {id: uuid, name: name} objects

omegga.getRoleSetup() ⇒ object

Get up-to-date role setup from RoleSetup.json

Kind: instance method of Omegga

omegga.getRoleAssignments() ⇒ object

Get up-to-date role assignments from RoleAssignment.json

Kind: instance method of Omegga

omegga.getBanList() ⇒ object

Get up-to-date ban list from BanList.json

Kind: instance method of Omegga

omegga.getNameCache() ⇒ object

Get up-to-date name cache from PlayerNameCache.json

Kind: instance method of Omegga

omegga.getPlayer(arg) ⇒ Player

find a player by name, id, controller, or state

Kind: instance method of Omegga

Param Type Description
arg String name, id, controller, or state

omegga.findPlayerByName(name) ⇒ Player

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

omegga.getHostId() ⇒ String

get the host's ID

Kind: instance method of Omegga Returns: String - - Host Id

omegga.clearBricks(target, quiet)

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

omegga.clearAllBricks(quiet)

Clear all bricks on the server

Kind: instance method of Omegga

Param Type Default Description
quiet Boolean false quietly clear bricks

omegga.saveBricks(name)

Save bricks under a name

Kind: instance method of Omegga

Param Type Description
name String save file name

omegga.loadBricks(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

omegga.getSaves() ⇒ Array.<String>

get all saves in the save folder and child folders

Kind: instance method of Omegga

omegga.getSavePath(name) ⇒ String

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

omegga.writeSaveData(name, data)

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

omegga.readSaveData(name, nobricks) ⇒ SaveData

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

omegga.loadSaveData(data) ⇒ Promise

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

omegga.getSaveData() ⇒ Promise.<SaveData>

get current bricks as save data

Kind: instance method of Omegga Returns: Promise.<SaveData> - - BRS JS Save Data

omegga.changeMap(map) ⇒ Promise

Change server map

Kind: instance method of Omegga

Param Type Description
map String Map name

omegga.getServerStatus() ⇒ Promise.<Object>

Get a server status object containing bricks, time, players, player ping, player roles, etc

Kind: instance method of Omegga Returns: Promise.<Object> - - Server Status

omegga.getAllPlayerPositions() ⇒ Promise.<Array.<Object>>

get every player's position and alive states

Kind: instance method of Omegga

omegga.getMinigames() ⇒ Promise.<Array.<Object>>

get all minigames and their players (and the player's teams)

Kind: instance method of Omegga

Omegga.log(...args)

send a console log to the readline terminal or stdout

Kind: static method of Omegga

Param Type Description
...args args things to print out

Omegga.error(...args)

send a console error to the readline terminal or stderr

Kind: static method of Omegga

Param Type Description
...args args things to print out

Omegga.warn(...args)

send a console warn to the readline terminal or stdout

Kind: static method of Omegga

Param Type Description
...args args things to print out

Omegga.setTerminal(...term)

send a console log to the readline terminal or console

Kind: static method of Omegga

Param Type Description
...term args things to print out
Clone this wiki locally