GetServerHttpPort: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Clearer readability) |
||
| Line 15: | Line 15: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("getHttpPort", | addCommandHandler("getHttpPort", | ||
function(player, command) | function(player, command) | ||
outputChatBox("HTTP port of this server is: " .. getServerHttpPort(), player, 0, 255, 0) | |||
outputChatBox("HTTP port of this server is: " .. getServerHttpPort(), player, 0, 255, 0) | end | ||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Server functions}} | {{Server functions}} | ||
Latest revision as of 16:13, 22 December 2025
This function retrieves the server's HTTP port.
Syntax
int getServerHttpPort ( )
Returns
An integer corresponding to the server's HTTP port.
Example
This example outputs server's HTTP port to the chat box when player uses command getHttpPort
addCommandHandler("getHttpPort",
function(player, command)
outputChatBox("HTTP port of this server is: " .. getServerHttpPort(), player, 0, 255, 0)
end
)
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown