예제 #1
0
 def activate(self, clientId):
     """
     convenience function. pushes menu cmdMap and prompt, and displays menu
     """
     pushCmdHandler(clientId, self.cmdMap)
     pushPrompt(clientId, lambda x: self.prompt)
     sendToClient(clientId, self.menu)
예제 #2
0
파일: form.py 프로젝트: taishan90/mud
 def activate( self, clientId ):
     """
     convenience function. pushes menu cmdMap and prompt, and displays menu
     """
     pushCmdHandler( clientId, self.cmdMap )
     pushPrompt( clientId, lambda x: self.prompt )
     sendToClient( clientId, self.menu( clientId ) )
예제 #3
0
def zoneListCmd( clientId, remaining ):
    zoneTemplates = zoneList()

    zones = "{!{FGZone Templates:{FC" + endl
    for zt in zoneTemplates:
        zones += " " + str(zt) + endl

    sendToClient( clientId, zones )
예제 #4
0
def mobListCmd(clientId, remaining):
    mobTemplates = mobList()

    mobs = "{!{FGMob Templates:{FC" + endl
    for mt in mobTemplates:
        mobs += " " + str(mt) + endl

    sendToClient(clientId, mobs)
예제 #5
0
파일: zoneList.py 프로젝트: taishan90/mud
def zoneListCmd(clientId, remaining):
    zoneTemplates = zoneList()

    zones = "{!{FGZone Templates:{FC" + endl
    for zt in zoneTemplates:
        zones += " " + str(zt) + endl

    sendToClient(clientId, zones)
예제 #6
0
def mobListCmd( clientId, remaining ):
    mobTemplates = mobList()

    mobs = "{!{FGMob Templates:{FC" + endl
    for mt in mobTemplates:
        mobs += " " + str(mt) + endl

    sendToClient( clientId, mobs )
예제 #7
0
파일: mobEdit.py 프로젝트: taishan90/mud
def mobEditCmd(clientId, remaining):
    if remaining:
        (token, remaining) = first_token(remaining)
        templateId = toInt(token)

        if templateId:
            mobTemplate = getMobTemplate(templateId)

            if mobTemplate:
                _editMob(clientId, mobTemplate)
                return

        _invalidMobId(clientId, token)

    # MobTemplateSelector
    sendToClient(clientId, "MobTemplateSelector not impl")
예제 #8
0
def zoneEditCmd( clientId, remaining):
    if remaining:
        (token, remaining) = first_token(remaining)
        templateId = toInt(token)

        if templateId:
            zoneTemplate = getZoneTemplate( templateId )

            if zoneTemplate:
                _editZone( clientId, zoneTemplate )
                return
            
        _invalidZoneId( clientId, token )

    # ZoneTemplateSelector
    sendToClient( clientId, "ZoneTemplateSelector not impl" )
예제 #9
0
def zoneEditCmd(clientId, remaining):
    if remaining:
        (token, remaining) = first_token(remaining)
        templateId = toInt(token)

        if templateId:
            zoneTemplate = getZoneTemplate(templateId)

            if zoneTemplate:
                _editZone(clientId, zoneTemplate)
                return

        _invalidZoneId(clientId, token)

    # ZoneTemplateSelector
    sendToClient(clientId, "ZoneTemplateSelector not impl")
예제 #10
0
def defaultInvalidSelectionCallback(clientId, menuStr):
    sendToClient(clientId, menuStr)
예제 #11
0
def welcomeCallback(clientId):
    sendToClient(clientId, welcomeMessage % rootCmdMap.commands())
예제 #12
0
파일: chat.py 프로젝트: taishan90/mud
def cmdChat(clientId, remaining):
    if not remaining or len(remaining) == 0:
        sendToClient(clientId, "Usage: chat msg\r\n")
        return

    cmdChatFromMsg(clientId, remaining)
예제 #13
0
def cmdColumnsDemo( clientId, remaining ):
    sendToClient( clientId, "\r\n{!{FYColumns Demo:\r\n\r\n" + toColumns( [ rootCmdMap.commands(), "no color\r\n{!bold\r\n{FMfore magenta\r\n" + rootCmdMap.commands(), demoMsg ], [9, 15, 40], True ) + noSeps )
예제 #14
0
파일: form.py 프로젝트: taishan90/mud
def defaultInvalidSelectionCallback( clientId, menuFunc ):
    sendToClient( clientId, menuFunc( clientId ) )
예제 #15
0
파일: edit.py 프로젝트: ryanberckmans/mud
def submitEdit(clientId, text):
    sendToClient(clientId, endl + "{!{FUYou edited:%s{@%s" % (endl, text) + endl)
예제 #16
0
파일: menu.py 프로젝트: ryanberckmans/mud
 def use( self, clientId ):
     sendToClient( clientId, self.menuStr )
     pushCmdHandler( clientId, self.menuMap )
예제 #17
0
파일: text.py 프로젝트: ryanberckmans/mud
def textCallback( clientId, text ):
    sendToClient( clientId, "{!{FUYou typed:{FG %s" % text )
    popPrompt( clientId )
예제 #18
0
파일: chat.py 프로젝트: ryanberckmans/mud
def cmdChat( clientId, remaining ):
    if not remaining or len(remaining) == 0:
        sendToClient( clientId, "Usage: chat msg\r\n")
        return

    cmdChatFromMsg( clientId, remaining )
예제 #19
0
파일: mobEdit.py 프로젝트: taishan90/mud
def _invalidMobId(clientId, token):
    sendToClient(clientId, "Invalid mob id '%s'" % token)
예제 #20
0
def _activate( clientId, textEditor ):
    pushCmdHandler( clientId, textEditor.cmdMap )
    pushPrompt( clientId, lambda clientId: _prompt )
    sendToClient( clientId, textEditor.menu )
예제 #21
0
def submenuSelectionCallback(clientId):
    sendToClient(clientId, menu(clientId))
예제 #22
0
파일: chatconfig.py 프로젝트: taishan90/mud
def submenuSelectionCallback(clientId):
    sendToClient(clientId, menu(clientId))
예제 #23
0
def textCallback(clientId, text):
    sendToClient(clientId, "{!{FUYou typed:{FG %s" % text)
    popPrompt(clientId)
예제 #24
0
def _defaultInvalidSelectionCallback( clientId, menu ):
    sendToClient( clientId, menu )
예제 #25
0
def _editMobShortNameCallback(clientId, mobTemplateForm, mobShortName):
    mobTemplateForm.mobTemplate.sname = mobShortName
    popPrompt(clientId)
    sendToClient(clientId, mobTemplateForm.form.menu(clientId))
예제 #26
0
def _displayText( clientId, textEditor ):
    sendToClient( clientId, textEditor.text + endl + textEditor.menu )
예제 #27
0
def _invalidZoneId(clientId, token):
    sendToClient(clientId, "Invalid zone id '%s'" % token)
예제 #28
0
파일: edit.py 프로젝트: taishan90/mud
def submitEdit( clientId, text ):
    sendToClient( clientId, endl + "{!{FUYou edited:%s{@%s" % (endl, text) + endl )
예제 #29
0
def welcomeCallback( clientId ):
    sendToClient( clientId, welcomeMessage % rootCmdMap.commands() )
예제 #30
0
def _invalidZoneId( clientId, token ):
    sendToClient( clientId, "Invalid zone id '%s'" % token )
예제 #31
0
파일: textEditor.py 프로젝트: taishan90/mud
def _activate(clientId, textEditor):
    pushCmdHandler(clientId, textEditor.cmdMap)
    pushPrompt(clientId, lambda clientId: _prompt)
    sendToClient(clientId, textEditor.menu)
예제 #32
0
def _editZoneNameCallback(clientId, zoneTemplateForm, zoneName):
    zoneTemplateForm.zoneTemplate.name = zoneName
    popPrompt(clientId)
    sendToClient(clientId, zoneTemplateForm.form.menu(clientId))
예제 #33
0
파일: textEditor.py 프로젝트: taishan90/mud
def _displayText(clientId, textEditor):
    sendToClient(clientId, textEditor.text + endl + textEditor.menu)
예제 #34
0
def _editZoneNameCallback( clientId, zoneTemplateForm, zoneName ):
    zoneTemplateForm.zoneTemplate.name = zoneName
    popPrompt( clientId )
    sendToClient( clientId, zoneTemplateForm.form.menu( clientId ) )
예제 #35
0
def _editMobShortNameCallback(clientId, mobTemplateForm, mobShortName):
    mobTemplateForm.mobTemplate.sname = mobShortName
    popPrompt(clientId)
    sendToClient(clientId, mobTemplateForm.form.menu(clientId))
예제 #36
0
 def use(self, clientId):
     sendToClient(clientId, self.menuStr)
     pushCmdHandler(clientId, self.menuMap)
예제 #37
0
def cmdColumnsDemo(clientId, remaining):
    sendToClient(
        clientId, "\r\n{!{FYColumns Demo:\r\n\r\n" + toColumns([
            rootCmdMap.commands(), "no color\r\n{!bold\r\n{FMfore magenta\r\n"
            + rootCmdMap.commands(), demoMsg
        ], [9, 15, 40], True) + noSeps)