Exemplo n.º 1
0
 def get_char_name(self, inp):
     inp = inp.lower()
     if len(inp) < 3 or len(inp) > 15:
         self.sock.dispatch('Character names must be between 3 and 15 characters long.')
         self.sock.dispatch('Enter a character name: ', trail=False)
     elif len(inp.split()) > 1:
         self.sock.dispatch('Character names must only contain one word.')
         self.sock.dispatch('Enter an character name: ', trail=False)
     elif not inp.isalpha():
         self.sock.dispatch('Character names may only contain letters.')
         self.sock.dispatch('Enter an character name: ', trail=False)
     else:
         self.name = inp.lower()
         if os.path.exists('{0}/{1}'.format(world.playerDir, self.name)):
             maybeplayer = fileparser.flatFileParse('{0}/{1}'.format(world.playerDir, self.name))
             self.password = maybeplayer['password']
             self.lasttime = maybeplayer['lasttime']
             self.lasthost = maybeplayer['lasthost']
             self.sock.dispatch('Please enter your password: '******'Is this a new character? ', trail=False)
                 self.interp = self.confirm_new_char
             else:
                 self.sock.dispatch("I'm sorry, we aren't allowing new characters at this time.\n\r")
                 self.sock.dispatch("Contact [email protected] for an invite!")
                 self.sock.close()
Exemplo n.º 2
0
 def load(self):
     """ Uses self.path to get a file location to load the command data.  Loads the data, assigns instance
         variables based on the data.  Compiles the code from from the file into a code object to be used
         in eval() when the command is called.
     
     Keyword arguments:
         None
         
     Return value:
         None
         
     Example:
         None
         
     Additional notes:
         None
         
     """
     dictinfo = flatFileParse(self.path)
     self.name = dictinfo['name']
     self.capability = dictinfo['capability']
     self.description = dictinfo['description']
     self.disabled = dictinfo['disabled']
     self.racelim = listRead(dictinfo['racelim'])
     self.classlim = listRead(dictinfo['classlim'])
     self.skilllim = dictRead(dictinfo['skilllim'])
     self.noview = dictinfo['noview']
     try:
         self.compiled = compile(self.description, 'tmp', 'exec')
     except Exception as msg:
         print("Error compiling {0}.\n{1}\n".format(self.name, msg))
         self.disabled = 'true'
Exemplo n.º 3
0
 def load(self):
     dictinfo = flatFileParse(self.filename)
     self.name = textRead(dictinfo['name'])
     self.password = textRead(dictinfo['password'])
     self.capability = listRead(dictinfo['capability'])
     self.lasthost = textRead(dictinfo['lasthost'])
     self.lasttime = textRead(dictinfo['lasttime'])
     newroom = int(textRead(dictinfo['location']))
     newroom = area.roomByVnum(newroom)
     self.location = newroom
     self.move(newroom)
     self.long_description = textRead(dictinfo['long description'])
     self.short_description = textRead(dictinfo['short description'])
     self.race = races.racebyname(textRead(dictinfo['race']))
     self.age = int(textRead(dictinfo['age']))
     self.gender = textRead(dictinfo['gender'])
     self.level = int(textRead(dictinfo['level']))
     self.alignment = textRead(dictinfo['alignment'])
     self.money = dictRead(dictinfo['money'])
     self.height = dictRead(dictinfo['height'])
     self.weight = int(textRead(dictinfo['weight']))
     self.maxhp = int(textRead(dictinfo['maxhp']))
     self.currenthp = int(textRead(dictinfo['currenthp']))
     self.maxmovement = int(textRead(dictinfo['maxmovement']))
     self.currentmovement = int(textRead(dictinfo['currentmovement']))
     self.maxwillpower = int(textRead(dictinfo['maxwillpower']))
     self.currentwillpower = int(textRead(dictinfo['currentwillpower']))
     self.totalmemoryslots = dictRead(dictinfo['totalmemoryslots'])
     self.memorizedspells = dictRead(dictinfo['memorizedspells'])
     self.hitroll = int(textRead(dictinfo['hitroll']))
     self.damroll = int(textRead(dictinfo['damroll']))
     self.wimpy = int(textRead(dictinfo['wimpy']))
     self.title = textRead(dictinfo['title'])
     self.guild = textRead(dictinfo['guild'])
     self.council = textRead(dictinfo['council'])
     self.family = textRead(dictinfo['family'])
     self.clan = textRead(dictinfo['clan'])
     self.deity = textRead(dictinfo['deity'])
     self.skillpoints = int(textRead(dictinfo['skillpoints']))
     self.seen_as = textRead(dictinfo['seen as'])
     self.maximum_stat = dictRead(dictinfo['maximum stat'])
     self.current_stat = dictRead(dictinfo['current stat'])
     self.discipline = textRead(dictinfo['discipline'])
     self.aesthetic = textRead(dictinfo['aesthetic'])
     self.exp = dictRead(dictinfo['exp'])
     self.inventory = listRead(dictinfo['inventory'])
     self.worn = dictRead(dictinfo['worn'])
     self.baceac = dictRead(dictinfo['baceac'])
     self.currentac = dictRead(dictinfo['currentac'])
     self.hunger = int(textRead(dictinfo['hunger']))
     self.thirst = int(textRead(dictinfo['thirst']))
     self.position = textRead(dictinfo['position'])
     self.aid = textRead(dictinfo['aid'])
     self.knownpeople = dictRead(dictinfo['known people'])
     self.prompt = textRead(dictinfo['prompt'])
     self.alias = dictRead(dictinfo['alias'])
Exemplo n.º 4
0
 def load(self):
     dictinfo = flatFileParse(self.path)
     self.name = dictinfo['name']
     self.description = dictinfo['description']
     self.alignment = listRead(dictinfo['alignment'])
     self.playable = dictinfo['playable']
     self.descriptive = dictinfo['descriptive']
     self.size = dictinfo['size']
     self.heightfeet = int(dictinfo['heightfeet'])
     self.heightinches = int(dictinfo['heightinches'])
     self.undead = dictinfo['undead']
     self.weight = int(dictinfo['weight'])
     self.ageminimum = int(dictinfo['ageminimum'])
     self.agemaximum = int(dictinfo['agemaximum'])
     self.baslashing = int(dictinfo['baslashing'])
     self.babashing = int(dictinfo['babashing'])
     self.bapiercing = int(dictinfo['bapiercing'])
     self.balashing = int(dictinfo['balashing'])
     self.brfire = int(dictinfo['brfire'])
     self.brice = int(dictinfo['brice'])
     self.brlightning = int(dictinfo['brlightning'])
     self.brearth = int(dictinfo['brearth'])
     self.brdisease = int(dictinfo['brdisease'])
     self.brpoison = int(dictinfo['brpoison'])
     self.brmagic = int(dictinfo['brmagic'])
     self.brholy = int(dictinfo['brholy'])
     self.brmental = int(dictinfo['brmental'])
     self.brphysical = int(dictinfo['brphysical'])
     self.wearlocations = listRead(dictinfo['wearlocations'])
     self.bodyparts = listRead(dictinfo['bodyparts'])
     self.skin = listRead(dictinfo['skin'])
     self.eyes = listRead(dictinfo['eyes'])
     self.hair = listRead(dictinfo['hair'])
     self.speed = dictinfo['speed']
     self.speed = int(self.speed)
     self.agility = dictinfo['agility']
     self.agility = int(self.agility)
     self.strength = dictinfo['strength']
     self.strength = int(self.strength)
     self.intelligence = dictinfo['intelligence']
     self.intelligence = int(self.intelligence)
     self.wisdom = dictinfo['wisdom']
     self.wisdom = int(self.wisdom)
     self.charisma = dictinfo['charisma']
     self.charisma = int(self.charisma)
     self.luck = dictinfo['luck']
     self.luck = int(self.luck)
     self.constitution = dictinfo['constitution']
     self.constitution = int(self.constitution)
     self.start_location = dictRead(dictinfo['start_location'])
     self.special_skills = dictRead(dictinfo['special_skills'])
Exemplo n.º 5
0
 def load(self):
     """ Open the area data file located at self.path.  Assigns the data read into the instance
         variables.
     
     Keyword arguments:
         None
         
     Return value:
         None
         
     Example:
         None
         
     Additional notes:
         None
         
     """ 
     dictinfo = flatFileParse(self.path)
     self.creator = dictinfo['creator']
     self.viewable = dictinfo['viewable']
     self.keywords = listRead(dictinfo['keywords'])
     self.topics = dictinfo['topics']
     self.section = dictinfo['section']
     self.description = dictinfo['description']