• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Improvements for the dedicated server

Can you post some screenshots? I'm curious how the hostiles and animals look on the map. It's one thing to show two dozen players. But now in addition to players, it will show 50+ zombies and 50+ animals simultaneously?
I can tonight or tomorrow -- out most of today, but they cluster on their layer just like players do when there's more than one in close proximity.

 
I threw your fork on my server, and the /api/getplayerslocation is returning a 500 error. The server logs show a Null Reference error. Windows PC running 12.5

 
I don't suppose I could talk you into using some kind of a lightweight database instead, like sqlite or nosql or something? Thanks!
Planned, but more likely when we update the player storage in the core game ;)

 
I threw your fork on my server, and the /api/getplayerslocation is returning a 500 error. The server logs show a Null Reference error. Windows PC running 12.5
Let's see your web permissions config?
 
Let's see your web permissions config?
I think I have it setup so that anyone can view maps, status, player locations, etc, but not the log.

<?xml version="1.0" encoding="UTF-8"?>

<webpermissions>

<admintokens>

<!-- <token name="adminuser1" token="supersecrettoken" permission_level="0" /> -->

</admintokens>

<permissions>

<!-- <permission module="webapi.executeconsolecommand" permission_level="0" /> -->

<!-- <permission module="webapi.getplayersonline" permission_level="1" /> -->

<!-- <permission module="web.map" permission_level="1000" /> -->

<permission module="web.map" permission_level="2000" />

<permission module="webapi.getstats" permission_level="2000" />

<permission module="webapi.getplayerslocation" permission_level="2000" />

<permission module="webapi.getlandclaims" permission_level="1000" />

<permission module="webapi.getlog" permission_level="0" />

<permission module="webapi.getplayersonline" permission_level="2000" />

<permission module="webapi.getplayerinventory" permission_level="2000" />

</permissions>

</webpermissions>

 
I think I have it setup so that anyone can view maps, status, player locations, etc, but not the log.
<?xml version="1.0" encoding="UTF-8"?>

<webpermissions>

<admintokens>

<!-- <token name="adminuser1" token="supersecrettoken" permission_level="0" /> -->

</admintokens>

<permissions>

<!-- <permission module="webapi.executeconsolecommand" permission_level="0" /> -->

<!-- <permission module="webapi.getplayersonline" permission_level="1" /> -->

<!-- <permission module="web.map" permission_level="1000" /> -->

<permission module="web.map" permission_level="2000" />

<permission module="webapi.getstats" permission_level="2000" />

<permission module="webapi.getplayerslocation" permission_level="2000" />

<permission module="webapi.getlandclaims" permission_level="1000" />

<permission module="webapi.getlog" permission_level="0" />

<permission module="webapi.getplayersonline" permission_level="2000" />

<permission module="webapi.getplayerinventory" permission_level="2000" />

</permissions>

</webpermissions>
This seems fine (although you are missing most of the new permissions). You should be able to view without an error if the user is logged in.

I see the mistake I made with web viewers who aren't logged in and will fix it ASAP!

 
Same result. Getstats also threw an exception, but those errors appeared in the log before it even loaded the save, so I am guessing they requested stats before the server even had them ready. These though happened after the server was up:

2015-10-07T15:53:31 58.462 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:32 59.623 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:34 61.314 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:36 63.462 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:36 63.756 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:39 66.314 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

 
Same result. Getstats also threw an exception, but those errors appeared in the log before it even loaded the save, so I am guessing they requested stats before the server even had them ready. These though happened after the server was up:
2015-10-07T15:53:31 58.462 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:32 59.623 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:34 61.314 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:36 63.462 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:36 63.756 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object

2015-10-07T15:53:39 66.314 ERR Error in ApiHandler.HandleRequest(): Handler getplayerslocation threw an exception:

NullReferenceException: Object reference not set to an instance of an object
Hmm, bizarre. What happens if you require permission level 1000 for everything (just to test with)... should require you to log in via Steam. Do the errors go away, then?
 
Well the errors do go away when I set the permissions to 1000, but I modified my JS files to no longer allow/require sign in through steam, so I cannot test anything there. It is a public website where everyone sees the same thing which is why most of the permissions were either 0 or 2000.

I then took getstats and map back to 2000, and the site is working again error free, but obviously player positions don't load.

In case it helps, the map is located here. I have all permissions set to 2000 now, except for playerlocations which is 1000 and log which is 0, and I am error free. The moment I enable playerlocations, it starts acting up.

 
You may be stripping out login sessions. Additionally, many (if not all) of the javascript updates I have made aren't present at your website. Specifically, inventory_dialog.js, stats.js, and map.js were updated -- perhaps more. You may also not be including the new marker images (in the leaflet subfolders).

Try copying the included static web files to a test build or mapped to another port so you can test if it's an issue with your code changes or not.

 
Can you post some screenshots? I'm curious how the hostiles and animals look on the map. It's one thing to show two dozen players. But now in addition to players, it will show 50+ zombies and 50+ animals simultaneously?
Here's that screen cap I promised. It uses the built-in clustering to combine markers if they're cramped too close together. You can then click on the cluster count for an expanded view of individual markers. See left/right frames:

hostile_markers.jpg

(full-sized image)

 
So I no longer get null reference errors in my log file, but the /api/getplayerslocation is returning an empty array [] all the time, even when I was logged in briefly.

 
So I no longer get null reference errors in my log file, but the /api/getplayerslocation is returning an empty array [] all the time, even when I was logged in briefly.
That sounds correct. You probably still haven't changed your web permissions, so the default permission set is only going to show web viewers their own location (relative to their logged in Steam ID). Since your customizations don't require Steam logins, it makes sense that they are getting an empty list. Either try with the Steam login or crank up the webapi.viewallplayers permission level to 2000.

 
Since the steam login link doesn't work and I didn't really want to use it anyway, I upped the permissions to 2000. The map shows one player online, but does not add the player to the view able list. The "getplayerslocation" still returns an empty array. We are almost there, I can smell it!

AllocFixes1.jpg

- - - Updated - - -

Since the steam login link doesn't work and I didn't really want to use it anyway, I upped the permissions to 2000. The map shows one player online, but does not add the player to the view able list. The "getplayerslocation" still returns an empty array. We are almost there, I can smell it!

AllocFixes1.jpg

http://www.klankamakazee.com/7D2DAllocWithFixes/AllocFixes1.png

 
Since the steam login link doesn't work and I didn't really want to use it anyway, I upped the permissions to 2000. The map shows one player online, but does not add the player to the view able list. The "getplayerslocation" still returns an empty array. We are almost there, I can smell it!
View attachment 11156

http://www.klankamakazee.com/7D2DAllocWithFixes/AllocFixes1.png
But your web permission list output doesn't show 'webapi.viewallplayers'. This is a new permission and should be set to 2000 since you've disabled Steam logins.
 
It won't let me set that permission. I tried the console command to add it, it failed, so I edited the XML file directly and added it. The console saw the change, reloaded the XML, but still didn't contain that permission.

2015-10-08T11:00:54 2866.004 INF Executing command 'webpermission webapi.viewallplayers 2000' by ControlPanel

Invalid sub command "webapi.viewallplayers".

2015-10-08T11:01:17 2889.297 INF Reloading webpermissions.xml

2015-10-08T11:01:17 2889.298 INF Loading permissions file at 'C:\Users\USER\AppData\Roaming/7DaysToDie/Saves/webpermissions.xml'

2015-10-08T11:01:17 2889.300 INF Loading permissions file done.

2015-10-08T11:01:37 2909.476 INF Executing command 'webpermission list' by ControlPanel

Defined web function permissions:

Level: Web function

2000: web.map

2000: webapi.getanimalslocation

2000: webapi.getrawentitieslist

2000: webapi.gethostilelocation

2000: webapi.getplayersonline

2000: webapi.getplayerslocation

2000: webapi.getplayerinventory

2000: webapi.getlandclaims

2000: webapi.getstats

0: webapi.executeconsolecommand

0: webapi.getlog

 
Back
Top