Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

Category: settings (164)

CS2D Command sv_hostport

Categories

Parameters

  • port (0-65535): port, 0 = auto detect

Info

Sets the UDP port which is used for hosting the server. Default port is 36963 (recommended).
In auto detect mode (port 0) CS2D will try to find and use a free UDP port.

Note: Port changes do not take effect immediately. A map change is required (map, sv_map, changemap, changelevel) to make this change take effect. Already connected players will lose their connection during the map change when the port is changed. They will have to manually reconnect.

Note: This setting only takes effect when hosting a server. As client localport / clientport defines the used UDP port!

Attention: sv_hostport will not work if the command line parameter -port is used

Attention: If you want to run multiple instances of CS2D servers on the same physical machine you have to manually define different ports. Otherwise CS2D will either fail to run the server(s) or it will try to automatically use a random port as a fallback. If you have problems with running CS2D with a specific port you should check if other programs are already using that port or if it is blocked by a firewall.

Lua Hook Lua Hooks

Lua Command Lua Commands