Connect to a password-protected server from the server browser

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6191 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2011-04-01 14:55:36 +00:00
parent ae2589021e
commit 462845ff08
2 changed files with 27 additions and 1 deletions
+13
View File
@@ -166,6 +166,19 @@ menuitemslider "Server IP & port: " 0 2 "$serverbrowserhideip" 1 [ "Show" "Show
menuitemslider "Sort servers by: " 0 7 "$serversort" 1 [ "Ping" "Number of players" "Max players" "Minutes remaining" "Map name" "Gamemode" "IP address" "Server description"] [ serversort $arg1 ]
menuinitselection 1
// connecting from the serverbrowser to a password-protected server
// called by sbconnect
newmenu "password required"
menuinit [ alias sbpwd "";] // Resets the aliases
menuitemvar [result $sbmsg]
menuitem "You need a password to join it." -1
menuitem "" -1
menuitemtextinput "Password: " "" "alias sbpwd $arg1" "" 128
menuitem "" -1
menuitem " 2 [ Connect ] " "echo connecting to $sbdesc ; connect $sbdns $sbport $sbpwd"
menuinitselection 3
addfavcatmenu = [
i = (+ 1 (findlist (listfavcats) $arg1))
newmenu "edit favourites"
+14 -1
View File
@@ -226,7 +226,20 @@ toggleshowmap = [ showmap 1; onrelease [ showmap 0 ] ]
// arg6 1: banned, 2: blacklisted 3: both
// arg7 "server description"
// TODO: interpret a#3,4,5,6 [ft:any1:2010apr04]
sbconnect = [ echo connecting to $arg7 ; connect $arg1 $arg2 ]
sbdns = ""; sbport = ""; sbdesc = ""; sbmsg = ""; sbpwd = "";
sbconnect = [
sbdns = $arg1; sbport = $arg2; sbdesc = $arg7; sbpwd = ""; sbmsg = ""
if (>= $arg6 1) [
sbmsg = "You are banned from this server."; showmenu "password required"; ] [
if (= $arg5 1) [
sbmsg = "This server is set to private."; showmenu "password required"; ] [
if (= $arg4 1) [
sbmsg = "This server is password-protected."; showmenu "password required";
] [
echo connecting to $arg7; connect $arg1 $arg2;
] ] ]
]
// For those players who use IRC too much...
join = [ connect $arg1 $arg2 $arg3 ]