コード例 #1
0
ファイル: avatars.py プロジェクト: samucaoo1/tge-152-fork
 def __init__(self, name, mind, realm):
     self.name = name
     self.mind = mind
     self.realm = realm
     if self.name:
         row = Clients.byUsername(self.name)
         row.status = Clients.Online
     return
コード例 #2
0
ファイル: avatars.py プロジェクト: Bloodknight/tge-152-fork
 def __init__(self, name, mind, realm):
     self.name = name
     self.mind = mind
     self.realm = realm
     if self.name:
         row = Clients.byUsername(self.name)
         row.status = Clients.Online
     return
コード例 #3
0
ファイル: server.py プロジェクト: samucaoo1/tge-152-fork
def main():
    OPTIONS, argv = getOptions('mmolite/config/servers.cfg', 'world server',
                               sys.argv)

    if OPTIONS.username == "-": OPTIONS.username = raw_input("Username: "******"-": OPTIONS.password = raw_input("Password: "******"Setting up World Server..."

        dbconn.resetDB()
        print "Successfully"
        return
    else:
        print "Initialize World Server database..."
        dbconn.startDB()
        Clients.dropTable(ifExists=True)
        Clients.createTable()

        print "Run TGE dedicated server"
        argv.extend([
            '-dedicated', '-game', 'test.mmo', '-mission',
            'test.mmo/data/missions/chatspot.mis'
        ])
        pytorque.initialize(len(argv), argv)

        print "World server connecting to master server: ip[%s] port[%d]" % (
            OPTIONS.master_ip, OPTIONS.master_port)

        creds = credentials.UsernamePassword(OPTIONS.username,
                                             OPTIONS.password)
        world = WorldServer(OPTIONS.master_ip, OPTIONS.master_port,
                            OPTIONS.world_port, PeerType.World, creds,
                            WorldPortal())
        world.run()
        #reactor.run()
        reactor.startRunning()

        #the main loop is broken out and can be combined with other frameworks rather easily
        while pytorque.tick():
            reactorTick()

        #cleanup pytorque.. goodbye!
        pytorque.shutdown()
コード例 #4
0
ファイル: server.py プロジェクト: samucaoo1/tge-152-fork
    def remote_newClient(self, accountID, username, authenticID, mode):

        client = Clients(accountID=accountID,
                         username=username,
                         authenticID=authenticID,
                         location=WorldServer.Name,
                         status=Clients.Hopping,
                         mode=mode,
                         expiryTime=datetime.now() + timedelta(minutes=5))
コード例 #5
0
ファイル: server.py プロジェクト: Bloodknight/tge-152-fork
 def requestAvatarId(self, credentials):
     name = credentials.username
     
     try:
         row = Clients.byUsername(name)
     except:
         print "Login Failed: username[%s]"%(name)
         return failure.Failure(credError.UnauthorizedLogin("Bad username"))
     
     print "Received client: username[%s] password[%s]"%(name, row.authenticID)
     return defer.maybeDeferred(credentials.checkPassword, row.authenticID).addCallback(self._checkedPassword, name)
コード例 #6
0
ファイル: server.py プロジェクト: samucaoo1/tge-152-fork
    def requestAvatarId(self, credentials):
        name = credentials.username

        try:
            row = Clients.byUsername(name)
        except:
            print "Login Failed: username[%s]" % (name)
            return failure.Failure(credError.UnauthorizedLogin("Bad username"))

        print "Received client: username[%s] password[%s]" % (name,
                                                              row.authenticID)
        return defer.maybeDeferred(credentials.checkPassword,
                                   row.authenticID).addCallback(
                                       self._checkedPassword, name)
コード例 #7
0
ファイル: server.py プロジェクト: Bloodknight/tge-152-fork
def main():
    OPTIONS, argv = getOptions('mmolite/config/servers.cfg', 'world server', sys.argv)
    
    if OPTIONS.username=="-": OPTIONS.username = raw_input("Username: "******"-": OPTIONS.password = raw_input("Password: "******"Setting up World Server..."
        
        dbconn.resetDB()
        print "Successfully"
        return
    else: 
        print "Initialize World Server database..."
        dbconn.startDB()
        Clients.dropTable(ifExists=True); Clients.createTable()
        
        print "Run TGE dedicated server"
        argv.extend(['-dedicated', '-game', 'test.mmo', '-mission', 'test.mmo/data/missions/chatspot.mis'])
        pytorque.initialize(len(argv),argv)

        print "World server connecting to master server: ip[%s] port[%d]"%(OPTIONS.master_ip, OPTIONS.master_port)
        
        creds = credentials.UsernamePassword(OPTIONS.username, OPTIONS.password)
        world = WorldServer(OPTIONS.master_ip, OPTIONS.master_port, OPTIONS.world_port, PeerType.World, creds, WorldPortal())
        world.run()
        #reactor.run()
        reactor.startRunning()

        #the main loop is broken out and can be combined with other frameworks rather easily
        while pytorque.tick():
            reactorTick()

        #cleanup pytorque.. goodbye!
        pytorque.shutdown()
コード例 #8
0
ファイル: avatars.py プロジェクト: samucaoo1/tge-152-fork
 def logout(self):
     if self.name:
         row = Clients.byUsername(self.name)
         Clients.delete(row.id)
         self.name = None
     self.realm.logout(self)
コード例 #9
0
ファイル: avatars.py プロジェクト: Bloodknight/tge-152-fork
 def logout(self):
     if self.name:
         row = Clients.byUsername(self.name)
         Clients.delete(row.id)
         self.name = None
     self.realm.logout(self)
コード例 #10
0
ファイル: server.py プロジェクト: samucaoo1/tge-152-fork
 def remote_getLoad(self):
     rows = Clients.selectBy(location=WorldServer.Name)
     return rows.count()
コード例 #11
0
ファイル: server.py プロジェクト: Bloodknight/tge-152-fork
 def remote_getLoad(self):
     rows = Clients.selectBy(location = WorldServer.Name)
     return rows.count()