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: 247

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: 221

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Sicklyboy @ Sicklyboy:
    And if the concern is that "well we can't trust the government to intervene for this because the government can't do anything right and wastes tons of money" then holy shit push for a better government. I'm certainly trying to. Don't throw your hands up and go "we've tried nothing and we're all out of ideas"
  • K3Nv2 @ K3Nv2:
    Plus technology cost iirc even a water jet drill is 1k per
  • cearp @ cearp:
    @K3Nv2 that's crazily expensive. how long will that take to pay off?

    Although diet is largely education, people don't need to go to university to learn what's healthy and what's not,
    it's the whole country, big corporations and advertising that is to blame for leading most of the population to believe that poptarts and froot loops are healthy to feed a child
  • mthrnite @ mthrnite:
    i would think the population knows better but with food deserts and abject poverty, sometimes a poptart gonna have to do.
  • mthrnite @ mthrnite:
    it's a big ol complicated world innit
    +1
  • Sicklyboy @ Sicklyboy:
    As someone who went through the grade school system in the US some time within the past 30 or so years, not nearly enough is done to promote and educate on how to eat healthy in a way that is feasible to do on a regular basis and also affordable. Eating healthy is, comparatively, fucking expensive. So is eating unhealthy, but in many cases eating unhealthy is more affordable than eating healthy
    +1
  • cearp @ cearp:
    90k could get you a 3 bedroom house in some poorer parts of the country
  • K3Nv2 @ K3Nv2:
    @cearp, it's like buying a new car most dentists say so $250 per the rest of your life
  • cearp @ cearp:
    Jesus
  • K3Nv2 @ K3Nv2:
    These are actual implants to dentures though
  • cearp @ cearp:
    Well once it's all done I'm sure you'll be happy with the result
  • K3Nv2 @ K3Nv2:
    Just a flappity denture would probably be 5k
  • mthrnite @ mthrnite:
    sold
  • K3Nv2 @ K3Nv2:
    I got some faith implants are going to justbe included with a crown cost
  • K3Nv2 @ K3Nv2:
    Procedures bullshit wait 4 months for graft to heal wait another four months the post to heal then get crown
  • SylverReZ @ SylverReZ:
    Only 1 tempycoin.
    +1
  • K3Nv2 @ K3Nv2:
    Got kfc for dinner fucking dinner box is a joke
  • BigOnYa @ BigOnYa:
    Just go gummy, ancientboi would like you better that way anyways, and you save money on toothbrushes/toothpaste
  • cearp @ cearp:
    @Sicklyboy I agree, but also it's about self control and realistic thinking. We wouldn't feed a dog soda, so why feed it to ourselves? Eating unhealthy food because it's cheap is one thing, but I'm sure you know people who drink soda routinely when they should be drinking water which is free.
    I get it can feel mean to say "no treat sweet beverage for you anymore" but for many people it's just in their way of life.
  • K3Nv2 @ K3Nv2:
    I drink soda twice out of the week
  • K3Nv2 @ K3Nv2:
    Plus decay can start as young as 15 tons of factors
  • cearp @ cearp:
    Even sugar free isn't good, as the acid is bad enough.
  • cearp @ cearp:
    oh earlier than 15 Ken, babies, children can get decay
  • K3Nv2 @ K3Nv2:
    So dentists give. Us these caps that'll last a few years to fight thrm
  • K3Nv2 @ K3Nv2:
    Yeah but babies get a new set
    K3Nv2 @ K3Nv2: Yeah but babies get a new set