PS3 ps3netsrv for savegames

LifeCoder

Forum Noob
Hi all!

I recently started backing up my games towards ps3netsrv and whilst playing one of them I thought hey I want to continue this save with rpcs3. I did some searching and it's possible to transfer the saves between them so thats nice but it has a lot of annoying manual processes. No problem normally but when you have a lot of games and play them all instead of sticking to a game it becomes highly annoying especially when forgetting to transfer.
Hence I thought a local server that can take care of this sounds amazing, so I started downloading webman-mod from github as it had a lot of modules and me being a total newbie into ps3 homebrew development needed some code to look at how it is done.

I wrote a barebones plugin that connects to my server, success, now I need to ofcourse get information from the ps3. So I found xregistry and its functions to get the user id, nice we can continue. Then I came to reading the save files but the problem I'm running into is that to list files in a directory or list all subdirectories in a directory I need the sysLv2Fs functions and those seem to reside within the PSL1GHT SDK ppu sys/file.h. Alright success I hear you say, include it and use it. However I could not include it at first, so I added the include directory to my makefile which caused a lot of things to be redefined: "In file included from C:/PSDK3v2/psl1ght/ppu/include/ppu-lv2.h:4,
from C:/PSDK3v2/psl1ght/ppu/include/sys/memory.h:8,
from c:/usr/local/cell/host-win32/ppu/bin/../../../target/ppu/include/cell/sysmodule.h:12,
from main.c:4:
C:/PSDK3v2/psl1ght/ppu/include/ppu-types.h:71: error: conflicting types for 'sys_mutex_t'
c:/usr/local/cell/host-win32/ppu/bin/../../../target/ppu/../common/include/sys/sys_types.h:72: error: previous declaration of 'sys_mutex_t' was here"

I assume I'm using 2 sdk's at the same time with this, however the one in C:/usr does not expose those functions. My question being, how can I use these functions or another function that can accomplish the same goal.

I tried googling but for some odd reason could not find anything related to these functions in terms of documentation.

Thanks
 
AFAIK You cannot use PSL1GHT to make VSH plugins.

Instead of sysLv2Fs functions, you can use cellFs functions adding -lfs_stub to make and adding #include <cell/cell_fs.h> to you code.

This snippet scans the files in a folder
Code:
int fd;
if(cellFsOpendir(PATH, &fd) == CELL_FS_SUCCEEDED)
{
   CellFsDirectoryEntry dir; uint32_t read_e; char full_path[2048];
   while(cellFsGetDirectoryEntries(fd, &dir, sizeof(dir), &read_e) == CELL_FS_SUCCEEDED && read_e)
   {
       sprintf(full_path, "%s/%s", PATH, dir.entry_name.d_name);
       // add your code here
   }
   cellFsClosedir(fd);
}

BTW I think a more simple way is using the FTP command mget *.* from FTP client on the PC.
 
Last edited:
Aha good to know thanks! FTP is a good suggestion actually, I hadn't thought of this. I used this as an excuse to start reading into ps3 homebrew development. Though FTP is an easier option, it would require periodic checkins to see if any savegames were changed. On the one hand it's a quick and dirty way of solving it that I definitely want to document or build as a quick access way to do this but I definitely want to keep the plugin idea to say be able to notice when a game was exited and then instead of either downloading the file or looking at the last modified date with FTP use checksums. The idea was always to have the application, that stores the savegames to put them elsewhere, ensures they get changed to fit on either a console or emulator(if needed, not that far yet)

Anyhow, I did a little minddumping. Your code indeed works as expected, thank you! I'll also look at the FTP idea to get a faster solution but definitely want to keep tinkering with the ps3 and plugins :D
 

Similar threads

Back
Top