Atavism Version 2018.1AGIS API

atavism.server.plugins
Class VoiceClient

java.lang.Object
  extended by atavism.server.plugins.VoiceClient

public class VoiceClient
extends java.lang.Object

Client to communicate with the voice plugin


Field Summary
static int ERROR_GROUP_ALREADY_EXISTS
          Error: group already exists
static int ERROR_MEMBER_ALREADY_EXISTS
          Error: member already exists in the group
static int ERROR_MISSING_ADD_PROPERTY
          Error: we tried perform an operation that requires a boolean "add" property, but didn't find one.
static int ERROR_MISSING_MAX_VOICES
          Error: we tried to create a new group but there was no "maxVoices" parm
static int ERROR_MISSING_POSITIONAL
          Error: we tried to create a new group but there was no "positional" parm
static int ERROR_NO_SUCH_GROUP
          Error: no such group
static int ERROR_NO_SUCH_MEMBER
          Error: no such member of the group
static int ERROR_NO_SUCH_OPCODE
          Error: the VoicePlugin doesn't understand the message opcode
static int ERROR_PLAYER_NOT_CONNECTED
          Error: we tried to add a member who isn't connected to the VoicePlugin.
static MessageType MSG_TYPE_VOICE_MEMBER_ADDED
          The MessageType of the message sent by a voice group to notify of addition of a member to the group.
static MessageType MSG_TYPE_VOICE_MEMBER_REMOVED
          The MessageType of the message sent by a voice group to notify removal of a member from the group.
static MessageType MSG_TYPE_VOICECLIENT
          The ExtensionMessages sent by the VoiceClient all have this type, so that the VoicePlugin(s) don't get deluged with ExtensionMessages intended for other plugins.
static int SUCCESS
          An operation with no return value succeeded
static int SUCCESS_FALSE
          A boolean operation returned false
static int SUCCESS_TRUE
          A boolean operation returned true
 
Constructor Summary
VoiceClient()
           
 
Method Summary
static int addMember(OID groupOid, OID memberOid, int priority, boolean allowedSpeaker)
          Add a member to a group
 int addMemberAllowed(OID groupOid, OID memberOid, java.lang.String authToken)
          Determine if the oid is that of a member of the group.
static int addVoiceGroup(OID oid, boolean positional, int maxVoices)
          Add a positional voice group.
static java.lang.String errorString(int errorCode)
          Translate an error code into a string
 java.util.Set<OID> getAllowedMembers(OID groupOid)
          Return the allowed members
static OID getPlayerGroup(OID memberOid)
          What group does the member belong to?
static int isAllowedSpeaker(OID groupOid, OID memberOid)
          Is the member allowed to speak?
static int isListener(OID groupOid, OID memberOid)
          Is the member listening?
static int isMember(OID groupOid, OID memberOid)
          Find a member in the group by oid.
static int isMemberSpeaking(OID groupOid, OID memberOid)
          Is the member speaking?
static int isPositional(OID groupOid)
          Return SUCCESS_TRUE if the group is a positional group; that is, if membership in the group is determined by being near the listener, and the priority of speakers is determined by how near any speaker is.
protected static WorldManagerClient.ExtensionMessage makeVoicePluginMessage(java.lang.String opcode, OID groupOid)
           
protected static WorldManagerClient.ExtensionMessage makeVoicePluginMessage(java.lang.String opcode, OID groupOid, OID memberOid)
           
protected static WorldManagerClient.ExtensionMessage makeVoicePluginMessage(java.lang.String opcode, OID groupOid, OID memberOid, boolean add)
           
static int removeMember(OID groupOid, OID memberOid)
          Remove the member of the group identified by the given oid, and return true if that member was found in the group.
static int removeVoiceGroup(OID groupOid)
          Remove a voice group.
protected static int sendAddMemberMessage(OID groupOid, OID memberOid, int priority, boolean allowedSpeaker)
           
protected static int sendNewGroupMessage(java.lang.String opcode, OID groupOid, boolean positional, int maxVoices)
           
protected static int sendVoicePluginRPC(java.lang.String opcode, OID groupOid)
           
protected static int sendVoicePluginRPC(java.lang.String opcode, OID groupOid, OID memberOid)
           
protected static int sendVoicePluginRPC(java.lang.String opcode, OID groupOid, OID memberOid, boolean add)
           
 int setAllowedMembers(OID groupOid, java.util.Set<OID> allowedMembers)
          Supply a list of oids of players allowed to be in the group
static int setAllowedSpeaker(OID groupOid, OID memberOid, boolean add)
          Change the member with the given oid to be an allowed speaker if add is true, or not an allowed speaker if add is false.
static int setListener(OID groupOid, OID memberOid, boolean add)
          Change the member with the given oid to be a listener if add is true, or not a listener if add is false.
static int setMemberSpeaking(OID groupOid, OID memberOid, boolean add)
          Change the member with the given oid, who must be an allowed speaker, to speak if add is true, or to stop speaking, if add is false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_TYPE_VOICECLIENT

public static MessageType MSG_TYPE_VOICECLIENT
The ExtensionMessages sent by the VoiceClient all have this type, so that the VoicePlugin(s) don't get deluged with ExtensionMessages intended for other plugins. The only downside is that plugins that use VoiceClient will have to add this message type to the "published" messages of the plugin.


MSG_TYPE_VOICE_MEMBER_ADDED

public static MessageType MSG_TYPE_VOICE_MEMBER_ADDED
The MessageType of the message sent by a voice group to notify of addition of a member to the group.


MSG_TYPE_VOICE_MEMBER_REMOVED

public static MessageType MSG_TYPE_VOICE_MEMBER_REMOVED
The MessageType of the message sent by a voice group to notify removal of a member from the group.


SUCCESS

public static final int SUCCESS
An operation with no return value succeeded

See Also:
Constant Field Values

SUCCESS_TRUE

public static final int SUCCESS_TRUE
A boolean operation returned true

See Also:
Constant Field Values

SUCCESS_FALSE

public static final int SUCCESS_FALSE
A boolean operation returned false

See Also:
Constant Field Values

ERROR_NO_SUCH_GROUP

public static final int ERROR_NO_SUCH_GROUP
Error: no such group

See Also:
Constant Field Values

ERROR_GROUP_ALREADY_EXISTS

public static final int ERROR_GROUP_ALREADY_EXISTS
Error: group already exists

See Also:
Constant Field Values

ERROR_NO_SUCH_MEMBER

public static final int ERROR_NO_SUCH_MEMBER
Error: no such member of the group

See Also:
Constant Field Values

ERROR_MEMBER_ALREADY_EXISTS

public static final int ERROR_MEMBER_ALREADY_EXISTS
Error: member already exists in the group

See Also:
Constant Field Values

ERROR_NO_SUCH_OPCODE

public static final int ERROR_NO_SUCH_OPCODE
Error: the VoicePlugin doesn't understand the message opcode

See Also:
Constant Field Values

ERROR_PLAYER_NOT_CONNECTED

public static final int ERROR_PLAYER_NOT_CONNECTED
Error: we tried to add a member who isn't connected to the VoicePlugin.

See Also:
Constant Field Values

ERROR_MISSING_ADD_PROPERTY

public static final int ERROR_MISSING_ADD_PROPERTY
Error: we tried perform an operation that requires a boolean "add" property, but didn't find one.

See Also:
Constant Field Values

ERROR_MISSING_MAX_VOICES

public static final int ERROR_MISSING_MAX_VOICES
Error: we tried to create a new group but there was no "maxVoices" parm

See Also:
Constant Field Values

ERROR_MISSING_POSITIONAL

public static final int ERROR_MISSING_POSITIONAL
Error: we tried to create a new group but there was no "positional" parm

See Also:
Constant Field Values
Constructor Detail

VoiceClient

public VoiceClient()
Method Detail

addVoiceGroup

public static int addVoiceGroup(OID oid,
                                boolean positional,
                                int maxVoices)
Add a positional voice group.

Parameters:
oid - The oid of the voice group to add.
positional - True if the new group is a positional group; false if it's a non-positional group.
maxVoices - The maximum number of voice channels that may ever be simultaneously in use by any client.
Returns:
The return code for the operation: SUCCESS or an error return code.

removeVoiceGroup

public static int removeVoiceGroup(OID groupOid)
Remove a voice group.

Parameters:
groupOid - The oid of the voice group to remove.
Returns:
The return code for the operation: SUCCESS or an error return code.

isPositional

public static int isPositional(OID groupOid)
Return SUCCESS_TRUE if the group is a positional group; that is, if membership in the group is determined by being near the listener, and the priority of speakers is determined by how near any speaker is.

Parameters:
groupOid - The oid of the voice group.
Returns:
The return code for the operation: SUCCESS_TRUE or SUCCESS_FALSE, or an error return code.

addMemberAllowed

public int addMemberAllowed(OID groupOid,
                            OID memberOid,
                            java.lang.String authToken)
Determine if the oid is that of a member of the group.

Parameters:
groupOid - The oid of the voice group.
memberOid - The oid of possible group member.
authToken - The authentication token for voice connection for this member.
Returns:
The return code for the operation: SUCCESS_TRUE if adding the member is allowed; SUCCESS_FALSE otherwise

setAllowedMembers

public int setAllowedMembers(OID groupOid,
                             java.util.Set<OID> allowedMembers)
Supply a list of oids of players allowed to be in the group

Parameters:
groupOid - The oid of the voice group.
allowedMembers - The set of oids of possible group members.
Returns:
SUCCESS if the operation completed; otherwise an error return code.

getAllowedMembers

public java.util.Set<OID> getAllowedMembers(OID groupOid)
Return the allowed members

Parameters:
groupOid - The oid of the voice group.
Returns:
A Set of allowed members, or an error code.

addMember

public static int addMember(OID groupOid,
                            OID memberOid,
                            int priority,
                            boolean allowedSpeaker)
Add a member to a group

Parameters:
groupOid - The oid of the voice group.
memberOid - The oid of the newly-created member
priority - The speaking priority that the member should be assigned; speakers with higher priorities will be heard over speakers with lower priorities.
allowedSpeaker - True if the new member should be allowed to speak; false otherwise.
Returns:
The return code for the operation: SUCCESS or an error return code.

isMember

public static int isMember(OID groupOid,
                           OID memberOid)
Find a member in the group by oid.

Parameters:
groupOid - The oid of the voice group.
memberOid - The oid of the member to find
Returns:
The return code for the operation: SUCCESS_TRUE or SUCCESS_FALSE, or an error return code.

removeMember

public static int removeMember(OID groupOid,
                               OID memberOid)
Remove the member of the group identified by the given oid, and return true if that member was found in the group.

Parameters:
groupOid - The oid of the voice group.
memberOid - The oid of the member to remove.
Returns:
The return code for the operation: SUCESS or an error return code.

isMemberSpeaking

public static int isMemberSpeaking(OID groupOid,
                                   OID memberOid)
Is the member speaking?

Parameters:
groupOid - The oid of the voice group.
memberOid - The oid of the member who speaking status should be returned.
Returns:
The return code for the operation: SUCCESS_TRUE or SUCCESS_FALSE, or an error return code.

isListener

public static int isListener(OID groupOid,
                             OID memberOid)
Is the member listening?

Parameters:
groupOid - The oid of the voice group.
memberOid - The oid of the member who listening status should be returned.
Returns:
The return code for the operation: SUCCESS_TRUE or SUCCESS_FALSE, or an error return code.

setAllowedSpeaker

public static int setAllowedSpeaker(OID groupOid,
                                    OID memberOid,
                                    boolean add)
Change the member with the given oid to be an allowed speaker if add is true, or not an allowed speaker if add is false.

Parameters:
groupOid - The oid of the voice group.
memberOid - The member whose allowed speaker status should change.
add - If true, make the member an allowed speaker; if false, stop allowing the member to be a speaker.
Returns:
The return code for the operation: SUCCESS or an error return code.

setMemberSpeaking

public static int setMemberSpeaking(OID groupOid,
                                    OID memberOid,
                                    boolean add)
Change the member with the given oid, who must be an allowed speaker, to speak if add is true, or to stop speaking, if add is false. Reflect any changes in who is and isn't speaking by sending out the appropriate voice deallocations and voice allocations to users. Calls to this method are what generates voice allocation and deallocation traffic to the clients in response to speakers starting and stopping speaking.

Parameters:
groupOid - The oid of the voice group.
memberOid - The member whose speaking status should change.
add - If true, make the member a speaker in the group, if add is True, else stop the member speaking.
Returns:
The return code for the operation: SUCCESS or an error return code.

setListener

public static int setListener(OID groupOid,
                              OID memberOid,
                              boolean add)
Change the member with the given oid to be a listener if add is true, or not a listener if add is false.

Parameters:
groupOid - The oid of the voice group.
memberOid - The member whose whose status should change.
add - If true, make the member a listener in the group, if add is True, else stop the member listening.
Returns:
The return code for the operation: SUCCESS or an error return code.

isAllowedSpeaker

public static int isAllowedSpeaker(OID groupOid,
                                   OID memberOid)
Is the member allowed to speak?

Parameters:
groupOid - The oid of the voice group.
memberOid - The oid of the member who allowed speaking status should be returned.
Returns:
The return code for the operation: SUCCESS_TRUE or SUCCESS_FALSE, or an error return code.

getPlayerGroup

public static OID getPlayerGroup(OID memberOid)
What group does the member belong to?

Parameters:
memberOid - The oid of the member whose groupOid should be returned.
Returns:
The groupOid of the player, or null if the player is not currently associated with a group.

errorString

public static java.lang.String errorString(int errorCode)
Translate an error code into a string


makeVoicePluginMessage

protected static WorldManagerClient.ExtensionMessage makeVoicePluginMessage(java.lang.String opcode,
                                                                            OID groupOid)

makeVoicePluginMessage

protected static WorldManagerClient.ExtensionMessage makeVoicePluginMessage(java.lang.String opcode,
                                                                            OID groupOid,
                                                                            OID memberOid)

makeVoicePluginMessage

protected static WorldManagerClient.ExtensionMessage makeVoicePluginMessage(java.lang.String opcode,
                                                                            OID groupOid,
                                                                            OID memberOid,
                                                                            boolean add)

sendNewGroupMessage

protected static int sendNewGroupMessage(java.lang.String opcode,
                                         OID groupOid,
                                         boolean positional,
                                         int maxVoices)

sendAddMemberMessage

protected static int sendAddMemberMessage(OID groupOid,
                                          OID memberOid,
                                          int priority,
                                          boolean allowedSpeaker)

sendVoicePluginRPC

protected static int sendVoicePluginRPC(java.lang.String opcode,
                                        OID groupOid)

sendVoicePluginRPC

protected static int sendVoicePluginRPC(java.lang.String opcode,
                                        OID groupOid,
                                        OID memberOid)

sendVoicePluginRPC

protected static int sendVoicePluginRPC(java.lang.String opcode,
                                        OID groupOid,
                                        OID memberOid,
                                        boolean add)


Copyright © 2018 Dragonsan Studios Sp. z o.o.