Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work in progress data saving and VNC #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

robinduckett
Copy link
Collaborator

Work in progress data saving and VNC

Data saving doesn't currently work, I think the Docker volumes are to blame when sharing with the host container. Figuring out a way to run a docker commit to another docker image with the saved data upon saving the world, to then run to copy out the files from /root/.dockingstation since the dirs in the install directory don't seem to have the save data

@pushfoo
Copy link
Member

pushfoo commented May 29, 2020

My first reaction is that I'm not sure that including the offline login hack makes sense for a base image that others build off of. I'm going to look at this more and try to get the repo working on my machine before I make further judgements.

@robinduckett
Copy link
Collaborator Author

As long as creatures.net is owned by some domain squatter, we can't even run a DS server where it needs to be, so we either need the offline hack otherwise you're effectively stuck at the login page.

Maybe this is fine initially, but this is a WIP branch that should not be merged, mostly for the third party offline login hack, which we will need to replicate or find another way around.

@pushfoo
Copy link
Member

pushfoo commented May 29, 2020

You're right that we need to make a new launcher / installer script to get around the domain squat.
As to how I deal with the issue, I inject a pair of CAOS scripts Aiko gave me a while back to A) create a new world and B) load it. It lets me keep my initial install as close to stock as possible when testing things. If @Amaikokonut is fine with it, I can BSD 0 (public domain) them as a gist or whatever permissive license they'd prefer.
I was planning on putting the scripts into pyc2e and eventually wherever world management ends up. From our past discussion i think we agreed on a C/C++ lib other languages can bind should manage worlds.

@Amaikokonut
Copy link
Member

Fine by me!

It might be also worth mentioning that the offline hack isn't terribly hard to replicate, if you need someone to do that, let me know.

@daleglass
Copy link

The creatures.net issue could be worked around by patching the binary. Just register a domain the same length or shorter for the server.

Alternatively, one could use LD_PRELOAD to intercept the domain resolution.

@pushfoo
Copy link
Member

pushfoo commented May 29, 2020

I'm pretty sure the URL fetching is in instalblast.exe or some launcher on windows, and a shell script under linux. No binary patching needed, just replace what launches the engine. The function from the linux installer script, line 176:

# $1 - Remote file name relative to URL_STUB
# $2 - Local file name
function download()
{
	rm -f "$2"

	if [ -z "$CD_PATH" ]
	then
		if type wget 2>/dev/null >/dev/null
		then
			# If we get failure, we try again verbosely so the
			# user can see the error
			if ! wget --cache=off -q -O "$2" "$URL_STUB$1"
			then 
				if ! wget --cache=off -O "$2" "$URL_STUB$1"
				then
					echo Error performing wget
					download_fail
				fi
			fi
		elif type lynx 2>/dev/null >/dev/null
		then
			ESCAPED_URL=`echo $URL_STUB$1 | sed "s/ /%20/g"`
			if ! lynx -source "$ESCAPED_URL" >"$2"
			then
				echo Error performing lynx get
				download_fail
			fi
		else
			echo "You need either wget (preferably) or lynx installed."
			echo "These are standard pieces of software which you should"
			echo "be able to install using the normal method for your"
			echo "distribution."
			exit 1
		fi
	else
		# Install from CD or tarball
		cp "$CD_PATH/$1" "$2"
	fi
}

I was going to imitate how the installer sets up the config in pyc2e as a prototype for c2e virtualenv before moving it to c++ somewhere, maybe in openc2e.

@daleglass
Copy link

There's a reference in lc2e-netbabel.so to heart.creatures.net, is that of any concern?

@robinduckett
Copy link
Collaborator Author

@daleglass looks like it may be a server health check URL, may want to patch it out with our scripts, or build in albianwarp support from get go

@pushfoo
Copy link
Member

pushfoo commented May 29, 2020

I think there was a number that kept incrementing in some old packet dumps i once had. It seemed like an activity check feature i've read about in other protocols. Maybe heart is related? I don't remember seeing that behavior implemented in rebabel, so it might not be needed. It might be there though, the code is somewhat hard to read. Refactoring or replacing the codebase for that is an eventual goal of mine after prayer, a dependency, is cleaned up. The current states of both are understandable as they were (iirc) built on by a C/C# programmer developer who got them second hand from someone else.

@pushfoo
Copy link
Member

pushfoo commented May 29, 2020

I think there were was also support for multiple creatures warp servers that may have been round robin loadbalanced. Heart may have been the canonical reference server that data about other servers was downloaded from, or used when others weren't available.
We should ask around for people's old DS install directories to confirm, as I think I inferred this from a servers.cg file from an ancient win98 install I no longer have. :(

@pushfoo
Copy link
Member

pushfoo commented Jun 2, 2020

@robinduckett In the interest of not worrying about each other's changes, i'd like to merge this if the following things can be made true:

  1. the vnc option is easier or more reliable than getting x forwarding to work
  2. the login patch can be made optional

The first seems to already be true since x forwarding needed some strange local hacks on my machine. I'm also assuming VNC clients need fewer permissions to set up than xquartz.
The second seems easy if I understand things correctly. If the nologin patch only adds files to bootstrap, couldn't you make another docker file that uses the ds install image as a base and adds the patch on top?

@pushfoo
Copy link
Member

pushfoo commented Jun 2, 2020

Also, if you want i can post my changes on another branch so you can try them on your side. I think running different versions of the docker stack may be why i had to do things differently.

@pushfoo
Copy link
Member

pushfoo commented Jun 4, 2020

If you'd prefer to wait a bit, there's no longer a rush to merge this. Once I get pyc2e and a few things more developed, i'll want to revisit docker. For now though, docker isn't as urgent for me as someone figured out how to make DS run on ubuntu and debian fairly reliably. It's easier to work on those projects from a VM, for now. We might even want to adopt some of that work for the docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants