World of Hello
|
used for anything related to the server. More...
#include <server.h>
Static Public Member Functions | |
static bool | isConnected () |
checks if the user is online or offline. More... | |
static server | sendToClients (string command, string commandStr, bool removable=true, string key="", string keyStr="") |
send a command to clients. More... | |
static server | setKey (conditional< string, int > user, string key, string keyVal) |
set a user variable key for receiving certain data. More... | |
static server | addKey (conditional< string, int > user, string key, string keyVal) |
adds a user variable key for sending data to clients. More... | |
static server | removeKey (conditional< string, int > user, string key, string keyVal="") |
removes a key or keyVal from the client. More... | |
static conditional< multiReturn< element *, string >, multiReturn< mesh *, string >, multiReturn< ServerObject *, string >, nil > | getObjectFromCommand (string command) |
gets an object based on the server command. More... | |
static server | getObjects (string location) |
get objects saved on the server. More... | |
static server | sendScript (string scriptName, string scriptCont=game:getScript(scriptName), function func=null,...) |
sends the script to the server. More... | |
static server | sendFile (string filePath, function func=null,...) |
sends a file to the server. More... | |
static server | sendFile (string filePath, string serverFilePath, function func=null,...) |
sends a file to the server. More... | |
static server | sendFile (string serverFilePath, string fileContent, bool anyVal, function func=null,...) |
sends a file to the server. More... | |
static server | appendFile (string serverFilePath, string content, function func=null,...) |
appends content to the end of a server file. More... | |
static server | getFile (string serverFilePath, function func=null,...) |
get a file from the server. More... | |
static server | downloadFile (string serverFilePath, function func=null,...) |
downloads a file from the server and lets the user pick a save location. More... | |
static server | renameFile (string serverFilePath, sring newServerFilePath, function func=null,...) |
renames a server file to a new name. More... | |
static server | deleteFile (string serverFilePath, function func=null,...) |
deletes a file from the server. More... | |
static server | getFilePaths (string serverFolderPath, string find="", bool recursive=false, int maxResults=100, int page=0, function func,...) |
gets a list of files in a server's world directory. More... | |
static server | getScriptPaths (string serverFilePath, function func,...) |
gets a list of scripts from the server that the user is also running. More... | |
static server | getAccountPermissions (string accountName, function func,...) |
get and account's permissions. More... | |
static server | getAccountsWithPermissions (string permission, string permissionStr, function func,...) |
gets a list of accounts who have the provided permissions. More... | |
static server | getAccountsWithPermissions (string permission, function func,...) |
gets a list of accounts who have the provided permissions. More... | |
static server | findAccounts (string name, int max, int page, function func,...) |
gets a list of accounts that may match a given name. More... | |
static server | addPermission (string account, string permission, string permissionStr, bool enabled=true, function func=null,...) |
Adds a permission to the client. More... | |
static server | removePermission (string account, string permission, string permissionStr="", bool enabled=true, function func=null,...) |
Removes a permission from the client. More... | |
static server | getAccountIsStaff (string account, function func,...) |
gets whether the client is a staff member or not. More... | |
static server | setAccountIsStaff (string account, bool isStaff=true, function func=null,...) |
sets whether the client is a staff member or not, More... | |
static server | getWorldProperties (function func,...) |
get the world's properties. More... | |
static server | addWorldProperty (string property, string propertyStr, bool enabled=true, function func=null,...) |
adds a world property to the world. More... | |
static server | removeWorldProperty (string property, string propertyStr="", bool enabled=true, function func=null,...) |
removes a world property from the world. More... | |
static server | getOnlineList (function func,...) |
gets a list of all connected user accounts. More... | |
static server | getAccountsByName (string name, int maxResults=100, int page=0, function func,...) |
gets a list of accounts by name. More... | |
static server | getServerList (function func,...) |
gets a list of all worlds. More... | |
static int | getSendMessageCount (string command) |
get the amount of messages being sent for a command. More... | |
static server | getVar (string textFilePath, string variable, function func,...) |
gets a stored value from the server. More... | |
static server | setVar (string textFilePath, string variable, string value, function func=null,...) |
sets a stored value to the server. More... | |
static server | ping (string message, function func,...) |
pings the server to grab a response. More... | |
static server | getSQL (string dbFile, string SQL, function func,...) |
sends an SQL command to the server to receive the results. More... | |
static server | sendGit (string command, string location="", function func=null,...) |
sends a git command to be ran on the server. More... | |
static server | getClientsWithKeys (string key, string valVal, function func,...) |
gets a list of clients who have the given keys. More... | |
static server | getClientsWithKeys (string key, function func,...) |
gets a list of clients who have the given keys. More... | |
static server | getNPCServers (function func,...) |
gets a list of NPC servers and their status More... | |
static server | createNPCServer (string name, function func=null,...) |
creates a new NPCServer. More... | |
static server | removeNPCServer (string name, function func=null,...) |
removes an NPCServer. More... | |
static server | startNPCServer (string name, bool onServer=true, function func=null,...) |
starts an NPCServer. More... | |
static server | stopNPCServer (string name, function func=null,...) |
stops an NPCServer. More... | |
static server | setNPCServerBootOnInit (string name, bool bootOnInit=true, function func=null,...) |
sets whether or not the NPCServer boots when the world is initialized. More... | |
static server | setNPCServerFaultTolerant (string name, bool faultTolerant=true, function func=null,...) |
sets whether or not the NPCServer is fault-tolerant. More... | |
used for anything related to the server.
Most of these functions send a command to the server to get a result back. Since these commands go through the server, the results must be caught using "function onCommand(command, commandStr)" instead. If the user is offline, the commands are still caught through the "onCommand" function, but are obtained locally, if possible, instead.
|
static |
adds a user variable key for sending data to clients.
Adds a server key to the client. If the user param is an int value, adds the key on the client with the ID. If it's a string, adds the key on the client with the account name.\n If the key doesn't exist, it will be created. If the key does exist, the keyVal is added as an array item.\n WARNING: keys are temporary, they are removed when the client disconnects from the server. Required permission: KeyPermissions.
The | user ID or the account name. |
The | key to add to this user. |
The | value of the key to be added to this user. |
|
static |
Adds a permission to the client.
Adds a permission, whether that permission is enabled or disabled, to the client.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: The account adding the permission must have the "Account" permission and be a staff member, otherwise an error is thrown.
The | account to add the permission to. |
The | type of permission to add. |
The | permission string to add. |
(optional) | Whether the client has the permission enabled or disabled. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
adds a world property to the world.
Adds a property, whether that property is enabled or disabled, to the world.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: The account adding the permission must have the "World" permission and be a staff member, otherwise an error is thrown.
The | property to add to the world. |
The | property string to add to the world. |
(optional) | Whether or not the property is enabled. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
appends content to the end of a server file.
Adds the given content to the end of the given server file. The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given.
The | path of the file stored in the server. |
The | content to be added to the end of the file. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
creates a new NPCServer.
Creates a new NPCServer, which can be used to run specific tasks normal users don't have access to.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given.
The | name of the new NPCServer. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
deletes a file from the server.
Removes the file from the server.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: the deleted file cannot be restored. If you want some way to have backups, you'll have to handle that yourself. One way to create restoration processes would be to create a "dedicated server" with a command clients send to the created server, and then the dedicated server deletes the file and created a backup.\n WARNING: the file may only be removed if the user has sufficient server rights. If the user does not have the correct rights, a server command "MessageBox" will be thrown with the reason. Required permission: FilePermissions.
The | path of the file stored in the server. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
downloads a file from the server and lets the user pick a save location.
Downloads a file from the server, then prompts the user for a save location.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: there is no required permission to download files by default.\n You must disable (a) file(s)/folder(s) in the World/Account Properties under permission FileDownload to keep files secure.
The | path of the file stored in the server. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of accounts that may match a given name.
Gets accounts that may match the name given, returns the first given max names.\n If there are more names than the given max, you can find the next list of names by passing in the next page value.\n The function, func, given is invoked with the optional values given as well as an additional param: string[] names.
The | name of the account to find. |
The | amount of names to return at one time, cannot exceed 100. |
The | pagination, starting at 0. |
The | function to be invoked when the accounts are found. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets whether the client is a staff member or not.
Gets whether or not the account is a staff member.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed bool isStaff, where isStaff is true if the account is a staff member, otherwise false. WARNING: The account checking whether or not another account is a staff member must be a staff member, otherwise an error is thrown.\n WARNING: The account to check whether or not it's a staff member must exist, otherwise false is returned.\n
The | name of the account. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
get and account's permissions.
Gets a given account's permissions for the connected world.\n The given function, func, is then triggered as an Event.Server.onSQLReceived event and passed any additional arguments given. It is also passed map<string,string[]> permissions, where permissions is a dictionary whose first value is the permission name, and second value is a list of all values for the permission.
The | name of the account to get the permissions of. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of accounts by name.
Gets a list of accounts that match a given name.\n This is typically used to implement searching accounts.\n We cap the amount of results at 100 to help prevent taking up too much of the client network, but you can grab the next set of results using the page param.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string[] accounts, where accounts is a list of account names, and int pages, where pages is the number of results divided by the given maxResults.
The | name of the account to search for. |
(optional) | The amount of results to return. Results cap at a maximum of 100. |
(optional) | The page number of the results to return. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of accounts who have the provided permissions.
Gets a list of accounts who have the permission and, if given, has the permission for a certain string.\n Permissions are currently: Script, File, AppendFile, World, and Account. The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string[] accounts, where accounts is a list of account names. WARNING: this function does not return accounts who have permissions (for example, File permissions) from the World's properties. Only through permissions by account.
The | permission (Script, File, etc.) to get a list of accounts who contain it. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of accounts who have the provided permissions.
Gets a list of accounts who have the permission and, if given, has the permission for a certain string.\n Permissions are currently: Script, File, AppendFile, World, and Account. The given function, func, is then triggered and passed any additional arguments given. It is also passed string[] accounts, where accounts is a list of account names. WARNING: this function does not return accounts who have permissions (for example, File permissions) from the World's properties. Only through permissions by account.
The | permission (Script, File, etc.) to get a list of accounts who contain it. |
A | string to check if the user has permission to that item. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of clients who have the given keys.
Sends a server request to get clients who have the given keys with associated keyVals.\n If no keyVal is given, gets all clients who have the given key.\n Keys are set using self:setKey().\n The given function, func, is then triggered and passed any additional arguments given. It is also passed map<string,string[]> results, where results is a dictionary whose second value is a list that maps to strings "Account" and "ID".
The | key for getting clients who contain it. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of clients who have the given keys.
Sends a server request to get clients who have the given keys with associated keyVals.\n If no keyVal is given, gets all clients who have the given key.\n Keys are set using self:setKey().\n The given function, func, is then triggered as an Event.Server.onSQLReceived event and passed any additional arguments given. It is also passed map<int,string> clients, where clients is a dictionary whose first value is the client's dynamic ID, and second value is the client's account name.
The | key for getting clients who contain it. |
The | associate key value for getting clients who contain it. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
get a file from the server.
Downloads a file from the server.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: there is no required permission to download files by default.\n You must disable (a) file(s)/folder(s) in the World/Account Properties under permission FileDownload to keep files secure.
The | path of the file stored in the server. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of files in a server's world directory.
Gets a list of all the files and folders in the given server directory.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string[] filePaths, where filePaths is a list of file paths.\n By passing in a find parameter, will only return files that match the find (recursively in all folders, if recursive is passed as true). WARNING: the file paths may only be obtained if the user has sufficient server rights. If the user does not have the correct rights for any file, a server command "MessageBox" will be thrown with the reason. Otherwise, the user will only get file paths they have permissions to. Required permission: FilePermissions.
The | path of a folder to get all files in. |
(optional) | A file to find. |
(optional) | Whether the file to find should be recursively searched or not. |
(optional) | The amount of results to return. Results cap at a maximum of 100. |
(optional) | The page number of the results to return. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of NPC servers and their status
Sends a server request as SQL to get NPC Servers.\n If an identifier is given the SQL event is raised with the identifier, otherwise nil.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string[] NPCServers, where NPCServers is a list of all NPCServer names. WARNING: the NPC Servers may only be obtained if the user has sufficient server rights. If the user does not have the correct rights, a server command "MessageBox" will be thrown with the reason. Required permissions: NPCServer + Admin.
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets an object based on the server command.
Gets an object based on the given server command.\n If the command is not an object, or is an invalid object, returns nil.\n This function may also be used on strings, but is intended for server commands in "function onCommand()".
The | server command. |
|
static |
get objects saved on the server.
Gets objects saved on the server. You may use this function to grab a single saved object, or all saved objects in a directory. Objects start in the "Objects/" server directory. Each object then gets stored on the server, and sent to the client like a normal object.
The | location of the object on the server, or the location of the directory with multiple objects. |
|
static |
gets a list of all connected user accounts.
Gets a list of all connected user accounts.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string[] accounts, where accounts is a list of account names.
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a list of scripts from the server that the user is also running.
Gets a list of all files from the server, filtered to only files with a .lua extension.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string[] accounts, where accounts is a list of account names. WARNING: the script paths may only be obtained if the user has sufficient server rights. If the user does not have the correct rights for any scripts, a server command "MessageBox" will be thrown with the reason. Otherwise, the user will only get script paths they have permissions to. Required permission: ScriptPermissions.
The | path of a folder to get all scripts in. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
get the amount of messages being sent for a command.
When a large command is being sent to the server, it is sent in chunks. This function gets the amount of chunks that need to be sent before the command is processed.\n Good for checking upload/download speeds.\n WARNING: if multiple messages are matched with the given command, returns the count of all of them together.\n You may use asterisks ('*') to match different commands.
The | command to get the send message count for. |
|
static |
gets a list of all worlds.
Gets a list of all servers (worlds) who have the world property "WorldListed = true"\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string[] servers, where servers is a list of world (server) names.
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
sends an SQL command to the server to receive the results.
Performs SQL on a given server database file.\n The given function, func, is then triggered as an Event.Server.onSQLReceived event and passed any additional arguments given. It is also passed map<string,string[]> results, where results is a dictionary whose first value is the column name, and second value is a list of all values for the column.
The | database file stored on the server (typically ends in ".db"). |
The | SQL string to be performed. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
gets a stored value from the server.
Gets a value previously set by server:setVar() from the server. May also be used to get a variable out of the user's account if the textFilePath starts with "accounts/".\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string val, where val the value of the given variable.
The | path to the .txt file with the variable. Should not have a trailing .txt. |
The | variable to get from a file. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
get the world's properties.
Gets the world's properties.\n The given function, func, is then triggered as an Event.Server.onSQLReceived event and passed any additional arguments given. It is also passed map<string,string[]> properties, where properties is a dictionary whose first value is the property name, and second value is a list of all values for the property. WARNING: the world properties may only be obtained if the user has sufficient server rights. If the user does not have the correct rights, a server command "MessageBox" will be thrown with the reason. Required permissions: World.
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
checks if the user is online or offline.
|
static |
pings the server to grab a response.
Sends a message to the server. The server then sends the same message back to the client, which can be caught with onCommand(cmd, str) (view the Events tab for more information on onCommand).\n This is useful for situations where you need to see if other information is still awaiting being sent to the client.\n For example, if you try to get all files in a path from the server, you can't know when all files have been downloaded or if they are still being downloaded. Instead, you can ping the server for a response. When the response is received, you know all files have been downloaded.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. It is also passed string message, where message is the given message.
The | message for the server to send to yourself. |
The | function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
removes a key or keyVal from the client.
If the user param is an int value, removes the key from the client with the ID. If it's a string, removes the key from the client with the account name.\n If keyVal is not an empty string and the client contains the key with the keyVal, the keyVal is removed. If it is the only keyVal in the key, the key is removed.\n If keyVal is an empty string and the client contains the key, the entire key and it's contents are removed.\n WARNING: keys are temporary, they are removed when the client disconnects from the server. Required permission: KeyPermissions.
The | user ID or the account name. |
The | key, or key with the keyVal, to be removed from the client. |
(optional) | The keyVal of the key to be removed from the client. |
|
static |
removes an NPCServer.
Deletes an existing NPCServer by name, case sensitive. If the NPCServer doesn't exist, nothing is removed. The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given.
The | name of the NPCServer to be deleted. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
Removes a permission from the client.
Removes a permission, whether that permission is enabled or disabled, from the client.\n If no permissionStr is given, all permissions of type permission are removed.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: The account adding the permission must have the "Account" permission and be a staff member, otherwise an error is thrown.
The | account to remove the permission from. |
The | type of permission to remove. |
(optional) | The permission string to remove, otherwise all permissions of type permission. |
(optional) | Whether the client has the permission enabled or disabled, otherwise all permissions of type permission that are of the given enabled. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
removes a world property from the world.
Removes a property, whether that property is enabled or disabled, from the world.\n If no propertyStr is given, all properties of type property are removed.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: The account removing the permission must have the "World" permission and be a staff member, otherwise an error is thrown.
The | type of property to remove. |
(optional) | The propertyStr to remove if given, otherwise all properties of type property. |
(optional) | Whether the world has the property enabled or disabled, otherwise all properties of type property that are of the given enabled. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
renames a server file to a new name.
Renames the server file to the new name. If the new file name is renamed to a different directory, the file will be moved accordingly and create new folders as necessary.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: the file may only be renamed if the user has sufficient server rights. If the user does not have the correct rights, a server command "MessageBox" will be thrown with the reason. Required permission: FilePermissions.
The | name of the file to rename. |
The | new name of the file. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
sends a file to the server.
Sends a file with it's content to the server.\nUpdates the existing file or creates a new file with the content. All clients using this file will receive the new file. Any clients who log in and then use the file or who do not have the file will receive this new file when possible. This means that it updates the file for everyone.\nThe file is stored in the server in the world's directory under the file's name, not the file path.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: the file may only be updated if the user has sufficient server rights. If the user does not have the correct rights, a server command "MessageBox" will be thrown with the reason.
The | path of the file to send to the server. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
sends a file to the server.
Sends a file with it's content to the server under a new name and/or directory.\nUpdates the existing file or creates a new file with the content. All clients using this file will receive the new file. Any clients who log in and then use the file or who do not have the file will receive this new file when possible. This means that it updates the file for everyone.\nThe file is stored in the server in the world's directory with the serverFilePath directory. All folders will be created corresponding to serverFilePath.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: the file may only be updated if the user has sufficient server rights. If the user does not have the correct rights, a server command "MessageBox" will be thrown with the reason.
The | path of the file to send to the server. |
The | new name of the file to be stored in the server. All folders will be created as necessary. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
sends a file to the server.
Sends a file with the given file content to the server to be created or updated without the client needing the file to be in their world folder.\nUpdates the existing file or creates a new file with the content. All clients using this file will receive the new file. Any clients who log in and then use the file or who do not have the file will receive this new file when possible. This means that it updates the file for everyone.\nThe file is stored in the server in the world's directory with the serverFilePath directory. All folders will be created corresponding to serverFilePath.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: the file may only be updated if the user has sufficient server rights. If the user does not have the correct rights, a server command "MessageBox" will be thrown with the reason.
The | path of the file to send to the server. |
The | new name of the file to be stored in the server. All folders will be created as necessary. |
Any | value. Used to distinguish between "sendFile(string filePath, string serverFilePath)" and this function. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
sends a git command to be ran on the server.
Executes a git command to be ran on the server at the base World location.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: must have the permission ScriptPermissions to be able to use any commands.
The | git command to execute. |
(optional) | The server folder to perform the git command, otherwise the base location. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
sends the script to the server.
Sends a script with it's content, or new content, to the server for other clients to receive if they are using the script. If the client is offline or they do not have the script, they will receive this new script when possible. This means that it updates the server script for everyone.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: the script may only be updated if the user has sufficient server rights.
The | name of the script to be updated in the server. |
(optional) | The content of the script to be updated in the server. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
send a command to clients.
Sends a command to clients who fit the criteria through key variables. If a command is removable, then the command is not required to be sent to the clients, and the data may be dropped for speed. Likewise, if it is removable and a command with the same command name is in queue to be sent to the server, the first command is updated to the new command for speed. If a command is not removable, it will for sure make it to the server, regardless of multiple commands with the same command name.\n You may also use the key and keyStr to match clients who have keys (see self:setKey()).
The | command that clients will receive. |
The | command action that clients will receive with the command. |
(optional) | Whether or not the command should for-sure make it to the client, or if it can be dropped for speed purposes. |
(optional) | The key that all clients must have for the command to be sent to them. |
(optional) | The keyStr that all clients must have for the command to be sent to them. If keyStr is empty, the clients must only require the key. |
|
static |
sets whether the client is a staff member or not,
Sets whether or not the account is a staff member.\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: The account setting whether or not another account is a staff member must be a staff member and have "Account" permissions, otherwise an error is thrown.
The | name of the account. |
(optional) | Whether or not the account is a staff member. |
|
static |
set a user variable key for receiving certain data.
Sets a server key to the client. If the user param is an int value, sets the key on the client with the ID. If it's a string, sets the key on the client with the account name. If the key contains multiple keyVals, then the key will be updated to contain only the given keyVal.\n WARNING: keys are temporary, they are removed when the client disconnects from the server. Required permission: KeyPermissions.\n
The | user ID or the account name. |
The | key to be set to this user. |
The | value of the key to be set to this user. |
|
static |
sets whether or not the NPCServer boots when the world is initialized.
Worlds are initialized the first time a client connects to the world. Sets whether or not the NPCServer should boot up when a world is initialized, false by default. The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given.
The | name of the NPC server. |
(optional) | Whether or not the NPCServer boots on initialization. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
sets whether or not the NPCServer is fault-tolerant.
Fault-tolerance means that if an NPCServer is to crash or disconnect, then the NPCServer is restarted. If an NPCServer is started locally, the NPCServer is restarted on the server. The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given.
The | name of the NPC server. |
(optional) | Whether or not the NPCServer is fault-tolerant. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
sets a stored value to the server.
Sets a value to be stored on the server. May also be used to set a variable on a user's account if the textFilePath starts with "accounts/".\n The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given. WARNING: the variable may only be set if the user has sufficient server rights. If the user does not have the correct rights, a server command "MessageBox" will be thrown with the reason. Required permissions: AccountPermissions for an account, otherwise FilePermissions.
The | path to the .txt file with the variable. Should not have a trailing .txt. |
The | variable to set the value of in the file. |
The | value to set the variable on the server to. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
starts an NPCServer.
Starts an NPCServer task, which acts like a user. By default, the NPCServer starts by running script Scripts/NPCServer_(NPCServerName)/main.lua, where (NPCServerName) is the given name (without parenthesis). Does nothing if the NPCServer name isn't found. The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given.
The | name of the NPC server to start. |
(optional) | Whether the NPCServer starts locally or on the server. True by default. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |
|
static |
stops an NPCServer.
Stops an NPCServer task from running, closing it completely. Does nothing if the NPCServer name isn't found. The given function, func, is then triggered as an Event.Server.onCommand event and passed any additional arguments given.
The | name of the NPC server to stop. |
(optional) | The function to trigger with the server response. |
(optional) | Any number of values to pass to the function, func, when invoked. |