- Code: Select all
# GIT Wizard script for Warcraft III
# Standard Page about Client/Server
loadvar clisrv
setvar heading "Client or Server"
setvar subheading "Please select if you are hosting or joining the game below."
addline control "radio|clisrv|Please select one:|"
appendstring control "|First Remote Client on my LAN"
appendstring control "|Another Remote Client on my LAN"
appendstring control "|Local Client"
appendstring control "|The Server"
addline control "space|||2"
addline control "label||Select 'First Remote Client on my LAN' if the server hosted someplace else and you are the first or only client on your LAN."
appendstring control " Only one person per LAN should select this option, the rest must select 'Another Remote Client on my LAN'."
appendstring control " If the server is local on your own LAN, but not on your computer, select 'Local Client'."
appendstring control " If you are the server, select 'The Server'.|5"
showpage
savevar clisrv
# No need for GIT if another remote client
if clisrv = 1
cancel "You do not need to run GIT as another remote client. Only the first remote client needs to run GIT and you will be able to find the server."
endif
# No need for GIT if local client
if clisrv = 2
cancel "You do not need to run GIT as a local client. You should be able to see the game server using the normal method."
endif
# Basic common settings
setvar sockets ""
setvar ports "6112 : Warcraft III"
setvar options OPT_FRAME_ETH2
addflag options OPT_IPV4_NOUC
setvar packets 0
setvar protos PROTO_UDP
# Server Pages
if clisrv = 3
# Only need this information for server
# Standard Network Configuration page
loadvar hostname
loadvar firewall
loadvar nat
loadvar externalhostname
setvar heading "Network Configuration"
setvar subheading "Please enter your IP address information below."
addline control "label||What is your hostname or IP address?"
addline control "text1|hostname||4"
addline control "label||Are you open to receive incoming connections or are you firewalled?"
addline control "radio|firewall||4|Open|Firewalled"
addline control "label||Do you have a direct connection to the Internet or are you using NAT?"
addline control "radio|nat||4|Direct Connection|NAT"
addline control "label||If you are using NAT, what is your external hostname or IP address?"
addline control "text1|externalhostname||4"
addline control "space|||3"
addline control "specl||ipfwnat";
showpage
savevar hostname
savevar firewall
savevar nat
savevar externalhostname
# Page Providing Server IP + Asking for Number of Remote LANs
loadvar multimax
math multimax multimax - 1
setvar heading "Server IP + Number of Remote LANs"
setvar subheading "Information to provide to the clients."
addline control "label||Reminder: Your external hostname or IP is:"
if nat = 0
addline control "textr|hostname||4"
else
addline control "textr|externalhostname||4"
addflag options OPT_IPV4_NAT
setvar natinternal hostname
setvar natexternal externalhostname
endif
addline control "label||You must provide this information to each of the clients now."
addline control "space|||4"
addline control "label||How many remote LANs are there? (Two clients on the same LAN only count as one)"
addline control "dropd|multimax||10|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16"
# If firewalled, add a reminder text
# NAT with no firewall implies DMZ, so the port should be open
if firewall != 0
addline control "space|||4"
if nat != 0
addline control "label||Reminder: Since you are using NAT, you must map port 213 from "
appendstring control externalhostname
appendstring control " to "
appendstring control hostname
appendstring control "|2"
else
addline control "label||Reminder: Since you are firewalled, you must be able to open access to incoming connections on port 213.|2"
endif
endif
showpage
math multimax multimax + 1
savevar multimax
setvar multiport 213
addflag options OPT_TCP_MULTI
setvar hosts ""
else # Client Pages
# Page Requesting Server IP
loadvar servhost
setvar heading "Server IP"
setvar subheading "Enter the hostname or IP of the server."
addline control "label||Enter the hostname or IP of the server."
addline control "text1|servhost||4"
addline control "label||This information should be provided by the person running the server."
showpage
savevar servhost
setvar hosts servhost
appendstring hosts ":213"
appendstring hosts METH_TCP_CONNECT
endif