GetServerPort: Difference between revisions
Jump to navigation
Jump to search
(Added doc page, adapted from getServerName) |
DJFrankie-X (talk | contribs) |
||
Line 12: | Line 12: | ||
==Example== | ==Example== | ||
This example | This example Sends out the serverPort when you type: /serverport | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function outputServerPort ( ) | function outputServerPort ( ) | ||
outputChatBox ( | local serverPort = getServerPort() | ||
outputChatBox (" Server Port: "..serverPort.." ") --Output Serverport in Chatbox | |||
end | end | ||
addCommandHandler ( "serverport", outputServerPort ) --add the command Handler | |||
addCommandHandler ( " | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Server functions}} | {{Server functions}} |
Revision as of 17:32, 6 February 2008
This function retrieves the server's port.
Syntax
int getServerPort ( )
Returns
An integer corresponding to the server's port.
Example
This example Sends out the serverPort when you type: /serverport
function outputServerPort ( ) local serverPort = getServerPort() outputChatBox (" Server Port: "..serverPort.." ") --Output Serverport in Chatbox end addCommandHandler ( "serverport", outputServerPort ) --add the command Handler
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown