- Joined
- Sep 5, 2008
- Messages
- 79
- Reaction score
- 10
BetaFlyffPatcher: Patcher refuses to "find" custom content
I used the BetaFlyffPatcher up untill now and it worked just fine to patch the 3 data files, the neuz and the existing world files.
But this time i tried to add a custom instance by copying an existing one ( Rustia). I renamed it, did all the editing in the files and made the list.txt with titanium as usual but after uploading it to the patch server and trying to patch the client it get the following error message:
i am 100% that the path and the files exists. Even when i copy the domain name and the path from the error-log into a browser i can download the file. What am i missing? I tried to use the search but it seems ragezone has some problems with their server currently. (RageZone Error Message: connection to localhost:9312 failed (errno=111, msg=Connection refused))
Edit: i figured it's not the path on the server that the patcher cannot find but the path in the client. This however doesn't make sense since how else are you going to add new content to the client if not by using the patcher. Otherwise the user would have to redownload the client whenever you decide to add content that requires a new folder. Is there a setting i am missing or is the Flyff Patcher really that badly written that he cannot handle new folders? Creating a new empty folder with the mentioned name on the client sides "fixes" the patcher and the client is able to download the map
Edit2: Lets turn this question into a "guide". I checked the source of the patcher and as it seems it just stops working if the directory doesn't exists even tho it has the functionality to create new directories. I have no experience in C++ so i programmed the solution in pseudo code and googled how to realize it so take my code with a grain of salt and feel free to correct me if you know a more secure or better way to fix the problem.
Now for the solution. In the "httpdownload.cpp" add a function to check if a directory exists or not. You can take my solution if you feel so:
Next go to the "httpdownload.cpp:ownloadFile(...)" function and check if the directory that the patcher tries to safe the file to exists before it exits because he can't safe the file to the directory. If the directory does not exist create it.
To be more clear, look for:
Before that insert your code or use mine:
Hope this helps
I used the BetaFlyffPatcher up untill now and it worked just fine to patch the 3 data files, the neuz and the existing world files.
But this time i tried to add a custom instance by copying an existing one ( Rustia). I renamed it, did all the editing in the files and made the list.txt with titanium as usual but after uploading it to the patch server and trying to patch the client it get the following error message:
Code:
10/31-02:25:18 Attempt to connect(domain.xyz).
10/31-02:25:18 Connected
10/31-02:25:18 RESCLIENT/World/DuRustiaSingle/DuRustiaSingle.dyo.gz, 0(th), 126bytes
10/31-02:25:18 Das System kann den angegebenen Pfad nicht finden.(Can't find the mentioned path)
CODE: 3 RESULT: 6
i am 100% that the path and the files exists. Even when i copy the domain name and the path from the error-log into a browser i can download the file. What am i missing? I tried to use the search but it seems ragezone has some problems with their server currently. (RageZone Error Message: connection to localhost:9312 failed (errno=111, msg=Connection refused))
Edit: i figured it's not the path on the server that the patcher cannot find but the path in the client. This however doesn't make sense since how else are you going to add new content to the client if not by using the patcher. Otherwise the user would have to redownload the client whenever you decide to add content that requires a new folder. Is there a setting i am missing or is the Flyff Patcher really that badly written that he cannot handle new folders? Creating a new empty folder with the mentioned name on the client sides "fixes" the patcher and the client is able to download the map
Edit2: Lets turn this question into a "guide". I checked the source of the patcher and as it seems it just stops working if the directory doesn't exists even tho it has the functionality to create new directories. I have no experience in C++ so i programmed the solution in pseudo code and googled how to realize it so take my code with a grain of salt and feel free to correct me if you know a more secure or better way to fix the problem.
Now for the solution. In the "httpdownload.cpp" add a function to check if a directory exists or not. You can take my solution if you feel so:
Code:
//does what it says. Check if a Directory Exists
BOOL DirectoryExists(const char* dirName) {
DWORD attribs = ::GetFileAttributesA(dirName);
if (attribs == INVALID_FILE_ATTRIBUTES) {
return false;
}
return (attribs & FILE_ATTRIBUTE_DIRECTORY);
}
Next go to the "httpdownload.cpp:ownloadFile(...)" function and check if the directory that the patcher tries to safe the file to exists before it exits because he can't safe the file to the directory. If the directory does not exist create it.
To be more clear, look for:
Code:
CFile fileToWrite;
if( !fileToWrite.Open( strCompressedFile, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite) )
return DOWNLOAD_ERROR_CREATEFILE;
Before that insert your code or use mine:
Code:
string filename = info.szPath;
string directory;
//Extract the directory from the fullpath
const size_t last_slash_idx = filename.rfind('\\');
if (std::string::npos != last_slash_idx)
{
directory = filename.substr(0, last_slash_idx);
}
//if the directory does not exist create it
if (!DirectoryExists(directory.c_str())) {
CreateDirectory(directory.c_str(), NULL);
}
Hope this helps
Last edited: