Examples of WonderlandClientSender


Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

        // to fake an xmpp name to look like someone it's not. In an otherwise
        // authenticated world, this might be a way to make it look like
        // people are saying things they're not.

        CommsManager cm = WonderlandContext.getCommsManager();
        WonderlandClientSender sender = cm.getSender(TextChatConnectionType.CLIENT_TYPE);

        // Send to all clients, because the message is originating from a non-client source.
        Set<WonderlandClientID> clientIDs = sender.getClients();

        // Construct a new message with appropriate fields.
        TextChatMessage textMessage = new TextChatMessage(msg, from, "");
        sender.send(clientIDs, textMessage);
    }
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

  orbMessageHandlerRef.get().setUsername(username);

  CommsManager cm = WonderlandContext.getCommsManager();

        WonderlandClientSender sender = cm.getSender(CellChannelConnectionType.CLIENT_TYPE);

  sender.send(new OrbChangeNameMessage(cellID, username));
    }
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

    }
  
    public void setBystanders(String[] bystanders) {
  CommsManager cm = WonderlandContext.getCommsManager();

        WonderlandClientSender sender = cm.getSender(CellChannelConnectionType.CLIENT_TYPE);

  sender.send(new OrbBystandersMessage(cellID, bystanders));
    }
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

    }

    public void attach(String callID) {
  CommsManager cm = WonderlandContext.getCommsManager();

        WonderlandClientSender sender = cm.getSender(CellChannelConnectionType.CLIENT_TYPE);

        sender.send(new OrbAttachVirtualPlayerMessage(cellID, callID));
    }
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

  Player player = vm.getPlayer(callId);

  AudioGroup secretAudioGroup;

  WonderlandClientSender sender = WonderlandContext.getCommsManager().getSender(AudioManagerConnectionType.CONNECTION_TYPE);

  switch (code) {
  case CallStatus.ESTABLISHED:
      if (player == null) {
    logger.warning("Couldn't find player for " + status);
    return;
      }

      //vm.dump("all");
      player.setPrivateMixes(true);

      sender.send(new CallEstablishedMessage(callID));
      break;

  case CallStatus.MUTED:
      sender.send(new CallMutedMessage(callID, true));
      break;

  case CallStatus.UNMUTED:
      sender.send(new CallMutedMessage(callID, false));
      break;

        case CallStatus.STARTEDSPEAKING:
      if (player == null) {
    logger.warning("Couldn't find player for " + status);
    return;
      }

      secretAudioGroup = getSecretAudioGroup(player);

      if (playerIsChatting(player)) {
    VoiceChatHandler.getInstance().setSpeaking(player, callID, true, secretAudioGroup);
      }

      if (secretAudioGroup != null) {
    return;
      }

      sender.send(new CallSpeakingMessage(callID, true));
            break;

        case CallStatus.STOPPEDSPEAKING:
      if (player == null) {
    logger.warning("Couldn't find player for " + status);
    return;
      }

      secretAudioGroup = getSecretAudioGroup(player);

      if (playerIsChatting(player)) {
    VoiceChatHandler.getInstance().setSpeaking(player, callID, false, secretAudioGroup);
      }

      if (secretAudioGroup != null) {
    return;
      }

      sender.send(new CallSpeakingMessage(callID, false));
            break;

  case CallStatus.MIGRATED:
      if (isExternalCall) {
    return;
      }

      sender = WonderlandContext.getCommsManager().getSender(CellChannelConnectionType.CLIENT_TYPE);
      sender.send(clientID, new CallMigrateMessage(callID, true));
      break;

  case CallStatus.MIGRATE_FAILED:
      if (isExternalCall) {
    return;
      }

      sender.send(clientID, new CallMigrateMessage(callID, false));
      break;

  case CallStatus.ENDED:
      if (done) {
    return;
      }

if (false) {
      if (player != null) {
          AudioGroup[] audioGroups = player.getAudioGroups();

          for (int i = 0; i < audioGroups.length; i++) {
        audioGroups[i].removePlayer(player);
          }

    if (player.getSetup().isOutworlder) {
              vm.removePlayer(player);
    }
      } else {
    logger.warning("Couldn't find player for " + status);
      }
}

      done();
      sender.send(new CallEndedMessage(callID, status.getOption("Reason")));
            break;
   
  case CallStatus.BRIDGE_OFFLINE:
            logger.info("Bridge offline: " + status);
    // XXX need a way to tell the voice manager to reset all of the private mixes.
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

      return;
  }

        CommsManager cm = WonderlandContext.getCommsManager();

        WonderlandClientSender sender = cm.getSender(CellChannelConnectionType.CLIENT_TYPE);

        switch (status.getCode()) {
  case CallStatus.DTMF_KEY:
      handleDtmfKey(status);
      break;
 
        case CallStatus.MUTED:
            sender.send(new OrbMuteCallMessage(orbCellID, true));
            break;

        case CallStatus.UNMUTED:
            sender.send(new OrbMuteCallMessage(orbCellID, false));
            break;

        case CallStatus.STARTEDSPEAKING:           
      if (isMuted && muteMessageSpoken == false) {
    muteMessageSpoken = true;

    VoiceManager vm = AppContext.getManager(VoiceManager.class);

    Call call = vm.getCall(callID);

     try {
                    call.playTreatment("tts:You are muted.");
                    call.playTreatment("tts:Press star, three to unmute");
    } catch (IOException e) {
        logger.warning("unable to play you are muted treatment to " + call
      + ":  " + e.getMessage());
    }
      }

            sender.send(new OrbSpeakingMessage(orbCellID, true));
            break;
           
        case CallStatus.STOPPEDSPEAKING:
            sender.send(new OrbSpeakingMessage(orbCellID, false));
            break;
           
  case CallStatus.TREATMENTDONE:
      String treatment = status.getOption("Treatment");

      logger.fine("Treatment done:  " + treatment);

      if (treatment.equals(help)) {
    //VoiceHandler voiceHandler = VoiceHandlerImpl.getInstance();
          //voiceHandler.setListenAttenuator(callID, listenAttenuator);
    playingHelp = false;
      }

      break;

        case CallStatus.ENDED:
      if (ended) {
    return;
      }

      System.out.println("Orb ended " + callID + " this call id " + this.callID);

      if (this.callID.equals(callID)) {
          endCall(callID);
                sender.send(new OrbEndCallMessage(orbCellID));
      } else {
    if (hostCellID != null) {
                    sender.send(new OrbAttachMessage(orbCellID, hostCellID, false));
    }
      }
      break;
  }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

    private boolean ended;

    public void callStatusChanged(CallStatus status) {   
  logger.finer("got status " + status);

        WonderlandClientSender sender = WonderlandContext.getCommsManager().getSender(
      CellChannelConnectionType.CLIENT_TYPE);

  VoiceManager vm = AppContext.getManager(VoiceManager.class);

  Call externalCall = null;

  if (listing.getExternalCallID() != null) {
      externalCall = vm.getCall(listing.getExternalCallID());
  }

  Call softphoneCall = vm.getCall(listing.getSoftphoneCallID());

  logger.fine("external call:  " + externalCall);
  logger.fine("softphone call:  " + softphoneCall);

        switch(status.getCode()) {
        case CallStatus.INVITED:
            //The call has been placed, the phone should be ringing
            /** HARRISDEBUG: It should be tested whether or not we'll catch
             * callStatus changes for calls which we've just set up.
             * If not, this code will have to be moved back to the
             * "messageReceived->PlaceCall" function.
             **/
            if (listing.isPrivate()) {
                //Start playing the phone ringing sound                   
    try {
                    softphoneCall.playTreatment("ring_tone.au");
          } catch (IOException e) {
        logger.warning("Unable to play treatment " + softphoneCall + ":  "
            + e.getMessage());
          }
            }
           
            sender.send(clientID, new CallInvitedResponseMessage(cellID, listing, true));
            break;

        //Something's picked up, the call has been connected
        case CallStatus.ESTABLISHED:
            if (listing.isPrivate()) {
                //Stop playing the phone ringing sound
    try {
                    softphoneCall.stopTreatment("ring_tone.au");
          } catch (IOException e) {
        logger.warning("Unable to stop treatment " + softphoneCall + ":  "
            + e.getMessage());
          }
            }

            sender.send(clientID, new CallEstablishedResponseMessage(cellID, listing, true));
            break;

        case CallStatus.ENDED:
      if (ended) {
    return;
      }

      ended = true;
 
      vm.removeCallStatusListener(this);

            //Stop the ringing
      if (softphoneCall != null) {
          try {
                    softphoneCall.stopTreatment("ring_tone.au");
          } catch (IOException e) {
        logger.warning(
      "Unable to stop treatment " + softphoneCall + ":  "
          + e.getMessage());
          }
      }
               
            String softphoneCallID = listing.getSoftphoneCallID();
               
            //This may appear redundant, but it's necessary for the VoiceManager
      // to remove its internal data structures.

            if (listing.simulateCalls() == false) {
    if (externalCall != null) {
        try {
                        vm.endCall(externalCall, true);
              } catch (IOException e) {
            logger.warning(
          "Unable to end call " + externalCall + ":  "
                + e.getMessage());
              }
    }

                if (listing.isPrivate()) {
        String audioGroupId = softphoneCallID + "_"
            + listing.getPrivateClientName();

        AudioGroup audioGroup = vm.getAudioGroup(audioGroupId);

        if (audioGroup != null) {
            if (softphoneCall.getPlayer() != null) {
                softphoneCall.getPlayer().attenuateOtherGroups(audioGroup,
              AudioGroup.DEFAULT_SPEAKING_ATTENUATION,
                  AudioGroup.DEFAULT_LISTEN_ATTENUATION);
            }

                  vm.removeAudioGroup(audioGroup);
        }
    }
            }
               
            sender.send(clientID, new CallEndedResponseMessage(cellID,
    listing, true, status.getOption("Reason")));
            break;
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

  boolean isSpeaking = (inPrivateChat(audioGroup, player) == false);

        audioGroup.addPlayer(player, new AudioGroupPlayerInfo(isSpeaking,
                AudioGroupPlayerInfo.ChatType.PRIVATE));
       
  WonderlandClientSender sender =
            WonderlandContext.getCommsManager().getSender(AudioManagerConnectionType.CONNECTION_TYPE);

  sender.send(new ConeOfSilenceEnterExitMessage(name, callId, true));
    }
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

            return;
        }

        audioGroup.removePlayer(player);

  WonderlandClientSender sender =
            WonderlandContext.getCommsManager().getSender(AudioManagerConnectionType.CONNECTION_TYPE);

  sender.send(new ConeOfSilenceEnterExitMessage(name, callId, false));
    }
View Full Code Here

Examples of org.jdesktop.wonderland.server.comms.WonderlandClientSender

  VoiceChatHandler.updateAttenuation(player);

  if (entered) {
      entered = false;

      WonderlandClientSender sender =
                WonderlandContext.getCommsManager().getSender(AudioManagerConnectionType.CONNECTION_TYPE);

      sender.send(new ConeOfSilenceEnterExitMessage(name, player.getId(), false));
  }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.