Jump to content

Improvements for the dedicated server


Alloc

Recommended Posts

Hey Folks,

 

it's me again I played a bit with the hooks and somehow I came to the idea that I could use the "serverPostStart" hook to make my server print out messages via the telnetCommand "say" every 600s.

 

I have to admit that I'm pretty new to that linux server thing and I know it isn't the best prereq, but I'm eager to learn how this stuff works so maybe someone can take a look into it and give me a hint into the right direction.

 

So let's get down to business!

 

Since I want that the server sends the messages over and over again I thought I could do a while loop with true as condition.

 

Here's myscript:

 

#!/bin/bash
. /usr/local/lib/7dtd/common.sh

while true
do
telnetCommand $1 "say Use bandanas to mark your faction."
sleep 600
telnetCommand $1 "say A brown bandana represents the Nomads."
sleep 600
telnetCommand $1 "say A red bandana represents the Vagabonds."
sleep 600
telnetCommand $1 "say A green bandana represents the Colonists."
sleep 600
telnetCommand $1 "say A black bandana represents the Outlaws."
sleep 600
telnetCommand $1 "say A white bandana represents the Altruists."
sleep 600
telnetCommand $1 "say You may only attack others inside the wasteland biome."
sleep 600
telnetCommand $1 "say You may defend your claim by any means if necessary."
sleep 600
telnetCommand $1 "say You may use the unlocked shelters all over the world as hideout during the night."
sleep 600
done

 

It works fine so far, the problem is just that the shell goes to sleep too after I started the server. As I said I'm really new to this shell script stuff, I know a little about programming but I'm far from being professional nor I want to be professional, I have other fields of study and it's just for fun. :)

 

Anyways, hope someone have a bright idea!

 

Kind Regards

pitufocabeza

Link to comment
Share on other sites

Hi,

 

Since I want that the server sends the messages over and over again I thought I could do a while loop with true as condition.

 

Here's myscript:

...

 

It works fine so far, the problem is just that the shell goes to sleep too after I started the server. As I said I'm really new to this shell script stuff, I know a little about programming but I'm far from being professional nor I want to be professional, I have other fields of study and it's just for fun. :)

 

first of all: wrong thread ;) The correct one is over here: http://7daystodie.com/forums/showthread.php?11184-Native-Linux-server-(with-management-scripts)

 

On the topic of the hook: Hooks aren't meant to run infinitely but just do some action and close. If you want stuff to be done all the time I'd probably go with a cron job to run your script on a given interval. Of course in that case you'll have to pass in the server instance name manually (either as parameter to your script when cron executes it or by hard coding it into the script).

 

Regards,

Chris

Link to comment
Share on other sites

Hi Alloc & everyone.

 

So I've added quite a lot more various server command to your fixes, the classes are attached to this post. If you'd like to add them to your build, feel free!

 

Here's the list of new command, they should be self-explanatory but they all generate help when called without parameters

AddBuffIn.cs

AddBuffOn.cs

AddLootAt.cs

CountEnemyEntityIn.cs

CountEntityIn.cs

GetBlockAt.cs

GetDensityAt.cs

GetLootAt.cs

KillEnemyEntityIn.cs

ListBuffIn.cs

ListBuffOn.cs

ListEnemyEntityIn.cs

ListEntityIn.cs

RemoveBuffIn.cs

RemoveBuffOn.cs

RetrieveLootAt.cs

SetBlockAt.cs

SetBlockIn.cs

SetDensityAt.cs

SetPropOn.cs

SpawnEntityAt.cs

SpawnHordAt.cs

UnlockAt.cs

 

All commands that finish with "in" takes a shape as parameter, so it's possible to do "batch" command. Or for instance, building shapes in blocks, killing enemies that are within/outside a distance of any players, etc.

 

Here's the shapes available as of now:

ShapeAll.cs

ShapeBox.cs

ShapeEntityProx.cs

ShapePlayersProx.cs

ShapeSphere.cs

 

Have fun! :)

binary-improvements-nie.zip

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

First off, a big thanks for your work! :tyrannosaurus:

 

In your list entities command, a dropped item will appear - with it's co-ordinates - but no actual information on what item it is, or how many. This information could be used for a variety of purposes -- most valuable of which that I can see, is player trading; without the use of modded game-files.

 

There are several really cool functions that I could use this information for, within my server manager; should it ever become available.

Link to comment
Share on other sites

Hey guys, sorry if I don't make sense - I just started playing 7dtd yesterday am hosted a dedicated server. Was wondering if this "server fix" works with the latest alpha version, and if so - will it overwrite my map?

 

Thanks again :) Trying to get the ability for users to sethomes and such.

 

I am running the 7dtd server on CentOS 7 - I am not sure how to get this to work with my dedicated server as the install instructions reference .exe files. Any help would be great!

Edited by eNkrypt (see edit history)
Link to comment
Share on other sites

Hey guys, sorry if I don't make sense - I just started playing 7dtd yesterday am hosted a dedicated server. Was wondering if this "server fix" works with the latest alpha version, and if so - will it overwrite my map?

 

Thanks again :) Trying to get the ability for users to sethomes and such.

 

I am running the 7dtd server on CentOS 7 - I am not sure how to get this to work with my dedicated server as the install instructions reference .exe files. Any help would be great!

Yes it works, no it doesn't change your map. You may want to run the mapping script with no one on the server if you plan to use that feature though.

Link to comment
Share on other sites

Hello,

 

First off, a big thanks for your work! :tyrannosaurus:

 

In your list entities command, a dropped item will appear - with it's co-ordinates - but no actual information on what item it is, or how many. This information could be used for a variety of purposes -- most valuable of which that I can see, is player trading; without the use of modded game-files.

 

There are several really cool functions that I could use this information for, within my server manager; should it ever become available.

 

You can achieve player trading using the GetLootAt / RetrieveLootAt / AddLootAt commands

Link to comment
Share on other sites

Hi Alloc & everyone.

 

So I've added quite a lot more various server command to your fixes, the classes are attached to this post. If you'd like to add them to your build, feel free!

 

Here's the list of new command, they should be self-explanatory but they all generate help when called without parameters

AddBuffIn.cs

AddBuffOn.cs

AddLootAt.cs

CountEnemyEntityIn.cs

CountEntityIn.cs

GetBlockAt.cs

GetDensityAt.cs

GetLootAt.cs

KillEnemyEntityIn.cs

ListBuffIn.cs

ListBuffOn.cs

ListEnemyEntityIn.cs

ListEntityIn.cs

RemoveBuffIn.cs

RemoveBuffOn.cs

RetrieveLootAt.cs

SetBlockAt.cs

SetBlockIn.cs

SetDensityAt.cs

SetPropOn.cs

SpawnEntityAt.cs

SpawnHordAt.cs

UnlockAt.cs

 

All commands that finish with "in" takes a shape as parameter, so it's possible to do "batch" command. Or for instance, building shapes in blocks, killing enemies that are within/outside a distance of any players, etc.

 

Here's the shapes available as of now:

ShapeAll.cs

ShapeBox.cs

ShapeEntityProx.cs

ShapePlayersProx.cs

ShapeSphere.cs

 

Have fun! :)

 

posted 2weeks ago.. missed that ..looks like some nice utility stuff

 

 

You can achieve player trading using the GetLootAt / RetrieveLootAt / AddLootAt commands

 

not checked it yet.. is this to be used on static containers like chests? or can it be directly to and from a player at there xyz position aswel?

Link to comment
Share on other sites

Alloc, I'm not sure if this has already been posted about, but there are so many posts about your mod that I can't find anything.

 

Our server map has grown enormous. Opening the webpage and zooming in/out causes noticeable lag and CPU spikes on the server, affecting gameplay.

What can I do to optimize the webserver map?

Link to comment
Share on other sites

Hi Alloc & everyone.

 

So I've added quite a lot more various server command to your fixes, the classes are attached to this post. If you'd like to add them to your build, feel free!

 

Here's the list of new command, they should be self-explanatory but they all generate help when called without parameters

AddBuffIn.cs

AddBuffOn.cs

AddLootAt.cs

CountEnemyEntityIn.cs

CountEntityIn.cs

GetBlockAt.cs

GetDensityAt.cs

GetLootAt.cs

KillEnemyEntityIn.cs

ListBuffIn.cs

ListBuffOn.cs

ListEnemyEntityIn.cs

ListEntityIn.cs

RemoveBuffIn.cs

RemoveBuffOn.cs

RetrieveLootAt.cs

SetBlockAt.cs

SetBlockIn.cs

SetDensityAt.cs

SetPropOn.cs

SpawnEntityAt.cs

SpawnHordAt.cs

UnlockAt.cs

 

All commands that finish with "in" takes a shape as parameter, so it's possible to do "batch" command. Or for instance, building shapes in blocks, killing enemies that are within/outside a distance of any players, etc.

 

Here's the shapes available as of now:

ShapeAll.cs

ShapeBox.cs

ShapeEntityProx.cs

ShapePlayersProx.cs

ShapeSphere.cs

 

Have fun! :)

 

This is great work. I can see a lot of uses for these commands already. Especially buffs via server commands. It also seems it would be possible to do some interesting anti-cheating stuff that I won't go into detail here. Oh and proper selling of items looks to be possible with these commands, so a resource trade system could become quite advanced with these commands.

 

Will this be updated in parallel with allocs fixes? Or is alloc planning to incorporate this functionality at some point?

Link to comment
Share on other sites

Hi Alloc & everyone.

 

So I've added quite a lot more various server command to your fixes, the classes are attached to this post. If you'd like to add them to your build, feel free!

 

...

Wow, quite a bunch of nice additions :)

Currently not planning to integrate it, I'm hoping to get the console rework done soon that should hopefully also allow adding such additions more easily. Then we don't have to put everything into a single DLL anymore ;)

 

 

Our server map has grown enormous. Opening the webpage and zooming in/out causes noticeable lag and CPU spikes on the server, affecting gameplay.

What can I do to optimize the webserver map?

Feared this would happen at some point :(

Especially when zooming the browser requests a *lot* of tile files. You could reduce the number of files by changing the tilesize to 256 though that would require to reset the map (and optionally completely rerender it afterwards). Can't tell you how much of an improvement this would be but as doubling the tilesize basically divides the number of requests by 4 it could help. If you want to do that shutdown the server, go to the map-folder of the savegame, open the mapinfo.json, replace the 128 for blocksize with 256 (theoretically 512 should work too, wouldn't recommend it though as it will trade file count against performance for the actual rendering code), delete all the subfolders, start the server again.

Link to comment
Share on other sites

Maybe some smart person can make the webserver throttle map file access?

 

One of my players ran the tiles through an optimisation tool and managed to halve all the file sizes, might be an option.

Link to comment
Share on other sites

Maybe some smart person can make the webserver throttle map file access?

Could help a bit but the major problem is probably the amount of requests, not the individual file size.

 

Hey me again!

I've added an isometric map renderer, check this out! http://www.theroad7dtd.com/plotworld

Wondering ... you don't use the game's rendering capabilities, do you? Looks like you added kind of an own renderer based on the blocks?

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