summaryrefslogtreecommitdiff
path: root/http2/data/index.html
blob: 08dcc2f0f85ebbcb0988b774042fa365ac6c6cfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>The Bub's Brothers</title>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#000099" alink="#FF0000">
&nbsp;
<center><table cellspacing=0 cellpadding=0 border=0 width="95%%">

%(
externaltarget = running and ' target="new"' or ''
)s


<tr>
<td width="6%%" bgcolor="#000000">&nbsp;</td>
<td bgcolor="#000000">&nbsp;</td>
<td width="6%%" bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#FFFFFF"><a href="stop.html?time=%(tim)s"><img src="close.png" width=17 height=17>&nbsp;<font color="#FF0000" size=+1>Stop this program</font></a></td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#F0E0E0">&nbsp;</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#E0C0C0" align="center"><font size=+3><strong>The Bub's Brothers</strong></font></td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#F0E0E0">&nbsp;</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#FFFFFF" align="right">
  <a href="http://bub-n-bros.sourceforge.net"%(externaltarget)s>Web Home page</a> -
  <a href="name.html">Player Names &amp; Teams</a> -
  <a href="options.html?time=%(tim)s">Configuration</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#FFFFFF" background="wave1.png"><font size=+3>&nbsp;</font></td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td>
  <table width="100%%" cellpadding=7>
  <tr>
    <td width="20%%" bgcolor="#000080" align="center"><font size=+1 color="#FFFF00"><strong>New game</strong></font></td>
    <td bgcolor="#C0C0FF">
      <table border=0>
      <tr>
        <td width=48><img src="%(juststarted and 'sfbob.png' or 'bob.png')s"></td>
        <td>%(
if running:
    print '<form name="S" action="index.html" method="get">'
    print '<input type=hidden name="time" value="%s">' % tim
    print '<table width="100%" border=0><tr><td><p><strong>'
    if juststarted:
        print 'Server started!'
    elif justconnected:
        print 'Playing'
    elif count == 0:
        print 'No client is connected to your server at the moment.'
    elif count == 1:
        print 'One connected client.'
    else:
        print '%d connected clients.' % count
    print '</strong></p></td>'
    print '<td align="center"><input type=submit value="Update on connected clients"></td>'
    print '</tr></table></form>'
    print '<p><strong><a href="join.html?host=%s&port=%s&httpport=%s&time=%s">' % (running[0][0], running[0][1], self.httpport, tim),
    print 'Join your own game now</a></strong> at <strong>%s:%s</strong></p>' % (
        running[0])
##if metapublish:
##    import time
##    print '<p><a href="register.html?a=%s">' % time.time()
##    if self.globaloptions.metapublish == 'y':
##        self.has_been_published = 1
##        metaquery = metaquery or []
##        metaquery.insert(0, 'desc='+fndesc)
##        s = 'a=' + metapublish
##        if s not in metaquery:
##            metaquery.insert(0, s)
##        print 'Register again',
##    else:
##        print 'Register (after all)',
##    print 'your server to the SourceForge meta-server</a><br>'
##    print '<a href="register.html?d=%s">' % time.time()
##    print 'Unregister your server</a>',
##    print '<font size=-1>(it is unregistered automatically after some time',
##    print 'when other people cannot find it, or',
##    print 'if you stop it with the link <font color="#FF2000">Stop this program</font> at the top of the page)</font></p>'
)s
<form name="n" action="new.html" method="get">
<input type=hidden name="time" value="%(tim)s">
%(
if self.Game:
    print '<input type=submit',
    if running:
        print 'value="Start another game">'
    else:
        print 'value="Start a new game">'
else:
    print 'You need the <a href="http://bub-n-bros.sourceforge.net/download.html">complete version</a> to start a new game.<br><font size=-1>With this version you can only connect to existing servers and <font color="#FF0000">only over fast links!</font></font>'
)s
</form>
        </td>
      </tr>
      </table>
    </td>
  </tr>
  </table>
</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>



<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#FFFFFF" background="wave3.png"><font size=+3>&nbsp;</font></td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td>%(
servers = self.getlocalservers()[:]

found = []
def show((addr, (info, ping)), found=found):
    import socket
    infolst = info.split(':') or ['?']
    if len(infolst) >= 3:
        httpport = infolst.pop(2)
    else:
        httpport = 'off'
    print '<a href="join.html?host=%s&port=%d&httpport=%s&time=%s">' % (
        addr[0], addr[1], httpport, tim)
    host, port = addr
    #host = socket.gethostbyaddr(host)[0]
    if ping is not None:
        infolst.append('ping: %dms' % int(ping*1000))
    if (addr, infolst[0]) == running:
        infolst.append('this is your own server')
        found.append(1)
    infolst = map(htmlquote, infolst)
    print '<strong>%s:%s</strong></a> playing <strong>%s</strong>' % (
        host, port, infolst[0])
    if len(infolst) > 1:
        print '&nbsp;(%s)' % ' &middot; &middot; '.join(infolst[1:])

if servers is None:
    rowspan = 1
else:
    rowspan = (len(servers) or 1)+1
)s
<table width="100%%" cellpadding=7><tr>
  <td width="20%%" bgcolor="#FF0080" align="center" rowspan="%(rowspan)s">
    <font size=+1 color="#FFFF00">
    <strong>Local games</strong>
    </font>
  </td>
  <td bgcolor="#FFC0C0">
%(
if servers is not None:
    if servers:
        show(servers[0])
    else:
        print "(no server found)"
    print '</td></tr>'
    for s in servers[1:]:
        print '<tr><td bgcolor="#FFC0C0">'
        show(s)
        print '</td></tr>'
    print '<tr><td bgcolor="#FFC0C0">'
)s
    <table border=0><tr>
      <td width=48><img src="boob.png"></td>
      <td>
%(
if running and not found:
    import hostchooser, gamesrv
    if gamesrv.displaysockport(gamesrv.openpingsocket()) != hostchooser.UDP_PORT:
        print '<p><font size=-1>Note: your server does not appear in this list'
        print 'because the UDP port %d is already in use (is another Bub &amp; Bob server running on this machine?).' % hostchooser.UDP_PORT
        print 'Use the full server address <strong>%s:%s</strong></font></p>' % running[0]
)s
        <form name="L" action="index.html" method="get">
          <input type=hidden name="time" value="%(tim)s">
          <input type=submit value="Search again for local servers">
        </form>
      </td>
    </tr></table>
    <p><form name="J" action="join.html" method="get">
      <input type=hidden name="time" value="%(tim)s">
      Or connect to server:
      <input type=text name="host" size=25>
      (<code>host</code> or <code>host:port</code>)
      <input type=submit value="Go">
    </form></p>
  </td>
</tr></table>
</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#FFFFFF" background="wave2.png"><font size=+3>&nbsp;</font></td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td>
  <table width="100%%" cellpadding=7>
  <tr>
    <td width="20%%" bgcolor="#008000" align="center"><font size=+1 color="#FFFF00"><strong>Internet games</strong></font></td>
    <td bgcolor="#C0FFCC">
      <table border=0>
      <tr>
        <td width=48><img src="bub.png"></td>
        <td><p><a href="%(self.metaserverpage(headers))s">Go to the Internet servers page</a></p>
        <p><font size=-1>Don't forget to <a href="name.html">give a name</a>
           to your dragons before you join a server!
        </font></p></td>
      </tr>
      </table>
    </td>
  </tr>
  </table>
</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#000000" align="center"><img src="header.png"></td>
<td bgcolor="#000000">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#000000">&nbsp;</td>
<td bgcolor="#000000">&nbsp;</td>
</tr>


</table></center>


</body>
</html>