Commits

mickael9 committed 135b141 Merge

Merge beta1.3 into master

  • Participants
  • Parent commits cc4bca6, 46465a2

Comments (0)

Files changed (2)

 from web import form
 
 urls = (
+    # login.minecraft.net
+    '/', 'getversion',
     '/game/getversion.jsp', 'getversion',
+
+    # server auth
     '/game/joinserver.jsp', 'joinserver',
     '/game/checkserver.jsp', 'checkserver',
-    '/register', 'register',
+    '/game/register', 'register',
 )
 
 render = web.template.render('templates/')
                 password=None,
                 version=None)
 
-        if int(i.version) < config.LAUNCHER_VER:
+        try:
+            if int(i.version) not in config.LAUNCHER_VERS:
+                return "Old version"
+        except ValueError:
             return "Old version"
 
         try:
         try:
             user = db.where('users', username = i.user)[0]
         except IndexError:
-            op = urllib2.OpenerDirector()
-            op.add_handler(urllib2.HTTPHandler())
-
-            req = urllib2.Request("http://%s/game/checkserver.jsp?%s" %
-                    (config.PROXY_IP, urlencode({'user' : i.user, 'serverId': i .serverId})),
-                    headers={'Host' : "minecraft.net"})
-
-            resp = op.open(req)
-            web.ctx.status = "%d %s" % (resp.code, resp.msg)
-            return resp.read()
+            return "NO"
 
         if i.serverId != user.server_id:
             return "NO"
 SALT = ''
-CLIENT_VER = '1295618277000' # see http://www.tkte.ch/projects/pymy/
-LAUNCHER_VER = 12
-PROXY_IP = '194.28.157.42'   # minecraft.net
+CLIENT_VER = '1298470263000' # see ~/.minecraft/bin/version
+LAUNCHER_VERS = (12, 13)
 ALLOWED_IPS = ('127.0.0.1',) # these server IPs are allowed to use this master