- g_szURL="http://arua.sevenhearts.net/";
- g_szVFS="data.idx";
- ExePath="~patch";
- function lua_DN_EXT_DEL(szFileName)
- if (0==cf_r_DN2FILE(g_szURL, szFileName)) then
- do return 0 end;
- end
- if (0==cf_l_EXTRACT(szFileName)) then
- do return 0 end;
- end
- cf_l_DELETE(szFileName);
- return 1;
- end
- function lua_DN_EXT_DEL2(szDownPath, szFileName)
- szDownURL=g_szURL.."/"..szDownPath;
- if (0==cf_r_DN2FILE(szDownURL, szFileName)) then
- do return 0 end;
- end
- if (0==cf_l_EXTRACT(szFileName)) then
- do return 0 end;
- end
- cf_l_DELETE(szFileName);
- return 1;
- end
- g_VFSFiles={};
- g_VFSFiles[1]={"3DDATA.VFS.1"};
- g_VFSFiles[2]={"BASIC.VFS.1"};
- g_VFSFiles[3]={"DATA.VFS.1"};
- g_VFSFiles[4]={"GROUND.VFS.1"};
- g_VFSFiles[5]={"MAP.VFS.1"};
- g_VFSFiles[6]={"TRose.exe.1"};
- g_VFSFiles[7]={"TGameCtrl_r.dll.1"};
- g_VFSFiles[8]={"data.idx.1"};
- g_VFSFiles[9]={"RoseOnline.lua.1"};
- for c=1, getn(g_VFSFiles) do
- strFileName=g_VFSFiles[c][1];
- iVfsCRCCheck=cf_GETFILECRC(strFileName);
- if (iVfsCRCCheck~=0) then
- cf_l_DELETE(strFileName);
- end
- end
- g_PatchInfo={};
- g_PatchInfo[1]={"TRose.exe",
- -1805721449,
- "TRose.zip",
- ""};
- g_PatchInfo[2]={"TGameCtrl_r.dll",
- 1487682055,
- "TGameCtrl_r.zip",
- ""};
- g_PatchInfo[3]={"Par2Patch.exe",
- 106161604,
- "Par2Patch.zip",
- ""};
- for i=1, getn(g_PatchInfo) do
- strFile=g_PatchInfo[c][1];
- nCrc=g_PatchInfo[c][2];
- strZipName=g_PatchInfo[c][3];
- strDelDir=g_PatchInfo[c][4];
- iExeCRC=cf_GETFILECRC(strFile);
- if (iExeCRC~=nCrc) then
- cf_l_DELETE(strFile);
- lua_DN_EXT_DEL2(ExePath, strZipName);
- cf_l_DELETE(strZipName);
- LoadFlag=1;
- if (strDelDir~="") then
- cf_l_DELETE(strDelDir);
- end
- end
- end
- g_LuaFiles={};
- g_LuaFiles[1]={"RoseOnline.lua",
- -1873047095,
- "SHOLua.zip",
- ""};
- for x=1, getn(g_LuaFiles) do
- strFile=g_LuaFiles[c][1];
- nCrc=g_LuaFiles[c][2];
- strZipName=g_LuaFiles[c][3];
- strDelDir=g_LuaFiles[c][4];
- iExeCRC=cf_GETFILECRC(strFile);
- if (iExeCRC~=nCrc) then
- cf_l_DELETE(strFile);
- lua_DN_EXT_DEL2(ExePath, strZipName);
- cf_l_DELETE(strZipName);
- LoadFlag=1;
- cf_l_EXIT("RoseOnline.exe", strDelDir);
- if (strDelDir~="") then
- cf_l_DELETE(strDelDir);
- end
- end
- end
- g_BaseVers={};
- g_BaseVers[1]={762,
- "SHO762.zip"};
- g_BaseVers[2]={763,
- "SHO763.zip"};
- g_BaseVers[3]={764,
- "SHO764.zip"};
- g_BaseVers[4]={765,
- "SHO765.zip"};
- g_BaseVers[5]={766,
- "SHO766.zip"};
- g_BaseVers[6]={767,
- "SHO767.zip"};
- g_BaseVers[7]={768,
- "SHO768.zip"};
- g_BaseVers[8]={772,
- "SHO772.zip"};
- g_BaseVers[9]={773,
- "SHO773.zip"};
- g_BaseVers[10]={774,
- "SHO774.zip"};
- g_BaseVers[11]={775,
- "SHO775.zip"};
- g_BaseVers[12]={777,
- "SHO777.zip"};
- g_BaseVers[13]={778,
- "SHO778.zip"};
- g_BaseVers[14]={779,
- "SHO779.zip"};
- g_Par2Patch={};
- g_Par2Patch[1]={752,
- "SHO752.PAR2",
- " r -q -q SHO752.PAR2"};
- g_Par2Patch[2]={760,
- "SHO760.PAR2",
- " r -q -q SHO760.PAR2"};
- g_Par2Patch[3]={761,
- "SHO761.PAR2",
- " r -q -q SHO761.PAR2"};
- iVer=cf_l_VFS_CURVER(g_szVFS);
- iBaseCNT=getn(g_Par2Patch);
- if (iBaseCNT>0) then
- for j=1, iBaseCNT do
- iBaseVer=g_Par2Patch[c][1];
- if (iVer<iBaseVer) then
- PatchFile=g_Par2Patch[c][2];
- PatchTarget=g_Par2Patch[c][3];
- iFileTest=cf_GETFILECRC(PatchFile);
- if (iFileTest==0) then
- cf_l_MESSAGEBOX("Patch v0."..iBaseVer.." will start downloading. The launcher may appear frozen, simply leave it running and the patch will complete. Manual patches can also be found on our website http://www.sevenhearts.net. "Warning", 1);
- if (0==cf_r_DN2FILE(g_szURL, PatchFile)) then
- cf_l_PRINT("ERROR: in Base Version Patch");
- do return end;
- end
- end
- if (iFileTest~=0) then
- cf_l_MESSAGEBOX("Patchfile v0."..iBaseVer.." found. The installation may take several minutes to complete. Don't close the patching window while it's running!", "Warning", 1);
- end
- iVer=iBaseVer;
- cf_l_EXIT("Par2Patch.exe", PatchTarget);
- end
- end
- end
- bBasePatch=false;
- iBaseCNT=getn(g_BaseVers);
- if (iBaseCNT>0) then
- for j=1, iBaseCNT do
- iBaseVer=g_BaseVers[c][1];
- cf_l_VFS_PUSH_PATCH(g_szURL, g_BaseVers[c][2], g_szVFS);
- if (iVer<iBaseVer) then
- cf_l_MESSAGEBOX("Patch v0."..iBaseVer.." will start downloading. The launcher may appear frozen, simply leave it running and the patch will complete. Manual patches can also be found on our website http://www.sevenhearts.net. "Warning", 1);
- bBasePatch=true;
- PatchList=g_BaseVers[c][2];
- if (0==cf_l_VFS_PATCH(g_szURL, PatchList, g_szVFS)) then
- cf_l_PRINT("ERROR: in Base Version Patch");
- do return end;
- end
- iVer=iBaseVer;
- end
- end
- if (bBasePatch==true) then
- cf_l_VFS_CLEARBLANK(g_szVFS);
- end
- end
- cf_l_STARTFILE("TriggerDetect.exe", "@TRIGGER_SOFT@ _server arua.sevenhearts.net");
The sevenhearts is the only Irose/krrose server which still uses this methode, I never used EVO so i don't know if the official servers still work like this.
In your client directory theres an lua file called RoseOnline.lua, if you open it with notepad you see:
ScriptURL = "http://updates.sevenhearts.net/~sevenhearts.bin"
~sevenhearts.bin is a compiled lua file which you can decompile to get the original file back
If you open the ~sevenhearts file after decompiling it in notepad you see
the first line points at the update site where the clients downloads the files for updating
than there's some functions and after that a file list which is crc checked
if the crc is wrong it is deleted and downloaded again
than the lua file roseonline.lua is crc checked and downloaded again if it fails
after that there's a list of zip files which contain par2 files, these files update the VFS as a whole and not the seperate files in the vfs, the par2patch.exe is used for that.
than there's zip files wich contain parts of filenames, like SHO762.zip contains the file 762
if you open the 762 file in a hex editor you can see that the first 4 bytes is the patch number
FA02 0000 = 0 762
the 6th byte is 05 which means 5 files to update
followed by a number 01FA0200 (this is part of the filename as you see in the updatewindow i think)
and a number FF FFFA 02 which is an opcode of the type of update(i think)
than two bytes containing the path length of the destination file 1E00 = 30, the path and filename 3Ddata\Item\LIST_FIELDITEM.ZSC, path length of the destination VFS 0A00, name of the VFS container 3DDATA.VFS
after that is the next file

and the final line is the command which is run when you click the play button(I think)
cf_l_STARTFILE("TriggerDetect.exe", "@TRIGGER_SOFT@ _server arua.sevenhearts.net");
edit: the CRC number is a CRC-32 and its a Signed Long
g_PatchInfo[1]={"TRose.exe",
-1805721449, //CRC number
"TRose.zip",
""};
and how the client knows at which rev number it is
if anyone is interested I can explain how to decompile and compile the lua file