Package org.jdesktop.wonderland.modules.presencemanager.common.messages

Examples of org.jdesktop.wonderland.modules.presencemanager.common.messages.PresenceInfoAddedMessage


      pm.playerInRange(info, msg.isInRange());
      return;
  }

        if (message instanceof PresenceInfoAddedMessage) {
            PresenceInfoAddedMessage m = (PresenceInfoAddedMessage) message;

            logger.fine("GOT PresenceInfoAddedMessage for " + m.getPresenceInfo());

            pm.presenceInfoAdded(m.getPresenceInfo());
            return;
        }

        if (message instanceof PresenceInfoRemovedMessage) {
            PresenceInfoRemovedMessage m = (PresenceInfoRemovedMessage) message;
            PresenceInfo pi = pm.getPresenceInfo(m.getCellID());
            if (pi == null) {
                logger.warning("No presence info found for " + m.getCellID());
                return;
            }

            logger.fine("GOT PresenceInfoRemovedMessage for " + pi);
            pm.presenceInfoRemoved(pi);
            return;
        }

        if (message instanceof PresenceInfoChangedMessage) {
            PresenceInfoChangedMessage m = (PresenceInfoChangedMessage) message;
            PresenceInfo pi = pm.getPresenceInfo(m.getCellID());
            if (pi == null) {
                logger.warning("No presence info found for " + m.getCellID());
                return;
            }

            logger.fine("GOT PresenceInfoChangeMessage for " + pi);
     
            switch (m.getChange()) {
                case SPEAKING:
                    pm.setSpeaking(pi, m.getValue());
                    break;
                case MUTED:
                    pm.setMute(pi, m.getValue());
                    break;
                case SECRET_CHAT:
                    pm.setInSecretChat(pi, m.getValue());
                    break;
                case CONE_OF_SILENCE:
                    pm.setEnteredConeOfSilence(pi, m.getValue());
                    break;
            }
            return;
        }

        if (message instanceof PresenceInfoChangedAliasMessage) {
            PresenceInfoChangedAliasMessage m = (PresenceInfoChangedAliasMessage) message;
            PresenceInfo pi = pm.getPresenceInfo(m.getCellID());
            if (pi == null) {
                logger.warning("No presence info found for " + m.getCellID());
                return;
            }

            pm.changeUsernameAlias(pi, m.getAlias());
            return;
        }

        throw new UnsupportedOperationException("Unknown message:  " + message);
    }
View Full Code Here


        // add the presence info object to our map
        getPresenceInfo().put(clientID, pi);

        // notify all clients of the new presence info
        sender.send(new PresenceInfoAddedMessage(pi));

        // create a listener for this player
        PlayerListener listener = new PlayerListener(sender, clientID,
                callID, cellID, getPresenceInfo());
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.presencemanager.common.messages.PresenceInfoAddedMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.