def phase (s): l = s.line() if l is None: return if s.play == KP_USER: s.name = l if not V_NAME.match(l): s.msg(fb.TInvUser) if not fb.passwd.has_key(l): s.msg(fb.TNoUser) s.play = KP_NEWU else: s.msg('Pass: '******'Sorry.\n'); s.close() s.body = fb.users[s.name]; if s.body.K is not None: s.body.K.close() s.body.K = s if isW(s.body): s.body.mov(fb.WEntry) else: s.body.mov(fb.PEntry) s.msg('\n\n' + fb.TOldEntry); s.buf = 'look\n' + s.buf; s.play = KP_PLAY elif s.play == KP_NEWU: l = slo(l) if l in ['y', 'yes']: s.msg(fb.TNewPass) s.play = KP_NEWP else: s.msg('\nUser: '******'m': g = fb.GMale elif l == 'f': g = fb.GFemale elif l == 'n': g = fb.GNeuter elif l == 'a': g = fb.GAmbig else: s.msg(fb.TInvGender) return s.body = P(N=[ s.name ], S=cap(s.name), D=cap(s.name), G=g, K=s); s.body.mov(fb.PEntry) fb.users[s.name] = s.body; fb.passwd[s.name] = s.pswd; fb.save_pass() s.msg('\n\n' + fb.TNewEntry); s.buf = 'look\n' + s.buf; s.play = KP_PLAY
def main (): fb.load_res() tm = time.time; mud = Fresnel(2002) try: while 1: tf = tm() + 0.125 # 8 cycles/second poll(); map(lambda x: x.run(), fb.users.values()) te = tm() if te < tf: time.sleep(tf - te) except KeyboardInterrupt, err: fb.save_res(); fb.save_room(); fb.save_pass()
def main(): fb.load_res() tm = time.time mud = Fresnel(2002) try: while 1: tf = tm() + 0.125 # 8 cycles/second poll() map(lambda x: x.run(), fb.users.values()) te = tm() if te < tf: time.sleep(tf - te) except KeyboardInterrupt, err: fb.save_res() fb.save_room() fb.save_pass()
def phase(s): l = s.line() if l is None: return if s.play == KP_USER: s.name = l if not V_NAME.match(l): s.msg(fb.TInvUser) if not fb.passwd.has_key(l): s.msg(fb.TNoUser) s.play = KP_NEWU else: s.msg('Pass: '******'Sorry.\n') s.close() s.body = fb.users[s.name] if s.body.K is not None: s.body.K.close() s.body.K = s if isW(s.body): s.body.mov(fb.WEntry) else: s.body.mov(fb.PEntry) s.msg('\n\n' + fb.TOldEntry) s.buf = 'look\n' + s.buf s.play = KP_PLAY elif s.play == KP_NEWU: l = slo(l) if l in ['y', 'yes']: s.msg(fb.TNewPass) s.play = KP_NEWP else: s.msg('\nUser: '******'m': g = fb.GMale elif l == 'f': g = fb.GFemale elif l == 'n': g = fb.GNeuter elif l == 'a': g = fb.GAmbig else: s.msg(fb.TInvGender) return s.body = P(N=[s.name], S=cap(s.name), D=cap(s.name), G=g, K=s) s.body.mov(fb.PEntry) fb.users[s.name] = s.body fb.passwd[s.name] = s.pswd fb.save_pass() s.msg('\n\n' + fb.TNewEntry) s.buf = 'look\n' + s.buf s.play = KP_PLAY