Jump to content

Troubleshooting ET vanilla browser connection


Napoleon
 Share

Recommended Posts

  • Staff

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

Link to comment
Share on other sites

  • Staff

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.

 

Link to comment
Share on other sites

  • Staff

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.

Link to comment
Share on other sites

  • Napoleon changed the title to Troubleshooting ET vanilla browser connection (practical dead end)
  • Staff

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);
		}
	}
  • Like 1
Link to comment
Share on other sites

  • Staff
6 hours ago, Bier said:

Maybe call a batchfile first which does the stripping, which then starts et...?

That seems like a good solution! :classic_laugh:

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. :1106:

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...

 

  • Like 1
Link to comment
Share on other sites

  • Staff
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:1106:

update1 it works in desktop directory and not in the et.exe directory. windows :1106:

update2: its a space that causes the issue :1106:

Link to comment
Share on other sites

  • Staff
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:1106:

it works in desktop directory and not in the et.exe directory. windows :1106:

Or rights maybe?

Link to comment
Share on other sites

  • Staff
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! :)

 

Link to comment
Share on other sites

  • Staff

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

Link to comment
Share on other sites

  • Staff

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...

Link to comment
Share on other sites

  • Staff

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%"

 

Link to comment
Share on other sites

  • Staff
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..
 

Link to comment
Share on other sites

  • Staff

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.

Link to comment
Share on other sites

  • Staff
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...

Link to comment
Share on other sites

  • Staff
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:/. :classic_laugh:

testing a copy I have on a different drive and it still fails.

Link to comment
Share on other sites

  • Napoleon changed the title to Troubleshooting ET vanilla browser connection

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...