http://bugs.winehq.org/show_bug.cgi?id=20433
Summary: Earth Eternal cannot connect, creates flood of DNS requests Product: Wine Version: 1.1.31 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winsock AssignedTo: wine-bugs@winehq.org ReportedBy: ramon.cahenzli@gmail.com
Earth Eternal is an online game by Sparkplay Media with an AppDB entry here:
http://appdb.winehq.org/objectManager.php?sClass=version&iId=18115
The game is usually started with a parameter telling it where to find its resources. The parameter takes the form of a URL.
The current standard URL is used here:
wine Spark.exe "http://static.beta.eartheternal.com/Release/Current/EarthEternal.car"
However, if this is done in WINE, Earth Eternal floods WINE with gethostbyname() calls (500 calls per second on my machine). The calls all return the correct IP address, I've verified this by adding some ugly trace code to dlls/ws2_32/socket.c. Since Earth Eternal is closed source, we cannot find out whether the result of the gethostbyname() call is used correctly or whether that loop of gethostbyname() calls is a bug.
We are now trying to disassemble the binary to find out.
It seems the game might work otherwise, it has a simple 3D renderer built in a popular engine (OGRE), and there are a few OGRE-based games that already work in WINE.
There is a workaround to at least partially get EE to connect and retrieve its data files. If started like this:
wine Spark.exe "http://208.71.157.18/Release/Current/EarthEternal.car"
The date files are fetched and installed. Connection still fails at the login screen, though, because the program then proceeds to establish *all* connections with 208.71.157.18 instead of using the respective servers (login, static content and routing servers).
Some details of this bug are discussed here:
http://www.eartheternal.com/forums/earth-eternal-chat/topics/EE-on-Linux-In-...
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #1 from Juan Lang juan_lang@yahoo.com 2009-10-21 12:45:10 --- Is there a download or demo available?
Any console output?
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #2 from Ramon Cahenzli ramon.cahenzli@gmail.com 2009-10-21 14:14:19 --- (In reply to comment #1)
Is there a download or demo available?
I first thought one needs to have an account in order to download the installer, but apparently I can also just link there:
http://static.beta.eartheternal.com/Release/Current/Platform/SparkPlayerInst...
Any console output?
Oh, sure! Sorry. I will attach a log of WINEDEBUG='+winsock' on Spark.exe as well as Spark.exe's and WINE's own STDERR output. It's all rolled into one file, but the "trace:" at the start should make it easy to filter the winsock bits.
I think we can see that gethostbyname() never actually returns null (if I read this log correctly), so Earth Eternal should be happy, take the returned hostent struct and cheerfully connect to the indicated server.
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #3 from Ramon Cahenzli ramon.cahenzli@gmail.com 2009-10-21 14:14:59 --- Created an attachment (id=24269) --> (http://bugs.winehq.org/attachment.cgi?id=24269) Earth Eternal flooding gethostbyname() but ignoring its result
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #4 from Ramon Cahenzli ramon.cahenzli@gmail.com 2009-10-23 10:56:35 --- Created an attachment (id=24293) --> (http://bugs.winehq.org/attachment.cgi?id=24293) Running EE using hostname as argument
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #5 from Ramon Cahenzli ramon.cahenzli@gmail.com 2009-10-23 10:56:54 --- Created an attachment (id=24294) --> (http://bugs.winehq.org/attachment.cgi?id=24294) Running EE using IP as an argument
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #6 from Ramon Cahenzli ramon.cahenzli@gmail.com 2009-10-23 10:57:23 --- Created an attachment (id=24295) --> (http://bugs.winehq.org/attachment.cgi?id=24295) akoshka's patch to ws2_32/socket.c
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #7 from Ramon Cahenzli ramon.cahenzli@gmail.com 2009-10-23 10:58:26 --- Earth Eternal forum user akoshka has identified a problem either in WINE, in Earth Eternal or in Microsoft's documentation for inet_addr().
The rest of this comment is a quote from akoshka's posting, and a patch to socket.c is attached to the bug:
After running Wine with the additional WINEDEBUG option 'relay', I noticed there some suspicious differences :-
Run1 - Using the hostname
(see attached "run_using_hostname.txt")
Run2 - Using the IP address
(see attached "run_using_ip.txt")
There are two differences there. First off the value 0xffffffff is returned from ws2_32.inet_addr when using a hostname in the URL, yet something that looks more like a 4 byte IP address is returned when the IP address URL is used.
So, I checked the MSDN documentation for inet_addr. It appears that this call is supposed by used to resolve IP addresses (not hostnames) to a 4 byte unsigned long.
The documentation does not suggest that fully qualified hostnames should be used. Yet, it appears thats exactly what spark player is doing.
So I hacked around in the WS_inet_addr function, again in socket.c. I've added a hack to attempt to resolve as a hostname as well. If that works, then the 4 byte unsigned long of that hosts address is returned instead.
Fired up the client using the hostname URL, and it worked straight off!!!
From the login screen, through the character selection, to actually being in
the game, with all textures loaded (I also cleared out the cache to prove this).
The only thing I've seen so far that doesn't work is screen resizing.
All of this suggests to me that :-
1) Spark player is incorrectly using the inet_addr function somewhere. Although it works. 2) The MSDN documentation is wrong and doesn't say that hostnames can be used.
http://bugs.winehq.org/show_bug.cgi?id=20433
Rockfire rockfire.redmoon@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rockfire.redmoon@gmail.com
--- Comment #8 from Rockfire rockfire.redmoon@gmail.com 2010-07-09 14:01:43 --- Just a bump really. This issue still exists in the game, and it would be nice to not have to patch it anymore!
The above patch still works, and looks to me like it only really implements an undocumented feature of the socket API.
I would prove this myself, but do not currently have access to a Windows installation.
http://bugs.winehq.org/show_bug.cgi?id=20433
Kai Blin kai.blin@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
--- Comment #9 from Kai Blin kai.blin@gmail.com 2010-07-10 02:29:45 --- Sounds like an easy test case to do. I'll try to make some time to look into this.
http://bugs.winehq.org/show_bug.cgi?id=20433
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #10 from Bruno Jesus 00cpxxx@gmail.com 2011-11-23 21:13:51 CST --- I have tested inet_addr in several different ways it does not resolve names, it ever returns INADDR_NONE for anything that is not an IP.
Can any player attach a +winsock in 1.3.33? Some useful things have changed in sockets since the last post in this bug.
The log from comment 3 shows that the applications calls select/read in an unbind and unconnected socket which is useless and returns errors. I really would appreciate a newer log.
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #11 from Rockfire rockfire.redmoon@gmail.com 2011-11-26 09:03:57 CST --- Unfortunately, both the Earth Eternal and the Japanese version Ikimonogatari servers are now both closed (again). Coincidentally, Earth Eternal closed on the very day you posted this reply :)
It's not looking hugely likely that they will be coming back either, although nothing official from the publishers yet.
With this uncertainty, I'm not sure if this bug is worth is worth any further effort, at least at the moment. One enterprising player has built a server, but nothing public or that can be legally used.
For what it's worth. I do know the patch was still required with 1.1.30 (the last version I tried), but no longer have any logs available.
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #12 from Rockfire rockfire.redmoon@gmail.com 2011-11-26 09:09:51 CST --- Correction "For what it's worth. I do know the patch was still required with 1.3.30 (the last version I tried)"
http://bugs.winehq.org/show_bug.cgi?id=20433
--- Comment #13 from Bruno Jesus 00cpxxx@gmail.com 2012-03-03 21:21:06 CST --- This bug is most likely abandoned because Earth Eternal is no longer available. Download links no longer work and the game server was shutdown.
http://bugs.winehq.org/show_bug.cgi?id=20433
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |ABANDONED
--- Comment #14 from Austin English austinenglish@gmail.com 2012-03-04 13:21:50 CST --- (In reply to comment #13)
This bug is most likely abandoned because Earth Eternal is no longer available. Download links no longer work and the game server was shutdown.
Abandoned.
http://bugs.winehq.org/show_bug.cgi?id=20433
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #15 from Austin English austinenglish@gmail.com 2012-03-04 17:32:27 CST --- Closing.