def _create_player(session, playername, password, permissions, typeclass=None):
 try:
  new_player = create.create_player(playername, None, password, permissions=permissions, typeclass=typeclass)
 except Exception as e:
  session.msg(('There was an error creating the Player:\n%s\n If this problem persists, contact an admin.' % e))
  logger.log_trace()
  return False
 new_player.db.FIRST_LOGIN = True
 pchannel = ChannelDB.objects.get_channel(settings.DEFAULT_CHANNELS[0]['key'])
 if (not pchannel.connect(new_player)):
  string = ("New player '%s' could not connect to public channel!" % new_player.key)
  logger.log_err(string)
 return new_player

def _create_player ( session , playername , password , permissions , typeclass = None ) : try : new_player = create . create_player ( playername , None , password , permissions = permissions , typeclass = typeclass ) except Exception as e : session . msg ( ( 'There was an error creating the Player:\n%s\n If this problem persists, contact an admin.' % e ) ) logger . log_trace ( ) return False new_player . db . FIRST_LOGIN = True pchannel = ChannelDB . objects . get_channel ( settings . DEFAULT_CHANNELS [ 0 ] [ 'key' ] ) if ( not pchannel . connect ( new_player ) ) : string = ( "New player '%s' could not connect to public channel!" % new_player . key ) logger . log_err ( string ) return new_player
helper function .