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

Make TMNF/UF egg fully functional #1

Closed
treierxyz opened this issue Dec 29, 2020 · 22 comments
Closed

Make TMNF/UF egg fully functional #1

treierxyz opened this issue Dec 29, 2020 · 22 comments

Comments

@treierxyz
Copy link
Contributor

I can't seem to get the TMNF/UF egg working, something seems to be wrong with the install script. Any help would be appreciated.
log.txt

@Hoerli1337
Copy link
Owner

Currently it is code garbage and nothing works.
This is also due to the fact that the documentation is wrong in the important places and I am currently only by try & error.

At the moment the download of the gamefiles works again and actually you should be able to start the server.
But it doesn't load the matchsettings yet (gets stuck there).

The variables seem to work 80%, on some installations e.g. the username for the server login is not yet passed correctly.
You can test it if you like.

If some coding skills are available, I'm always grateful for help.
I know absolutely nothing about Docker and I don't think we'll be friends anytime soon ;)
I'm glad that something works at all.

@treierxyz
Copy link
Contributor Author

Wow, I didn't expect progress this soon! Thank you for dedicating time onto this project again!

I myself am not familiar with how Pterodactyl eggs and Docker exactly work either, but I will read the documentation and try to help where I can. I can be of assistance with testing, possibly also with coding if I get the hang of it.

Getting a working egg for TMF would make running a server 100x easier and I would be very grateful for that.

@treierxyz
Copy link
Contributor Author

I was getting 500 Server Error when importing the updated egg but it turns out that was caused by my server still being on v1.1.3, upgrading to v1.2.0 fixed it.

@Hoerli1337
Copy link
Owner

With older versions I have not tested it at all.
I have Pterodactyl freshly installed to finish the Egg.
Good to know that it does not seem to work with v1.1.3.

@treierxyz
Copy link
Contributor Author

I got this far, crashes instantly after launching.
log.txt
Trackmania logs don't give much either...
ConsoleLog.15.txt
It didn't add the server username indeed, but adding it manualy didn't change anything.

Speaking of which, I have tried to set up a Maniaplanet server with NoxInmortus/docker-trackmania and noticed that it has the same exact problem, the username doesn't get parsed.

@treierxyz
Copy link
Contributor Author

I got the username working, I replaced the variable MASTERSERVER_ACCOUNT with MASTERSERVER_ACCOUNT_USER and now it works.

It could be that having MASTERSERVER_ACCOUNT causes some conflicts because there are variables with MASTERSERVER_ACCOUNT + _xyz? Anyway, I recommend replacing the variable MASTERSERVER_ACCOUNT with for example MASTERSERVER_ACCOUNT_USER like I did or anything else similar as that seemed to do the trick.

@treierxyz treierxyz changed the title TMNF/UF egg installs incorrectly Make TMNF/UF egg fully functional Jan 2, 2021
@Hoerli1337
Copy link
Owner

Hoerli1337 commented Jan 3, 2021

Thanks for your feedback!
I actually used the Egg for ManiaPlanet as a template and tried to get this to work somehow.
Changing the variable might help with the problem with the names.

I'm guessing the server is still missing a package in the system, but I can't tell which one.
Just crashing on load without a log is not exactly normal for a TM server.

I have also extended the variables to change other values.

@treierxyz
Copy link
Contributor Author

With the changes I made in #3 I got the basic server working. Please review these changes and hopefully we can move along to implementing XAseco.

@Hoerli1337
Copy link
Owner

Just checked it!
It works! Finally ... :)

Will now sit down and try to implement xAseco.
I still have to think about how to do the whole thing with the database.
Whether I pack a database server (mariadb) in the container or implement nothing and require this, so that xaseco works.
Should be safe in the end.

@treierxyz
Copy link
Contributor Author

I've already been toying around with XASECO on the egg, it can be manually set up with no problems.

For the database, I used Pterodactyls database feature. You set up a user for Pterodactyl to manage the databases and add that user in Pterodactyl (you might also need to allow access through your firewall). Then you can create databases for each server and manage them all on your node with phpMyAdmin or whatever. In the server configs, you use the IP of the pterodactyl0 interface and the database info from the database you made for the server instance.

I think it would be better to stick with this approach as it seems like the intended way to use databases in Pterodactyl, I'm already doing this for my other eggs so why not this one? Only problem is you can't add these values with variables as you can't make the database before the server is installed, but you could either:

  1. skip the egg installer script initially, add the database and populate the variables, then reenable the install script and reinstall or
  2. let the user set up XASECO configs manually (probably the better and faster option)

This same database implementing automatically problem occurs on any egg, you can't do it without these workarounds according to my knowledge. At the end of the day, it's up to you how you implement this.

@Hoerli1337
Copy link
Owner

Sounds good to me! I will not include a database for now.

Have split the egg now.
Got an egg for a pure TrackMania NF/UF server in case someone doesn't want xAseco.
At least the egg works now clean.
You could change it so that the ports given by Pterodactyl are used instead of free selectable ones and no subfolder exists anymore. Then you could include the start command directly in Pterodactyl.

Created a second egg including xAseco, in which we can now tinker further!
The setup should run so far and known parameters should be written into the configs.
Database and small things are currently still open, since this must set the user himself.

I didn't have time to correct the start command. This does not work at the moment.
I am also not sure if the CronJob is running.
Maybe I will get to it tomorrow.

@treierxyz
Copy link
Contributor Author

I removed the subfolder from the standalone server egg (#4). Please review and merge.

On my manual XASECO install I had issues with stopping the server gracefully, XASECO didn't respond to SIGINT, so I temporarily used SIGKILL. That needs to be figured out. I made a pid file for XASECO so it can be stopped using that.

I found out that you could use this to configure settings for the server. There is not a lot of documentation and the current egg works fine right now, but later on it could be a great addition.

I found another German chap on the Pterodactyl Discord who recently started working on a TM2020 egg and is using this feature, here's a sample of how XML parsing would go from their egg:

{
    "UserData/Config/dedicated_cfg.txt": {
        "parser": "xml",
        "find": {
            "dedicated.system_config.server_port": "{{server.build.default.port}}",
            "dedicated.server_options.name": "{{server.build.env.SERVER_NAME}}",
            "dedicated.server_options.max_players": "{{server.build.env.MAX_PLAYER}}",
            "dedicated.server_options.max_spectators": "{{server.build.env.MAX_PLAYER}}",
            "dedicated.masterserver_account.login": "{{server.build.env.MASTER_USER}}",
            "dedicated.masterserver_account.password": "{{server.build.env.MASTER_PASS}}"
        }
    }
}

For now, though, this is not a priority and can be implemented later.

@Hoerli1337
Copy link
Owner

Thanks!

I have already looked at that with the parsing of the Config.
But I never had to do with this kind of editing before.
Maybe this is something for version 2, but for now I keep it "simple" for me.

I'm currently trying to start xaseco cleanly in some way without breaking the output in Pterodacyl.
The second start command in start.sh is ignored because the TM server is started in the foreground.
Thus xaseco is never started.
I created two start files start1.sh + start2.sh. start2.sh had the start command for xaseco.
I put in the start-command "start1.sh && start2.sh" to run both files.
With this it worked 1x (10x not) but then I don't have the output in pterodactyl to set the server as "online".
I am currently trying in vain to create a CronJob which should call the auto-restart.sh.

Do you have any idea to start it?

(PS: Don't have and use Discord, maybe I would have found the german chap ;) )

@treierxyz
Copy link
Contributor Author

Yea, I tried the same thing, mashing shell scripts together, but it ain't pretty. Need to do some research, look at other eggs for examples of how they do it.

Also the "German chap" is @DatMayo on GitHub, sorry for the mention but hey, maybe this egg could be useful for your TM2020 egg?

@DatMayo
Copy link

DatMayo commented Jan 6, 2021

What the heck?
@Hoerli1337 if you want, we can participate on this PR :)

@Hoerli1337
Copy link
Owner

Yes gladly :)
Would be very happy about it.
Maybe we get the Egg together somehow.

@DatMayo
Copy link

DatMayo commented Jan 6, 2021

I sent you a DM on Discord, its better then communicating via ticket :)

@treierxyz
Copy link
Contributor Author

treierxyz commented Jan 6, 2021

@DatMayo I actually have a fully working Maniaplanet + PyPlanet egg here which could help and also a draft PR for the original repo (nevermind, they didn't like my changes that I included so I won't merge there).

@DatMayo
Copy link

DatMayo commented Jan 9, 2021

Thx for your response, I'll have a look into it over the next days :)

@Hoerli1337
Copy link
Owner

Hoerli1337 commented Jan 9, 2021

If i start xaseco first and then the tm-server it works :)
I may have to add a delay to the startup in xAseco itself so that the TM server can be started safely.
You only need to setup the database and enter the credentials, enter your tm master-acc and you ready to go.

Now I just need to get this working with the automatic restart of xaseco somehow.

@Hoerli1337
Copy link
Owner

I closed the issue because with the current setup of Pterodactyl it is not possible to cover everything in one Egg.
Unfortunately I can't manage to start the TM server with xaseco and its dependencies cleanly.
If anyone has more luck with this, I'm happy to hear ideas or solutions.

@Hoerli1337
Copy link
Owner

UPDATE: There is now an Egg available, which includes TM NF / UF and xaseco in version 1.16.

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

No branches or pull requests

3 participants