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

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


            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


        // set the alias
        pi.setInConeOfSilence(inCOS);

        // send a message to the connection
        Message m = new PresenceInfoChangedMessage(pi.getCellID(),
                                                   Change.CONE_OF_SILENCE,
                                                   inCOS);
        getPresenceSender().send(m);
    }
View Full Code Here

        if (pi == null) {
            logger.warning("No presence info for " + speakingID);
            return;
        }

        Message m = new PresenceInfoChangedMessage(pi.getCellID(),
                                                   Change.SPEAKING, speaking);
        getPresenceSender().send(m);
    }
View Full Code Here

                    }
                    break;

                case CallStatus.MUTED:
                    pi.setMuted(true);
                    sender.send(new PresenceInfoChangedMessage(cellID, Change.MUTED, true));
                    break;

                case CallStatus.UNMUTED:
                    pi.setMuted(false);
                    sender.send(new PresenceInfoChangedMessage(cellID, Change.MUTED, false));
                    break;

                case CallStatus.STARTEDSPEAKING:
                    // ignore this indicator if the player is in a secret
                    // audio group
                    if (isInSecretAudioGroup(player)) {
                        return;
                    }

                    sender.send(new PresenceInfoChangedMessage(cellID, Change.SPEAKING, true));
                    break;

                case CallStatus.STOPPEDSPEAKING:
                    // ignore this indicator if the player is in a secret
                    // audio group
                    if (isInSecretAudioGroup(player)) {
                        return;
                    }

                    sender.send(new PresenceInfoChangedMessage(cellID, Change.SPEAKING, false));
                    break;
            }
        }
View Full Code Here

TOP

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

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.