MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / nw_GetNumbersFromHostAddress

Function nw_GetNumbersFromHostAddress

networking/networking.cpp:838–855  ·  view source on GitHub ↗

Fills in the string with the string address from the internet address

Source from the content-addressed store, hash-verified

836
837// Fills in the string with the string address from the internet address
838void nw_GetNumbersFromHostAddress(network_address *address, char *str) {
839 // ASSERT(NetworkProtocol==NP_TCP);
840 ASSERT(str);
841 struct in_addr addr;
842
843 if (address->connection_type == NP_TCP) {
844 memcpy(&addr, address->address, sizeof(struct in_addr));
845 sprintf(str, "IP: %s:%d", inet_ntoa(addr), address->port);
846 }
847
848#ifdef WIN32
849 else if (Use_DirectPlay && (address->connection_type == NP_DIRECTPLAY)) {
850 DPID id;
851 memcpy(&id, address->address, sizeof(DPID));
852 sprintf(str, "DirectPlay: 0x%x", id);
853 }
854#endif
855}
856
857#define CLOSE_TIMEOUT_TIME 3 // 3 seconds
858

Callers 3

nw_CheckListenSocketFunction · 0.85
nw_WorkReliableFunction · 0.85
MultiDoPlayerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected