CTR-tools / CTR-ModSDK

ModSDK - a modding toolkit to create mods for Crash Team Racing in C. This repository also houses an effort to fully decompile and reverse-engineer CTR in C.
https://discord.gg/WHkuh2n
306 stars 37 forks source link

Add online client support for linux #131

Closed bemug closed 2 months ago

bemug commented 4 months ago

This won't work as is and requires a patch in duckstation to expose shared memory in Linux. Later we will refactor the client to use PINE to access memory, instead of shmem.

bemug commented 4 months ago

I don't have access to a Windows platform. Could anyone try it before merging ?

GreyXor commented 3 months ago

@bemug hello, can you rebase with latest fixes ? https://github.com/CTR-tools/CTR-ModSDK/commits/main/mods/Windows/OnlineCTR/Network_PC/Client/CL_main.c Thanks :)

bemug commented 3 months ago

I'm sorry but I won't.

As the duckstation fork will not get merged, I'd rather focus on implementing PINE support instead. This will enable Linux the proper way, and secure the Windows build too as the shared memory support will be dropped. I'm not sure when I'll have a time slot to do so, feel free to give it a go :)

GreyXor commented 3 months ago

I'm sorry but I won't.

As the duckstation fork will not get merged, I'd rather focus on implementing PINE support instead. This will enable Linux the proper way, and secure the Windows build too as the shared memory support will be dropped. I'm not sure when I'll have a time slot to do so, feel free to give it a go :)

Alright, I didn't knew we'll take this path. I would rather rewrite a client in rust or go that is connects to the PINE socket. Will check, no promises here.

I'm stuck with the pine memory address mapping.

octr = (struct OnlineCTR*)&pBuf[0x8000C000 & 0xffffff];

Here is the current OnlineCTR mapping, i'm just not sure where the game memory from pine is beginning. Would it be 0000C0000 then ? I could find it with a bit of debugging but maybe you already know if the starting address is 0.

bemug commented 3 months ago

I'm afraid I can't help you, I didn't tinker with the memory mapping yet. Niko should know more about this. Keep us posted. Good luck !