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

Examples of org.jdesktop.wonderland.modules.presencemanager.common.PresenceInfo


  logger.fine("Set member list...");

  synchronized (invitedMembers) {
      synchronized (members) {
          for (int i = 0; i < memberList.length; i++) {
        PresenceInfo info = memberList[i];

        invitedMembers.remove(info);

        logger.fine("Member " + info);
View Full Code Here


      audioGroup = vm.createAudioGroup(group, setup);
  }

  PresenceInfo[] calleeList = msg.getCalleeList();

  PresenceInfo caller = msg.getCaller();

  if (msg.getChatType() != null) {
      Player player = vm.getPlayer(caller.getCallID());

      if (player == null) {
    logger.warning("No Player for " + caller.getCallID());
    return;
      }

      boolean added = addPlayerToAudioGroup(audioGroup, player, caller, msg.getChatType());

      if (added) {
          sender.send(new VoiceChatJoinAcceptedMessage(group, caller, msg.getChatType()));
      }

      if (added == false && (calleeList == null || calleeList.length == 0)) {
          endVoiceChat(vm, audioGroup);
          return;
      }
  }

  logger.info("Request to join AudioGroup " + group + " caller " + caller);

  if (calleeList == null || calleeList.length == 0) {
      return;
  }

  for (int i = 0; i < calleeList.length; i++) {
      PresenceInfo info = calleeList[i];

      String callID = info.getCallID();

      Player player = vm.getPlayer(callID);

      if (player == null) {
    logger.warning("No player for callID " + callID);
    continue;
      }

      if (info.getClientID() == null) {
    /*
     * This is an outworlder.  We automatically join them to the group
      * The InCallDialog can be used to change the privacy setting
     * and to remove the outworlder from the chat.
     */
          addPlayerToAudioGroup(audioGroup, player, info, msg.getChatType());
          sender.send(new VoiceChatJoinAcceptedMessage(group, info, msg.getChatType()));
        continue;
      }

      AudioGroupPlayerInfo playerInfo = audioGroup.getPlayerInfo(player);

      if (playerInfo != null && sameChatType(playerInfo.chatType, msg.getChatType())) {
    logger.fine("Player " + info
        + " is already in audio group " + audioGroup);

    if (playerInfo.isTransientMember == false) {
        continue;
    }
      }

            WonderlandClientID id =
         CommsManagerFactory.getCommsManager().getWonderlandClientID(info.getClientID());

      if (id == null) {
    logger.warning("No WonderlandClientID for " + info);
    continue;
      }
View Full Code Here

    private void handleBystanders(AudioGroup group, Player player, AudioGroupPlayerInfo.ChatType chatType) {
  Player[] playersInRange = player.getPlayersInRange();

  AudioGroupPlayerInfo info = group.getPlayerInfo(player);

  PresenceInfo presenceInfo = playerMap.get(player.getId());

  if (chatType.equals(AudioGroupPlayerInfo.ChatType.PUBLIC)) {
      for (int i = 0; i < playersInRange.length; i++) {
    addBystander(group, player, playersInRange[i]);
      }
View Full Code Here

             */
            sender.send(new VoiceChatTransientMemberMessage(audioGroup.getId(),
                player.getId(), false));
  }

  PresenceInfo presenceInfo = playerMap.remove(player.getId());

  if (presenceInfo == null) {
      logger.warning("No presence Info for " + player.getId());
      return;
  }
View Full Code Here

  Player[] players = audioGroup.getPlayers();

  for (int i = 0; i < players.length; i++) {
      Player player = players[i];

      PresenceInfo info = playerMap.get(player.getId());
 
      if (info == null) {
    logger.fine("Unable to find presence info for "
        + player.getId() + " group " + group);
    continue;
View Full Code Here

            connectSoftphone();
        }
    }

    private void changeUsernameAlias(ChangeUsernameAliasMessage msg) {
        PresenceInfo info = msg.getPresenceInfo();

        pm.changeUsernameAlias(info, info.getUsernameAlias());

        AvatarNameEvent avatarNameEvent = new AvatarNameEvent(
                EventType.CHANGE_NAME, info.getUserID().getUsername(),
                info.getUsernameAlias());

        InputManager.inputManager().postEvent(avatarNameEvent);
    }
View Full Code Here

    }

    private void joinVoiceChat(VoiceChatJoinAcceptedMessage msg) {
        logger.fine("GOT JOIN ACCEPTED MESSAGE FOR " + msg.getCallee());

        PresenceInfo info = pm.getPresenceInfo(msg.getCallee().getCallID());

        logger.fine(
                "GOT JOIN ACCEPTED FOR " + msg.getCallee() + " info " + info);

        if (info == null) {
            info = msg.getCallee();

            logger.warning("adding pm for " + info);
            pm.addLocalPresenceInfo(info);
        }

        if (msg.getChatType() == ChatType.SECRET) {
            info.setInSecretChat(true);
        } else {
            info.setInSecretChat(false);
        }

        notifyMemberChangeListeners(msg.getGroup(), info, true);
    }
View Full Code Here

        notifyMemberChangeListeners(msg.getGroup(), info, true);
    }

    private void leaveVoiceChat(VoiceChatLeaveMessage msg) {
        PresenceInfo callee = msg.getCallee();

        logger.info("GOT LEAVE MESSAGE FOR " + callee);

        notifyMemberChangeListeners(msg.getGroup(), callee, false);

        if (callee.getClientID() == null) {
            pm.removeLocalPresenceInfo(callee)// it's an outworlder
        }
    }
View Full Code Here

            pm.removeLocalPresenceInfo(callee)// it's an outworlder
        }
    }

    private void voiceChatCallEnded(VoiceChatCallEndedMessage msg) {
        PresenceInfo callee = msg.getCallee();

        String reason = getUserFriendlyReason(msg.getReasonCallEnded());

        logger.warning("Call ended for " + callee + " Reason:  " + reason);

        if (!reason.equalsIgnoreCase("Hung up") &&
                !reason.equalsIgnoreCase("User requested call termination")) {
            callEnded(callee, reason);
        }

        if (callee.getClientID() == null) {
            pm.removeLocalPresenceInfo(callee)// it's an outworlder
        }

        notifyMemberChangeListeners(msg.getGroup(), callee, false);
    }
View Full Code Here

    public String getCOSName() {
        return COSName;
    }

    private void coneOfSilenceEnterExit(ConeOfSilenceEnterExitMessage msg) {
        PresenceInfo info = pm.getPresenceInfo(msg.getCallID());

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

        pm.setEnteredConeOfSilence(info, msg.entered());

        AvatarNameEvent avatarNameEvent;

        if (msg.entered()) {
            COSName = msg.getCOSName();

            avatarNameEvent = new AvatarNameEvent(
                    EventType.ENTERED_CONE_OF_SILENCE,
                    info.getUserID().getUsername(), info.getUsernameAlias());
        } else {
            COSName = null;

            avatarNameEvent = new AvatarNameEvent(
                    EventType.EXITED_CONE_OF_SILENCE,
                    info.getUserID().getUsername(), info.getUsernameAlias());
        }

        InputManager.inputManager().postEvent(avatarNameEvent);
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.presencemanager.common.PresenceInfo

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.