%( def nameval(type, name, value=None, default=None, mangling=1, options=options): if mangling: name = mode.unique_id() + '_' + name s = getattr(options, name) or default checked = s == value if type == 'option': return 'option %svalue="%s"' % (checked and 'selected ' or '', value) elif type == 'select': return 'select name="%s"' % name elif type == 'text': return 'input type=text name="%s" value="%s"' % ( name, htmlquote(s)) else: return 'input type=%s %sname="%s" value="%s"' % ( type, checked and 'checked ' or '', name, value) def begingroup(text, fgcolor, bgcolor, lightbgcolor, img, nbitems): global groupinfo print '
' print '' % (nbitems or 1, bgcolor) print '%s' % (fgcolor, text) print '' groupinfo = [lightbgcolor, bgcolor, fgcolor, 0, 0, img] if not nbitems: begingroupitem() endgroupitem() def begingroupitem(highlight=0): if groupinfo[4]: print '
' groupinfo[4] += 1 groupinfo[3] = highlight print '' % groupinfo[highlight] print '

' def endgroupitem(): print '
' if groupinfo[3]: print '' % groupinfo[-1] print '

' print '
' def endgroup(): pass def beginmode(): highlight = mode in currentmodes begingroupitem(highlight) print '' err = mode.imperror() if highlight: url = None err = err or "selected" print '' elif err: url = None print '' % err else: url = "options.html?%s=%s&savetime=%s" % (mode.prefix, mode.name, time.time()) err = "select" print '' % url print '' print '' if url: print '' % url, print htmlquote(err), if url: print '', print '' print '', print htmlquote(mode.name), print '' if mode.url: print ' - web site' % mode.url print '
' print htmlquote(mode.descr) return highlight def beginmodeoptions(): print '
' print '

' def endmodeoptions(): print ' | ' print '' print '

' def endmode(): print '' endgroupitem() def modeitems(modelist): global mode for mode in modelist: if beginmode(): txt = mode.htmloptionstext(nameval) if txt: beginmodeoptions() print txt endmodeoptions() endmode() )s

| Settings |
| Technical documentation - Back to the main page |

%( graphicmodes = self.graphicmodeslist() currentmodes = self.localmodes() begingroup('Display driver', '#800000', '#FFC000', '#C0C0C0', 'lbeb.png', len(graphicmodes)) modeitems(graphicmodes) endgroup() )s
%( soundmodes = self.soundmodeslist() java = graphicmodes[0] in currentmodes begingroup('Sound driver', '#800000', '#FFFF00', '#C0C0C0', 'lbiob.png', java and 1 or len(soundmodes)) if java: begingroupitem(1) print '
' endgroupitem() else: modeitems(soundmodes) endgroup() )s
Java Applet always does sounds, but', print 'background music is not implemented
%( begingroup('Network options', '#004000', '#80FF00', None, 'lbib.png', 1) begingroupitem(1) )s

Network ports are automatically assigned, but you can optionally choose fixed ones and let them in through your firewall. Clients using the "Internet games" meta-server can usually connect even through firewalls. Moreover servers can re-route UDP traffic to clients behind firewalls over TCP. %( if java: print "These settings don't apply to the Java applet." )s

TCP game server port: <%(nameval("text", "port_LISTEN", default="", mangling=0))s>
HTTP server port: <%(nameval("text", "port_HTTP", default="", mangling=0))s>

Client incoming UDP port (or `host:port` if redirected): <%(nameval("text", "port_CLIENT", default="", mangling=0))s>
<%(nameval("radio", "datachannel", "ucp", mangling=0))s>always UDP <%(nameval("radio", "datachannel", "tcp", mangling=0))s>no UDP, only TCP <%(nameval("radio", "datachannel", "auto", default="auto", mangling=0))s>Auto-detect
Client incoming TCP port (metaserver-directed back-connections): <%(nameval("text", "port_BACK", default="", mangling=0))s>

Help!

%( endgroupitem() endgroup() )s