Ets|Members Napoleon Posted September 19, 2020 Ets|Members Share Posted September 19, 2020 These should be the magic four registry keys added during installation of ET legacy. Exporting these from my registry and readding them with a different name and altered key has so far resulted in a boot of et vanilla, only no direct serverconnection. WriteRegStr HKCR "et" "URL Protocol" "" WriteRegStr HKCR "et" "" "URL: Enemy Territory Protocol" WriteRegStr HKCR "et\DefaultIcon" "" "$INSTDIR\etl.exe" WriteRegStr HKCR "et\shell\open\command" "" "$INSTDIR\etl.exe +set fs_basepath $\"$INSTDIR$\" +connect $\"%1$\"" Apparently HKEY_CLASSES_ROOT is abbreviated as HKCR. et is the name of the key INSTDIR is abbreviated installation directory, which is a variable depending on your choice here +connect should make sure that the ip in the browser is send to the application Added exported regedit keys: Not sure if the HKCR/Applications/et_x contribute but I found the legacy entry and made an et vanilla one, on the off chance that it also contributes HKCR_etL.reg HKCRapplication_etL.reg HKCRapplication_etvanilla.reg HKCRetvanilla.reg Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 20, 2020 Author Ets|Members Share Posted September 20, 2020 Important to note that the method is called: custom URI schemes The actual problem is at this stage that the ip argument is not passed to ET vanilla. Where ET legacy is succesful, the vanilla fix doesnt work. Both ET vanilla and legacy can directly connect to an ip using a modified shortcut. See this topic. So the question is where does the argument get dropped. Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 20, 2020 Author Ets|Members Share Posted September 20, 2020 Apparently the whole URI et://108.61.18.109:27920 is passed to the progam. ETL can process this, but ET vanilla can't handle this. The two options I see is: -the register should delete the first part if someone knows how. I'm open to suggestions. -ET should be modified to accomdate the whole link. I found the part in the ETL code where they strip the et:// part, this might be altered/copied for ET. Then the entire code would have to be recompiled. Not too unfamiliar with this, but also seems unlikely to be used by many. Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 20, 2020 Author Ets|Members Share Posted September 20, 2020 The code snippet I mentioned is in lines 887-915 in src/client/cl_main.c in et legacy source code. In The cl_main.c from et vanilla this part is non existent // Game started as a custom protocol handler for et://<ip>[:port][/password][?session] if (!Q_stricmpn(server, "et://", 5)) { char *address = strlen(server) > 5 ? &server[5] : NULL; char *password = address ? strstr(address, "/") : NULL; if (password > address) { *password++ = '\0'; } else { password = NULL; } if (address) { server = address; } if (password) { if (strlen(password) + 1 > MAX_CVAR_VALUE_STRING) { Com_Error(ERR_DROP, "CL_Connect_f: MAX_CVAR_VALUE_STRING exceeded"); } Cvar_Set("password", password); } } 1 Quote Link to comment Share on other sites More sharing options...
Administrators kate Posted September 20, 2020 Administrators Share Posted September 20, 2020 good work and very great to always trying to learn something new 1 Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 Maybe call a batchfile first which does the stripping, which then starts et...? 1 Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 6 hours ago, Bier said: Maybe call a batchfile first which does the stripping, which then starts et...? That seems like a good solution! I can use a batch file file to split off the et:// part now. Apparently having spaces in directory names is an issue on its own for batch files. The batch file can also start the program now. The plan is to have an additional batch file that can add the needed registry keys to allow the URI scheme to point to the batch file. This will probably save some headaches. To be continued... 1 Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 You can cut up the string in parts using the %1, %2, %3 placeholders. If it needs to get dirtier that this maybe check out this link: https://www.robvanderwoude.com/ntfortokens.php Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 35 minutes ago, Bier said: You can cut up the string in parts using the %1, %2, %3 placeholders. If it needs to get dirtier that this maybe check out this link: https://www.robvanderwoude.com/ntfortokens.php From what I can see it works now, not really sure how or why. Am currently working on batch file that writes to registry. again problems... probably related to spaces again update1 it works in desktop directory and not in the et.exe directory. windows update2: its a space that causes the issue Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 23 minutes ago, Napoleon said: From what I can see it works now, not really sure how or why. Am currently working on bash file that writes to registry. again problems... probably related to spaces again it works in desktop directory and not in the et.exe directory. windows Or rights maybe? Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 7 minutes ago, Bier said: Or rights maybe? I wondered about that. I moved the batch file into a new folder on desktop with a space in the file name. Failed. edit1: Also the reason for update 2, thats how I tested it :) By the way thanks for the input, is appreciated! :) Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 Ill try.. :-) We'll get there! Are you using quotes around the path/file names with spaces...? Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 Yes. I can write spaces to registry without issue from a spaced directory, e.g. w ow I can write C:\Users\[napo]\Desktop\et.exe +set base_path "C:\Users\[napo]\Desktop\" to registry from desktop directory I can write w ow from "C:\Games\Wolfenstein ET2\" to registry I can't write C:\Users\[napo]\Desktop\night mare\et.exe +set base_path "C:\Users\[napo]\Desktop\night mare\" to registry from desktop directory I can't write C:\Games\Wolfenstein ET2\et.exe +set base_path "C:\Games\Wolfenstein ET2" from the ET directory Edit1: Perhaps the issue is how I write the path. Statically I can write C:\w ow\ to registry, but current path with ~dp0 gives problems Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 I can write C:\Users\[napo]\Desktop\et.exe +set base_path "C:\Users\[napo]\Desktop\" to registry from desktop directory ----------------------------------- > no space in this part I can't write C:\Users\[napo]\Desktop\night mare\et.exe +set base_path "C:\Users\[napo]\Desktop\night mare\" ------------------------------------------------ > there is a space in this part No quotes needed here? I can't write C:\Games\Wolfenstein ET2\et.exe +set base_path "C:\Games\Wolfenstein ET2" from the ET directory ------------------------------------- > also space in this part Just thinking out loud... Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 Edit1: I think the ~dp0 might have an underlying issue with spaces. I'll put my current code here: @echo off setlocal enableextensions enableDelayedExpansion set cur_path="%~dp0" set cur_path_et="%~dp0vanilla_stripper.bat" set variable0="+set" set variable1="fs_basepath" set variable2="+connect" set stringedtogether="%cur_path_et% %variable% \%cur_path% %variable2% " rem \"%1\""" echo %cur_path% echo %cur_path_et% echo %variable0% echo %variable1% reg add "HKEY_CLASSES_ROOT\etj" /t REG_SZ /d "URL: Enemy Territory Stripper Protocol" /f reg add "HKEY_CLASSES_ROOT\etj" /t REG_SZ /v "URL Protocol" /f reg add "HKEY_CLASSES_ROOT\etj\DefaultIcon" /t REG_SZ /d "%cur_path_et%" /f reg add "HKEY_CLASSES_ROOT\etj\shell\open\command" /t REG_SZ /d "%cur_path_et% %variable0% %variable1% "%cur_path%" Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 dp0 is indeed causing the issue Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 set stringedtogether="%cur_path_et% %variable% \%cur_path% %variable2% " rem \"%1\""" ""C:\Users\Ron\vanilla_stripper.bat" \"C:\Users\Ron\" "+connect" " rem \"\""" Adding the strings to stringedtogether nicely preserves the quotes... Hmm.. I cannot asses the validity of the resulting string as i dont know what happens there.. Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 1 minute ago, Napoleon said: dp0 is indeed causing the issue Ah.. really?? Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 2 minutes ago, Bier said: Ah.. really?? yeah... switching to fs0 is already promising. dp0 on stackoverflow Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 used dps0 now, s to include shortening. It will now write to the registry. Not sure what happens if a space is very early in the directory name, but I think (fully aware assumption is the mother of all fuck ups) that most have Wolfenstein Enemy Territory as directory name for vanilla et. So the problem should be rare if it arises at all. Edit: will see if i can get it to work combined now. Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 Sound good! Fingers crossed for the last step! :-) Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 Unfortunately peanut butter. Though its a new problem. Quote Link to comment Share on other sites More sharing options...
Moderators Bier Posted September 21, 2020 Moderators Share Posted September 21, 2020 .bat files not coupled to cmd.exe by default? C:\WINDOWS\system32/etmain ? That cannot be right... Man, what a pit of snakes!! Lets play a few maps... Reset your mind... :-) Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 3 minutes ago, Bier said: .bat files not coupled to cmd.exe by default? C:\WINDOWS\system32/etmain ? That cannot be right... Man, what a pit of snakes!! Hmm the cmd.exe, you might be on to something there. cmd.exe proved to be somewhat problematic in the past. I ran it from the powershell. Yes, that was quite the surprise. Yeah... Quote Link to comment Share on other sites More sharing options...
Ets|Members Napoleon Posted September 21, 2020 Author Ets|Members Share Posted September 21, 2020 1 hour ago, Bier said: .bat files not coupled to cmd.exe by default? C:\WINDOWS\system32/etmain ? That cannot be right... Man, what a pit of snakes!! Lets play a few maps... Reset your mind... :-) It indeed calls the directory cmd.exe is in for its execution, this the directory that sticks. With this in mind I have rewritten a couple of things and booked preliminary success of getting it to work for C:/. testing a copy I have on a different drive and it still fails. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.