Beispiel #1
0
 def onNewVoiceSession(self):
     naali.getDefaultScene().connect("ComponentAdded(Scene::Entity*, IComponent*, AttributeChange::Type)", self._onComponentAdded)    
     self._indicators = {} # map uuid to VoiceIndicator objects
     self._presenceMonitors = []
     self._voiceSession = self._commService.InWorldVoiceSession() 
     if self._voiceSession is not None:
         print self._voiceSession
         print type(self._voiceSession)
         self._voiceSession.connect("ParticipantJoined(Communications::InWorldVoice::ParticipantInterface*)", self.onParticipantJoined)
Beispiel #2
0
 def onNewVoiceSession(self):
     naali.getDefaultScene().connect(
         "ComponentAdded(Scene::Entity*, IComponent*, AttributeChange::Type)",
         self._onComponentAdded)
     self._indicators = {}  # map uuid to VoiceIndicator objects
     self._presenceMonitors = []
     self._voiceSession = self._commService.InWorldVoiceSession()
     if self._voiceSession is not None:
         print self._voiceSession
         print type(self._voiceSession)
         self._voiceSession.connect(
             "ParticipantJoined(Communications::InWorldVoice::ParticipantInterface*)",
             self.onParticipantJoined)
Beispiel #3
0
 def update(self, time):
     #print "here", time
     self.time += time
     if self.sels:
         ent = self.active
         #try:
         #    ent.prim
         #except ValueError:
         #that would work also, but perhaps this is nicer:
         s = naali.getDefaultScene()
         if not s.HasEntityId(ent.id):
             #my active entity was removed from the scene by someone else
             self.deselect(ent, valid=False)
             return
             
         if self.time > self.UPDATE_INTERVAL:
             try:
                 #sel_pos = self.selection_box.placeable.Position
                 arr_pos = self.manipulator.getManipulatorPosition()
                 ent_pos = ent.placeable.position
                 #if sel_pos != ent_pos:
                 self.time = 0 #XXX NOTE: is this logic correct?
                 #    self.selection_box.placeable.Position = ent_pos
                 if arr_pos != ent_pos:
                     self.manipulator.moveTo(self.sels)
             except RuntimeError, e:
                 r.logDebug("update: scene not found")
Beispiel #4
0
    def update(self, time):
        #print "here", time
        if self.windowActive:
            self.time += time
            if self.sels:
                ent = self.active
                #try:
                #    ent.prim
                #except ValueError:
                #that would work also, but perhaps this is nicer:
                s = naali.getDefaultScene()
                if not s.HasEntityId(ent.id):
                    #my active entity was removed from the scene by someone else
                    self.deselect(ent, valid=False)
                    return

                if self.time > self.UPDATE_INTERVAL:
                    try:
                        #sel_pos = self.selection_box.placeable.Position
                        arr_pos = self.manipulator.getManipulatorPosition()
                        ent_pos = ent.placeable.Position
                        #if sel_pos != ent_pos:
                        self.time = 0  #XXX NOTE: is this logic correct?
                        #    self.selection_box.placeable.Position = ent_pos
                        if arr_pos != ent_pos:
                            self.manipulator.moveTo(self.sels)
                    except RuntimeError, e:
                        r.logDebug("update: scene not found")
Beispiel #5
0
    def __init__(self,
                 nick=NICKNAME,
                 ircchannel=IRCCHANNEL,
                 host=IRCSERVER,
                 port=PORT):
        if not naali.server.IsAboutToStart():
            return
        circuits.Component.__init__(self)
        self.client = ircclient.Client(nick, ircchannel, host, port)
        self += self.client  #so that we can handle irc events here too
        self.client.connect()

        self.chatapp = None

        self.scene = None
        self.chatapp = None

        naali.server.connect("UserConnected(int, UserConnection*)",
                             self.onUserConnected)
        naali.server.connect("UserDisconnected(int, UserConnection*)",
                             self.onUserDisconnected)

        #when live reloading, chatapp is already there:
        self.scene = naali.getDefaultScene()
        if self.scene is not None:
            self.chatapp = self.scene.GetEntityByNameRaw("ChatApplication")
            self.init_chatapp_handlers()

        self.cmds = {'help': self.help, 'users': self.users, 'fps': self.fps}
Beispiel #6
0
    def __init__(self, nick=NICKNAME, ircchannel=IRCCHANNEL, host=IRCSERVER, port=PORT):
        if not naali.server.IsAboutToStart():
            return
        circuits.Component.__init__(self)
        self.client = ircclient.Client(nick, ircchannel, host, port)
        self += self.client #so that we can handle irc events here too
        self.client.connect()

        self.chatapp = None

        self.scene = None
        self.chatapp = None

        naali.server.connect("UserConnected(int, UserConnection*)", self.onUserConnected)
        naali.server.connect("UserDisconnected(int, UserConnection*)", self.onUserDisconnected)

        #when live reloading, chatapp is already there:
        self.scene = naali.getDefaultScene()
        if self.scene is not None:
            self.chatapp = self.scene.GetEntityByNameRaw("ChatApplication")
            self.init_chatapp_handlers()

        self.cmds = {
            'help': self.help,
            'users': self.users,
            'fps': self.fps
            }
Beispiel #7
0
 def _getAvatarEntity(self, uuid):
     entities = naali.getDefaultScene().GetEntitiesWithComponentRaw("EC_OpensimPresence")
     for e in entities:
         presence = e.GetComponentRaw("EC_OpenSimPresence")
         if presence is not None:
             if presence.QGetUUIDString() == uuid:
                 return e
     return None
Beispiel #8
0
 def _getAvatarEntity(self, uuid):
     entities = naali.getDefaultScene().GetEntitiesWithComponentRaw(
         "EC_OpensimPresence")
     for e in entities:
         presence = e.GetComponentRaw("EC_OpenSimPresence")
         if presence is not None:
             if presence.QGetUUIDString() == uuid:
                 return e
     return None
Beispiel #9
0
    #print dir(qent), type(qent.EC_Placeable), qent.EC_Placeable
    print dir(ent.placeable)
    print "Name:", ent.placeable.name
    print "objectName:", ent.placeable.objectName

    print "DynProp check:", 'myplace' in qent.dynamicPropertyNames()
    
if 0: #using the dynamic property component getters implemented in core/componentpropertyadder now
    ent = naali.getUserAvatar()
    qent = ent.qent
    print dir(qent)
    print qent.dynamicPropertyNames()
    print qent.placeable

if 0: #getting all entities with a certain component, now directly as the entity objects. works :)
    s = naali.getDefaultScene()
    ents = s.GetEntitiesWithComponentRaw("EC_Placeable")
    for ent in ents:
        print ent.placeable.position
        
if 0: #estate management uses presence info. websocketserver too
    s = naali.getDefaultScene()
    ents = s.GetEntitiesWithComponentRaw("EC_OpenSimPresence")
    for ent in ents:
        displaystring = ent.opensimpresence.QGetFullName() + "|" + ent.opensimpresence.QGetUUIDString()
        print displaystring

if 1: #start a pythonqt console
    try:
        r.qtconsole
    except: