We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/* returns a string referencing the printable ip address of the current host / static int host_get_address(lua_State l) { ENetHost *host = check_host(l, 1); std::string address; char buff[1024]; enet_address_get_host_ip(&host->address, buff, 1024); address.clear(); address.append(buff); lua_pushstring(l, address.c_str()); return 1; }
/* and in function registry */
static const struct luaL_Reg enet_host_funcs [] = { {"service", host_service}, {"check_events", host_check_events}, {"compress_with_range_coder", host_compress_with_range_coder}, {"connect", host_connect}, {"flush", host_flush}, {"broadcast", host_broadcast}, {"channel_limit", host_channel_limit}, {"bandwidth_limit", host_bandwidth_limit}, {"total_sent_data", host_total_sent_data}, {"total_received_data", host_total_received_data}, {"service_time", host_service_time}, {"peer_count", host_peer_count}, {"get_peer", host_get_peer}, {"get_address", host_get_address}, {NULL, NULL} };
If you find this useful, please add it. I'm currently using that add on function to run local server auto detection.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
/* returns a string referencing the printable ip address of the current host /
static int host_get_address(lua_State l)
{
ENetHost *host = check_host(l, 1);
std::string address;
char buff[1024];
enet_address_get_host_ip(&host->address, buff, 1024);
address.clear();
address.append(buff);
lua_pushstring(l, address.c_str());
return 1;
}
/* and in function registry */
static const struct luaL_Reg enet_host_funcs [] =
{
{"service", host_service},
{"check_events", host_check_events},
{"compress_with_range_coder", host_compress_with_range_coder},
{"connect", host_connect},
{"flush", host_flush},
{"broadcast", host_broadcast},
{"channel_limit", host_channel_limit},
{"bandwidth_limit", host_bandwidth_limit},
{"total_sent_data", host_total_sent_data},
{"total_received_data", host_total_received_data},
{"service_time", host_service_time},
{"peer_count", host_peer_count},
{"get_peer", host_get_peer},
{"get_address", host_get_address},
{NULL, NULL}
};
If you find this useful, please add it. I'm currently using that add on function to run local server auto detection.
The text was updated successfully, but these errors were encountered: