Homebrew Save Nintendo WiFi - A project to save online servers for DS (and Wii) games

leseratte

Wiimmfi Team
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,859
Country
Germany
Well, thats what I mentioned in post #139. But this also happens when server and two clients are running on different computers, but behind the same NAT as the server. So I have no way to test this.

Maybe you are able to host a server (with the two changes you've posted here) with port forwardings for testing using my database and give me your public IP?
 

Attachments

  • gpcm.db.zip
    895 bytes · Views: 245

leseratte

Wiimmfi Team
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,859
Country
Germany
OK, the problem is the NAT neg server or that it is behind the same nat. I tried using my server and the openspy natneg ones, and continental races now work.

Now we need to find out if this is because of the NAT or because of an error in your natneg script.

Also, I'm now able to register friends and I see the Mii of them (so the server answers correctly), but I don't see them online, so the status doesn't get redirected to the friends.
 

leseratte

Wiimmfi Team
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,859
Country
Germany
I'm using the natneg server from openspy.org: http://openspy.net/

So we have to test if your natneg script works, but we can't test this w/o a public server to run the script on.

With this Natneg, I was able to race a continental race, but friend races do not work, because your server scripts do not return the status that the friend is online.
 

leseratte

Wiimmfi Team
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,859
Country
Germany
Probably yes.
Just give me an IP and I change the natneg entry on my local dns server and try it with a Wii and dolphin.

Or do you host the whole server?
 

leseratte

Wiimmfi Team
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,859
Country
Germany
With your natneg server I'm unable to connect. So there must be a difference between your natneg script and the openspy natneg server.
 

leseratte

Wiimmfi Team
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,859
Country
Germany
I've tested it, but now the Wii's stuck again at the question about its own pid. It never asks for other players.

I added a logging line on gamespy_server_browser_Server in line 265 - the server uses the DS variant (little endian) although it's a Wii and no DS.

I fixed that by adding a "console = 1" - line, but probably broke DS matchmaking by that.

By the Way, your server is NOT correctly parsing the request string from the Wii:

Code:
[2014-04-12 08:44:41 | GameSpyServerBrowserServer] Searching for server matching 'dwc_mver = 90 and dwc_pid != 1 and maxplayers = 11 and numplayers < 11 and dwc_mtype = 0 and dwc_hoststate = 2 and dwc_suspend = 0 and (rk = 'vs_123' and (ev > 4263 or ev <= 5763) and p = 0)' with the fields '['numplayers', 'maxplayers', 'dwc_pid', 'dwc_mtype', 'dwc_mver', 'dwc_eval', 'dwc_groupid', 'dwc_hoststate', 'dwc_suspend', 'rk', 'ev', 'eb', 'p']'
Matched: dwc_suspend = 0
Matched: dwc_hoststate = 2
Matched: dwc_mtype = 0
Matched: numplayers < 11
Matched: maxplayers = 11
Not matched: dwc_pid != 1
Matched: dwc_mver = 90
Matched: p = 0
Not matched: ev = 5763
Matched: 4263 < or
Matched: rk > ev
Matched 9/10
Matched 0/10

The Wii sends nothing about "ev = 5763". The Wii asks about an ev greater than 4263 OR less or equal than 5763 (Yes, I know this ev query is senseless since it's always true but I use a patched variant. In a normal game this string is not senseless)

And dwc_pid != 1 should also match as the dwc_pid from this player is 2.

You better add a table in your database with this data, then you can simply query this string to the database and get the players back, because other Wii games use more complicated strings and it'll be hard to add all those combinations of values into the server.
 

leseratte

Wiimmfi Team
Member
Joined
Jun 2, 2012
Messages
453
Trophies
1
XP
1,859
Country
Germany
The endianness is correct now, but I get this error:

Code:
[2014-04-12 11:44:22 | GameSpyServerBrowserServer] find_server_by_address returned: None
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
    return self._dataReceived(data)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/usr/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 588, in dataReceived
    why = self.rawDataReceived(data)
  File "/home/florian/mkw-ana/serverabschaltung/n_dwc_emu/gamespy_server_browser_server.py", line 120, in rawDataReceived
    logger.log(logging.DEBUG, "%s %s" % (ip, server['publicip']))
exceptions.TypeError: 'NoneType' object has no attribute '__getitem__'

Maybe this is because of the Wii being in the same Network than the server.

If the Wii is in the same network, there is the following data: localip0=10.0.1.30 (this IP doesn't exist in my network), publicip=10.0.1.226 (local IP of Wii). The value "localip1" does not exist.
If the Wii is in another network, there is the following data: localip0=10.0.1.226 (local IP of wii), publicip=37.48.21.142 (public IP of Wii), localip1=190.190.190.190 (always this value)
 

Toad King

Well-Known Member
OP
Member
Joined
Aug 19, 2009
Messages
374
Trophies
0
XP
546
Country
United States
Nagato, I'm still running into issues trying to run it on my server. Both sides can connect to the server, but when I try to have one join the other's game, it just timesout and says the game no longer exists. Also, there's some weird bug where after connecting once, any attempt to connect again gives a 52200 error after it connects to conntest.nintendowifi.net. (I'm testing in MPH and Tetris DS.)

Also I get this error trying to add a friend in Tetris DS:

Code:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
    return self._dataReceived(data)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 578, in dataReceived
    why = self.rawDataReceived(data)
  File "/home/toadking/nintendo_dwc_emulator/gamespy_profile_server.py", line 135, in rawDataReceived
    self.perform_addbuddy(data_parsed)
  File "/home/toadking/nintendo_dwc_emulator/gamespy_profile_server.py", line 369, in perform_addbuddy
    self.db.add_buddy(self.profileid, newprofileid)
  File "/home/toadking/nintendo_dwc_emulator/gamespy/gs_database.py", line 335, in add_buddy
    c.execute(q, [userProfileId, buddyProfileId, now, 0, 0]) # 0 will mean not authorized
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 6, and there are 5 supplied.
 

Toad King

Well-Known Member
OP
Member
Joined
Aug 19, 2009
Messages
374
Trophies
0
XP
546
Country
United States
I've uploaded a log of an attempted friend match in Tetris DS, including packet dumps.

Also, it appears that 52200 error is only happening in MPH. Tetris DS seems to be able to reconnect just fine.
 

Attachments

  • test_data.zip
    25 KB · Views: 220

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Veho @ Veho: Link the Twink?