[Completed] Server Wipe Button

Xyniik

New member
JFF Member
Feb 5, 2017
27
8
3
36
Arizona, United States of America
Would it be possible to create a button that when clicked it wipes the entire server?

All information for the server is located under the "\ConanSandbox\Saved\" folders in the root directory of the server.

I don't know if this will help you out but I made a similar code for a program before but I've altered it a little to just give you an idea:

private void wipeDirectory_OnClick(object sender, MouseEventArgs e)
{
DialogResult dialogResult =
MessageBox.Show("You are about to erase " + serverDirectory + "\ConanSandbox\Saved\", "Wipe Server",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning;)
if (dialogResult == DialogResult.Yes)

{
Array.ForEach(Directory.GetFiles(@serverDirectory + "\ConanSandbox\Saved\"),
delegate(string path) { File.Delete(path); });
}
}
If this code works for you feel free but I was really just posting it so you can get a better understanding of what I was thinking. Sometimes code speaking code is easier than words! :)
Obviously the serverDirectory variable would be whatever you use to save the server location and you would just set the button event onClick and link to this.

Lemme know if this helps at all!
 
  • Like
Reactions: Trekkan
Yeah, basically just clear out all characters and structures. Mainly because with it being alpha, there is going to be a lot of new changes and usually its just best to start completely fresh.