Exemplo n.º 1
0
def login(actor):
    '''Perform some initialisation for the Player being logged in.'''
    actor.connstate = 'online'
    actor.chunked_event = None
    actor.chunks = iter([])
    actor.receiveEvent(LoginFirstEvent())
    distributeEvent(actor.room, [actor], LoginThirdEvent(actor))
Exemplo n.º 2
0
def login(actor):
    '''Perform some initialisation for the Player being logged in.'''
    actor.connstate = 'online'
    actor.chunked_event = None
    actor.chunks = iter([])
    actor.receiveEvent(LoginFirstEvent())
    distributeEvent(actor.room, [actor], LoginThirdEvent(actor))
Exemplo n.º 3
0
def speakTo(actor, target, text):
    if target not in actor.room and target not in actor.inventory:
        unfoundObject(actor)
    else:
        actor.receiveEvent(SpeakToFirstEvent(target, text))
        target.receiveEvent(SpeakToSecondEvent(actor, text))
        distributeEvent(actor.room, [actor, target],
                        SpeakToThirdEvent(actor, target, text))
Exemplo n.º 4
0
def speakTo(actor, target, text):
    if target not in actor.room and target not in actor.inventory:
        unfoundObject(actor)
    else:
        actor.receiveEvent(SpeakToFirstEvent(target, text))
        target.receiveEvent(SpeakToSecondEvent(actor, text))
        distributeEvent(actor.room, [actor, target],
                        SpeakToThirdEvent(actor, target, text))
Exemplo n.º 5
0
def logoffFinal(actor):
    #XXX: is this doing stuff in the correct order?
    if actor.connstate != 'online':
        logging.info("Foiled a double logoff attempt with %r." % actor)
        return
    actor.connstate = 'offline'
    actor.receiveEvent(LogoffFirstEvent())
    distributeEvent(actor.room, [actor], LogoffThirdEvent(actor))
    actor.disconnect()
    actor.room.remove(actor)
Exemplo n.º 6
0
def emoteTo(actor, target, first, second, third):
    if target.room not in [actor.room, actor.inventory]:
        unfoundObject()
        return
    first = process(first)
    second = process(second)
    third = process(third)
    actor.receiveEvent(EmoteTargettedFirst(target, first))
    target.receiveEvent(EmoteTargettedSecond(actor, second))
    distributeEvent(actor.room, [actor, target],
                    EmoteTargettedThird(actor, target, third))
Exemplo n.º 7
0
def speak(actor, text):
    actor.receiveEvent(SpeakNormalFirstEvent(text))
    distributeEvent(actor.room, [actor], SpeakNormalThirdEvent(actor, text))
Exemplo n.º 8
0
def emote(actor, first, third):
    first = process(first)
    third = process(third)
    actor.receiveEvent(EmoteUntargettedFirst(actor, first))
    distributeEvent(actor.room, [actor],
                    EmoteUntargettedThird(actor, third))
Exemplo n.º 9
0
def speak(actor, text):
    actor.receiveEvent(SpeakNormalFirstEvent(text))
    distributeEvent(actor.room, [actor], SpeakNormalThirdEvent(actor, text))