mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:29:47 +02:00
always store ports as unsigned short ports
This commit is contained in:
parent
c3c0793ddc
commit
fd73b8de82
4 changed files with 7 additions and 7 deletions
|
@ -43,9 +43,9 @@ struct AgentList {
|
||||||
char agentType;
|
char agentType;
|
||||||
uint32_t ip;
|
uint32_t ip;
|
||||||
in_addr public_sin_addr;
|
in_addr public_sin_addr;
|
||||||
in_port_t public_port;
|
unsigned short public_port;
|
||||||
char *private_addr;
|
char *private_addr;
|
||||||
in_port_t private_port;
|
unsigned short private_port;
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
bool active;
|
bool active;
|
||||||
timeval time, connectTime;
|
timeval time, connectTime;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "UDPSocket.h"
|
#include "UDPSocket.h"
|
||||||
#include "Audio.h"
|
#include "Audio.h"
|
||||||
|
|
||||||
const int AGENT_UDP_PORT = 40103;
|
const unsigned short AGENT_UDP_PORT = 40103;
|
||||||
|
|
||||||
int update_agents(char * data, int length);
|
int update_agents(char * data, int length);
|
||||||
int add_agent(char * address, unsigned short port, char *private_address, unsigned short private_port, char agentType);
|
int add_agent(char * address, unsigned short port, char *private_address, unsigned short private_port, char agentType);
|
||||||
|
|
|
@ -60,7 +60,7 @@ int simulate_on = 1;
|
||||||
|
|
||||||
const int MAX_PACKET_SIZE = 1500;
|
const int MAX_PACKET_SIZE = 1500;
|
||||||
char DOMAIN_HOSTNAME[] = "highfidelity.below92.com";
|
char DOMAIN_HOSTNAME[] = "highfidelity.below92.com";
|
||||||
char DOMAIN_IP[100] = ""; // IP Address will be used first if not empty string
|
char DOMAIN_IP[100] = "192.168.1.47"; // IP Address will be used first if not empty string
|
||||||
const int DOMAINSERVER_PORT = 40102;
|
const int DOMAINSERVER_PORT = 40102;
|
||||||
UDPSocket agentSocket(AGENT_UDP_PORT);
|
UDPSocket agentSocket(AGENT_UDP_PORT);
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ void Timer(int extra)
|
||||||
// Send a message to the domainserver telling it we are ALIVE
|
// Send a message to the domainserver telling it we are ALIVE
|
||||||
//
|
//
|
||||||
char output[100];
|
char output[100];
|
||||||
sprintf(output, "%c %f,%f,%f,%s %hd", 'I', location[0], location[1], location[2], localAddressBuffer, (unsigned short) AGENT_UDP_PORT);
|
sprintf(output, "%c %f,%f,%f,%s %hd", 'I', location[0], location[1], location[2], localAddressBuffer, AGENT_UDP_PORT);
|
||||||
std::cout << "sending " << output << " to domain server\n";
|
std::cout << "sending " << output << " to domain server\n";
|
||||||
int packet_size = strlen(output);
|
int packet_size = strlen(output);
|
||||||
agentSocket.send(DOMAIN_IP, DOMAINSERVER_PORT, output, packet_size);
|
agentSocket.send(DOMAIN_IP, DOMAINSERVER_PORT, output, packet_size);
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
const int MAX_AGENTS = 1000;
|
const int MAX_AGENTS = 1000;
|
||||||
const int LOGOFF_CHECK_INTERVAL = 1000;
|
const int LOGOFF_CHECK_INTERVAL = 1000;
|
||||||
|
|
||||||
const int MIXER_LISTEN_PORT = 55443;
|
const unsigned short MIXER_LISTEN_PORT = 55443;
|
||||||
|
|
||||||
const int BUFFER_LENGTH_BYTES = 1024;
|
const int BUFFER_LENGTH_BYTES = 1024;
|
||||||
const int BUFFER_LENGTH_SAMPLES = BUFFER_LENGTH_BYTES / sizeof(int16_t);
|
const int BUFFER_LENGTH_SAMPLES = BUFFER_LENGTH_BYTES / sizeof(int16_t);
|
||||||
|
@ -229,7 +229,7 @@ void *reportAliveToDS(void *args) {
|
||||||
while (true) {
|
while (true) {
|
||||||
gettimeofday(&lastSend, NULL);
|
gettimeofday(&lastSend, NULL);
|
||||||
|
|
||||||
sprintf(output, "%c %f,%f,%f,54.241.92.53 %hd", 'M', 0.f, 0.f, 0.f, (unsigned short)MIXER_LISTEN_PORT);
|
sprintf(output, "%c %f,%f,%f,54.241.92.53 %hd", 'M', 0.f, 0.f, 0.f, MIXER_LISTEN_PORT);
|
||||||
int packetSize = strlen(output);
|
int packetSize = strlen(output);
|
||||||
audioSocket.send(DOMAIN_IP, DOMAINSERVER_PORT, output, packetSize);
|
audioSocket.send(DOMAIN_IP, DOMAINSERVER_PORT, output, packetSize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue