WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: XeR on August 03, 2012, 01:23:47 PM

Title: Using sockets?
Post by: XeR on August 03, 2012, 01:23:47 PM
Hey guys,
I'm working on a Riivolution project (Ohai megazig), which aims to balance Mario Kart Wii's gameplay and make it more competitive, just like Balanced Brawl (http://balancedbrawl.net/) or Call of Duty 4 promod (http://www.codpromod.com/).

However, I'd like to add an auto-update feature for differents reasons:

So far, I've been able to find every functions I need: net_socket, net_connect, net_send, net_recv, and net_init (libogc names)
To connect my server, I need to call net_init, net_socket, and then net_connect.
Every in-game functions works just like LibOGC^H^H^Hogc's, except for net_init, which seems to need two pointers/callbacks.
Any advanced hackers out there already tried to use the sockets?
Title: Re: Using sockets?
Post by: Bully@Wiiplaza on August 03, 2012, 02:21:34 PM
Funky + Bowser Bike more overpowered than it is now 8)
Title: Re: Using sockets?
Post by: dcx2 on August 15, 2012, 02:48:32 PM
MKWii probably has a net_init function somewhere in it already.  Could you rely on users already having their network initialized?  Alternatively, could you find where net_init is being called by MKWii's game code, and then mimic the function by providing it the same pointers?
Title: Re: Using sockets?
Post by: XeR on August 16, 2012, 07:05:28 PM
Quote from: dcx2 on August 15, 2012, 02:48:32 PM
MKWii probably has a net_init function somewhere in it already.  Could you rely on users already having their network initialized?  Alternatively, could you find where net_init is being called by MKWii's game code, and then mimic the function by providing it the same pointers?
Yeah, it does have a net_init function. It is called each time the player connect to the NWFC, and the network is unloaded when it isn't needed.
I tried with 2 blr, but it froze.
Title: Re: Using sockets?
Post by: XeR on February 03, 2013, 12:08:32 PM
Hmmm... After almost a year, I haven't been able to find how to init network... :/
So, if anyone wants to have a look, here are my notes. (Grab a RMCP01 RAM dump.)
[spoiler]socket_create
----------
0x800FFFC8
arg1: 0x00000002 (AF_INET)
arg2: 0x00000001 (SOCK_STREAM)
arg3: 0x00000000 (0x00000006 also works)

socket_connect
----------
0x800F12A4
arg1: socket ID (From socket_create)
arg2: pointer -> socket
arg3: 0x00000008 (socket length)

socket structure:
2 bytes: family (0x0002)
2 bytes: port
4 bytes: IP address

socket_write
----------
0x800F13A0
arg1: socket ID
arg2: pointer -> string
arg3: string length

socket_read
----------
0x800F1308
arg1: socket ID
arg2: pointer -> buffer
arg3: buffer length[/spoiler]
Title: Re: Using sockets?
Post by: γRB on July 03, 2013, 11:21:27 AM
up
Title: Re: Using sockets?
Post by: live2play on July 08, 2013, 10:55:34 PM
Does Promod allow you to host a server for Wii online matches?  If so, does anyone have a link to how to configure this on the Wii side?