Jump to content

Improvements for the dedicated server


Alloc

Recommended Posts

I'm working on a fork of Alloc's great work here and thought I'd fix the custom and tinted icons issues. Anyone know the formula for the color blending during tint? I've tried so, so many variations to get items to tint correctly but they're slightly off every time.

 

7dtd_blend_Test.jpg.97007156f84340360fdcf1c63e662acb.jpg

 

Anyone have ideas on the exact method used to blend the icon's tint?

 

(full sized image: dtd_blend_test.png)

Link to comment
Share on other sites

I'm working on a fork of Alloc's great work here and thought I'd fix the custom and tinted icons issues. Anyone know the formula for the color blending during tint? I've tried so, so many variations to get items to tint correctly but they're slightly off every time.

 

[ATTACH=CONFIG]11109[/ATTACH]

 

Anyone have ideas on the exact method used to blend the icon's tint?

 

(full sized image: dtd_blend_test.png)

 

Hi psouza4, there is a method to do it which is by Photoshop. (I have a Photoshop CS6 OSX Version)

 

----------------------------------------------------------------------------------------

 

Open the icon image, then click "Add a layer style" -> "Color Overlay".

 

Select "Multiply" in Blend Mode and it will give you the same tint as you put in game.

Link to comment
Share on other sites

Yeah I just figured out using Paint.Net and random experimentation with layer blending that it's a simple multiply blend. (But thanks a ton for your reply -- if I hadn't figured it out, I would have been stumbling around for a while on it still).

 

Anyone have a 12.5A Windows-based server and want to test my build?

Link to comment
Share on other sites

Hmm, can't edit my last post. Here's an update with the corrected tinting:

 

7dtd_blend_final.png

 

And here's a quick-and-dirty changelog of stuff I've added to my fork:

 

Enemies (zombies and hostile animal entities) are now shown on the map as Hostiles and require permission level 'webapi.gethostilelocation' for web viewers to see.

 

Animals (non-hostile entities) are now shown on the map as Animals and require permission level 'webapi.getanimalslocation' for web viewers to see.

 

Permission level for 'webapi.viewallclaims' is now required for a viewer to see all claims, otherwise the permission level for 'webapi.getlandclaims' will only show viewer-owned claims. A viewer requires both 'webapi.getlandclaims' and 'webapi.viewallclaims' to be set for all claims to show (you can't just set 'webapi.viewallclaims').

https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=317405&viewfull=1#post317405

 

Permission level for 'webapi.viewallplayers' is now required for a viewer to see all players, otherwise the permission level for 'webapi.getplayerslocation' will only show the player for the currently-authenticated viewer. A viewer requires both 'webapi.getplayerslocation' and 'webapi.viewallplayers' to be set for all players to show (you can't just set 'webapi.viewallplayers').

https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=317405&viewfull=1#post317405

 

Banned players are now hidden from the web map.

https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=320702&viewfull=1#post320702

 

Items using 'CustomIcon' and 'CustomIconTint' are now supported (although the exact tinting may not be perfectly the same as the game).

https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=317117&viewfull=1#post317117

https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=317679&viewfull=1#post317679

 

Map marker icons for players, hostiles, and animals have been updated.

 

Build binaries:

server_fixes_psouza_27915_1102.tar.gz

 

Build source code (not all of my code is neatened up yet):

server_fixes_source_psouza_27915_1102.zip

 

No support provided for compiling this yourself -- you can refer to Alloc's instructions for that. And I'm not entirely sure the .tar package will work properly on linux-based boxes since no permission/owner data is being retained from my Windows machine. You may have to clean that up manually if you're running a linux server.

 

Please let me know how you like my updates and if you encounter any issues. And a big thanks to Alloc' for his project: this is my way of helping out and giving something back!

Edited by psouza4
Added link for ban request (see edit history)
Link to comment
Share on other sites

Enemies (zombies and hostile animal entities) are now shown on the map as Hostiles and require permission level 'webapi.gethostilelocation' for web viewers to see.

 

Animals (non-hostile entities) are now shown on the map as Animals and require permission level 'webapi.getanimalslocation' for web viewers to see.

 

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Thanks for helping troubleshoot!

 

I've made some sanity changes in the logic for all my new code, cleaned it up significantly, and included the webserver files in the binary archive (which is now a .zip since the tarball is redundant when I build on Windows).

 

New build binaries:

server_fixes_psouza_28115_514.zip

 

New build source code:

server_fixes_source_psouza_28115_514.zip

Link to comment
Share on other sites

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

 

(full-sized image)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.2662f3b82f0408c85ce1dc1720391cb1.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.2662f3b82f0408c85ce1dc1720391cb1.jpg

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

Link to comment
Share on other sites

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!

 

[ATTACH=CONFIG]11156[/ATTACH]

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.
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Great -- I found what was causing those permissions to be dropped. Basically, the framework for this mod is dynamically reading each API and loading it as a module with a permission, so each permission must be mapped to an API. I've worked around that for this next build, which should read and allow you to set these new permissions.

 

New build binaries:

server_fixes_psouza_28115_697.zip

 

New build source code:

server_fixes_source_psouza_28115_697.zip

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