• 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

On some servers I have seen that the live map has a check box to display the traders on the map.Does anybody know how to add that to the map ?
That's custom code added by others and giving back seems to be feel bad to some :(

@Others: Suppose your issues are fixed as no one further commented after Curbolt's (probably correct) suggestion of updating?

 
Haven't run into issues myself and edited map.js to have icons for traders (in webserver/js/) so it's now like this:

https://pastebin.com/RgwxL8wA

after that added a cart icon (cart.png) to the leaflet/images folder, dumped the prefabs.xml from my world folder in the main webserver folder and now I have little cart icons on top of all my traders :)

722XCBG.jpg


Anyone not too scared of jquery is probably also able to extend it further to display more icons based on prefabs.xml (my changes are on line 77-118). Hope it's of use to others, too!

currently it just looks through the whole prefabs and any prefab with "trader" in the name gets this icon (could also be used for i.e. skyscrapers if you wish).

 
Hi.
On some servers I have seen that the live map has a check box to display the traders on the map.

Does anybody know how to add that to the map ?
Video on how to add markers and polygons on Alloc's map.

Cheers

 
Haven't run into issues myself and edited map.js to have icons for traders (in webserver/js/) so it's now like this:https://pastebin.com/RgwxL8wA

after that added a cart icon (cart.png) to the leaflet/images folder, dumped the prefabs.xml from my world folder in the main webserver folder and now I have little cart icons on top of all my traders :)

722XCBG.jpg


Anyone not too scared of jquery is probably also able to extend it further to display more icons based on prefabs.xml (my changes are on line 77-118). Hope it's of use to others, too!

currently it just looks through the whole prefabs and any prefab with "trader" in the name gets this icon (could also be used for i.e. skyscrapers if you wish).
Nice work! Now all I would like to have is a checkbox to enable/disable them on the map view.

 
Nice work! Now all I would like to have is a checkbox to enable/disable them on the map view.
https://1drv.ms/u/s!AvzZsIAN_6-wgppujf7LxZx_i29l_g

Change to icon of your choice in line 601 and 602:

Code:
iconUrl: '/static/leaflet/images/layers.png',
iconRetinaUrl: '/static/leaflet/images/layers.png',
The checkbox for Traders is shielded behind web.map permission in webpermissions.xml.

If you want it behind another permission, change line 164 to another permission present in webpermissons.xml:

Code:
if(HasPermission ("web.map"))
If you want it to be visible always without any permissions, just remove the if statement on line 164 around:

Code:
layerControl.addOverlay (GetTraderMarkerLayer (map, mapinfo), "Traders");
layerCount++;
Cheers

 
Last edited by a moderator:
https://1drv.ms/u/s!AvzZsIAN_6-wgppujf7LxZx_i29l_g
Change to icon of your choice in line 601 and 602:

Code:
iconUrl: '/static/leaflet/images/layers.png',
iconRetinaUrl: '/static/leaflet/images/layers.png',
The checkbox for Traders is shielded behind web.map permission in webpermissions.xml.

If you want it behind another permission, change line 164 to another permission present in webpermissons.xml:

Code:
if(HasPermission ("web.map"))
If you want it to be visible always without any permissions, just remove the if statement on line 164 around:

Code:
layerControl.addOverlay (GetTraderMarkerLayer (map, mapinfo), "Traders");
layerCount++;
Cheers

this compatible with cpm aswell?

 
Hey there Alloc

I noticed there's some chrani panel files in the latest release link ( http://illy.bz/fi/7dtd/server_fixes.tar.gz ). Is that intentional? I don't see the same files in the source code.

unknown.png

EDIT: here's an example nginx config for reverse proxying the webmap. Might be useful for someone :)

Code:
server {

server_name map.example.com;

       location / {
               proxy_set_header X-Forwarded-Host map.example.com;
               proxy_set_header X-Forwarded-Server map.example.com;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_set_header Host map.example.com;
               proxy_http_version 1.1;
               proxy_pass_request_headers on;
               proxy_set_header Connection "keep-alive";
               proxy_store off;
               proxy_pass http://localhost:8082;
       }


}
 
Last edited by a moderator:
Alloc's fixes is broken with the new Alpha 17.2 stable release. There doesn't seem to be a 17.2 compatible build yet either

Confirmed that once I removed Alloc's fixes. Players were actually able to connect to our server and not cause an instant server crash instead.

 
@Xenophobed44: Would at least need some logs.

@catalysm:

Yeah, seems like I forgot to clean up my local folder, but this must've been in for some time now. It was never actually used, iirc I only diffed the map.js file from ecv's version and mine to get his changes for Leaflet 1 in.

@ecv:

Sorry I had those files in, not sure if those were ever public from your end :(

 
Everything I do is available to the public anyway through git, don't worry. It's also a discontinued project, was part of my learning curve :) I believe in free software all the way. Probably because I don't make my money writing code. It's just when the need arises, and nobody else is doing it, that I go to work on stuff ^^

 
@Xenophobed44: Would at least need some logs.
I reinstalled the January 19th build of Alloc's Fixes. It seems server side the files became corrupted somehow. This appears to have solved the issue and I apologize for calling your wonderful fixes broke.

 
I just noticed and i dont know how long its broken, checked it last time during A16:

My hooks are broken.

the chat hook for example passes the instance name but all other values are empty.

playerConnect works fine.

Anyone got an idea?

 
@alloc Is there a way to add our own permission to be used in the webpermission.xml file ?

It would be handy for when adding new stuff to the map, like the earlier mentioned traders locations, so you have your own specific permission setting for that instead of having to use one of the already defined once?

 
I just noticed and i dont know how long its broken, checked it last time during A16:
My hooks are broken.

the chat hook for example passes the instance name but all other values are empty.

playerConnect works fine.

Anyone got an idea?
This mod does not have any hooks. If you're talking about the Linux scripts please use the appropriate thread, you will probably get more help there :)

@alloc Is there a way to add our own permission to be used in the webpermission.xml file ?
It would be handy for when adding new stuff to the map, like the earlier mentioned traders locations, so you have your own specific permission setting for that instead of having to use one of the already defined once?
Currently not without changing and recompiling the mod's code yourself.

 
@alloc I found an bug with v18_21_31 and a17.2 b27 stable

Before the stable (a17.2 b20 experimental) I was able to set the web permissions to 2000 so everyone that's not logged in could see the map.

With the current version I can still set the permissions to 2000, but when I try logging in via the steam login, it looks like it's logging in, but once returning to the map, it shows as not logged in.

Occasionally it does show me as logged in, but once I refresh the browser, I'm logged out again.

If I change the permissions back to 1000, everything works fine and I stay logged in, even on browser refresh.

EDIT:

Just noticed some times it logs me out when permissions are set to 1000 and I refresh the browser, so it not just with the permissions set to above 1000

 
Last edited by a moderator:
With the current version I can still set the permissions to 2000, but when I try logging in via the steam login, it looks like it's logging in, but once returning to the map, it shows as not logged in.
Occasionally it does show me as logged in, but once I refresh the browser, I'm logged out again.

If I change the permissions back to 1000, everything works fine and I stay logged in, even on browser refresh.

EDIT:

Just noticed some times it logs me out when permissions are set to 1000 and I refresh the browser, so it not just with the permissions set to above 1000
There's basically two things that make you lose your login status: Your (server facing) IP changes (e.g. by getting a new one assigned from your ISP on a reconnect) or your browser forgets the cookie with the session ID. Of course if the server is restarted you also have to relogin.

Hey Alloc,i like your server fixes!

I hope you will release a version that is compatible with 17.2 stable :-)
Doesn't look like there's an issue with the current ones and 17.2.

 
@alloc That was it...... totally forgot that I had ZenGuard running in the background that was preventing this.

Oh and I can confirm the Allocs Server Fixes v18_21_31 works on a17.2 b27 with no issue on my end now.

 
Back
Top