server_ip
These predefined strings hold the name and the first IP address of the server in a multiplayer game. On a client the strings are empty. They can be used to display the information the clients have to enter in the IP field in order to connect.Type:
STRING*, read-only
Remarks:
- For connecting on a local network the
server name or IP can be used; for connecting over the internet, the Internet IP address or the domain name must be used.
-
The server IP address is normally not identical to your Internet IP address, which is determined by your Internet service provider. You can find out your Internet IP address trough services like whatismyip.com.
-
When you're behind a firewall or router, use port forwarding to direct Internet data traffic with your port number to your local server IP address. See your router's manual for details about how to set up port forwarding.
Example:
...
while (connection == 0) { wait(1); }
str_cpy(temp_str,server_name);
str_cat(temp_str," has the IP: ");
str_cat(temp_str,server_IP);
scroll_message(temp_str);
...
See also:
level_name, app_name, level_load, player_name, -pl, server_name, session_name
► latest
version online