Members
(readonly) CommandType :number
Console command and variable types.
Type:
- number
Properties:
| Name | Type | Description |
|---|---|---|
COMMAND |
number | A command. |
INT |
number | An integer variable. |
INT64 |
number | A 64-bit integer variable. |
FLOAT |
number | A floating-point variable. |
STRING |
number | A string variable. |
(readonly) DewErrorCode :number
Error codes.
Type:
- number
Properties:
| Name | Type | Description |
|---|---|---|
OK |
number | The method ran successfully. |
UNKNOWN_ERROR |
number | An unknown error occurred while running the method. |
JS_EXCEPTION |
number | A JavaScript exception occurred while running the method. |
BAD_QUERY |
number | A game communication error occurred. |
UNSUPPORTED_METHOD |
number | The method is not supported by the game. |
INVALID_ARGUMENT |
number | An invalid argument was passed to the method. |
NETWORK_ERROR |
number | An error occurred while performing a network operation. |
NOT_AVAILABLE |
number | The requested information is not available. |
COMMAND_FAILED |
number | The console command failed to execute successfully. |
(readonly) GameMode :number
Game modes.
Type:
- number
Properties:
| Name | Type | Description |
|---|---|---|
NONE |
number | |
CTF |
number | |
SLAYER |
number | |
ODDBALL |
number | |
KOTH |
number | |
FORGE |
number | |
VIP |
number | |
JUGGERNAUT |
number | |
TERRITORIES |
number | |
ASSAULT |
number | |
INFECTION |
number |
(readonly) MPEventAudience :number
Multiplayer event audiences.
Type:
- number
Properties:
| Name | Type | Description |
|---|---|---|
CAUSE_PLAYER |
number | |
CAUSE_TEAM |
number | |
EFFECT_PLAYER |
number | |
EFFECT_TEAM |
number | |
ALL |
number |
(readonly) MPEventCategory :number
Multiplayer event categories.
Type:
- number
Properties:
| Name | Type | Description |
|---|---|---|
GENERAL |
number | |
FLAVOR |
number | |
SLAYER |
number | |
CTF |
number | |
ODDBALL |
number | |
FORGE |
number | |
KOTH |
number | |
VIP |
number | |
JUGGERNAUT |
number | |
TERRITORIES |
number | |
ASSAULT |
number | |
INFECTION |
number | |
SURVIVAL |
number | |
WP |
number |
Type Definitions
ConsoleCommand
Contains information about a console command and its current state.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
type |
CommandType | The type of the command or variable. |
module |
string | The module name. |
name |
string | The name of the command or variable. This includes the module prefix. |
shortName |
string | The short name of the command or variable. |
description |
string | A description to display in a help listing. |
value |
* | The current value of the variable. For commands, this will be |
defaultValue |
* | The default value of the variable. For commands, this will be |
minValue |
* | The minimum value of the variable. For string variables and commands, this will be |
maxValue |
* | The maximum value of the variable. For string variables and commands, this will be |
replicated |
boolean |
|
archived |
boolean |
|
hidden |
boolean |
|
hostOnly |
boolean |
|
hideValue |
boolean |
|
internal |
boolean |
|
arguments |
Array.<string> | A list of arguments for the command. Each string will contain a value name, a space, and then a description. For variables, this will be empty. |
- Source:
- See:
DewPromise
A promise made by an asynchronous ElDewrito method.
If the promise is rejected for a reason related to ElDewrito, it will be rejected with a DewError object. This object includes an error code which can be used to easily figure out what went wrong.
If the promise is rejected for any other reason, it may be rejected with a generic Error.
Therefore, you must use instanceof DewError to check that the error is actually an ElDewrito error before getting specific information.
Type:
- Promise.<(*|Error)>
EventCallback(event)
A callback function for responding to events.
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
object | The event information. Properties
|
GameVariantInfo
Contains information about a game variant.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
mode |
GameMode | The base game mode. |
name |
string | The name. Can be empty. |
description |
string | The description. Can be empty. |
author |
string | The author. Can be empty. |
teams |
boolean |
|
timeLimit |
number | The time limit in minutes (0 if unlimited). |
rounds |
number | The number of rounds. |
scoreToWin |
number | The score-to-win (-1 if unlimited). |
- Source:
- See:
MapVariantInfo
Contains information about a map variant.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
name |
string | The name. Can be empty. |
description |
string | The description. Can be empty. |
author |
string | The author. Can be empty. |
mapId |
number | The map ID. |
- Source:
- See:
ScoreboardInfo
Contains information about the scoreboard.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
hasTeams |
boolean |
|
teamScores |
Array.<number> | The scores of all of the teams in the game. |
gameType |
string | The gamemode type. |
players |
Array.<ScoreboardPlayer> | Players listed on the scoreboard. |
- Source:
- See:
ScoreboardPlayer
Contains information about a player on the scoreboard.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
name |
string | The player's name. |
team |
number | The player's team index. |
color |
string | The player's primary armor color. |
UID |
string | The player's UID. |
kills |
number | The number of kills. |
assists |
number | The number of assists. |
deaths |
number | The number of deaths. |
score |
number | The player's score. |
- Source:
- See:
SessionInfo
Contains information about the current game multiplayer session
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
established |
boolean |
|
hasTeams |
boolean |
|
isHost |
boolean |
|
mapName |
string | Name of the currently loaded map. |
- Source:
- See:
StatsInfo
Contains information about the player's stats
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
medals |
Array.<number> | The medals earned during this game. |
weapons |
Array.<WeaponStats> | Information about the weapons used during this game. |
- Source:
- See:
WeaponStats
Information about a weapon's use in the current game
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
BetrayalsWith |
number | How many times the player used this weapon to betray their teammates. |
HeadshotsWith |
number | How many headshots the player got with this weapon. |
KilledBy |
number | How many times the player was killed by this weapon. |
Kills |
number | How many kills the player got with this weapon. |
SuicidesWith |
number | How many times the player killed themselves with this weapon. |
Events
chat
Fired when a chat message is received.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
message |
string | The chat message. Make sure to escape this properly before displaying it. |
sender |
string | The username that sent this message. Make sure to escape this properly before displaying it. |
chatType |
string | The type of message that was received. Can be "GLOBAL", "TEAM", "WHISPER", or "SERVER". |
teamIndex |
number | The team index of the player. Not included when chatType is "SERVER". |
UID |
string | The UID of the player. Not included when chatType is "SERVER". |
color |
string | The hex color of the player's primary armor color. Not included when chatType is "SERVER". |
console
Fired when a line is written to the in-game console.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
line |
string | The line that was written. Make sure to escape this properly before displaying it. |
hide
Fired after the current screen is hidden.
Type:
- object
loadprogress
Fired when the loading screen is active and the loading progress changes.
This event is only sent to visible screens.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
currentBytes |
number | The current number of bytes that have been decompressed. |
totalBytes |
number | The total number of bytes that need to be decompressed. |
mpevent
Fired when a multiplayer event occurs that affects the local player.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
name |
string | The internal name of the event. |
category |
MPEventCategory | The event's category. |
audience |
MPEventAudience | The audience that the event is intended for. |
pong
Fired when a server replies to a ping. This can only be received while the screen is active.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
address |
string | The IP address of the server. |
latency |
number | The round-trip time of the ping in milliseconds. |
timestamp |
number | A timestamp value representing when the ping was sent. |
scoreboard
Fires when the scoreboard is updated
Type:
serverconnect
Fired when attempting to connect to a server and when the connection succeeds or fails.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
connecting |
boolean | True if the client is currently trying to connect to the server. |
success |
boolean | True if the client successfully connected to the server. Will always be false if connecting is true. |
show
Fired after the current screen is shown. The data passed to this event is the data that was passed to dew.show.
Type:
- object
signal-ready
Fired when the game client receives the websocket connection information packet.
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
server |
string | The ip + port of the signal server in the format ip:port |
password |
string | The password assigned for the client to connect with |