Difference between revisions of "Wiimmfi"

From Custom Mario Kart
Jump to navigation Jump to search
m
 
(105 intermediate revisions by 19 users not shown)
Line 1: Line 1:
 
[[File:Wiimmfi-300.png|right]]
 
[[File:Wiimmfi-300.png|right]]
[[Nintendo]] has announced that the [[Nintendo Wi-Fi Connection]] service will be [http://www.nintendo.com/consumer/info/services-update.jsp discontinued on May 20, 2014.]  This will impact all DS and Wii games with online features, including Mario Kart Wii. [[Wiimm]] had been analysing the [[Mario Kart Wii]] network traffic since November 2012 and had already written an helper tool named [[mkw-ana]]. And so he decided together with other people to create the '''Wii-Server Project''' to replace Nintendo's servers for [[Mario Kart Wii]] and perhaps for other games.
+
[[Nintendo]] announced that [[Nintendo Wi-Fi Connection]] would be [https://www.nintendo.com/consumer/info/services-update.jsp discontinued on May 20, 2014.]  This impacted all [[Nintendo DS]] and [[Wii]] games with online features that were directly using Nintendo WFC, which included [[Mario Kart Wii]]. [[Wiimm]] had been analyzing the [[Mario Kart Wii]] network traffic since November 2012, and had already written a helper tool named [[mkw-ana]]. And so he decided, together with other people, to create the '''Wiimmfi Project''' (formerly '''Wii-Server Project''') to replace Nintendo's servers for [[Mario Kart Wii]] and for other games, if possible.
  
  
 
__TOC__
 
__TOC__
  
 +
 +
== wiimmfi.de ==
 +
 +
'''wiimmfi.de''' replaces '''nintendowifi.net''' in games. All games must use this new domain and change https to http (see below).
 +
 +
The domain '''wiimmfi.de''' was registered by [[Wiimm]] for this project. If [[Wiimm]] discontinues this service at any time in the future, he will give away the domain, the software and the data base content.
  
 
== State of the Project ==
 
== State of the Project ==
  
The tester team around [[Wiimm]] already played versus and battle in rooms, in regions and worldwide. They played standard Mario Kart Wii and [[Wiimms Mario Kart Fun 2014-04|Wiimms MKW-Fun]]. The latter is based on [[CTGP Revolution v1.02|CTGP-R v1.02]].
+
On May 10 2014, 10 days before Nintendo shut down their NAS and disconnected themselves from [[GameSpy]], [[Wiimm]] released [[Wiimmfi Patcher]]s. Since that date, Wiimmfi was publically usuable. At first, the server only supported [[Mario Kart Wii]], including the different [[Custom Track Distribution]]s. However, more games have been enabled, tested, and are now fully supported.
  
On Sunday, different players met >90 minutes in region 125 (MKW-Fun 2014-04) without any problems. For Mario Kart Wii, the custom server is very stable now. The only problem may be the total number of players — time will show.
+
→ [https://wiimmfi.de/stat?showall=1 List of all Wiimmfi games (supported, test and disabled)]
  
Before playing on the new server, the game images must be patched to exchange the domain and to replace https by http access. There are 2 patchers available:
+
The game lists also contains information about issues.
  
=== Game Patcher ===
+
== Connecting to Wiimmfi ==
  
To play Wii games using the custom server, the games must be patched using the [[wiimmfi-Patcher]]. There are 2 patchers for USB-Loader, one for Mario Kart Wii and one for other games.
+
Wii games must be patched to access Wiimmfi, as Nintendo Wi-Fi Connection originally used SSL for login. However, a variety of patchers exist for Wii games:
For [[Riivolution]] users, [[MrBean35000vr]] is on the way to create a channel, that will patch the strings on the fly.  
+
* '''[https://chadsoft.co.uk CTGP-R]''' automatically includes Wiimmfi support in-app, with no setup required.
 +
* '''[https://download.wiimmfi.de/patcher/autowiimmfipatcher-latest.zip Auto Wiimmfi Patcher]''' is a home-brew app that will automatically patch Wii discs when launched (however, it is required to launch the app every time) - this app can also be accessed by setting the Wii's DNS to '''95.217.77.151''' and launching the WC24/Wii Shop Channel license agreement.
 +
* '''[https://github.com/RiiConnect24/auto-wiiware-patcher/releases Auto WiiWare Patcher]''' can patch most WiiWare WADs to allow enable Wiimmfi access.
 +
* '''[https://download.wiimmfi.de/patcher/wiimmfi-patcher-latest.zip Wiimm's Disc Patcher]''' can permanently patch disc images.
 +
* Updated USB Loaders can also automatically patch USB images for Wiimmfi - ''recent'' versions of USB Loader GX and WiiFlow can automatically patch for Wiimmfi using a Private Server option.
  
=== Confirmed games ===
+
== Implementation ==
  
The following games can be played using the custom servers:
+
[[Wiimm]] originally implemented the server in PHP, so that the servers were created quickly. From the beginning of development, it was known that the servers must be ported to C/C++ to improve performance. While developing, there were issues due to using PHP, and 2 servers have thus been ported to C.
* Mario Kart Wii
 
* Animal Crossing: City Folk/Let's Go to the City!
 
* Sonic & SEGA All-Stars Racing (only global races)
 
* Super Smash Bros. Brawl
 
  
Don't forget that the custom server runs in test mode and the development is not finished.
+
=== NAS ===
  
=== Games ready to test ===
+
[[NAS]] is the Nintendo Authentication Server. The Wii used naswii with HTTPS, and the DS used nas (which supported HTTP) with HTTPS. They are interchangeable. On Wiimmfi, the server is implemented using APACHE2 and PHP5. At the moment, logins are accepted with old and new profiles. New savegames send a request to get their unique console nickname from the server.
  
The following games are enabled and waiting for tests:
+
=== GPCM ===
* Animal Crossing: Wild World
 
* Mario & Sonic at the London 2012 Olympic Games
 
* Mario & Sonic at the Olympic Games
 
* Mario & Sonic at the Olympic Winter Games
 
* Mario Kart DS ([http://save-nintendo-wifi.com/mkds/MarioKartDS(USA)-NoSSL.xdelta NTSC-U-patch], [http://www62.zippyshare.com/v/89907886/file.html PAL-patch])
 
* Mario Strikers Charged (PAL+JAP)
 
* Pokemon Battle Revolution Wii
 
* Pokémon Diamond ([http://save-nintendo-wifi.com/pkmn-dp/1015%20Pokemon%20Diamond%20(v05)%20(US).xdelta NTSC-U-patch]
 
* Pokémon Pearl ([http://save-nintendo-wifi.com/pkmn-dp/1016%20Pokemon%20Pearl%20(v05)%20(US).xdelta NTSC-U-patch])
 
* Pro Evolution Soccer 2008
 
* Pro Evolution Soccer 2009
 
* Pro Evolution Soccer 2010
 
* Pro Evolution Soccer 2011
 
* The Last Story
 
* The Conduit
 
* The Conduit 2
 
  
It seems that DS games also need a patch to replace ''https'' requests by ''http''. [http://www.mediafire.com/download/s5ucc79m6xzrtis/SslPatcher_v1.4.zip Here] you can find a patcher that should work with all DS games.  
+
When entering the WFC, the Wii connects to [[GPCM]] using TCP. The connection is closed upon leaving WFC. The server is used for general maintenance and for message exchange between the clients.  
  
Here you can find always a list of [http://nas.wiimmfi.de/stat#game enabled games].
+
It is currently implemented as PHP script. The interprocess communication (transferring messages) is implemented with UNIX sockets. To improve the performance and to allow a better interprocess communication, a C-server was written. It is still in development and supports a model with supervisors and workers. Since March 2016, the new server is in use at Wiimmfi's test server.
  
== Updates ==
+
=== GPSP ===
  
; 2014-05-11 14:30 UTC
+
[[GPSP]] is used to retrieve information about friends. The Wii connects frequently using TCP. Nintendo's GPSP server was used to retrieve the profile_id and nick pairs before shutdown.
* Some of the users had created new profiles while connected to the custom servers. These Profiles are invalid now and you should remove them.
 
* Henceforth, new profiles are stored permanently, even on a server update.
 
* Mario Kart Wii: Meeting of non-friends works now much better and faster. The solution was to insert a "sleep(1/2 sec)" at the right place.
 
  
=== Maintenance Time ===
+
On Wiimmfi, [[GPSP]] has been implemented as PHP script.
  
The wiimmfi-server is running in test mode. There is a second server for the active development. And so major updates must be done frequently.
+
=== MASTER ===
  
'''The maintenance  is set between 15:00 and 16:00 UTC (17–18h CET) at every day.''' In this time the server may be stopped for updates and other things without further announcement. Don't be astonished if you are kicked or if login is not possible during this period. This time will also used to insert new retrieved friend codes.
+
[[MASTER]] listens on port 27900 via UDP. Games send status records to MASTER. MASTER stores them into a game specific table, where other clients can retrieve the information using [[MS]] (see next point).
  
== Implementation ==
+
At the beginning, [[MASTER]] was implemented as PHP script. In September 2014 it was replaced by a giant server written in C to improve performance. The new MASTER reduces was optimized and reduces queries to the database by ~90%.
  
[[Wiimm]] decided to implement the code in PHP as a fast solution and to find out the protocol details. From the beginning it was clear that it must be rewritten in C or C++ for performance reasons. While developing, there were some other issues, so one of the servers is already implemented in C.
+
=== MS ===
  
=== [[Server NASWII]]/NAS ===
+
[[MS]] is used by the clients to retrieve information about other online clients. The query is similar to an SQL query, with ''select'', ''where'' and ''limit'' clauses. The reply is encrypted by a game specific secret.
  
[[Server NASWII]] is the ''https'' based login server. NAS is an old NDS implementation for ''http''. Both can be interchanged. The server is implemented using APACHE2 and PHP5.
+
At the beginning, [[MS]] was implemented as PHP, but piped the response through an encoder written in C. In January 2016, it was integrated into the MASTER server (written in C).
  
At the moment, only logins are accepted with old and new profiles. Complete new savegames send a request to get their unique console nickname from the server. This is not implemented yet.
+
=== NATNEG ===
  
=== [[Server GPCM]] ===
+
[[NATNEG]] is used to establish a connection between two players, both of whom are behind NAT. The clients only communicate with this server when they try to connect to another player.
  
If entering the WFC, the Wii connects to the [[Server GPCM]] using TCP. The connection is closed, when leaving WFC. The server is used for general maintenance and for message exchange between the clients.  
+
[[NATNEG]] has been implemented in C. As it was the first C tool, it has an open second port to send special UDP packets for [[MS]] with the faked sender address of [[MASTER]].
  
It is implemented as PHP script. Because of interprocess communication (transferring messages) an re-implementation in C is planned. Currently the custom server does not support all kinds of messages.
+
=== SAKE ===
  
=== [[Server GPSP]] ===
+
[[SAKE]] is used for data exchange — files or records can be uploaded to the SAKE server. This is used for friend Mii exchange in Mario Kart Wii, along with ghosts.
  
[[Server GPSP]] is used to retrieve information about friends. The Wii connects and disconnects frequently using TCP. We use Nintendos GPSP server to retrieve the profile_id and nick pairs.
+
SAKE has been implemented in PHP, and can send/receive ghosts and Miis, along with other games' data.  
  
[[Server GPSP]] is fully implemented as PHP script.
+
=== RACE ===
  
=== [[Server MASTER]] ===
+
[[RACE]] is used for downloading competitions and rankings in Mario Kart Wii. RACE has been implemented in PHP, with competition support added by Leseratte (with help from Billy), which is now fully working.
=== [[Server MS]] ===
 
=== [[Server NATNEG]] ===
 
  
[[Server NATNEG]] is used to establish a connection between two players both being behind NAT. The clients only communicate with this server when they try to connect to another player.
+
=== GAMESTATS ===
  
=== [[Server SAKE]] ===
+
GAMESTATS is for game rankings/leaderboards. There are two versions of it; HTTP and TCP. Sepalani has implemented both in Python, the former is a near-complete implementation. Games like Mario Strikers Charged and Dr. Mario Online Rx use GAMESTATS.
=== [[Server GAMESTATS]] ===
 
  
== Using old profiles ==
+
=== DLS1 ===
  
For each profile, there exists a '''[[friend code|profile id]] and [[nick|nick name]] pair'''. Only the Wii of the user and the server database knows both of them. At login, the Wii sends the [[nick|nick name]] and the server answers with the related [[friend code|profile id]]. If the profile id is wrong, the game aborts the login.
+
[[DLS1]] is a server for game file downloading. Wiimmfi runs a PHP version which has no files (due to copyright reasons), but a third-party DLS1 server is also ran for a lot of NDS/Wii games for their own files. This server is unused by Mario Kart Wii.
  
If you want to use your old profile with the new custom servers, you must use the [http://forum.wii-homebrew.com/index.php?page=Thread&postID=588239 Web Formula] to register it. The server will then try to retrieve your related nickname. This retrieving works only, if you have registered friends, and at least one friend has registered your profile.
+
== Using old profiles ==
  
This data retrieving only works until 18th May, 2014. After this date, there will be a homebrew app (thanks to Maschell) which reads the necessary data out of the save game and adds it to our server, but this only works for Mario Kart Wii. You can download the app [http://download.wiimm.de/wiimmfi/mkw-profile-dumper.zip here]. Simply start it and all your MKWii profiles will get transmitted to our server.  
+
For each profile, there exists a '''[[friend code|profile ID]] and [[nick|nickname]] pair'''. Only the Wii and the server they were created on knows both of them. At login the Wii sends the nickname and the server answers with the related [[friend code|profile ID]]. If the profile ID is wrong, the game will abort the login with error code 60000.
  
If you want to use one of your old profiles, please use one of them during '''your first connection'''. It may lead to problems if your first connection is done with a new profile.
+
There is only 1 way to use your old profiles with Wiimmfi: At the beginning of the project, when the old [[GameSpy]] servers were available (which shut down on July 25th, 2014), Wiimm retrieved 2.9 million pairs. If your profile was retrieved, it is possible to use your old license on Wiimmfi; otherwise, you will need to create a new friend code (Mario Kart Wii now automatically does this with the latest patch)
  
=== Friend Code Market ===
+
⇒ [[Wiimmfi/Error 60000|Details and solutions]]
  
It seems that there are many people who are playing online, but have never added any friends. For those people without friends, there exists a '''Friend Code Market''':
+
== Links ==
* [http://forum.wii-homebrew.com/board42-kreativitaet/board329-mkw-server-project-english/p591317-friend-code-market/#post591317 Friend Code Market]
 
It is also possible to exchange your friend codes in other forums or at the discussion page.
 
  
== Links ==
+
;More about Wiimmfi at this Wiki
 +
* [[MKWii Network Protocol/Server/gpcm.gs.nintendowifi.net/Wiimmfi|Wiimmfi extension of the GPCM server protocol]]
 +
* [[Wiimmfi/Connection Status|Connection Status]] (status summary)
 +
* [[Wiimmfi/Nice ID|Nice ID]] (concept)
 +
* [[Wiimmfi/Online Status|Online Status]] (status summary)
 +
* [[Wiimmfi/Error 60000|Error 60000]]
  
;Project forum @ Wii-Homebrew.com
+
;Project forum at Wii-Homebrew.com
* [http://forum.wii-homebrew.com/index.php?page=Thread&postID=580703 MKW-Server-Projekt]
+
* [https://forum.wii-homebrew.com/index.php?page=Thread&postID=580703 Wiimmfi Project: Introduction]
* [http://forum.wii-homebrew.com/index.php?page=Thread&postID=588239 Web Formula to register your old friend code]
+
* [http://wiiki.wii-homebrew.com/Wiimmfi_(en) Wiimmfi-Page at WHB-Wiki] (english)
 +
* [http://wiiki.wii-homebrew.com/Wiimmfi Wiimmfi-Seite im WHB-Wiki] (deutsch)
  
; Other forums
+
;Forums at GBATEMP.net
* [http://www.mariokartwii.com/threads/134892-MKWii-Server-Project Project thread @ mariokartwii.com]
+
* [https://gbatemp.net/threads/save-nintendo-wifi-a-project-to-save-online-servers-for-wii-and-ds-games.362716/ Save Nintendo WiFi]
* [http://gbatemp.net/threads/save-nintendo-wifi-a-project-to-save-online-servers-for-wii-and-ds-games.362716/ Project thread @ gbatemp.net]
+
* [https://gbatemp.net/forums/wii-nintendo-wi-fi-connection.109/ Nintendo Wi-Fi & Wiimmfi]
  
[[category:General Information]]
+
[[category:Wiimmfi]]
 
[[category:Software]]
 
[[category:Software]]
 
[[category:Network Protocol]]
 
[[category:Network Protocol]]

Latest revision as of 11:33, 30 April 2023

Wiimmfi-300.png

Nintendo announced that Nintendo Wi-Fi Connection would be discontinued on May 20, 2014. This impacted all Nintendo DS and Wii games with online features that were directly using Nintendo WFC, which included Mario Kart Wii. Wiimm had been analyzing the Mario Kart Wii network traffic since November 2012, and had already written a helper tool named mkw-ana. And so he decided, together with other people, to create the Wiimmfi Project (formerly Wii-Server Project) to replace Nintendo's servers for Mario Kart Wii and for other games, if possible.



wiimmfi.de

wiimmfi.de replaces nintendowifi.net in games. All games must use this new domain and change https to http (see below).

The domain wiimmfi.de was registered by Wiimm for this project. If Wiimm discontinues this service at any time in the future, he will give away the domain, the software and the data base content.

State of the Project

On May 10 2014, 10 days before Nintendo shut down their NAS and disconnected themselves from GameSpy, Wiimm released Wiimmfi Patchers. Since that date, Wiimmfi was publically usuable. At first, the server only supported Mario Kart Wii, including the different Custom Track Distributions. However, more games have been enabled, tested, and are now fully supported.

List of all Wiimmfi games (supported, test and disabled)

The game lists also contains information about issues.

Connecting to Wiimmfi

Wii games must be patched to access Wiimmfi, as Nintendo Wi-Fi Connection originally used SSL for login. However, a variety of patchers exist for Wii games:

  • CTGP-R automatically includes Wiimmfi support in-app, with no setup required.
  • Auto Wiimmfi Patcher is a home-brew app that will automatically patch Wii discs when launched (however, it is required to launch the app every time) - this app can also be accessed by setting the Wii's DNS to 95.217.77.151 and launching the WC24/Wii Shop Channel license agreement.
  • Auto WiiWare Patcher can patch most WiiWare WADs to allow enable Wiimmfi access.
  • Wiimm's Disc Patcher can permanently patch disc images.
  • Updated USB Loaders can also automatically patch USB images for Wiimmfi - recent versions of USB Loader GX and WiiFlow can automatically patch for Wiimmfi using a Private Server option.

Implementation

Wiimm originally implemented the server in PHP, so that the servers were created quickly. From the beginning of development, it was known that the servers must be ported to C/C++ to improve performance. While developing, there were issues due to using PHP, and 2 servers have thus been ported to C.

NAS

NAS is the Nintendo Authentication Server. The Wii used naswii with HTTPS, and the DS used nas (which supported HTTP) with HTTPS. They are interchangeable. On Wiimmfi, the server is implemented using APACHE2 and PHP5. At the moment, logins are accepted with old and new profiles. New savegames send a request to get their unique console nickname from the server.

GPCM

When entering the WFC, the Wii connects to GPCM using TCP. The connection is closed upon leaving WFC. The server is used for general maintenance and for message exchange between the clients.

It is currently implemented as PHP script. The interprocess communication (transferring messages) is implemented with UNIX sockets. To improve the performance and to allow a better interprocess communication, a C-server was written. It is still in development and supports a model with supervisors and workers. Since March 2016, the new server is in use at Wiimmfi's test server.

GPSP

GPSP is used to retrieve information about friends. The Wii connects frequently using TCP. Nintendo's GPSP server was used to retrieve the profile_id and nick pairs before shutdown.

On Wiimmfi, GPSP has been implemented as PHP script.

MASTER

MASTER listens on port 27900 via UDP. Games send status records to MASTER. MASTER stores them into a game specific table, where other clients can retrieve the information using MS (see next point).

At the beginning, MASTER was implemented as PHP script. In September 2014 it was replaced by a giant server written in C to improve performance. The new MASTER reduces was optimized and reduces queries to the database by ~90%.

MS

MS is used by the clients to retrieve information about other online clients. The query is similar to an SQL query, with select, where and limit clauses. The reply is encrypted by a game specific secret.

At the beginning, MS was implemented as PHP, but piped the response through an encoder written in C. In January 2016, it was integrated into the MASTER server (written in C).

NATNEG

NATNEG is used to establish a connection between two players, both of whom are behind NAT. The clients only communicate with this server when they try to connect to another player.

NATNEG has been implemented in C. As it was the first C tool, it has an open second port to send special UDP packets for MS with the faked sender address of MASTER.

SAKE

SAKE is used for data exchange — files or records can be uploaded to the SAKE server. This is used for friend Mii exchange in Mario Kart Wii, along with ghosts.

SAKE has been implemented in PHP, and can send/receive ghosts and Miis, along with other games' data.

RACE

RACE is used for downloading competitions and rankings in Mario Kart Wii. RACE has been implemented in PHP, with competition support added by Leseratte (with help from Billy), which is now fully working.

GAMESTATS

GAMESTATS is for game rankings/leaderboards. There are two versions of it; HTTP and TCP. Sepalani has implemented both in Python, the former is a near-complete implementation. Games like Mario Strikers Charged and Dr. Mario Online Rx use GAMESTATS.

DLS1

DLS1 is a server for game file downloading. Wiimmfi runs a PHP version which has no files (due to copyright reasons), but a third-party DLS1 server is also ran for a lot of NDS/Wii games for their own files. This server is unused by Mario Kart Wii.

Using old profiles

For each profile, there exists a profile ID and nickname pair. Only the Wii and the server they were created on knows both of them. At login the Wii sends the nickname and the server answers with the related profile ID. If the profile ID is wrong, the game will abort the login with error code 60000.

There is only 1 way to use your old profiles with Wiimmfi: At the beginning of the project, when the old GameSpy servers were available (which shut down on July 25th, 2014), Wiimm retrieved 2.9 million pairs. If your profile was retrieved, it is possible to use your old license on Wiimmfi; otherwise, you will need to create a new friend code (Mario Kart Wii now automatically does this with the latest patch)

Details and solutions

Links

More about Wiimmfi at this Wiki
Project forum at Wii-Homebrew.com
Forums at GBATEMP.net