GetServerPort: Difference between revisions
Jump to navigation
Jump to search
(→Syntax) |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
int getServerPort ( | int getServerPort ( ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 14: | Line 14: | ||
This example Sends out the serverPort when you type: /serverport | This example Sends out the serverPort when you type: /serverport | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function outputServerPort ( | function outputServerPort ( ) | ||
local serverPort = getServerPort( | local serverPort = getServerPort() | ||
outputChatBox (" Server Port: " | outputChatBox (" Server Port: "..serverPort.." ") --Output Serverport in Chatbox | ||
end | end | ||
addCommandHandler ( "serverport", outputServerPort ) --add the command Handler | addCommandHandler ( "serverport", outputServerPort ) --add the command Handler |
Latest revision as of 14:49, 16 December 2014
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