예제 #1
0
파일: testrunner.py 프로젝트: A-K/naali
    def run(self):
        self.wait_time = int(self.config.get("wait_time", 60))
        yield "doing login"
        self.timer_start()
        r.startLoginOpensim(user, pwd, server)
        yield "waiting for connection"
        conn = None
        while not self.elapsed(self.wait_time):
            conn = r.getServerConnection()
            if conn and conn.IsConnected():
                break
            else:
                yield None
        else:
            return
        yield "waiting for avatar to appear"
        ent = None
        while not self.elapsed(self.wait_time):
            try:
                ent = naali.getUserAvatar()
            except ValueError:
                yield None
            else:
                break
        
        if not ent:
            yield "failure, avatar didn't appear"
            return

        for i in range(100):
            for x in self.do_api_calls():
                yield x
            break
        r.exit()
        yield "success"
예제 #2
0
    def run(self):
        self.wait_time = int(self.config.get("wait_time", 60))
        yield "doing login"
        self.timer_start()
        r.startLoginOpensim(user, pwd, server)
        yield "waiting for connection"
        conn = None
        while not self.elapsed(self.wait_time):
            conn = r.getServerConnection()
            if conn and conn.IsConnected():
                break
            else:
                yield None
        else:
            return
        yield "waiting for scene"
        while not self.scene and not self.elapsed(self.wait_time):
            yield None

        yield "creating object"
        r.getServerConnection().SendObjectAddPacket(42, 42, 22)
        yield "waiting for EntityCreated"
        while (not self.finished) and (not self.elapsed(self.wait_time)):
            yield None
        yield "exiting"
        r.exit()
        if self.finished:
            yield "success"
        else:
            yield "failure"
예제 #3
0
    def run(self):
        self.wait_time = int(self.config.get("wait_time", 60))
        yield "doing login"
        self.timer_start()
        r.startLoginOpensim(user, pwd, server)
        yield "waiting for connection"
        conn = None
        while not self.elapsed(self.wait_time):
            conn = r.getServerConnection()
            if conn and conn.IsConnected():
                break
            else:
                yield None
        else:
            return
        yield "waiting for avatar to appear"
        ent = None
        while not self.elapsed(self.wait_time):
            try:
                ent = naali.getUserAvatar()
            except ValueError:
                yield None
            else:
                break

        if not ent:
            yield "failure, avatar didn't appear"
            return

        for i in range(100):
            for x in self.do_api_calls():
                yield x
            break
        r.exit()
        yield "success"
예제 #4
0
 def login(self, worldinfo):
     r.logInfo("Anon login with %s - %s " % (worldinfo.loginuri, worldinfo.accounturi))
     urlfile = urllib2.urlopen(worldinfo.accounturi)
     s = urlfile.read()
     s = s.strip()
     r.logInfo("AnonLogin got account info: %s" % s)
     try:
         firstname, lastname = s.split() #just to check that it has the right format
     except ValueError:
         r.logInfo("Invalid data from anon login cred service: %s" % s)
     else:
         user = "******" % (firstname, lastname)
         r.startLoginOpensim(user, worldinfo.passwd, worldinfo.loginuri)
예제 #5
0
파일: testrunner.py 프로젝트: A-K/naali
    def run(self):
        self.wait_time = int(self.config.get("wait_time", 60))
        yield "doing login"
        self.timer_start()
        r.startLoginOpensim(user, pwd, server)
        yield "waiting for connection"
        conn = None
        while not self.elapsed(self.wait_time):
            conn = r.getServerConnection()
            if conn and conn.IsConnected():
                break
            else:
                yield None
        else:
            return
        yield "waiting for avatar to appear"
        ent = None
        while not self.elapsed(self.wait_time):
            try:
                ent = naali.getUserAvatar()
            except ValueError:
                yield None
            else:
                break
        
        if not ent:
            yield "failure, avatar didn't appear"
            return

        print 'dynamic property stuff:'
        ent.GetOrCreateComponentRaw("EC_DynamicComponent")
        print ent, type(ent)
        d = ent.qent.EC_DynamicComponent
        val = 42.0
        d.CreateAttribute("real", val)
        d.ComponentChanged(0)
        assert val == d.GetAttribute("real")

        val = 8.5
        d.SetAttribute("real", val)
        d.ComponentChanged(0)
        assert val == d.GetAttribute("real")
        d.RemoveAttribute("real")
        d.ComponentChanged(0)

        yield "created, changed and removed attribute"
        r.exit()
        yield "success"
예제 #6
0
    def run(self):
        self.wait_time = int(self.config.get("wait_time", 60))
        yield "doing login"
        self.timer_start()
        r.startLoginOpensim(user, pwd, server)
        yield "waiting for connection"
        conn = None
        while not self.elapsed(self.wait_time):
            conn = r.getServerConnection()
            if conn and conn.IsConnected():
                break
            else:
                yield None
        else:
            return
        yield "waiting for avatar to appear"
        ent = None
        while not self.elapsed(self.wait_time):
            try:
                ent = naali.getUserAvatar()
            except ValueError:
                yield None
            else:
                break

        if not ent:
            yield "failure, avatar didn't appear"
            return

        print 'dynamic property stuff:'
        ent.GetOrCreateComponentRaw("EC_DynamicComponent")
        print ent, type(ent)
        d = ent.qent.EC_DynamicComponent
        val = 42.0
        d.CreateAttribute("real", val)
        d.ComponentChanged(0)
        assert val == d.GetAttribute("real")

        val = 8.5
        d.SetAttribute("real", val)
        d.ComponentChanged(0)
        assert val == d.GetAttribute("real")
        d.RemoveAttribute("real")
        d.ComponentChanged(0)

        yield "created, changed and removed attribute"
        r.exit()
        yield "success"
예제 #7
0
    def run(self):
        yield "login"
        self.timer_start()
        r.startLoginOpensim(user, pwd, server)
        print "ELAPSED:", self.elapsed(self.wait_time)
        while not self.elapsed(self.wait_time):
            #print "X",
            yield None

        yield "logging out"
        self.timer_start()
        r.logout()
        while not self.elapsed(self.wait_time):
            yield None

        yield "exiting"
        r.exit()
예제 #8
0
파일: command.py 프로젝트: Chiru/naali
    #~ r.box.orientation = ent.orientation
    
    
    #~ min_ent = r.createEntity("cruncah1.mesh")
    #~ min_ent.scale = 0.3, 0.3, 0.3
    #~ min_ent.pos = pos[0] + min.x, pos[1] + min.y, pos[2] + min.z 
    
    #~ max_ent = r.createEntity("cruncah1.mesh")
    #~ max_ent.scale = 0.3, 0.3, 0.3
    #~ max_ent.pos = pos[0] + max.x, pos[1] + max.y, pos[2] + max.z
    
if 0: #login - for running tests automatically
    print "starting opensim login"
    #user, pwd, server = "Test User", "test", "localhost:9000"
    user, pwd, server = "d d", "d", "world.evocativi.com:8002"
    r.startLoginOpensim(user, pwd, server)
    
if 0: #getserverconnection test
    #print dir(r)
    #print "YO", r.getTrashFolderId()
    #r.deleteObject(2351241440)
    worldstream = r.getServerConnection()
    
    #print worldstream, dir(worldstream), worldstream.SendObjectDeRezPacket
    worldstream.SendObjectDeRezPacket(2891301779, r.getTrashFolderId())
    #ent = r.getEntity(r.getUserAvatarId())
    #worldstream.SendObjectDeletePacket(1278500474, True)
    #~ ent = r.getEntity(2208825114)
    #~ print ent

if 0: #getrexlogic test
예제 #9
0
    #~ r.box.scale = height, width, depth#depth, width, height
    #~ r.box.orientation = ent.orientation

    #~ min_ent = r.createEntity("cruncah1.mesh")
    #~ min_ent.scale = 0.3, 0.3, 0.3
    #~ min_ent.pos = pos[0] + min.x, pos[1] + min.y, pos[2] + min.z

    #~ max_ent = r.createEntity("cruncah1.mesh")
    #~ max_ent.scale = 0.3, 0.3, 0.3
    #~ max_ent.pos = pos[0] + max.x, pos[1] + max.y, pos[2] + max.z

if 0:  #login - for running tests automatically
    print "starting opensim login"
    #user, pwd, server = "Test User", "test", "localhost:9000"
    user, pwd, server = "d d", "d", "world.evocativi.com:8002"
    r.startLoginOpensim(user, pwd, server)

if 0:  #getserver test
    #print dir(r)
    #print "YO", r.getTrashFolderId()
    #r.deleteObject(2351241440)
    worldstream = r.getServerConnection()

    #print worldstream, dir(worldstream), worldstream.SendObjectDeRezPacket
    worldstream.SendObjectDeRezPacket(2891301779, r.getTrashFolderId())
    #ent = r.getEntity(r.getUserAvatarId())
    #worldstream.SendObjectDeletePacket(1278500474, True)
    #~ ent = r.getEntity(2208825114)
    #~ print ent

if 0:  #undo tests