Commit cef3565d authored by Fluorohydride's avatar Fluorohydride

remove files from irrlicht for compatibility issues. it is required to rebuild...

remove files from irrlicht for compatibility issues. it is required to rebuild irrlicht engine with pathed files to support unicode and ime input.
parent a9588d87
......@@ -31,27 +31,36 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break;
}
case BUTTON_JOIN_HOST: {
// struct addrinfo hints, *servinfo;
// memset(&hints, 0, sizeof(struct addrinfo));
// hints.ai_family = AF_INET; /* Allow IPv4 or IPv6 */
// hints.ai_socktype = SOCK_STREAM; /* Datagram socket */
// hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */
// hints.ai_protocol = 0; /* Any protocol */
// hints.ai_canonname = NULL;
// hints.ai_addr = NULL;
// hints.ai_next = NULL;
#if WINVER >= 0x0600
struct addrinfo hints, *servinfo;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_INET; /* Allow IPv4 or IPv6 */
hints.ai_socktype = SOCK_STREAM; /* Datagram socket */
hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */
hints.ai_protocol = 0; /* Any protocol */
hints.ai_canonname = NULL;
hints.ai_addr = NULL;
hints.ai_next = NULL;
int status;
char hostname[100];
char ip[20];
const wchar_t* pstr = mainGame->ebJoinIP->getText();
BufferIO::CopyWStr(pstr, hostname, 100);
// if ((status = getaddrinfo(hostname, NULL, &hints, &servinfo)) == -1) {
// //fprintf(stderr, "getaddrinfo error: %s\n", gai_strerror(status));
// //error handling
if ((status = getaddrinfo(hostname, NULL, &hints, &servinfo)) == -1) {
fprintf(stderr, "getaddrinfo error: %s\n", gai_strerror(status));
//error handling
BufferIO::CopyWStr(pstr, ip, 16);
// } else
// inet_ntop(AF_INET, &(((struct sockaddr_in *)servinfo->ai_addr)->sin_addr), ip, 20);
// freeaddrinfo(servinfo);
} else
inet_ntop(AF_INET, &(((struct sockaddr_in *)servinfo->ai_addr)->sin_addr), ip, 20);
freeaddrinfo(servinfo);
#else
int status;
char hostname[100];
char ip[20];
const wchar_t* pstr = mainGame->ebJoinIP->getText();
BufferIO::CopyWStr(pstr, hostname, 100);
BufferIO::CopyWStr(pstr, ip, 16);
#endif
unsigned int remote_addr = htonl(inet_addr(ip));
unsigned int remote_port = _wtoi(mainGame->ebJoinPort->getText());
BufferIO::CopyWStr(pstr, mainGame->gameConf.lastip, 20);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment