Using sockets?

Started by XeR, August 03, 2012, 01:23:47 PM

Previous topic - Next topic

XeR

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 or Call of Duty 4 promod.

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

  • Easier for everyone
  • Noone will have an outdated version
  • Better cheat protection
  • Unlimited space (almost)

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?

Bully@Wiiplaza

Funky + Bowser Bike more overpowered than it is now 8)
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

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?

XeR

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.

XeR

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]

γRB


live2play

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?