+ self.force_redisplay()
+ return d('chat '+what)
+
+ def chat_metacmd(what):
+ (cmdr, metacmd) = m.groups()
+ metacmd = regexp.sub('\\s+', ' ', metacmd).strip()
+ m2 = regexp.match(
+ '/([ad]) (?:([A-Za-z ]+)\\s*:)?([A-Za-z ]+)$',
+ metacmd)
+ if not m2: return chat(what)
+
+ (cmd, vn, targets) = m2.groups()
+ dml = ['metachat', cmd]
+
+ if cmd == 'a': each = self._onboard_event
+ else: each = disembark
+
+ if cmdr == self._myself.name:
+ dml.append('self')
+ how = 'manual: /%s' % cmd
+ else:
+ dml.append('other')
+ how = '/%s %s' % (cmd,cmdr)
+
+ v = None
+ if vn is not None and len(vn.split(' ')) == 2:
+ v = self._update_vessel_lookup(
+ vn.title(), timestamp, dml)
+ elif self._v is None:
+ dml.append('no-current')
+ elif vn is None:
+ dml.append('current')
+ v = self._v
+ elif regexp.match('(?:.* )?%s$' % vn.title(),
+ self._vessel):
+ dml.append('match')
+ v = self._v
+ else:
+ dml.append('unk-abbrev')
+
+ if v is None:
+ return d(' '.join(dml))
+
+ targets = targets.strip().split(' ')
+ dml.append(`len(targets)`)
+ for target in targets:
+ each(v, timestamp, target.title(), how)
+
+ return d(' '.join(dml))