UNPKG

node-haxball

Version:

The most powerful and lightweight API that allows you to develop your original Haxball(www.haxball.com) host, client, and standalone applications both on node.js and browser environments and also includes every possible hack and functionality that you can

72 lines (71 loc) 4.92 kB
module.exports = function(API){ const {Language, Errors: {ErrorCodes}} = API; Object.setPrototypeOf(this, Language.prototype); Language.call(this, "GB", { name: "English", version: "0.1", author: "abc", description: "Default language" }); this.api = { errors: { [ErrorCodes.Empty]: "", [ErrorCodes.ConnectionClosed]: 'Connection closed$1?(" $1":"")', [ErrorCodes.GameStateTimeout]: "Game state timeout", [ErrorCodes.RoomClosed]: "The room was closed.", [ErrorCodes.RoomFull]: "The room is full.", [ErrorCodes.WrongPassword]: "Wrong password.", [ErrorCodes.BannedBefore]: "You are banned from this room.", [ErrorCodes.IncompatibleVersion]: "Incompatible game version.", [ErrorCodes.FailedHost]: "Failed to connect to room host. If this problem persists please see the troubleshooting guide: https://github.com/haxball/haxball-issues/wiki/Connection-Issues", [ErrorCodes.Unknown]: "An error ocurred while attempting to join the room.<br><br>This might be caused by a browser extension, try disabling all extensions and refreshing the site.<br><br>The error has been printed to the inspector console.", [ErrorCodes.Cancelled]: "Cancelled", [ErrorCodes.FailedPeer]: "Failed to connect to peer.", [ErrorCodes.KickedNow]: 'You were $2?("banned":"kicked")$3?(" by $3":"")$1?(" ($1)":"")', [ErrorCodes.Failed]: "Failed", [ErrorCodes.MasterConnectionError]: "Master connection error", [ErrorCodes.StadiumParseError]: 'Error in "$1" index: $2', [ErrorCodes.StadiumParseSyntaxError]: "SyntaxError in line: $1", [ErrorCodes.StadiumParseUnknownError]: "Error loading stadium file.", [ErrorCodes.ObjectCastError]: "Cannot cast $1 to $2", [ErrorCodes.TeamColorsReadError]: "Too many", [ErrorCodes.UTF8CharacterDecodeError]: "Cannot decode UTF8 character at offset $1: charCode ($2) is invalid", [ErrorCodes.ReadTooMuchError]: "Read too much", [ErrorCodes.ReadWrongStringLengthError]: "Actual string length differs from the specified: $1 bytes", [ErrorCodes.EncodeUTF8CharNegativeError]: "Cannot encode UTF8 character: charCode ($1) is negative", [ErrorCodes.EncodeUTF8CharTooLargeError]: "Cannot encode UTF8 character: charCode ($1) is too large (>= 0x80000000)", [ErrorCodes.CalculateLengthOfUTF8CharNegativeError]: "Cannot calculate length of UTF8 character: charCode ($1) is negative", [ErrorCodes.CalculateLengthOfUTF8CharTooLargeError]: "Cannot calculate length of UTF8 character: charCode ($1) is too large (>= 0x80000000)", [ErrorCodes.BufferResizeParameterTooSmallError]: "Can't resize buffer to a capacity lower than 1", [ErrorCodes.BadColorError]: "Bad color", [ErrorCodes.BadTeamError]: "Bad team value", [ErrorCodes.StadiumLimitsExceededError]: "Error", [ErrorCodes.MissingActionConfigError]: "Class doesn't have a config", [ErrorCodes.UnregisteredActionError]: "Tried to pack unregistered action", [ErrorCodes.MissingImplementationError]: "Missing implementation", [ErrorCodes.AnnouncementActionMessageTooLongError]: "Message too long", [ErrorCodes.ChatActionMessageTooLongError]: "Message too long", [ErrorCodes.KickBanReasonTooLongError]: "String too long", [ErrorCodes.ChangeTeamColorsInvalidTeamIdError]: "Invalid team id", [ErrorCodes.MissingRecaptchaCallbackError]: "Recaptcha requested. Set a working recaptcha token while creating/joining a room.", [ErrorCodes.ReplayFileVersionMismatchError]: "The replay data is of a different version", [ErrorCodes.ReplayFileReadError]: "Couldn't load replay data.", [ErrorCodes.JoinRoomNullIdAuthError]: "Id and authObj cannot be null. (inside 1st parameter)", [ErrorCodes.PlayerNameTooLongError]: "Name too long", [ErrorCodes.PlayerCountryTooLongError]: "Country too long", [ErrorCodes.PlayerAvatarTooLongError]: "Avatar too long", [ErrorCodes.PlayerJoinBlockedByMPDError]: "Player join not allowed: $3 $4 $5 $1 $2", [ErrorCodes.PlayerJoinBlockedByORError]: "Player join event blocked by OperationReceived: $1", [ErrorCodes.PluginNotFoundError]: "Plugin not found at index $1", [ErrorCodes.PluginNameChangeNotAllowedError]: "Plugin name should not change", [ErrorCodes.LibraryNotFoundError]: "Library not found at index $1", [ErrorCodes.LibraryNameChangeNotAllowedError]: "Library name should not change", [ErrorCodes.AuthFromKeyInvalidIdFormatError]: "Invalid id format", [ErrorCodes.BadActorError]: "Bad Actor", [ErrorCodes.AuthBannedError]: "Auth banned: $1", [ErrorCodes.NoProxyIdentityProblem]: "Basro's backend is not compatible with the login system, so the identity token and identity events are disabled.", [ErrorCodes.NoProxyIdentitySolution]: "Solution: Use a proxy server and handle the login data there.", [ErrorCodes.FailedToCreateRoom]: "An error ocurred while attempting to create the room. ($1)" } }; };