From: <Blu...@us...> - 2010-09-28 21:59:18
|
Revision: 413 http://virtplayground.svn.sourceforge.net/virtplayground/?rev=413&view=rev Author: BlueWolf_ Date: 2010-09-28 21:59:12 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Client will now send all move-events to the server the way it should. It does't process the response from the server though Modified Paths: -------------- trunk/client/core/client.py trunk/client/downloader.py trunk/client/login.py trunk/client/playground.py Modified: trunk/client/core/client.py =================================================================== --- trunk/client/core/client.py 2010-09-27 22:02:49 UTC (rev 412) +++ trunk/client/core/client.py 2010-09-28 21:59:12 UTC (rev 413) @@ -274,12 +274,12 @@ "version": __version__ }) - def move(self, moving, pos, direction = None, speed = None): - data = {"moving": moving, "pos": pos} - if moving: - data['direction'] = direction - data['speed'] = speed - self.send("move", data) + def move(self, moving, pos, direction = None): + self.send("move", { + "moving": moving, + "pos": pos, + "direction": direction + }) def send(self, data_header, data_body = {}): Modified: trunk/client/downloader.py =================================================================== --- trunk/client/downloader.py 2010-09-27 22:02:49 UTC (rev 412) +++ trunk/client/downloader.py 2010-09-28 21:59:12 UTC (rev 413) @@ -74,7 +74,7 @@ def remove_usage(self, filename): try: load = self.loaded_files[filename] - except: pass + except: return load['usages'] -= 1 if load['usages'] == 0: Modified: trunk/client/login.py =================================================================== --- trunk/client/login.py 2010-09-27 22:02:49 UTC (rev 412) +++ trunk/client/login.py 2010-09-28 21:59:12 UTC (rev 413) @@ -52,6 +52,7 @@ if data['status'] == "login": if self.status != "login": # Load the data for the login + sh['timer'].stop("login-transit") self.surf.set_alpha(None) self.background = load_image(False, "images", "loginbg.png") self.loginbox = load_image(True, "images", "loginbox.png") Modified: trunk/client/playground.py =================================================================== --- trunk/client/playground.py 2010-09-27 22:02:49 UTC (rev 412) +++ trunk/client/playground.py 2010-09-28 21:59:12 UTC (rev 413) @@ -70,18 +70,23 @@ elif keys[3]: direction = 6 + if direction == None and self.direction == None: + # Not moving and nothing has changed (this can happen + # in some circumstances. Faulty window manager + return + if direction == None and self.direction != None: # Stop the timer. We are not walking self.direction = None - sh['client'].move(False, self.this_user['pos'][0:2]) + sh['client'].move(False, self.this_user['pos']) sh['timer'].stop("playground-walk") elif self.direction == None or \ direction != self.direction[0]: # We started walking or changed direction - sh['client'].move(True, self.this_user['pos'][0:2], - direction, MOVE_SPEED) + sh['client'].move(True, self.this_user['pos'], + direction) self.direction = (direction, time.time(), self.this_user['pos'][:]) @@ -94,6 +99,7 @@ if data['status'] == "login" and self.status == "playground": # Unload data from the playground sh['timer'].stop("playground-move") + sh['timer'].stop("playground-viewport-move") self.background.reset() self.viewport = None self.viewport_float = None This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |