I've noticed that in the flyff .ini files, the servers and client don't really like it when you specify domain names in place of IP addresses, so I have decided to release a little source snippet that allows the server's owner to use their domain name in place of their IP, however, I'm only going to explain how to set it for the account server, it should be easy enough to find how to do this for the other files.
AccountServer.cpp:
First, add this to the very top of the document (yes yes, I know, pragma is bad but I don't care.)
Add this method above the BOOL Script(LPCTSTR lpszFileName) method.Code:#pragma comment(lib, "ws2_32.lib") #include <winsock2.h> #include <ws2tcpip.h>
In the same file, search for strcpy( pServer->lpAddr, s.Token ); and change it to:Code:const char* resolve() { WSADATA wsaData; int result; DWORD dwError; struct hostent *remoteHost; char *host_name; struct in_addr addr; // Initialize Winsock result = WSAStartup(MAKEWORD(2, 2), &wsaData); if (result != 0){return "Error";} host_name = "DNS here"; remoteHost = gethostbyname(host_name); if (remoteHost == NULL) { dwError = WSAGetLastError(); if (dwError != 0) { if (dwError == WSAHOST_NOT_FOUND){return "Errhnf";} else if (dwError == WSANO_DATA){return "Errndrf";} else{return "Errff";} } } else { addr.s_addr = *(u_long *) remoteHost->h_addr_list[0]; return inet_ntoa(addr); } return "False"; }
Has Fun.Code:strcpy(pServer->lpAddr, ::resolve());



Reply With Quote![[Source] Autoresolve DNS](http://ragezone.com/hyper728.png)

