[sorrows-mudlib] r208 committed - Commit outstanding differences....

0 views
Skip to first unread message

sorrows...@googlecode.com

unread,
Jan 21, 2012, 1:51:19 AM1/21/12
to sorrows-mud...@googlegroups.com
Revision: 208
Author: richard.m.tew
Date: Fri Jan 20 22:48:26 2012
Log: Commit outstanding differences.
- Ensure events are only sent to users with the correct shell.
- Something related to connection status.
http://code.google.com/p/sorrows-mudlib/source/detail?r=208

Modified:
/trunk/games/roguelike/shells/roguelike.py
/trunk/games/roguelike/world/body.py
/trunk/mudlib/services/net/connection.py
/trunk/mudlib/services/net/connectionTelnet.py

=======================================
--- /trunk/games/roguelike/shells/roguelike.py Thu May 12 05:56:07 2011
+++ /trunk/games/roguelike/shells/roguelike.py Fri Jan 20 22:48:26 2012
@@ -235,11 +235,12 @@
# Events
------------------------------------------------------------------

def OnRemovalFromStack(self):
- self.user.connection.optionLineMode = self.oldOptionLineMode
- self.user.connection.telneg.will_echo()
- self.user.Write(ESC_RESET_TERMINAL)
- self.ScrollWindowVertically(-1)
- self.MoveCursor(0, self.statusOffset)
+ if self.user.connection.connected:
+ self.user.connection.optionLineMode = self.oldOptionLineMode
+ self.user.connection.telneg.will_echo()
+ self.user.Write(ESC_RESET_TERMINAL)
+ self.ScrollWindowVertically(-1)
+ self.MoveCursor(0, self.statusOffset)
Shell.OnRemovalFromStack(self)

def OnTerminalSizeChanged(self, columns, rows, redraw=True):
=======================================
--- /trunk/games/roguelike/world/body.py Sat Sep 4 22:53:46 2010
+++ /trunk/games/roguelike/world/body.py Fri Jan 20 22:48:26 2012
@@ -1,5 +1,7 @@
import copy
from game.world import Container
+import game
+import mudlib


class Body(Container):
@@ -19,7 +21,7 @@
self.tile.bgColour = bgColour

def OnObjectMoved(self, object_, oldPosition, newPosition):
- if self.user:
+ if self.user and isinstance(self.user.shell,
game.shells.RoguelikeShell):
self.user.shell.OnObjectMoved(object_, oldPosition,
newPosition)

if False:
=======================================
--- /trunk/mudlib/services/net/connection.py Sun Mar 14 17:34:30 2010
+++ /trunk/mudlib/services/net/connection.py Fri Jan 20 22:48:26 2012
@@ -1,8 +1,9 @@
import socket
from errno import EBADF

-class Connection:
+class Connection(object):
released = False
+ connected = True

def __init__(self, _socket):
self.socket = _socket
@@ -16,7 +17,7 @@
self.service = None

def OnDisconnection(self):
- pass
+ self.connected = False

def close(self):
self.socket.close()
=======================================
--- /trunk/mudlib/services/net/connectionTelnet.py Fri Jan 7 05:23:18 2011
+++ /trunk/mudlib/services/net/connectionTelnet.py Fri Jan 20 22:48:26 2012
@@ -124,6 +124,8 @@
slept += 0.01

def OnDisconnection(self):
+ super(TelnetConnection, self).OnDisconnection()
+
# Notify the service of the disconnection.
if self.user:
self.user.OnTelnetDisconnection()

Reply all
Reply to author
Forward
0 new messages