The Server table contains only functions that read information about the GameServer running the script. No function changes any data.
Server.GetCode
Returns the server code of this GameServer.
Server.GetCode() -> integer
No parameters. Short name: GetGameServerCode.
local code = Server.GetCode()
Server.GetOnlineCount
Returns the number of players currently on this GameServer.
Server.GetOnlineCount() -> integer
No parameters. Short name: GetGameServerCurUser.
Log.Add("Online: " .. Server.GetOnlineCount())
Server.GetMaxUser
Returns the maximum number of players of this GameServer.
Server.GetMaxUser() -> integer
No parameters. Short name: GetGameServerMaxUser.
local full = Server.GetOnlineCount() >= Server.GetMaxUser()
Server.GetName
Returns the server name, taken from the ServerName key in the GameServer's GameServer.conf file.
Server.GetName() -> string
No parameters. Returns an empty string if it is not configured.
Message.SendAll(1, "Welcome to " .. Server.GetName())
Server.GetVersion
Returns the client version that the server accepts, as a string made of 5 numbers joined by dots (the second number always has 2 digits, for example 1.04.xx.x.x).
Server.GetVersion() -> string
No parameters. Short name: GetGameServerVersion.
Log.Add("Version " .. Server.GetVersion())
Server.GetMode
Returns the server type.
Server.GetMode() -> integer
No parameters.
| Value | Meaning |
|---|---|
0 | PvP |
1 | Non-PvP |
2 | Golden PvP |
3 | Golden Non-PvP |
if Server.GetMode() == 1 then Log.Add("Non-PvP sub-server") end
Server.IsNonPvP
Returns true if this server does not allow PvP.
Server.IsNonPvP() -> boolean
No parameters.
if Server.IsNonPvP() then Message.Send(aIndex, 1, "This server has no PvP") end
Server.IsResetServer
Returns true if the server is a Reset server (the ResetServer key in Common.ini is enabled).
Server.IsResetServer() -> boolean
No parameters.
if not Server.IsResetServer() then return end
Server.GetClassPointsPerLevel
Returns the number of bonus points received on each level-up for a character class.
Server.GetClassPointsPerLevel(class) -> integer
| Parameter | Type | Description |
|---|---|---|
class | integer | Character class code (0 to 255), see the CLASS_* constants in System\Constants.lua |
Returns: the points per level; 0 if the class does not exist.
local p = Server.GetClassPointsPerLevel(CLASS_DK)
Server.Is28Option
Always returns true (the +28 option is always on in this version).
Server.Is28Option() -> boolean
No parameters. Note: the short name Is28Option() in Modules.lua returns the number 1, not true.
local on = Server.Is28Option()
Server.GetLanguage
Returns the name of the language file currently used by the GameServer (the Lang folder).
Server.GetLanguage() -> string
No parameters.
Log.Add("Lang: " .. Server.GetLanguage())