Jump to content

Server Tools


dmustanger

Recommended Posts

So I think I have my code right? How would I go about adding it to the game? http://pastebin.com/c7j0mwd1

 

I have not tested this, but you'll need to add an if statement somewhere under the if starts with "/" section in Hook.cs

 

Example:

 

if (_message == "StartShutdown") //This will be your chat forward slash command name.
{

if (ShutDownWorld.IsEnabled)

[indent]{[/indent]


[indent][indent]ShutDownWorld.Start;[/indent]
[/indent]

[indent]}[/indent]

else

[indent]{[/indent]


[indent][indent]_cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Shutdown is not enabled.[-]", CustomCommands.ChatColor), "Server", false, "", false));[/indent]
[/indent]

[indent]}[/indent]


[indent]return false;[/indent]

}

 

You'll also need to add the IsEnabled code to LoadConfig.cs

 

I might be missing something, but that should get you started down the rabbit hole. :encouragement:

Link to comment
Share on other sites

How about adding an option to call /home whatever you wish ie /home2 or /base2 (so that you can run it along side CBSM and have 2 homes available)

 

I wouldn't recommend running both at the same time due to potential conflicts, but you can download a copy of the source code from dmustanger's github and rename /home fairly easily if you'd like. Look in Hook.cs.

 

In CBSM, can't you just setup a zGate for multiple "homes"?

Link to comment
Share on other sites

Oh yeah! Duh! I guess you wouldn't want to give everyone on the server the ability to shutdown the server via chat. You could add code to check admin permission. Examples are in the AdminChatCommands section.

 

LoadConfig.cs reads the ServerToolsConfig.xml. You'll need to add the Enabled lines to be able to turn it on and off.

 

Sorry, but I'm not sure how to add it as a console command.

 

Automated how? Like every 24 hours or something?

Link to comment
Share on other sites

Yea, so i took the save world command that runs automatically and modified it to be a shutdown one. I'm having trouble locating the servertoolsconfig.xml, but I managed to find Servertools.csproj and added a line below

<Compile Include="src\AutoSaveWorld\AutoSaveWorld.cs" />

as

<Compile Include="src\AutoRestart\AutoRestart.cs" />

Is this the file you were refering to?

 

 

Also are the config files generated from the .cs files from within the src folder or is that something else I need to change?

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

Govic,

 

I looked into the code you posted and found a few things that needed to be fixed.

 

Here is a link to my version of the shutdown timer function added to ServerTools 3.2 compiled and ready to go.

 

https://github.com/schwanz9000/ServerTools3.2withShutdownTimer/releases

 

This will check admin permissions which must be level 0 for the /shutdown command to start. Once started, it will start a 10 minute timer counting off each minute and then the last 30, 10, 5, 4, 3, 2, 1, seconds.

 

NOTE TO ALL: If you have a rented Blue Fang Solutions dedicated server, they already have a server side script that automatically restarts the server. If you want to stop the server for a period of time, you must use their dashboard stop button.

 

Also how do I go about compiling these files into the final format?

 

These files are written and compiled in Microsoft Visual Studio. You can get a free fully functional version for private use here.

Link to comment
Share on other sites

I appreciate the work you did, but I was wanting a feature to automate this shutdown command like the auto save command that Auto saves the world every x amount of minutes adjustable via config. That was what I was trying to create although the ability to shutdown via chat is also helpful.

Link to comment
Share on other sites

With the mod installed in the Mod folder and the server running, go to /saves/ServerTools and enable custom commands in the ServerToolsConfig.xml. Then you can setup the commands in CustomChatCommands.xml to teleport to x,y,z. Once setup, you can use /whateveryourcommandis. Use -1 as the Y coord so you don't fall through the world. It will place you on the top most block. For that, I either make a platform/area just for the landing or an air shaft with a wall and spikes at the surface to land in underground establishments. Basically don't have any blocks above wherever you want to land.

 

You can setup as many of these as you'd like and can set a timer for how long between ports.

 

Example:

<Command Command="arena" Response="tele {EntityId} 1000 -1 1000" />

 

As far as zgates and a coin system, there isn't anything for that.

 

I just need it to have an economy mod for shop and link commands to it. So if wanted to charge for a command. Also need the ability to link multiple commands. Ex: /fixleg - debuff sprainedLeg; debuff brokenLeg; say "be careful"; pay 100 coins.

 

Other features would be nice too:

- Live Poll

- Custom chat colors

- Event timers

- Area triggers; going to certain location triggers a command or event.

- Events with prizes, race, PvP arena, scavenger hunt.

Link to comment
Share on other sites

First... i love it, works really great and that without telnet =). Thanks!

 

i use coppi's mod -> https://7daystodie.com/forums/showthread.php?44835-Coppi-MOD-New-features

 

there is a command to change that chat color for a specific player.

can you write a fix, for your mod to ignore the "[colorcode]" (for gimme and other commands)? sorry for my english.

 

here is a picture (i think it is better to understand ^^): http://fs5.directupload.net/images/160723/g3qt45oy.png

Link to comment
Share on other sites

First... i love it, works really great and that without telnet =). Thanks!

 

i use coppi's mod -> https://7daystodie.com/forums/showthread.php?44835-Coppi-MOD-New-features

 

there is a command to change that chat color for a specific player.

can you write a fix, for your mod to ignore the "[colorcode]" (for gimme and other commands)? sorry for my english.

 

here is a picture (i think it is better to understand ^^): http://fs5.directupload.net/images/160723/g3qt45oy.png

 

Try my modded files...

 

https://7daystodie.com/forums/showthread.php?44916-Coppi-s-Additions-and-ServerTools-fighting-for-Chat-Hook

Link to comment
Share on other sites

Okay i was playing around and working with visual studio, but i still was unable to find the location where the servertoolsconfig.xml is generated from. I would like to add my automatic restart as something that can be enabled/disabled. Does it generate the config based on the files it has and i dont need to do anything? Also it is the .sln that i should have open correct, and when i get it to the stage to try it i build it?

Link to comment
Share on other sites

Okay i was playing around and working with visual studio, but i still was unable to find the location where the servertoolsconfig.xml is generated from.

servertoolsconfig.xml is created in the LoadConfig.cs

 

I would like to add my automatic restart as something that can be enabled/disabled. Does it generate the config based on the files it has and i dont need to do anything? Also it is the .sln that i should have open correct, and when i get it to the stage to try it i build it?

You need to add a line to the UpdateConfig method in LoadConfig.cs. Yes. The .sln is the project AKA solution. Build - Build ServerTools will make the .dll. The new .dll is located in the (your folder)ServerTools\obj\Debug or (your folder)ServerTools\obj\Release depending on the Solution Configurations.

 

great mod - love it.

 

any way to support Giveto commands for admins like "GiveTo 171 Stone Axe 600 1 (player ID, item, quality, quantity)

 

also can /gimme support giving xp like "giveselfskillxp Mining Tools 10000"

Give and Give XP are part of Alloc's Server Fixes.

 

 

so how does the Ban or kick players for invalid items/blocks in their inventory work? I gave myself 500 concreteblockr (re-enforced) and it did nothing.

RconcreteBlock is not a default invalid item. Look at InvalidItems.xml for a list of items or add the items you want.

 

FEATURE request - Teleport - can you add it?

 

so we can teleport to friends

You can set custom commands to teleport to your friends bases if that helps.

 

dmustanger - I hope you don't mind me answering all these questions for you. :smile:

Link to comment
Share on other sites

<Command Command="hubcity" Response="tele {EntityId} 0 -1 0" DelayBetweenUses="30" />

 

That's a basic one that should teleport you to coords 0,0 at the surface when you type /hubcity in chat (with a 30 second cooldown).

Link to comment
Share on other sites

what is the <Tool Name="Day7" Enable="False" /> do in the Servertoolsconfig.xml?

 

Day7 announces when the next day 7 horde is. Change enable to True and type /day7 for it to display how many days before the next day 7 horde.

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