Here are the details:
I was looking through the API, and I guess you were right. It doesn't look like there is anything we can make of use.
Well, then I started looking through the SQL Database Structure.
Table 'servcharacter' has something that IS unique. Field IPAddress. (duh!)
Having found something that is unique, I can now build my query.
SELECT CharacterLocationX FROM servcharacter WHERE IPAddress='<IP Address>' and wham! We have our X Coordinate.
SELECT CharacterLocationY FROM servcharacter WHERE IPAddress='<IP Address>' and wham! We have our Y Coordinate.
All we need to do is write some code to detect the IP Address of the machine, store it into a variable. Then we can combine the strings to get our query. Execute the query, and store the results.
This should open a plethora (at least for SQL servers) of stuff we can access to the database. An absolute ton.
I have found a script that will detect your IP Address, however, I am having difficulty with conversions. I'm a novice, unfortuantely, which means I have to ask for help.
Code:
//Simpile(?) IP Detection Script
#include <stdio.h>
#include <WinSock.h>
#pragma comment(lib, "wsock32.lib")
int main(int argc, char *argv[])
{
WORD wVersionRequested;
WSADATA wsaData;
char name[255];
PHOSTENT hostinfo;
wVersionRequested = MAKEWORD( 1, 1 );
char *ip;
if ( WSAStartup( wVersionRequested, &wsaData ) == 0 )
if( gethostname ( name, sizeof(name)) == 0)
{
if((hostinfo = gethostbyname(name)) != NULL)
{
int nCount = 0;
{
ip = inet_ntoa (*(struct in_addr *)hostinfo->h_addr_list[nCount]);
printf(ip);
printf("\n");
}
}
}
return 0;
}
Any suggestions? If anyone has some time to help me with this, my MSN is
mpddarkelf@hotmail.com, or reach me by ICQ # 176763073