• 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

*one million pokes later*

ok I was able to remove the strong name thingy using .Net Reflector + Reflexil v1.8 add-in Strong Name Remover (the tool is a bit hidden under the UI). Select UnityEngine.dll and added my compiled 7dtd-server-fixes.dll and deof Assembly-CSharp.dll under '\binary-improvements\bin\Release'

After that painful step, running 7dtd-fixer.exe works.

but not if I compiled it with MonoDevelop. starting the server would yield a truck load of 'System.MissingMethodException: Method not found: 'System.Threading.Monitor.Enter'.' exception (and other methods)

So I built 'binary-improvements\server-fixes.sln' using Visual Studio 2010.

*BUT*

I reverted the solution/projects to the SVN head, so the target framework for fixes dll is back to 3.5.

So I fixed all the 'default parameter not allowed' build errors. (Mostly from JSON code)

Then did a rebuild of everything in Release (Not Release_Version as it does not work if you do not have bash)

Then did the Remove Strong name excruciating step again. Copied the dlls to my dedicated server and it WORKS!

omg I still can't believe it!

 
Hey Alloc, any idea why the map coords in IE shows with 12 decimal places? Screenshot
No idea. But I'm not explicitly formatting the values either so it might just be non exact calculations or something caused by the floats.

change 7dtd-server-fixes target framework to "Mono/.net 4.0". (was 3.5 and yielded compile errors on default parameters, don't know why)
.NET 4 wont work as Unity uses 3.5. Why some people get that default params error ... no idea, never had this happen.

 
Hey Folks,

I don't know if it's the right place to ask but since it's kinda related to your fixes Alloc I'll just give it try.

Well, I'm hosting a 7DTD dedicated server on Ubuntu Server 14.02 64-bit, everything works fine so far, except for one thing and honestly I googl'd my ass off to find a solution but nobody says anything about it.

Let's come to the point, on almost every other Server I noticed commands like /rules, /sethome, /gimme, /home, etc and yea I know that you can implement them by running FrontRunnerTeks Servermanager, but since I'm running Ubuntu on the Server I obviously can't use it.

So my question is, is there any other possible opportunity to enable chat commands for players via the chat frame and not via console?

I would be glad if anyone knows an answer to this.

Thanks in advance and best regards

pitufocabeza

 
You can for example use the hooks if you use my management scripts and code something that way. Or you can run FRTs SM from a Windows machine and have it connect over the network. Finally you could extend the mod to implement chat commands though that's probably the hardest way (especially if you're not familiar with C# and you'd also have to get used to how the chat stuff of the game works).

 
Thanks for the quick reply,

Thats what I'm currently doing, I'm running FRTs SM on my local PC, but as you can imagine the idea of running the server on a dedicated linux host was that my PC doesn't have to run day and night.

So I think I'll will go into the hooks, any advise?

Unfortunately my knowledge about C# isn't good enough to extend the mod.

Regards

Pitufocabeza

 
This might help as a point to get started: https://7dtd.illy.bz/wiki/Hooks

Also I think there were some people in the thread for the management scripts who said they implemented some stuff with the chat hook, maybe you should ask over there :)

 
Maybe this is a stupid question but are your fixes ever going to be rolled into the standard release of the dedicated server and if so when would this occur? if it is going to be soon I can stop hounding our server owner to get these installed. :-)

 
A lot of it, yes. Not necessarily all of it though. Only time can tell though.

 
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:

Code:
#!/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

 
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

 
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

 

Attachments

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.

 
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!

 
Last edited by a moderator:
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.

 
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

 
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?

 
Back
Top