mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
make eve send her ID to identify with the avatar mixer
This commit is contained in:
parent
0566330a8a
commit
d5d9479b65
3 changed files with 27 additions and 27 deletions
|
@ -130,8 +130,6 @@ int main(int argc, const char* argv[]) {
|
||||||
unsigned char broadcastPacket[MAX_PACKET_SIZE];
|
unsigned char broadcastPacket[MAX_PACKET_SIZE];
|
||||||
broadcastPacket[0] = PACKET_HEADER_HEAD_DATA;
|
broadcastPacket[0] = PACKET_HEADER_HEAD_DATA;
|
||||||
|
|
||||||
int numBytesToSend = 0;
|
|
||||||
|
|
||||||
timeval thisSend;
|
timeval thisSend;
|
||||||
double numMicrosecondsSleep = 0;
|
double numMicrosecondsSleep = 0;
|
||||||
|
|
||||||
|
@ -148,13 +146,16 @@ int main(int argc, const char* argv[]) {
|
||||||
Agent *avatarMixer = agentList->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER);
|
Agent *avatarMixer = agentList->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER);
|
||||||
|
|
||||||
// make sure we actually have an avatar mixer with an active socket
|
// make sure we actually have an avatar mixer with an active socket
|
||||||
if (avatarMixer != NULL && avatarMixer->getActiveSocket() != NULL) {
|
if (agentList->getOwnerID() != UNKNOWN_AGENT_ID && avatarMixer != NULL && avatarMixer->getActiveSocket() != NULL) {
|
||||||
|
unsigned char* packetPosition = broadcastPacket + sizeof(PACKET_HEADER);
|
||||||
|
packetPosition += packAgentId(packetPosition, agentList->getOwnerID());
|
||||||
|
|
||||||
// use the getBroadcastData method in the AvatarData class to populate the broadcastPacket buffer
|
// use the getBroadcastData method in the AvatarData class to populate the broadcastPacket buffer
|
||||||
numBytesToSend = eve.getBroadcastData((broadcastPacket + 1));
|
packetPosition += eve.getBroadcastData(packetPosition);
|
||||||
|
|
||||||
// use the UDPSocket instance attached to our agent list to send avatar data to mixer
|
// use the UDPSocket instance attached to our agent list to send avatar data to mixer
|
||||||
agentList->getAgentSocket().send(avatarMixer->getActiveSocket(), broadcastPacket, numBytesToSend);
|
agentList->getAgentSocket().send(avatarMixer->getActiveSocket(), broadcastPacket, packetPosition - broadcastPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
// temporarily disable Eve's audio sending until the file is actually available on EC2 box
|
// temporarily disable Eve's audio sending until the file is actually available on EC2 box
|
||||||
if (numIterationsLeftBeforeAudioSend == 0) {
|
if (numIterationsLeftBeforeAudioSend == 0) {
|
||||||
|
@ -175,13 +176,12 @@ int main(int argc, const char* argv[]) {
|
||||||
|
|
||||||
// simulate the effect of pressing and un-pressing the mouse button/pad
|
// simulate the effect of pressing and un-pressing the mouse button/pad
|
||||||
handStateTimer++;
|
handStateTimer++;
|
||||||
if ( handStateTimer == 100 ) {
|
|
||||||
|
if (handStateTimer == 100) {
|
||||||
eve.setHandState(1);
|
eve.setHandState(1);
|
||||||
}
|
} else if (handStateTimer == 150) {
|
||||||
if ( handStateTimer == 150 ) {
|
|
||||||
eve.setHandState(0);
|
eve.setHandState(0);
|
||||||
}
|
} else if (handStateTimer >= 200) {
|
||||||
if ( handStateTimer >= 200 ) {
|
|
||||||
handStateTimer = 0;
|
handStateTimer = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -696,13 +696,12 @@ void displaySide(Camera& whichCamera) {
|
||||||
drawGroundPlaneGrid(10.f);
|
drawGroundPlaneGrid(10.f);
|
||||||
|
|
||||||
// Draw voxels
|
// Draw voxels
|
||||||
if (showingVoxels)
|
if (showingVoxels) {
|
||||||
{
|
|
||||||
voxels.render();
|
voxels.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render avatars of other agents
|
// Render avatars of other agents
|
||||||
AgentList* agentList = AgentList::getInstance();
|
AgentList *agentList = AgentList::getInstance();
|
||||||
agentList->lock();
|
agentList->lock();
|
||||||
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||||
if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) {
|
if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) {
|
||||||
|
|
|
@ -13,18 +13,19 @@
|
||||||
#ifndef hifi_PacketHeaders_h
|
#ifndef hifi_PacketHeaders_h
|
||||||
#define hifi_PacketHeaders_h
|
#define hifi_PacketHeaders_h
|
||||||
|
|
||||||
const char PACKET_HEADER_DOMAIN = 'D';
|
typedef char PACKET_HEADER;
|
||||||
const char PACKET_HEADER_PING = 'P';
|
const PACKET_HEADER PACKET_HEADER_DOMAIN = 'D';
|
||||||
const char PACKET_HEADER_PING_REPLY = 'R';
|
const PACKET_HEADER PACKET_HEADER_PING = 'P';
|
||||||
const char PACKET_HEADER_HEAD_DATA = 'H';
|
const PACKET_HEADER PACKET_HEADER_PING_REPLY = 'R';
|
||||||
const char PACKET_HEADER_Z_COMMAND = 'Z';
|
const PACKET_HEADER PACKET_HEADER_HEAD_DATA = 'H';
|
||||||
const char PACKET_HEADER_INJECT_AUDIO = 'I';
|
const PACKET_HEADER PACKET_HEADER_Z_COMMAND = 'Z';
|
||||||
const char PACKET_HEADER_SET_VOXEL = 'S';
|
const PACKET_HEADER PACKET_HEADER_INJECT_AUDIO = 'I';
|
||||||
const char PACKET_HEADER_ERASE_VOXEL = 'E';
|
const PACKET_HEADER PACKET_HEADER_SET_VOXEL = 'S';
|
||||||
const char PACKET_HEADER_VOXEL_DATA = 'V';
|
const PACKET_HEADER PACKET_HEADER_ERASE_VOXEL = 'E';
|
||||||
const char PACKET_HEADER_BULK_AVATAR_DATA = 'X';
|
const PACKET_HEADER PACKET_HEADER_VOXEL_DATA = 'V';
|
||||||
const char PACKET_HEADER_TRANSMITTER_DATA = 't';
|
const PACKET_HEADER PACKET_HEADER_BULK_AVATAR_DATA = 'X';
|
||||||
const char PACKET_HEADER_DOMAIN_LIST_REQUEST = 'L';
|
const PACKET_HEADER PACKET_HEADER_TRANSMITTER_DATA = 't';
|
||||||
const char PACKET_HEADER_DOMAIN_RFD = 'C';
|
const PACKET_HEADER PACKET_HEADER_DOMAIN_LIST_REQUEST = 'L';
|
||||||
|
const PACKET_HEADER PACKET_HEADER_DOMAIN_RFD = 'C';
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue