Difference between revisions of "Server"
MrSugarCube (talk | contribs) |
m (Added languagemenue) |
||
Line 1: | Line 1: | ||
+ | {{Languages|Server}} | ||
+ | |||
__FORCETOC__ | __FORCETOC__ | ||
The server object is a global object that can be accessed from any script, by using the SERV reference. The following tables detail the various properties of the server in SphereServer: | The server object is a global object that can be accessed from any script, by using the SERV reference. The following tables detail the various properties of the server in SphereServer: |
Revision as of 21:30, 26 November 2010
The server object is a global object that can be accessed from any script, by using the SERV reference. The following tables detail the various properties of the server in SphereServer:
Contents
References
References return pointers to other objects (e.g. the CHAR.n reference allows you to access the characters that are attached to the account). These can either be accessed by using <REFNAME> to return the UID (1 for object types that don't have UIDs) of the object or 0 if it doesn't exist, or by using <REFNAME.KEY> where KEY is a valid property/function/reference for the REFNAME object. Click on the name for more detailed information such as usage and examples.
Name | Read/Write | Description |
ACCOUNT.n | R | Gets the nth account on the server. (zero-based) |
ACCOUNT.name | R | Gets the account with the specified name. |
AREA.defname | R | Gets the region with the specified defname. |
CHARDEF.defname | R | Gets the character definition for defname. |
CLIENT.n | R | Gets the nth client on the server. Note: The nth client may not be an ingame player character, <CLIENT.n> first as it returns 1 for ingame clients and 0 for non-player clients. |
GMPAGE.n | R | Gets the nth GM page on the server. |
GUILDSTONES.n | R | Gets the nth guild stone on the server. (zero-based) |
ITEMDEF.defname | R | Gets the item definition for defname. |
LASTNEWCHAR | R | Gets the last character created on the server. |
LASTNEWITEM | R | Gets the last item created on the server. |
MAP(x, y, map) MAP(x, y, z, map) |
R | Gets the map point for a specified location. |
REGIONRESOURCE.defname | R | Gets the region resource definition for defname. |
REGIONTYPE.defname | R | Gets the region type definition for defname. |
ROOM.defname | R | Gets the room with the specified defname. |
SKILL.defname | R | Gets the skill definition for defname. |
SKILLCLASS.defname | R | Gets the skillclass for defname. |
SPAWN.defname | R | Gets the spawn group for defname. |
SPELL.defname | R | Gets the spell definition for defname. |
SPELL.n | R | Gets the nth spell definition, ordered by skill requirements (1-based, ascending). |
TOWNSTONES.n | R | Gets the nth town stone on the server. (zero-based) |
Properties and Functions
Here is a list of all item properties and functions. If a function is marked as readable then it can return a value when used as <KEY>. Click on the name for more detailed information such as usage and examples. Settings from Sphere.ini can also be accessed from the server object, but they are not listed in this table.
Name | Read/Write | Description |
ACCOUNT ADD name password | W | Creates an account with the specified name and password. |
ACCOUNT ADDMD5 name hash | W | Creates an account with the specified name and MD5 password hash. |
ACCOUNT BLOCKED days command | W | Executes command on all accounts that have been unused for days days and are currently blocked. |
ACCOUNT JAILED days command | W | Executes command on all accounts that have been unused for days days and are currently jailed. |
ACCOUNT UNUSED days command | W | Executes command on all accounts that have been unused for days days. |
ACCOUNT UPDATE | W | Saves the accounts to file. |
ACCOUNT name command | W | Executes command on the account with the specified name. |
ACCOUNTS | RW | Gets or sets the number of accounts on the server. |
ALLCLIENTS command | W | Executes command on all online player characters. |
B message | W | Broadcasts message to all clients on the server. |
BLOCKIP address, time | W | Blocks an IP address for time, in tenths of a second (-1 = permanent). |
CHARS | RW | Gets or sets the number of characters on the server. |
CLEARLISTS mask | W | Removes all LISTs whose name contains mask. |
CLEARVARS prefix | W | Removes all VARs that start with the given prefix. |
CLIENTS | R | Gets the total number of connected clients. |
CONSOLE command | W | Executes command as if it had been typed directly into the server console. |
EXPORT file, flags, distance | W | Exports all objects within distance tiles of SRC to a file. (Flags: 1 = Items, 2 = Characters, 3 = Both) |
GARBAGE | W | Forces an immediate garbage collection (checks for invalid objects and fixes them if possible, or else removes them). |
GMPAGES | R | Returns the total number of GM pages. |
GUILDS | R | Returns the total number of guild and town stones. |
GUILDSTONES.COUNT | R | Returns the total number of guild stones on the server. |
HEARALL | RW | Gets or sets whether player speech is logged to server console and log file. |
IMPORT file, flags, distance | W | Imports previously exported items that were within distance tiles. (Flags: 1 = Items, 2 = Characters, 3 = Both) |
INFORMATION | W | Displays server information to SRC. |
ITEMS | RW | Gets or sets the number of items on the server. |
LOAD file | W | Loads a script file. |
LOG message | W | Logs message to server console and logs. |
LOOKUPSKILL skill_name | R | Looks up a skill name or key, and returns its skill number. |
MAP.map_num.ALLSECTORS command | W | Executes command on all sectors of a map. |
MAPLIST.map_num | R | Returns 1 if map_num is a valid map number. |
MAPLIST.map_num.BOUND.X | R | Returns the maximum X coordinate for a map. |
MAPLIST.map_num.BOUND.Y | R | Returns the maximum Y coordinate for a map. |
MAPLIST.map_num.CENTER.X | R | Returns the central X coordinate of a map. |
MAPLIST.map_num.CENTER.Y | R | Returns the central Y coordinate of a map. |
MAPLIST.map_num.SECTOR.COLS | R | Returns the number of sector columns on a map. |
MAPLIST.map_num.SECTOR.QTY | R | Returns the number of sectors on a map. |
MAPLIST.map_num.SECTOR.ROWs | R | Returns the number of sector rows on a map. |
MAPLIST.map_num.SECTOR.SIZE | R | Returns the size of the sectors on a map. |
MEM | R | Returns the total amount of memory being used, in kilobytes. |
PRINTLISTS LOG | W | Displays a list of all LISTs to SRC, or the server console. |
REGEN0 | RW | Gets or sets the length of time it takes for characters to regenerate 1 health point, in seconds. |
REGEN1 | RW | Gets or sets the length of time it takes for characters to regenerate 1 mana point, in seconds. |
REGEN2 | RW | Gets or sets the length of time it takes for characters to regenerate 1 stamina point, in seconds. |
REGEN3 | RW | Gets or sets the length of time it takes for characters to lose 1 food point, in seconds. |
RESPAWN | W | Respawns all dead NPCs (not corpses) in the world. |
RESTOCK | W | Restocks all NPCs in the world. |
RESTORE file, account_name, character_name | W | Restores a player character from a backup save. |
RESYNC | W | Checks all script files for any changes made since they were last loaded. |
RTICKS | R | Returns the real-world time, as a timestamp. |
RTICKS.FORMAT timestamp, format | R | Returns the real-world timestamp as a formatted datetime string. |
RTICKS.FROMTIME year, month, day, hour, minutes, seconds | R | Returns the specified real-world time, as a timestamp. |
RTIME | R | Returns the real-world time, as a formatted string. |
RTIME.FORMAT format | R | Returns the real-world time, as a formatted string. |
SAVE force_immediate | W | Begins a world save. If background saving is enabled, force_immediate can be used to force a foreground save. |
SAVECOUNT | R | Returns the number of world saves that have taken place. |
SAVESTATICS | W | Performs a statics save. |
SHRINKMEM | W | Temporarily reduces memory usage. |
SHUTDOWN time | W | Schedules a server shutdown in time minutes. |
TIME | R | Returns the total server uptime, in tenths of a second. |
TOWNSTONES.COUNT | R | Returns the total number of town stones on the server. |
UNBLOCKIP address | W | Unblocks a previously blocked IP address. |
VARLIST LOG | W | Displays a list of all VARs to SRC, or the server console. |
VERSION | R | Returns the SphereServer version. |