Jump to content

Improvements for the dedicated server


Alloc

Recommended Posts

On 12/16/2021 at 9:58 PM, LewZephyr said:

Are you getting any errors?  Mine seemed to run up fine, but Haven't had a chance to actually connect to server as a player.

It may not need an update for this version jump.

site have problem with claims and inventory to show up properly only this. i hope you fix it as fast as possible ;)

Link to comment
Share on other sites

On 11/3/2021 at 8:27 AM, Alloc said:

Of course it will be at least maintained (hopefully extended somewhat ;) ). At some point most of it will probably move to the core game, with just minor parts staying as a mod to show how to do some stuff in mods.

Hello Sir. Been using you fixes for years. On 20 any link I find to the  20 version the links seem to be dead. where may I find the best link to it if it's available. . I still have your POWERSHELL installer some where.

Link to comment
Share on other sites

Hi, hoping someone could help with an issue I encountered with Alloc's server mods -- also I'm sorry if this has been answered previously.

 

I manage a server that has Alloc's fixes and a UI mod, and other than that, vanilla files. The BloodMoonFrequency was set to 7, and on day 71 (a day after the BM on day 70) I used the console to enter ```setgamepref BloodMoonFrequency 10```, and then updated the serverconfig.xml to match. After restarting and logging in to the server, using the console I could see that the Blood moon was scheduled for day 80 as expected.

However, when I went to the Alloc webserver map, it was incorrectly showing the next blood moon occurring with the previous frequency (7) and the next blood moon occurring on day 77.

 

Is there any way to manually update Alloc's server to reflect the correct BM frequency?

I saw this open ticket on Alloc's Trac site (but I wonder if this update only queries the BM frequency once when the server is created?):  https://7dtd.illy.bz/ticket/163

 

Here's a picture (I would have taken a screenshot but the tooltip disappeared when I used the keyboard shortcut for the snipping tool):

spacer.png

Link to comment
Share on other sites

Oh, someone reading docs/tickets first finally :)

As it says this behaviour unfortunately is hardcoded in the web files currently (think only stats.js). You would have to change the calculations there. Buuut ... this will only work if whatever schedule runs is a) static (i.e. no bloodmoon range set) and b) is not offset to zero (e.g. if you had the default bloodmoon frequency of 7 but for some reason the next one would be on 76 or 78 instead of 77 it would break). For you it should work if the next one is really on day 80 for a frequency of 10. Would only need to change line 41 of stats.js to a proper calc, something like "(10 - gametime.days) % 10".

 

The real fix is to actually query the correct data from the server which is what the ticket is for but had not gotten around to that one yet unfortunately. Would not even be hard to implement but mostly forgot about it ;)

Link to comment
Share on other sites

Hey thanks for the quick reply.

(I do try to figure this stuff out on my own before asking questions)

Unfortunately, I'm not a software dev and I don't know much about JS, so you might need to hold my hand a bit more.

I tried editing stats.js but I'm just too dumb to fix the calculation.

 

Here's the function blocks I think are involved:

 

function DayOfWeek (days) {
        return days % 7 > 0 ? days % 7 : 7;
}

 

function TimeTitle (gametime) {
	var daynames = ["", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Bloodday"];
	var dayOfWeek = DayOfWeek (gametime.days);
	var result = "";
	// Show days til blood moon:
	result += (10 - dayOfWeek) + " days til blood moon\n";
	// Show day of week (number):
	result += "Day of week: " + dayOfWeek + "\n";
	// Show day of week (name):
	//result += daynames[dayOfWeek];
	return result;
}

 

I edited the line you pointed it, but it looks like that function is working with the DayOfWeek and dayOfWeek variables, and the whole thing goes sideways if a week in the game is 10 days. 

Obviously, this isn't a major issue but if there's something else you see that I could edit, please let me know! 🙃

 

Edit: BloodMoonRange is 0 and BloodMooonFrequency is 10

Edit 2: I see that you already gave a solution! Sorry, must have missed that. I'll put that in and try again.

Edited by mcpeen (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hello all,

I have a strange problem on my WebMap.

I made the following settings in the webpermissions.xml:

<permissions>
	<permission module="webapi.getlog" permission_level="0"/>
	<permission module="webapi.executeconsolecommand" permission_level="0"/>
	<permission module="webapi.viewallplayers" permission_level="0"/>
	<permission module="webapi.viewallclaims" permission_level="0"/>
	<permission module="webapi.getplayerinventory" permission_level="0"/>
	<permission module="web.map" permission_level="2000"/>
	<permission module="webapi.getstats" permission_level="2000"/>
	<permission module="webapi.getplayersonline" permission_level="2000"/>
	<permission module="webapi.getplayerslocation" permission_level="2000"/>
	<permission module="webapi.getlandclaims" permission_level="2000"/>
	<permission module="webapi.gethostilelocation" permission_level="2000"/>
	<permission module="webapi.getanimalslocation" permission_level="2000"/>
</permissions>

i also get all the data delivered from the corresponding endpoints, but the endpoint getplayerslocation always returns an empty array, even if players are online.
Have I set something wrong?

Link to comment
Share on other sites

I suppose you mean for non-admin users (i.e. including those not logged in to the page) it does not show anyone?

The getplayerslocation and getlandclaims APIs are a bit special as by default they only show the own position / claims (thus nothing for non logged in users as they obviously don't have a position/claim). To view all the webapi.viewallplayers / viewallclaims have to be set for the user. In case you want *everyone* to see *ever* position (claim) you need to set those to 2000.

Link to comment
Share on other sites

  • 2 months later...

@Alloc Or whomever else that can answer,
I'm not sure if this is the correct thread to post in but here we go:

I'm trying to look at the heatmap info. Double F8 works with debug mode enabled in SP, but it does not work on my dedicated server. Looking around online in various forums, etc, that seems to be the common theme.

Is there any way to manually go about pulling that data via a console command or reading the save files somehow? I did look around on tractickets and found this: https://7dtd.illy.bz/ticket/147 (adding a layer to the alloc web map) which would be baller, but it seems that ticket didnt catch any traction.

Link to comment
Share on other sites

As you noticed I haven't really looked into that, but I don't see why adding such a layer would be an issue. Just needs some code to pull that data and provide it to the web frontend. Though most likely it would only work in areas around online players as I think the data is stored with the chunks. Meaning the data is only available when those chunks are loaded which in turn is only around players. Will definitely keep an eye on that one, might get done in one of the next updates maybe :)

Link to comment
Share on other sites

  • 1 month later...

Hi there,

 

i installed "Alloc's server fixes" on my Deticated Linux Server and all Works fine include Webmap.

And for the first: Thank you for this nice Tool/Addon ^^

 

The map rendering to image files as people visit the different places works fine too.

 

Now my question:

Is there a way to render the complete map even if there were no players yet in unknown places?

 

Thanks in advance.

 

 

Edited by Flux (see edit history)
Link to comment
Share on other sites

  • 1 month later...

There are major changes planned but not even remotely close to a point to announce a release timeline.

 

The current version should work just fine for the time being, at least not seen any reports of issues with 20.5 (other than possibly having to delete the data file when migrating from < 20.4).

Link to comment
Share on other sites

  • 2 months later...

I am having some issues with the map server resetting the players list. As a consequence I am losing a lot of valuable historic information regarding player usage etc. Any ideas? I have been using it for many years, it used to happen on the very rare occasion but, recently it has been occurring about once a week.

 

Link to comment
Share on other sites

Hm, first time I've read such a complaint (other than some issues with the IDs being a bit of a nuiance). Not saying this could not be the case but I don't see how it would happen without at least an appropriate error/exception being logged at that point.

 

I am aware though that the current system for storing that data really sucks but I can promise it's definitely going to be different soon(TM) ;)

Link to comment
Share on other sites

  • 8 months later...

Hello alloc, ive been making a serverside app that scrapes the web data, grabs each person and there co-ordinates and compares it again my home area coordinates, and then moves them to either the indoor or outdoor discord channel.

it works well but its slower then i would like, so instead i wanted to go straight through the web api, but as i dont have the web api token im sort of stuck.

is there anyway i could get that web api token? or reset it?


any help would be greatly appreciated

 

Edited by Deadsimon (see edit history)
Link to comment
Share on other sites

19 hours ago, Alloc said:

That token is something you set up yourself. Have a look at the "webtokens" console command for setting it up, then you just pass that data to the API requests.

is there any documentation on this webapi, as i cant seem to find much about it that isnt CSM or catalyst.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...