• 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

The code and hot swapping worked great!

The only problem is that I have to refresh the whole page and find the player on the map again for the coords to refresh. I could move around the map and see the same coords below until I F5'd it.

6fPrgzf.png


 
Yeah, the marker popup is only created once. You will have to add the marker-popup-content code to the if-part with marker.getPopup ().setContent (...).

 
Is this what you meant? .setContent seems to work just like the .bindPopup. It works, but doesn't update the coords when the marker moves. I'm going through the Leaflet docs to educate myself, so I'll play around with it some more when I get home tonight.

Code:
var marker;
if (playersMappingList.hasOwnProperty(val.steamid)) {
 marker = playersMappingList[val.steamid].currentPosMarker;
} else {
 marker = L.marker([val.position.x, val.position.z], {icon: playerIcon}).bindPopup(
// // "Player: " + val.name +
// // "<br/>Position: " + val.position.x + " -1 " + val.position.z +
// (HasPermission ("webapi.getplayerinventory") ?
// "<br/><a class='inventoryButton' data-steamid='"+val.steamid+"'>Show inventory</a>"
// : "")
);
[color="#00FF00"]  marker.getPopup()
   .setContent("Player: " + val.name + "<br/>Position: " + val.position.x + " -1 " + val.position.z);[/color]

 playersMappingList[val.steamid] = { online: !val.online };
}
 
Last edited by a moderator:
Reading comprehension fail! :doh:

It's working now! Thanks a ton!

5RNWPDa.png
D047Mev.png


Here's the code for anyone that would like to try it...

Code:
if (playersMappingList.hasOwnProperty(val.steamid)) {
marker = playersMappingList[val.steamid].currentPosMarker;
marker.getPopup()
	.setContent("Player: " + val.name + "<br/>Position: " + val.position.x + " -1 " + val.position.z +
               (HasPermission ("webapi.getplayerinventory") ?
	"<br/><a class='inventoryButton' data-steamid='"+val.steamid+"'>Show inventory</a>": ""));
} else {
marker = L.marker([val.position.x, val.position.z], {icon: playerIcon}).bindPopup("Player: " + val.name);

playersMappingList[val.steamid] = { online: !val.online };
}
 
Mr Alloc.

Firstly, well done with your server fixes, they make life as a 7DTD admin far more bearable than it previously was.

Does your API have any console command functionality? Can I send a command to the API with the correct tokens, that will issue a command to the server? I host my website on a shared host that closes all ports that are not website related, so a CURL/Telent PHP script is not possible for me. If not, is it possible to run PHP code in the mono webserver that could then respond to ajax requests (cross-domain) from my webhost? I have toyed with the idea of CURL-POST to the included webcontrol panel, but the connection on that page is too flakey to be a reliable method of issuing commands. If you wanted to issue commands from a remotely hosted website with only the standard ports available, how would you do it using PHP/JS?

Thanks for your time :)

Zig.

 
Hi, I need help.

I am using the Alloc fixes and I really like and is very useful.

But I have a problem when I want to see the log, I empty out the window, and I am so new that no where else see the log, and who killed whom and their coordinates.

Map and players see them perfectly, 7 days dedicated server also works well.

Please, as I can see the log?

9VRPZLh.png


 
I have a problem when I want to see the log
Yeah, for some reason, the log stops at ~<100 lines.

Alloc is aware of the issue and he'll get it fixed when he has time.

In the meantime, you can always look at the output_log.txt file in the root/7DaysToDieServer_Data folder.

 
Hi. I have request if possible. I'm sure we are all familiar with the OutOfMemory error that locks up servers. Would it be possible to make an option to watch the log file for this error and automatically save and restart the server when this happens? I'm running a Linux server and am an amateur when it comes to anything in linux.

 
Does your API have any console command functionality? Can I send a command to the API with the correct tokens, that will issue a command to the server?
If you're talking about a WebAPI for console commands: Not yet.

If not, is it possible to run PHP code in the mono webserver that could then respond to ajax requests (cross-domain) from my webhost?
Hell NO :D

Wouldn't want to get that kind of PITA in to the game ;)

If you want code to handle your own requests you'll have to write .NET code for the mod.

I have toyed with the idea of CURL-POST to the included webcontrol panel, but the connection on that page is too flakey to be a reliable method of issuing commands.
If you're talking about the game's original control panel: Yeah, it's not very fault tolerant. Based on a OTP for the next request received on each prior request. As long as you keep a strict order of issuing things this should work (at least one server manager used to support this interface) though.

If you wanted to issue commands from a remotely hosted website with only the standard ports available, how would you do it using PHP/JS?
If you can't connect to remote ports with PHP (open a simple outgoing TCP socket) you'll either have to wait until I add the command API or code something yourself ;) But it should be possible to open connections at least to some ports, did you try changing the "Telnet" port on your game server to something like 80?

Hi. I have request if possible. I'm sure we are all familiar with the OutOfMemory error that locks up servers. Would it be possible to make an option to watch the log file for this error and automatically save and restart the server when this happens? I'm running a Linux server and am an amateur when it comes to anything in linux.
How should that work? If a program has run out of memory there's no way to catch that anymore, it's already crashed.

 
If you're talking about a WebAPI for console commands: Not yet.
But you have it in the pipeline? That is great news, if it can return data also, it will mean I never have to faf around with PHP telent wrappers again!

Hell NO :D Wouldn't want to get that kind of PITA in to the game ;)
Haha, point taken :p

If you're talking about the game's original control panel: Yeah, it's not very fault tolerant. Based on a OTP for the next request received on each prior request. As long as you keep a strict order of issuing things this should work (at least one server manager used to support this interface) though.
I've managed to get a PHP telent wrapper to issue commands for now, I look forward to when I can bin it and use the web API :D

If you can't connect to remote ports with PHP (open a simple outgoing TCP socket) you'll either have to wait until I add the command API or code something yourself ;) But it should be possible to open connections at least to some ports, did you try changing the "Telnet" port on your game server to something like 80?
I was very surprised when my webhost opened a few outbound ports to my server address without any fuss! This means I can issue commands from my webhost, but I seem unable to return any data from the connection. It works fine on my home dev machine, but as soon as I upload it, the commands are issued but there is no return. I haven't gone deep into it yet, but out of interest, it seems that Telnet uses random ports to send data back to the client. Is that right, and if so, is it possible to specify outgoing ports?

Once I realised that the highping kicker mod (Server Tools) did not make the server fall under the modified category, I installed that and shelved the once a minute cron spamming the telnet console for a player list for the pings. I'm using the same system with your webapi however to get the IP address for some GEO filtering, but a once a minute spam to a web address falls over far less than the same with a telnet connection. PHP has it's own geoplugin ( :p ) that makes the job really easy, but then the Telnet requirement raises it's ugly head and mocks me: commands via WebAPI will be a real boon, can I be cheeky and ask if you have a rough estimation of the time of release for this functionality?

Mr Alloc, the server map and the server fixes are an indispensable tool to me now, kudos for all the time and effort you put in, I hope those Pimps are paying you!

Keep surviving!

Zig.

 
Last edited by a moderator:
But you have it in the pipeline?
Yep.

I haven't gone deep into it yet, but out of interest, it seems that Telnet uses random ports to send data back to the client. Is that right, and if so, is it possible to specify outgoing ports?
Yes and no ;)

The connection is a simple TCP connection, there's no "random" ports for outbound vs inbound traffic. Of course any TCP connection (at least normally) does use a random client side port but that doesn't impact anything.

... can I be cheeky and ask if you have a rough estimation of the time of release for this functionality?
No estimate. Hope to get dev speed up a bit in the upcoming weeks though as I can dedicate more time to it.

 
...can I be cheeky and ask if you have a rough estimation of the time of release for this functionality?

No estimate. Hope to get dev speed up a bit in the upcoming weeks though as I can dedicate more time to it.
Can I also be cheeky and ask what your top 3 priorities/fixes/additions will be when you do get time? There is quite the pile of tickets to go through.

 
Alloc, I have a request. Can you please reduce the number of failed login attempts on the telnet server to 3? Or give us a command to set number of allowed failed attempts?

And if it's possible, an IP whitelist (for telnet) would go a very long way to help securing the servers.

 
Last edited by a moderator:
Can I also be cheeky and ask what your top 3 priorities/fixes/additions will be when you do get time? There is quite the pile of tickets to go through.
Nah, no real plan. Most likely the first thing would be finally fixing the log tab ;)

Alloc, I have a request. Can you please reduce the number of failed login attempts on the telnet server to 3? Or give us a command to set number of allowed failed attempts?
And if it's possible, an IP whitelist (for telnet) would go a very long way to help securing the servers.
No reason why not, just gotta find a place to save this stuff ;)

Also it's core game so will take longer to hit public anyway.

Is this still relevant? (most look quite old now).
Kinda ... I want to do them but especially the scripts have quite low priority currently as they worked as required mostly.

One in particular caught my eye - https://7dtd.illy.bz/ticket/60 - this ticket relating to a hook for player deaths.
Like some of the other "chat" things I wanted to delay it until I reworked the chat system / logging in game so it's easier to parse that stuff from the log.

 
Cheers Alloc.

Going to try and customise the build myself to add that in. Just wondering how you debug these libs in Visual Studio? I've got a local 7DTD server running via SteamCMD, and I've done a DEBUG build of the .dll's and added them (and associated PDB's) to the /mods dir of the server. The mod is definitely working (checked the server log and tested some commands in-game), but when I try and attach VS to the 7DaysToDieServer process, the mod .dll's never seem to appear in the modules list so I can't stick breakpoints anywhere in the code. It's weird because to sanity check this, I used ProcessExplorer and the 7DaysToDieServer process definitely has a handle on the mod's server-fixes .dll.

Any tips?

 
Back
Top