home
·
contact
·
privacy
projects
/
plomrogue2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix curses client broken by mapping code changes.
[plomrogue2]
/
rogue_chat_curses.py
diff --git
a/rogue_chat_curses.py
b/rogue_chat_curses.py
index 0644a4ccc439ebda77eacce232162748a7aeabac..8c629a596d2fe71fff4527b37263eded28a88495 100755
(executable)
--- a/
rogue_chat_curses.py
+++ b/
rogue_chat_curses.py
@@
-138,7
+138,8
@@
def cmd_PORTAL(game, position, msg):
cmd_PORTAL.argtypes = 'yx_tuple:nonneg string'
def cmd_PLAY_ERROR(game, msg):
cmd_PORTAL.argtypes = 'yx_tuple:nonneg string'
def cmd_PLAY_ERROR(game, msg):
- game.tui.flash()
+ game.tui.log_msg('? ' + msg)
+ game.tui.flash = True
game.tui.do_refresh = True
cmd_PLAY_ERROR.argtypes = 'string'
game.tui.do_refresh = True
cmd_PLAY_ERROR.argtypes = 'string'
@@
-290,11
+291,9
@@
class TUI:
self.force_instant_connect = True
self.input_lines = []
self.fov = ''
self.force_instant_connect = True
self.input_lines = []
self.fov = ''
+ self.flash = False
curses.wrapper(self.loop)
curses.wrapper(self.loop)
- def flash(self):
- curses.flash()
-
def connect(self):
def handle_recv(msg):
def connect(self):
def handle_recv(msg):
@@
-425,12
+424,12
@@
class TUI:
self.window_width)
def move_explorer(direction):
self.window_width)
def move_explorer(direction):
- target = self.game.map_geometry.move(self.explorer, direction)
+ target = self.game.map_geometry.move
_yx
(self.explorer, direction)
if target:
self.explorer = target
self.query_info()
else:
if target:
self.explorer = target
self.query_info()
else:
- self.flash
()
+ self.flash
= True
def draw_history():
lines = []
def draw_history():
lines = []
@@
-635,6
+634,9
@@
class TUI:
else:
self.send('PING')
last_ping = now
else:
self.send('PING')
last_ping = now
+ if self.flash:
+ curses.flash()
+ self.flash = False
if self.do_refresh:
draw_screen()
self.do_refresh = False
if self.do_refresh:
draw_screen()
self.do_refresh = False
@@
-689,13
+691,6
@@
class TUI:
self.send('NICK ' + quote(tokens[1]))
else:
self.log_msg('? need login name')
self.send('NICK ' + quote(tokens[1]))
else:
self.log_msg('? need login name')
- #elif self.input_.startswith('/msg'):
- # tokens = self.input_.split(maxsplit=2)
- # if len(tokens) == 3:
- # self.send('QUERY %s %s' % (quote(tokens[1]),
- # quote(tokens[2])))
- # else:
- # self.log_msg('? need message target and message')
else:
self.log_msg('? unknown command')
else:
else:
self.log_msg('? unknown command')
else:
@@
-754,7
+749,7
@@
class TUI:
self.host = self.game.portals[player.position]
self.reconnect()
else:
self.host = self.game.portals[player.position]
self.reconnect()
else:
- self.flash
()
+ self.flash
= True
self.log_msg('? not standing on portal')
elif key in self.movement_keys and 'MOVE' in self.game.tasks:
self.send('TASK:MOVE ' + self.movement_keys[key])
self.log_msg('? not standing on portal')
elif key in self.movement_keys and 'MOVE' in self.game.tasks:
self.send('TASK:MOVE ' + self.movement_keys[key])
@@
-762,4
+757,5
@@
class TUI:
self.send('TASK:WRITE %s %s' % (key, quote(self.password)))
self.switch_mode('play')
self.send('TASK:WRITE %s %s' % (key, quote(self.password)))
self.switch_mode('play')
-TUI('localhost:5000')
+#TUI('localhost:5000')
+TUI('wss://plomlompom.com/rogue_chat/')