Atavism Version 2018.1AGIS API

atavism.server.voice
Interface VoiceGroup

All Known Implementing Classes:
BasicVoiceGroup, NonpositionalVoiceGroup, PositionalVoiceGroup

public interface VoiceGroup

This is the interface that all voice groups must satisfy, and it's based exclusively on oids. The only players represented in the group at this level are those who are currently connected and have chosen this group as their current voice group.


Method Summary
 GroupMember addMember(OID memberOid, VoiceConnection memberCon)
          Add a member to a group
 GroupMember addMember(OID memberOid, VoiceConnection memberCon, int priority, boolean allowedSpeaker)
          Add a member to a group
 boolean addMemberAllowed(OID memberOid)
          Determine if the oid is that of a member of the group.
 void getAllMembers(java.util.List<GroupMember> memberList)
          Get all members of the group.
 java.util.Set<OID> getAllowedMembers()
          Return the allowed members
 int getDefaultPriority()
          Get the default priority that should be applied to new members if no priority is supplied
 OID getGroupOid()
          Return the group oid of a voice group.
 boolean isAllowedSpeaker(OID memberOid)
          Is the member allowed to speak?
 boolean isListener(OID memberOid)
          Is the member listening?
 GroupMember isMember(OID memberOid)
          Find a member in the group by oid.
 boolean isMemberSpeaking(OID memberOid)
          Is the member speaking?
 boolean isPositional()
          Return 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.
 void onAfterAddMember(OID memberOid, OID groupOid, boolean allowedSpeaker, byte micVoiceNumber, boolean listenToYourself)
          A call to this method is made after an addMember() operation.
 void onAfterRemoveMember(OID memberOid, OID groupOid, boolean allowedSpeaker)
          A call to this method is made after a removeMember() operation.
 boolean removeMember(OID memberOid)
          Remove the member of the group identified by the given oid, and return true if that member was found in the group.
 void sendVoiceFrameToListeners(OID speakerOid, AOByteBuffer buf, byte opcode, int pktSize)
          Send a voice frame originating with the speaker with the given oid, and contained in the first dataSize bytes of buf, to all eligible listeners
 void setAllowedMembers(java.util.Set<OID> allowedMembers)
          Supply a list of oids of players allowed to be in the group
 void setAllowedSpeaker(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.
 void setListener(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.
 void setMemberSpeaking(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.
 

Method Detail

isPositional

boolean isPositional()
Return 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.


getGroupOid

OID getGroupOid()
Return the group oid of a voice group.

Returns:
The groupOid of the voice group.

addMemberAllowed

boolean addMemberAllowed(OID memberOid)
Determine if the oid is that of a member of the group.

Parameters:
memberOid - The oid of possible group member.
Returns:
True if the memberOid is a member of the group or is allowed to be a member of the group, and false otherwise.

setAllowedMembers

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

Parameters:
allowedMembers - The set of oids of possible group members.

getAllowedMembers

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

Returns:
A Set of allowed member oids.

addMember

GroupMember addMember(OID memberOid,
                      VoiceConnection memberCon)
Add a member to a group

Parameters:
memberOid - The oid of the newly-created member
memberCon - The VoiceConnection object that embodies the connection to the voice server.
Returns:
The newly-created group member.

getAllMembers

void getAllMembers(java.util.List<GroupMember> memberList)
Get all members of the group.

Parameters:
memberList - The list of the members to which the groups members should be added.

addMember

GroupMember addMember(OID memberOid,
                      VoiceConnection memberCon,
                      int priority,
                      boolean allowedSpeaker)
Add a member to a group

Parameters:
memberOid - The oid of the newly-created member
memberCon - The VoiceConnection object that embodies the connection to the voice server.
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 newly-created group member.

onAfterAddMember

void onAfterAddMember(OID memberOid,
                      OID groupOid,
                      boolean allowedSpeaker,
                      byte micVoiceNumber,
                      boolean listenToYourself)
A call to this method is made after an addMember() operation.

Parameters:
memberOid - The oid of the newly-created member
groupOid - The groupOid of the voice group.
allowedSpeaker - True if the member is allowed to speak; false otherwise.
micVoiceNumber - The voice number of the incoming voice packets. For now, this is always zero.
listenToYourself - True if the member wants his own voice frames sent back to him. This is only used for testing purposes.

isMember

GroupMember isMember(OID memberOid)
Find a member in the group by oid.

Parameters:
memberOid - The oid of the member to find
Returns:
The member whose oid is memberOid, or null if there is no such member.

removeMember

boolean removeMember(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:
memberOid - The oid of the member to remove.

onAfterRemoveMember

void onAfterRemoveMember(OID memberOid,
                         OID groupOid,
                         boolean allowedSpeaker)
A call to this method is made after a removeMember() operation.

Parameters:
memberOid - The oid of the newly-created member
groupOid - The groupOid of the voice group.
allowedSpeaker - True if the member is allowed to speak; false otherwise.

getDefaultPriority

int getDefaultPriority()
Get the default priority that should be applied to new members if no priority is supplied

Returns:
The default member priority.

setAllowedSpeaker

void setAllowedSpeaker(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:
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.

setMemberSpeaking

void setMemberSpeaking(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:
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.

setListener

void setListener(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:
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.

sendVoiceFrameToListeners

void sendVoiceFrameToListeners(OID speakerOid,
                               AOByteBuffer buf,
                               byte opcode,
                               int pktSize)
Send a voice frame originating with the speaker with the given oid, and contained in the first dataSize bytes of buf, to all eligible listeners

Parameters:
speakerOid - The oid of the speaker that is the source of the voice frame(s)
buf - The buffer containing data packet; typically a data aggregation packet
opcode - The opcode to use when sending the frame(s). Typically VoicePlugin.opcodeAggregatedData.
pktSize - The size of the data packet.

isAllowedSpeaker

boolean isAllowedSpeaker(OID memberOid)
Is the member allowed to speak?

Parameters:
memberOid - The oid of the member who allowed speaking status should be returned.
Returns:
True if the member with the given oid is allowed to speak if he wants, false otherwise.

isMemberSpeaking

boolean isMemberSpeaking(OID memberOid)
Is the member speaking?

Parameters:
memberOid - The oid of the member who speaking status should be returned.
Returns:
True if the member with the given oid is speaking; false otherwise

isListener

boolean isListener(OID memberOid)
Is the member listening?

Parameters:
memberOid - The oid of the member who listening status should be returned.
Returns:
True if the member with the given oid is listening; false otherwise


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