Jump to content

Improvements for the dedicated server


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):


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:

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

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...
Posted (edited)

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

Vanilla command "visitmap" (see its help for detaills). Note that it will create all chunks for the world so can increase the size of the save considerably.

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