Converted all files to LF line endings
This commit is contained in:
parent
3890a82b0e
commit
41dbd31aac
21 changed files with 14591 additions and 14591 deletions
12376
HttpBins/HttpServer.xml
12376
HttpBins/HttpServer.xml
File diff suppressed because it is too large
Load diff
|
|
@ -1,96 +1,96 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Terraria;
|
using Terraria;
|
||||||
|
|
||||||
namespace TShockAPI
|
namespace TShockAPI
|
||||||
{
|
{
|
||||||
public class BackupManager
|
public class BackupManager
|
||||||
{
|
{
|
||||||
public string BackupPath { get; set; }
|
public string BackupPath { get; set; }
|
||||||
public int Interval { get; set; }
|
public int Interval { get; set; }
|
||||||
public int KeepFor { get; set; }
|
public int KeepFor { get; set; }
|
||||||
|
|
||||||
private DateTime lastbackup = DateTime.UtcNow;
|
private DateTime lastbackup = DateTime.UtcNow;
|
||||||
|
|
||||||
public BackupManager(string path)
|
public BackupManager(string path)
|
||||||
{
|
{
|
||||||
BackupPath = path;
|
BackupPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsBackupTime
|
public bool IsBackupTime
|
||||||
{
|
{
|
||||||
get { return (Interval > 0) && ((DateTime.UtcNow - lastbackup).TotalMinutes >= Interval); }
|
get { return (Interval > 0) && ((DateTime.UtcNow - lastbackup).TotalMinutes >= Interval); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Backup()
|
public void Backup()
|
||||||
{
|
{
|
||||||
lastbackup = DateTime.UtcNow;
|
lastbackup = DateTime.UtcNow;
|
||||||
ThreadPool.QueueUserWorkItem(DoBackup);
|
ThreadPool.QueueUserWorkItem(DoBackup);
|
||||||
ThreadPool.QueueUserWorkItem(DeleteOld);
|
ThreadPool.QueueUserWorkItem(DeleteOld);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoBackup(object o)
|
private void DoBackup(object o)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string worldname = Main.worldPathName;
|
string worldname = Main.worldPathName;
|
||||||
string name = Path.GetFileName(worldname);
|
string name = Path.GetFileName(worldname);
|
||||||
|
|
||||||
Main.worldPathName = Path.Combine(BackupPath, string.Format("{0}.{1:dd.MM.yy-HH.mm.ss}.bak", name, DateTime.UtcNow));
|
Main.worldPathName = Path.Combine(BackupPath, string.Format("{0}.{1:dd.MM.yy-HH.mm.ss}.bak", name, DateTime.UtcNow));
|
||||||
|
|
||||||
string worldpath = Path.GetDirectoryName(Main.worldPathName);
|
string worldpath = Path.GetDirectoryName(Main.worldPathName);
|
||||||
if (worldpath != null && !Directory.Exists(worldpath))
|
if (worldpath != null && !Directory.Exists(worldpath))
|
||||||
Directory.CreateDirectory(worldpath);
|
Directory.CreateDirectory(worldpath);
|
||||||
|
|
||||||
TShock.Utils.Broadcast("Server map saving, potential lag spike");
|
TShock.Utils.Broadcast("Server map saving, potential lag spike");
|
||||||
Console.WriteLine("Backing up world...");
|
Console.WriteLine("Backing up world...");
|
||||||
|
|
||||||
SaveManager.Instance.SaveWorld();
|
SaveManager.Instance.SaveWorld();
|
||||||
Console.WriteLine("World backed up");
|
Console.WriteLine("World backed up");
|
||||||
Console.ForegroundColor = ConsoleColor.Gray;
|
Console.ForegroundColor = ConsoleColor.Gray;
|
||||||
Log.Info(string.Format("World backed up ({0})", Main.worldPathName));
|
Log.Info(string.Format("World backed up ({0})", Main.worldPathName));
|
||||||
|
|
||||||
Main.worldPathName = worldname;
|
Main.worldPathName = worldname;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.ForegroundColor = ConsoleColor.Red;
|
Console.ForegroundColor = ConsoleColor.Red;
|
||||||
Console.WriteLine("Backup failed");
|
Console.WriteLine("Backup failed");
|
||||||
Console.ForegroundColor = ConsoleColor.Gray;
|
Console.ForegroundColor = ConsoleColor.Gray;
|
||||||
Log.Error("Backup failed");
|
Log.Error("Backup failed");
|
||||||
Log.Error(ex.ToString());
|
Log.Error(ex.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DeleteOld(object o)
|
private void DeleteOld(object o)
|
||||||
{
|
{
|
||||||
if (KeepFor <= 0)
|
if (KeepFor <= 0)
|
||||||
return;
|
return;
|
||||||
foreach (var fi in new DirectoryInfo(BackupPath).GetFiles("*.bak"))
|
foreach (var fi in new DirectoryInfo(BackupPath).GetFiles("*.bak"))
|
||||||
{
|
{
|
||||||
if ((DateTime.UtcNow - fi.LastWriteTimeUtc).TotalMinutes > KeepFor)
|
if ((DateTime.UtcNow - fi.LastWriteTimeUtc).TotalMinutes > KeepFor)
|
||||||
{
|
{
|
||||||
fi.Delete();
|
fi.Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
|
|
@ -583,10 +583,10 @@ namespace TShockAPI
|
||||||
// User deletion requires a username
|
// User deletion requires a username
|
||||||
else if (subcmd == "del" && args.Parameters.Count == 2)
|
else if (subcmd == "del" && args.Parameters.Count == 2)
|
||||||
{
|
{
|
||||||
var user = new User();
|
var user = new User();
|
||||||
if (args.Parameters[1].Split('.').Count() ==4)
|
if (args.Parameters[1].Split('.').Count() ==4)
|
||||||
|
|
||||||
// changed to support dot character in usernames
|
// changed to support dot character in usernames
|
||||||
// if (args.Parameters[1].Contains("."))
|
// if (args.Parameters[1].Contains("."))
|
||||||
user.Address = args.Parameters[1];
|
user.Address = args.Parameters[1];
|
||||||
else
|
else
|
||||||
|
|
@ -632,7 +632,7 @@ namespace TShockAPI
|
||||||
// Group changing requires a username or IP address, and a new group to set
|
// Group changing requires a username or IP address, and a new group to set
|
||||||
else if (subcmd == "group")
|
else if (subcmd == "group")
|
||||||
{
|
{
|
||||||
var user = new User();
|
var user = new User();
|
||||||
if (args.Parameters[1].Split('.').Count()==4)
|
if (args.Parameters[1].Split('.').Count()==4)
|
||||||
|
|
||||||
//changed to support dot character in usernames
|
//changed to support dot character in usernames
|
||||||
|
|
@ -1116,34 +1116,34 @@ namespace TShockAPI
|
||||||
else if (args.Parameters[0] == "gold")
|
else if (args.Parameters[0] == "gold")
|
||||||
{
|
{
|
||||||
num = 5;
|
num = 5;
|
||||||
}
|
|
||||||
else if (args.Parameters[0] == "demonite")
|
|
||||||
{
|
|
||||||
num = 7;
|
|
||||||
}
|
}
|
||||||
else if (args.Parameters[0] == "sapphire")
|
else if (args.Parameters[0] == "demonite")
|
||||||
{
|
{
|
||||||
num = 8;
|
num = 7;
|
||||||
}
|
}
|
||||||
else if (args.Parameters[0] == "ruby")
|
else if (args.Parameters[0] == "sapphire")
|
||||||
{
|
{
|
||||||
num = 9;
|
num = 8;
|
||||||
}
|
}
|
||||||
else if (args.Parameters[0] == "emerald")
|
else if (args.Parameters[0] == "ruby")
|
||||||
{
|
{
|
||||||
num = 10;
|
num = 9;
|
||||||
}
|
}
|
||||||
else if (args.Parameters[0] == "topaz")
|
else if (args.Parameters[0] == "emerald")
|
||||||
{
|
{
|
||||||
num = 11;
|
num = 10;
|
||||||
}
|
}
|
||||||
else if (args.Parameters[0] == "amethyst")
|
else if (args.Parameters[0] == "topaz")
|
||||||
{
|
{
|
||||||
num = 12;
|
num = 11;
|
||||||
}
|
}
|
||||||
else if (args.Parameters[0] == "diamond")
|
else if (args.Parameters[0] == "amethyst")
|
||||||
{
|
{
|
||||||
num = 13;
|
num = 12;
|
||||||
|
}
|
||||||
|
else if (args.Parameters[0] == "diamond")
|
||||||
|
{
|
||||||
|
num = 13;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1179,40 +1179,40 @@ namespace TShockAPI
|
||||||
num = 9;
|
num = 9;
|
||||||
num3 *= 1.1f;
|
num3 *= 1.1f;
|
||||||
}
|
}
|
||||||
else if (num == 7)
|
else if (num == 7)
|
||||||
{
|
{
|
||||||
num = 22;
|
num = 22;
|
||||||
num3 *= 1;
|
num3 *= 1;
|
||||||
}
|
}
|
||||||
else if (num == 8)
|
else if (num == 8)
|
||||||
{
|
{
|
||||||
num = 63;
|
num = 63;
|
||||||
num3 *= .80f;
|
num3 *= .80f;
|
||||||
}
|
}
|
||||||
else if (num == 9)
|
else if (num == 9)
|
||||||
{
|
{
|
||||||
num = 64;
|
num = 64;
|
||||||
num3 *=1;
|
num3 *=1;
|
||||||
}
|
}
|
||||||
else if (num == 10)
|
else if (num == 10)
|
||||||
{
|
{
|
||||||
num = 65;
|
num = 65;
|
||||||
num3 *= 1;
|
num3 *= 1;
|
||||||
}
|
}
|
||||||
else if (num == 11)
|
else if (num == 11)
|
||||||
{
|
{
|
||||||
num = 66;
|
num = 66;
|
||||||
num3 *= 1;
|
num3 *= 1;
|
||||||
}
|
}
|
||||||
else if (num == 12)
|
else if (num == 12)
|
||||||
{
|
{
|
||||||
num = 67;
|
num = 67;
|
||||||
num3 *= 1;
|
num3 *= 1;
|
||||||
}
|
}
|
||||||
else if (num == 13)
|
else if (num == 13)
|
||||||
{
|
{
|
||||||
num = 68;
|
num = 68;
|
||||||
num3 *= 1;
|
num3 *= 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1598,38 +1598,38 @@ namespace TShockAPI
|
||||||
for (int x = 0; x < Main.maxTilesX; x++)
|
for (int x = 0; x < Main.maxTilesX; x++)
|
||||||
{
|
{
|
||||||
for (int y = 0; y < Main.maxTilesY; y++)
|
for (int y = 0; y < Main.maxTilesY; y++)
|
||||||
{
|
{
|
||||||
switch (Main.tile[x, y].type)
|
switch (Main.tile[x, y].type)
|
||||||
{
|
{
|
||||||
case 117:
|
case 117:
|
||||||
case 25:
|
case 25:
|
||||||
Main.tile[x, y].type = 1;
|
Main.tile[x, y].type = 1;
|
||||||
break;
|
break;
|
||||||
case 109:
|
case 109:
|
||||||
case 23:
|
case 23:
|
||||||
Main.tile[x, y].type = 2;
|
Main.tile[x, y].type = 2;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
case 113:
|
case 113:
|
||||||
case 110:
|
case 110:
|
||||||
Main.tile[x, y].type = 0;
|
Main.tile[x, y].type = 0;
|
||||||
Main.tile[x, y].active = false;
|
Main.tile[x, y].active = false;
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
Main.tile[x, y].type = 3;
|
Main.tile[x, y].type = 3;
|
||||||
break;
|
break;
|
||||||
case 112:
|
case 112:
|
||||||
case 116:
|
case 116:
|
||||||
Main.tile[x, y].type = 53;
|
Main.tile[x, y].type = 53;
|
||||||
break;
|
break;
|
||||||
case 118:
|
case 118:
|
||||||
Main.tile[x, y].type = 38;
|
Main.tile[x, y].type = 38;
|
||||||
break;
|
break;
|
||||||
case 115:
|
case 115:
|
||||||
Main.tile[x, y].type = 52;
|
Main.tile[x, y].type = 52;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2262,7 +2262,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
private static void Reload(CommandArgs args)
|
private static void Reload(CommandArgs args)
|
||||||
{
|
{
|
||||||
FileTools.SetupConfig();
|
FileTools.SetupConfig();
|
||||||
TShock.HandleCommandLinePostConfigLoad(Environment.GetCommandLineArgs());
|
TShock.HandleCommandLinePostConfigLoad(Environment.GetCommandLineArgs());
|
||||||
TShock.Groups.LoadPermisions();
|
TShock.Groups.LoadPermisions();
|
||||||
TShock.Regions.ReloadAllRegions();
|
TShock.Regions.ReloadAllRegions();
|
||||||
|
|
|
||||||
|
|
@ -1,287 +1,287 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace TShockAPI
|
namespace TShockAPI
|
||||||
{
|
{
|
||||||
public class ConfigFile
|
public class ConfigFile
|
||||||
{
|
{
|
||||||
[Description(
|
[Description(
|
||||||
"The equation for calculating invasion size is 100 + (multiplier * (number of active players with greater than 200 health))"
|
"The equation for calculating invasion size is 100 + (multiplier * (number of active players with greater than 200 health))"
|
||||||
)] public int InvasionMultiplier = 1;
|
)] public int InvasionMultiplier = 1;
|
||||||
|
|
||||||
[Description("The default maximum mobs that will spawn per wave. Higher means more mobs in that wave.")] public int
|
[Description("The default maximum mobs that will spawn per wave. Higher means more mobs in that wave.")] public int
|
||||||
DefaultMaximumSpawns = 5;
|
DefaultMaximumSpawns = 5;
|
||||||
|
|
||||||
[Description("The delay between waves. Shorter values lead to less mobs.")] public int DefaultSpawnRate = 600;
|
[Description("The delay between waves. Shorter values lead to less mobs.")] public int DefaultSpawnRate = 600;
|
||||||
[Description("The port the server runs on.")] public int ServerPort = 7777;
|
[Description("The port the server runs on.")] public int ServerPort = 7777;
|
||||||
[Description("Enable or disable the whitelist based on IP addresses in whitelist.txt")] public bool EnableWhitelist;
|
[Description("Enable or disable the whitelist based on IP addresses in whitelist.txt")] public bool EnableWhitelist;
|
||||||
|
|
||||||
[Description(
|
[Description(
|
||||||
"Enable the ability for invaison size to never decrease. Make sure to run /invade, and note that this adds 2 million+ goblins to the spawn que for the map."
|
"Enable the ability for invaison size to never decrease. Make sure to run /invade, and note that this adds 2 million+ goblins to the spawn que for the map."
|
||||||
)] public bool InfiniteInvasion;
|
)] public bool InfiniteInvasion;
|
||||||
|
|
||||||
[Description("Set the server pvp mode. Vaild types are, \"normal\", \"always\", \"disabled\"")] public string PvPMode
|
[Description("Set the server pvp mode. Vaild types are, \"normal\", \"always\", \"disabled\"")] public string PvPMode
|
||||||
= "normal";
|
= "normal";
|
||||||
|
|
||||||
[Description("Prevents tiles from being placed within SpawnProtectionRadius of the default spawn.")] public bool
|
[Description("Prevents tiles from being placed within SpawnProtectionRadius of the default spawn.")] public bool
|
||||||
SpawnProtection = true;
|
SpawnProtection = true;
|
||||||
|
|
||||||
[Description("Radius from spawn tile for SpawnProtection.")] public int SpawnProtectionRadius = 10;
|
[Description("Radius from spawn tile for SpawnProtection.")] public int SpawnProtectionRadius = 10;
|
||||||
|
|
||||||
[Description(
|
[Description(
|
||||||
"Max slots for the server. If you want people to be kicked with \"Server is full\" set this to how many players you want max and then set Terraria max players to 2 higher."
|
"Max slots for the server. If you want people to be kicked with \"Server is full\" set this to how many players you want max and then set Terraria max players to 2 higher."
|
||||||
)] public int MaxSlots = 8;
|
)] public int MaxSlots = 8;
|
||||||
|
|
||||||
[Description("Global protection agent for any block distance based anti-grief check.")] public bool RangeChecks = true;
|
[Description("Global protection agent for any block distance based anti-grief check.")] public bool RangeChecks = true;
|
||||||
[Description("Disables any building; placing of blocks")] public bool DisableBuild;
|
[Description("Disables any building; placing of blocks")] public bool DisableBuild;
|
||||||
|
|
||||||
[Description("#.#.#. = Red/Blue/Green - RGB Colors for the Admin Chat Color. Max value: 255")] public float[]
|
[Description("#.#.#. = Red/Blue/Green - RGB Colors for the Admin Chat Color. Max value: 255")] public float[]
|
||||||
SuperAdminChatRGB = {255, 0, 0};
|
SuperAdminChatRGB = {255, 0, 0};
|
||||||
|
|
||||||
[Description("Super admin group chat prefix")] public string SuperAdminChatPrefix = "(Admin) ";
|
[Description("Super admin group chat prefix")] public string SuperAdminChatPrefix = "(Admin) ";
|
||||||
[Description("Super admin group chat suffix")] public string SuperAdminChatSuffix = "";
|
[Description("Super admin group chat suffix")] public string SuperAdminChatSuffix = "";
|
||||||
|
|
||||||
[Description(
|
[Description(
|
||||||
"Backup frequency in minutes. So, a value of 60 = 60 minutes. Backups are stored in the \\tshock\\backups folder.")] public int BackupInterval;
|
"Backup frequency in minutes. So, a value of 60 = 60 minutes. Backups are stored in the \\tshock\\backups folder.")] public int BackupInterval;
|
||||||
|
|
||||||
[Description("How long backups are kept in minutes. 2880 = 2 days.")] public int BackupKeepFor = 60;
|
[Description("How long backups are kept in minutes. 2880 = 2 days.")] public int BackupKeepFor = 60;
|
||||||
|
|
||||||
[Description(
|
[Description(
|
||||||
"Remembers where a player left off. It works by remembering the IP, NOT the character. \neg. When you try to disconnect, and reconnect to be automatically placed at spawn, you'll be at your last location. Note: Won't save after server restarts."
|
"Remembers where a player left off. It works by remembering the IP, NOT the character. \neg. When you try to disconnect, and reconnect to be automatically placed at spawn, you'll be at your last location. Note: Won't save after server restarts."
|
||||||
)] public bool RememberLeavePos;
|
)] public bool RememberLeavePos;
|
||||||
|
|
||||||
[Description("Hardcore players ONLY. This means softcore players cannot join.")] public bool HardcoreOnly;
|
[Description("Hardcore players ONLY. This means softcore players cannot join.")] public bool HardcoreOnly;
|
||||||
[Description("Mediumcore players ONLY. This means softcore players cannot join.")] public bool MediumcoreOnly;
|
[Description("Mediumcore players ONLY. This means softcore players cannot join.")] public bool MediumcoreOnly;
|
||||||
[Description("Kicks a Hardcore player on death.")] public bool KickOnMediumcoreDeath;
|
[Description("Kicks a Hardcore player on death.")] public bool KickOnMediumcoreDeath;
|
||||||
[Description("Bans a Hardcore player on death.")] public bool BanOnMediumcoreDeath;
|
[Description("Bans a Hardcore player on death.")] public bool BanOnMediumcoreDeath;
|
||||||
|
|
||||||
[Description("Enable/Disable Terrarias built in auto save")] public bool AutoSave = true;
|
[Description("Enable/Disable Terrarias built in auto save")] public bool AutoSave = true;
|
||||||
|
|
||||||
[Description("Number of failed login attempts before kicking the player.")] public int MaximumLoginAttempts = 3;
|
[Description("Number of failed login attempts before kicking the player.")] public int MaximumLoginAttempts = 3;
|
||||||
|
|
||||||
[Description("Not implemented")] public string RconPassword = "";
|
[Description("Not implemented")] public string RconPassword = "";
|
||||||
[Description("Not implemented")] public int RconPort = 7777;
|
[Description("Not implemented")] public int RconPort = 7777;
|
||||||
|
|
||||||
[Description("Used when replying to a rest /status request.")] public string ServerName = "";
|
[Description("Used when replying to a rest /status request.")] public string ServerName = "";
|
||||||
[Description("Not implemented")] public string MasterServer = "127.0.0.1";
|
[Description("Not implemented")] public string MasterServer = "127.0.0.1";
|
||||||
|
|
||||||
[Description("Valid types are \"sqlite\" and \"mysql\"")] public string StorageType = "sqlite";
|
[Description("Valid types are \"sqlite\" and \"mysql\"")] public string StorageType = "sqlite";
|
||||||
|
|
||||||
[Description("The MySQL Hostname and port to direct connections to")] public string MySqlHost = "localhost:3306";
|
[Description("The MySQL Hostname and port to direct connections to")] public string MySqlHost = "localhost:3306";
|
||||||
[Description("Database name to connect to")] public string MySqlDbName = "";
|
[Description("Database name to connect to")] public string MySqlDbName = "";
|
||||||
[Description("Database username to connect with")] public string MySqlUsername = "";
|
[Description("Database username to connect with")] public string MySqlUsername = "";
|
||||||
[Description("Database password to connect with")] public string MySqlPassword = "";
|
[Description("Database password to connect with")] public string MySqlPassword = "";
|
||||||
|
|
||||||
[Description("Bans a Mediumcore player on death.")] public string MediumcoreBanReason = "Death results in a ban";
|
[Description("Bans a Mediumcore player on death.")] public string MediumcoreBanReason = "Death results in a ban";
|
||||||
[Description("Kicks a Mediumcore player on death.")] public string MediumcoreKickReason = "Death results in a kick";
|
[Description("Kicks a Mediumcore player on death.")] public string MediumcoreKickReason = "Death results in a kick";
|
||||||
|
|
||||||
[Description("Enables DNS resolution of incoming connections with GetGroupForIPExpensive.")] public bool
|
[Description("Enables DNS resolution of incoming connections with GetGroupForIPExpensive.")] public bool
|
||||||
EnableDNSHostResolution;
|
EnableDNSHostResolution;
|
||||||
|
|
||||||
[Description("Enables kicking of banned users by matching their IP Address")] public bool EnableIPBans = true;
|
[Description("Enables kicking of banned users by matching their IP Address")] public bool EnableIPBans = true;
|
||||||
|
|
||||||
[Description("Enables kicking of banned users by matching their Character Name")] public bool EnableBanOnUsernames;
|
[Description("Enables kicking of banned users by matching their Character Name")] public bool EnableBanOnUsernames;
|
||||||
|
|
||||||
[Description("Selects the default group name to place new registrants under")] public string
|
[Description("Selects the default group name to place new registrants under")] public string
|
||||||
DefaultRegistrationGroupName = "default";
|
DefaultRegistrationGroupName = "default";
|
||||||
|
|
||||||
[Description("Selects the default group name to place non registered users under")] public string
|
[Description("Selects the default group name to place non registered users under")] public string
|
||||||
DefaultGuestGroupName = "guest";
|
DefaultGuestGroupName = "guest";
|
||||||
|
|
||||||
[Description("Force-Disable printing logs to players with the log permission")] public bool DisableSpewLogs = true;
|
[Description("Force-Disable printing logs to players with the log permission")] public bool DisableSpewLogs = true;
|
||||||
|
|
||||||
[Description("Valid types are \"sha512\", \"sha256\", \"md5\", append with \"-xp\" for the xp supported algorithms")] public string HashAlgorithm = "sha512";
|
[Description("Valid types are \"sha512\", \"sha256\", \"md5\", append with \"-xp\" for the xp supported algorithms")] public string HashAlgorithm = "sha512";
|
||||||
|
|
||||||
[Description("Buffers up the packets and sends them out at the end of each frame")] public bool BufferPackets = true;
|
[Description("Buffers up the packets and sends them out at the end of each frame")] public bool BufferPackets = true;
|
||||||
|
|
||||||
[Description("String that is used when kicking people when the server is full.")] public string ServerFullReason =
|
[Description("String that is used when kicking people when the server is full.")] public string ServerFullReason =
|
||||||
"Server is full";
|
"Server is full";
|
||||||
|
|
||||||
[Description("String that is used when kicking people when the server is full with no reserved slots.")] public string
|
[Description("String that is used when kicking people when the server is full with no reserved slots.")] public string
|
||||||
ServerFullNoReservedReason = "Server is full. No reserved slots open.";
|
ServerFullNoReservedReason = "Server is full. No reserved slots open.";
|
||||||
|
|
||||||
[Description("This will save the world if Terraria crashes from an unhandled exception.")] public bool
|
[Description("This will save the world if Terraria crashes from an unhandled exception.")] public bool
|
||||||
SaveWorldOnCrash = true;
|
SaveWorldOnCrash = true;
|
||||||
|
|
||||||
[Description("This will announce a player's location on join")] public bool EnableGeoIP;
|
[Description("This will announce a player's location on join")] public bool EnableGeoIP;
|
||||||
|
|
||||||
[Description("This will turn on a token requirement for the /status API endpoint.")] public bool
|
[Description("This will turn on a token requirement for the /status API endpoint.")] public bool
|
||||||
EnableTokenEndpointAuthentication;
|
EnableTokenEndpointAuthentication;
|
||||||
|
|
||||||
[Description("This is used when the API endpoint /status is queried.")] public string ServerNickname = "TShock Server";
|
[Description("This is used when the API endpoint /status is queried.")] public string ServerNickname = "TShock Server";
|
||||||
|
|
||||||
[Description("Enable/Disable the rest api.")] public bool RestApiEnabled;
|
[Description("Enable/Disable the rest api.")] public bool RestApiEnabled;
|
||||||
|
|
||||||
[Description("This is the port which the rest api will listen on.")] public int RestApiPort = 7878;
|
[Description("This is the port which the rest api will listen on.")] public int RestApiPort = 7878;
|
||||||
|
|
||||||
[Description("Disable tombstones for all players.")] public bool DisableTombstones = true;
|
[Description("Disable tombstones for all players.")] public bool DisableTombstones = true;
|
||||||
|
|
||||||
[Description("Displays a player's IP on join to everyone who has the log permission")] public bool DisplayIPToAdmins;
|
[Description("Displays a player's IP on join to everyone who has the log permission")] public bool DisplayIPToAdmins;
|
||||||
|
|
||||||
[Description(
|
[Description(
|
||||||
"Some tiles are 'fixed' by not letting TShock handle them. Disabling this may break certain asthetic tiles.")] public
|
"Some tiles are 'fixed' by not letting TShock handle them. Disabling this may break certain asthetic tiles.")] public
|
||||||
bool EnableInsecureTileFixes = true;
|
bool EnableInsecureTileFixes = true;
|
||||||
|
|
||||||
[Description("Kicks users using a proxy as identified with the GeoIP database")] public bool KickProxyUsers = true;
|
[Description("Kicks users using a proxy as identified with the GeoIP database")] public bool KickProxyUsers = true;
|
||||||
|
|
||||||
[Description("Disables hardmode, can't never be activated. Overrides /starthardmode")] public bool DisableHardmode;
|
[Description("Disables hardmode, can't never be activated. Overrides /starthardmode")] public bool DisableHardmode;
|
||||||
|
|
||||||
[Description("Disables Dungeon Guardian from being spawned by player packets, this will instead force a respawn")] public bool DisableDungeonGuardian;
|
[Description("Disables Dungeon Guardian from being spawned by player packets, this will instead force a respawn")] public bool DisableDungeonGuardian;
|
||||||
|
|
||||||
[Description("Enable Server Side Inventory checks, EXPERIMENTAL")] public bool ServerSideInventory;
|
[Description("Enable Server Side Inventory checks, EXPERIMENTAL")] public bool ServerSideInventory;
|
||||||
|
|
||||||
[Description("How often SSI should save, in minutes")] public int ServerSideInventorySave = 15;
|
[Description("How often SSI should save, in minutes")] public int ServerSideInventorySave = 15;
|
||||||
|
|
||||||
[Description("Time, in milliseconds, to disallow discarding items after logging in when ServerSideInventory is ON")] public int LogonDiscardThreshold=250;
|
[Description("Time, in milliseconds, to disallow discarding items after logging in when ServerSideInventory is ON")] public int LogonDiscardThreshold=250;
|
||||||
|
|
||||||
[Description("Disables reporting of playercount to the stat system.")] public bool DisablePlayerCountReporting;
|
[Description("Disables reporting of playercount to the stat system.")] public bool DisablePlayerCountReporting;
|
||||||
|
|
||||||
[Description("Disables clown bomb projectiles from spawning")] public bool DisableClownBombs;
|
[Description("Disables clown bomb projectiles from spawning")] public bool DisableClownBombs;
|
||||||
|
|
||||||
[Description("Disables snow ball projectiles from spawning")] public bool DisableSnowBalls;
|
[Description("Disables snow ball projectiles from spawning")] public bool DisableSnowBalls;
|
||||||
|
|
||||||
[Description(
|
[Description(
|
||||||
"Change ingame chat format, {0} = Group Name, {1} = Group Prefix, {2} = Player Name, {3} = Group Suffix, {4} = Chat Message"
|
"Change ingame chat format, {0} = Group Name, {1} = Group Prefix, {2} = Player Name, {3} = Group Suffix, {4} = Chat Message"
|
||||||
)] public string ChatFormat = "{1}{2}{3}: {4}";
|
)] public string ChatFormat = "{1}{2}{3}: {4}";
|
||||||
|
|
||||||
[Description("Force the world time to be normal, day, or night")] public string ForceTime = "normal";
|
[Description("Force the world time to be normal, day, or night")] public string ForceTime = "normal";
|
||||||
|
|
||||||
[Description("Disable/Revert a player if they exceed this number of tile kills within 1 second.")] public int
|
[Description("Disable/Revert a player if they exceed this number of tile kills within 1 second.")] public int
|
||||||
TileKillThreshold = 60;
|
TileKillThreshold = 60;
|
||||||
|
|
||||||
[Description("Disable/Revert a player if they exceed this number of tile places within 1 second.")] public int
|
[Description("Disable/Revert a player if they exceed this number of tile places within 1 second.")] public int
|
||||||
TilePlaceThreshold = 20;
|
TilePlaceThreshold = 20;
|
||||||
|
|
||||||
[Description("Disable a player if they exceed this number of liquid sets within 1 second.")] public int
|
[Description("Disable a player if they exceed this number of liquid sets within 1 second.")] public int
|
||||||
TileLiquidThreshold = 15;
|
TileLiquidThreshold = 15;
|
||||||
|
|
||||||
[Description("Disable a player if they exceed this number of projectile new within 1 second.")] public int
|
[Description("Disable a player if they exceed this number of projectile new within 1 second.")] public int
|
||||||
ProjectileThreshold = 50;
|
ProjectileThreshold = 50;
|
||||||
|
|
||||||
[Description("Ignore shrapnel from crystal bullets for Projectile Threshold.")] public bool
|
[Description("Ignore shrapnel from crystal bullets for Projectile Threshold.")] public bool
|
||||||
ProjIgnoreShrapnel = true;
|
ProjIgnoreShrapnel = true;
|
||||||
|
|
||||||
[Description("Require all players to register or login before being allowed to play.")] public bool RequireLogin;
|
[Description("Require all players to register or login before being allowed to play.")] public bool RequireLogin;
|
||||||
|
|
||||||
[Description(
|
[Description(
|
||||||
"Disables Invisibility potions from being used in PvP (Note, they can use them on the client, but the effect isn't sent to the rest of the server)"
|
"Disables Invisibility potions from being used in PvP (Note, they can use them on the client, but the effect isn't sent to the rest of the server)"
|
||||||
)] public bool DisableInvisPvP;
|
)] public bool DisableInvisPvP;
|
||||||
|
|
||||||
[Description("The maximum distance players disabled for various reasons can move from")] public int
|
[Description("The maximum distance players disabled for various reasons can move from")] public int
|
||||||
MaxRangeForDisabled = 10;
|
MaxRangeForDisabled = 10;
|
||||||
|
|
||||||
[Description("Server password required to join server")] public string ServerPassword = "";
|
[Description("Server password required to join server")] public string ServerPassword = "";
|
||||||
|
|
||||||
[Description("Protect chests with region and build permissions")] public bool RegionProtectChests;
|
[Description("Protect chests with region and build permissions")] public bool RegionProtectChests;
|
||||||
|
|
||||||
[Description("Disable users from being able to login with account password when joining")] public bool
|
[Description("Disable users from being able to login with account password when joining")] public bool
|
||||||
DisableLoginBeforeJoin;
|
DisableLoginBeforeJoin;
|
||||||
|
|
||||||
[Description("Allows users to register any username with /register")] public bool AllowRegisterAnyUsername;
|
[Description("Allows users to register any username with /register")] public bool AllowRegisterAnyUsername;
|
||||||
|
|
||||||
[Description("Allows users to login with any username with /login")] public bool AllowLoginAnyUsername = true;
|
[Description("Allows users to login with any username with /login")] public bool AllowLoginAnyUsername = true;
|
||||||
|
|
||||||
[Description("The maximum damage a player/npc can inflict")] public int MaxDamage = 175;
|
[Description("The maximum damage a player/npc can inflict")] public int MaxDamage = 175;
|
||||||
|
|
||||||
[Description("The maximum damage a projectile can inflict")] public int MaxProjDamage = 175;
|
[Description("The maximum damage a projectile can inflict")] public int MaxProjDamage = 175;
|
||||||
|
|
||||||
[Description("Ignores checking to see if player 'can' update a projectile")] public bool IgnoreProjUpdate = false;
|
[Description("Ignores checking to see if player 'can' update a projectile")] public bool IgnoreProjUpdate = false;
|
||||||
|
|
||||||
[Description("Ignores checking to see if player 'can' kill a projectile")] public bool IgnoreProjKill = false;
|
[Description("Ignores checking to see if player 'can' kill a projectile")] public bool IgnoreProjKill = false;
|
||||||
|
|
||||||
[Description("Ignores all no clip checks for players")] public bool IgnoreNoClip = false;
|
[Description("Ignores all no clip checks for players")] public bool IgnoreNoClip = false;
|
||||||
|
|
||||||
[Description("Allow Ice placement even when user does not have canbuild")] public bool AllowIce = false;
|
[Description("Allow Ice placement even when user does not have canbuild")] public bool AllowIce = false;
|
||||||
|
|
||||||
public static ConfigFile Read(string path)
|
public static ConfigFile Read(string path)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
return new ConfigFile();
|
return new ConfigFile();
|
||||||
using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
|
using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||||
{
|
{
|
||||||
return Read(fs);
|
return Read(fs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ConfigFile Read(Stream stream)
|
public static ConfigFile Read(Stream stream)
|
||||||
{
|
{
|
||||||
using (var sr = new StreamReader(stream))
|
using (var sr = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
var cf = JsonConvert.DeserializeObject<ConfigFile>(sr.ReadToEnd());
|
var cf = JsonConvert.DeserializeObject<ConfigFile>(sr.ReadToEnd());
|
||||||
if (ConfigRead != null)
|
if (ConfigRead != null)
|
||||||
ConfigRead(cf);
|
ConfigRead(cf);
|
||||||
return cf;
|
return cf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(string path)
|
public void Write(string path)
|
||||||
{
|
{
|
||||||
using (var fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Write))
|
using (var fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Write))
|
||||||
{
|
{
|
||||||
Write(fs);
|
Write(fs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(Stream stream)
|
public void Write(Stream stream)
|
||||||
{
|
{
|
||||||
var str = JsonConvert.SerializeObject(this, Formatting.Indented);
|
var str = JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||||
using (var sw = new StreamWriter(stream))
|
using (var sw = new StreamWriter(stream))
|
||||||
{
|
{
|
||||||
sw.Write(str);
|
sw.Write(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Action<ConfigFile> ConfigRead;
|
public static Action<ConfigFile> ConfigRead;
|
||||||
|
|
||||||
|
|
||||||
public static void DumpDescriptions()
|
public static void DumpDescriptions()
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
var defaults = new ConfigFile();
|
var defaults = new ConfigFile();
|
||||||
|
|
||||||
foreach (var field in defaults.GetType().GetFields().OrderBy(f => f.Name))
|
foreach (var field in defaults.GetType().GetFields().OrderBy(f => f.Name))
|
||||||
{
|
{
|
||||||
if (field.IsStatic)
|
if (field.IsStatic)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var name = field.Name;
|
var name = field.Name;
|
||||||
var type = field.FieldType.Name;
|
var type = field.FieldType.Name;
|
||||||
|
|
||||||
var descattr =
|
var descattr =
|
||||||
field.GetCustomAttributes(false).FirstOrDefault(o => o is DescriptionAttribute) as DescriptionAttribute;
|
field.GetCustomAttributes(false).FirstOrDefault(o => o is DescriptionAttribute) as DescriptionAttribute;
|
||||||
var desc = descattr != null && !string.IsNullOrWhiteSpace(descattr.Description) ? descattr.Description : "None";
|
var desc = descattr != null && !string.IsNullOrWhiteSpace(descattr.Description) ? descattr.Description : "None";
|
||||||
|
|
||||||
var def = field.GetValue(defaults);
|
var def = field.GetValue(defaults);
|
||||||
|
|
||||||
sb.AppendLine("## {0} ".SFormat(name));
|
sb.AppendLine("## {0} ".SFormat(name));
|
||||||
sb.AppendLine("**Type:** {0} ".SFormat(type));
|
sb.AppendLine("**Type:** {0} ".SFormat(type));
|
||||||
sb.AppendLine("**Description:** {0} ".SFormat(desc));
|
sb.AppendLine("**Description:** {0} ".SFormat(desc));
|
||||||
sb.AppendLine("**Default:** \"{0}\" ".SFormat(def));
|
sb.AppendLine("**Default:** \"{0}\" ".SFormat(def));
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
File.WriteAllText("ConfigDescriptions.txt", sb.ToString());
|
File.WriteAllText("ConfigDescriptions.txt", sb.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,119 +1,119 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace TShockAPI
|
namespace TShockAPI
|
||||||
{
|
{
|
||||||
public class FileTools
|
public class FileTools
|
||||||
{
|
{
|
||||||
internal static string RulesPath
|
internal static string RulesPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "rules.txt"); }
|
get { return Path.Combine(TShock.SavePath, "rules.txt"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string MotdPath
|
internal static string MotdPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "motd.txt"); }
|
get { return Path.Combine(TShock.SavePath, "motd.txt"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string WhitelistPath
|
internal static string WhitelistPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "whitelist.txt"); }
|
get { return Path.Combine(TShock.SavePath, "whitelist.txt"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string RememberedPosPath
|
internal static string RememberedPosPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "oldpos.xml"); }
|
get { return Path.Combine(TShock.SavePath, "oldpos.xml"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string ConfigPath
|
internal static string ConfigPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "config.json"); }
|
get { return Path.Combine(TShock.SavePath, "config.json"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CreateFile(string file)
|
public static void CreateFile(string file)
|
||||||
{
|
{
|
||||||
File.Create(file).Close();
|
File.Create(file).Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CreateIfNot(string file, string data = "")
|
public static void CreateIfNot(string file, string data = "")
|
||||||
{
|
{
|
||||||
if (!File.Exists(file))
|
if (!File.Exists(file))
|
||||||
{
|
{
|
||||||
File.WriteAllText(file, data);
|
File.WriteAllText(file, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets up the configuration file for all variables, and creates any missing files.
|
/// Sets up the configuration file for all variables, and creates any missing files.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SetupConfig()
|
public static void SetupConfig()
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(TShock.SavePath))
|
if (!Directory.Exists(TShock.SavePath))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(TShock.SavePath);
|
Directory.CreateDirectory(TShock.SavePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateIfNot(RulesPath, "Respect the admins!\nDon't use TNT!");
|
CreateIfNot(RulesPath, "Respect the admins!\nDon't use TNT!");
|
||||||
CreateIfNot(MotdPath,
|
CreateIfNot(MotdPath,
|
||||||
"This server is running TShock for Terraria.\n Type /help for a list of commands.\n%255,000,000%Current map: %map%\nCurrent players: %players%");
|
"This server is running TShock for Terraria.\n Type /help for a list of commands.\n%255,000,000%Current map: %map%\nCurrent players: %players%");
|
||||||
CreateIfNot(WhitelistPath);
|
CreateIfNot(WhitelistPath);
|
||||||
if (File.Exists(ConfigPath))
|
if (File.Exists(ConfigPath))
|
||||||
{
|
{
|
||||||
TShock.Config = ConfigFile.Read(ConfigPath);
|
TShock.Config = ConfigFile.Read(ConfigPath);
|
||||||
// Add all the missing config properties in the json file
|
// Add all the missing config properties in the json file
|
||||||
}
|
}
|
||||||
TShock.Config.Write(ConfigPath);
|
TShock.Config.Write(ConfigPath);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tells if a user is on the whitelist
|
/// Tells if a user is on the whitelist
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ip">string ip of the user</param>
|
/// <param name="ip">string ip of the user</param>
|
||||||
/// <returns>true/false</returns>
|
/// <returns>true/false</returns>
|
||||||
public static bool OnWhitelist(string ip)
|
public static bool OnWhitelist(string ip)
|
||||||
{
|
{
|
||||||
if (!TShock.Config.EnableWhitelist)
|
if (!TShock.Config.EnableWhitelist)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
CreateIfNot(WhitelistPath, "127.0.0.1");
|
CreateIfNot(WhitelistPath, "127.0.0.1");
|
||||||
using (var tr = new StreamReader(WhitelistPath))
|
using (var tr = new StreamReader(WhitelistPath))
|
||||||
{
|
{
|
||||||
string whitelist = tr.ReadToEnd();
|
string whitelist = tr.ReadToEnd();
|
||||||
ip = TShock.Utils.GetRealIP(ip);
|
ip = TShock.Utils.GetRealIP(ip);
|
||||||
bool contains = whitelist.Contains(ip);
|
bool contains = whitelist.Contains(ip);
|
||||||
if (!contains)
|
if (!contains)
|
||||||
{
|
{
|
||||||
foreach (var line in whitelist.Split(Environment.NewLine.ToCharArray()))
|
foreach (var line in whitelist.Split(Environment.NewLine.ToCharArray()))
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(line))
|
if (string.IsNullOrWhiteSpace(line))
|
||||||
continue;
|
continue;
|
||||||
contains = TShock.Utils.GetIPv4Address(line).Equals(ip);
|
contains = TShock.Utils.GetIPv4Address(line).Equals(ip);
|
||||||
if (contains)
|
if (contains)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,200 +1,200 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace TShockAPI
|
namespace TShockAPI
|
||||||
{
|
{
|
||||||
public class Group
|
public class Group
|
||||||
{
|
{
|
||||||
public readonly List<string> permissions = new List<string>();
|
public readonly List<string> permissions = new List<string>();
|
||||||
public readonly List<string> negatedpermissions = new List<string>();
|
public readonly List<string> negatedpermissions = new List<string>();
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public Group Parent { get; set; }
|
public Group Parent { get; set; }
|
||||||
public int Order { get; set; }
|
public int Order { get; set; }
|
||||||
public string Prefix { get; set; }
|
public string Prefix { get; set; }
|
||||||
public string Suffix { get; set; }
|
public string Suffix { get; set; }
|
||||||
public string ParentName { get { return (null == Parent) ? "" : Parent.Name; } }
|
public string ParentName { get { return (null == Parent) ? "" : Parent.Name; } }
|
||||||
public string ChatColor
|
public string ChatColor
|
||||||
{
|
{
|
||||||
get { return string.Format("{0}{1}{2}", R.ToString("X2"), G.ToString("X2"), B.ToString("X2")); }
|
get { return string.Format("{0}{1}{2}", R.ToString("X2"), G.ToString("X2"), B.ToString("X2")); }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (null != value)
|
if (null != value)
|
||||||
{
|
{
|
||||||
string[] parts = value.Split(',');
|
string[] parts = value.Split(',');
|
||||||
if (3 == parts.Length)
|
if (3 == parts.Length)
|
||||||
{
|
{
|
||||||
byte r, g, b;
|
byte r, g, b;
|
||||||
if (byte.TryParse(parts[0], out r) && byte.TryParse(parts[1], out g) && byte.TryParse(parts[2], out b))
|
if (byte.TryParse(parts[0], out r) && byte.TryParse(parts[1], out g) && byte.TryParse(parts[2], out b))
|
||||||
{
|
{
|
||||||
R = r;
|
R = r;
|
||||||
G = g;
|
G = g;
|
||||||
B = b;
|
B = b;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Permissions
|
public string Permissions
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
List<string> all = new List<string>(permissions);
|
List<string> all = new List<string>(permissions);
|
||||||
negatedpermissions.ForEach(p => all.Add("!" + p));
|
negatedpermissions.ForEach(p => all.Add("!" + p));
|
||||||
return string.Join(",", all);
|
return string.Join(",", all);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
permissions.Clear();
|
permissions.Clear();
|
||||||
negatedpermissions.Clear();
|
negatedpermissions.Clear();
|
||||||
if (null != value)
|
if (null != value)
|
||||||
value.Split(',').ForEach(p => AddPermission(p.Trim()));
|
value.Split(',').ForEach(p => AddPermission(p.Trim()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> TotalPermissions
|
public List<string> TotalPermissions
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var cur = this;
|
var cur = this;
|
||||||
var traversed = new List<Group>();
|
var traversed = new List<Group>();
|
||||||
HashSet<string> all = new HashSet<string>();
|
HashSet<string> all = new HashSet<string>();
|
||||||
while (cur != null)
|
while (cur != null)
|
||||||
{
|
{
|
||||||
foreach (var perm in cur.permissions)
|
foreach (var perm in cur.permissions)
|
||||||
{
|
{
|
||||||
all.Add(perm);
|
all.Add(perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var perm in cur.negatedpermissions)
|
foreach (var perm in cur.negatedpermissions)
|
||||||
{
|
{
|
||||||
all.Remove(perm);
|
all.Remove(perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (traversed.Contains(cur))
|
if (traversed.Contains(cur))
|
||||||
{
|
{
|
||||||
throw new Exception("Infinite group parenting ({0})".SFormat(cur.Name));
|
throw new Exception("Infinite group parenting ({0})".SFormat(cur.Name));
|
||||||
}
|
}
|
||||||
traversed.Add(cur);
|
traversed.Add(cur);
|
||||||
cur = cur.Parent;
|
cur = cur.Parent;
|
||||||
}
|
}
|
||||||
return all.ToList();
|
return all.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte R = 255;
|
public byte R = 255;
|
||||||
public byte G = 255;
|
public byte G = 255;
|
||||||
public byte B = 255;
|
public byte B = 255;
|
||||||
|
|
||||||
public Group(string groupname, Group parentgroup = null, string chatcolor = "255,255,255", string permissions = null)
|
public Group(string groupname, Group parentgroup = null, string chatcolor = "255,255,255", string permissions = null)
|
||||||
{
|
{
|
||||||
Name = groupname;
|
Name = groupname;
|
||||||
Parent = parentgroup;
|
Parent = parentgroup;
|
||||||
ChatColor = chatcolor;
|
ChatColor = chatcolor;
|
||||||
Permissions = permissions;
|
Permissions = permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool HasPermission(string permission)
|
public virtual bool HasPermission(string permission)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(permission))
|
if (string.IsNullOrEmpty(permission))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var cur = this;
|
var cur = this;
|
||||||
var traversed = new List<Group>();
|
var traversed = new List<Group>();
|
||||||
while (cur != null)
|
while (cur != null)
|
||||||
{
|
{
|
||||||
if (cur.negatedpermissions.Contains(permission))
|
if (cur.negatedpermissions.Contains(permission))
|
||||||
return false;
|
return false;
|
||||||
if (cur.permissions.Contains(permission))
|
if (cur.permissions.Contains(permission))
|
||||||
return true;
|
return true;
|
||||||
if (traversed.Contains(cur))
|
if (traversed.Contains(cur))
|
||||||
{
|
{
|
||||||
throw new Exception("Infinite group parenting ({0})".SFormat(cur.Name));
|
throw new Exception("Infinite group parenting ({0})".SFormat(cur.Name));
|
||||||
}
|
}
|
||||||
traversed.Add(cur);
|
traversed.Add(cur);
|
||||||
cur = cur.Parent;
|
cur = cur.Parent;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NegatePermission(string permission)
|
public void NegatePermission(string permission)
|
||||||
{
|
{
|
||||||
// Avoid duplicates
|
// Avoid duplicates
|
||||||
if (!negatedpermissions.Contains(permission))
|
if (!negatedpermissions.Contains(permission))
|
||||||
{
|
{
|
||||||
negatedpermissions.Add(permission);
|
negatedpermissions.Add(permission);
|
||||||
permissions.Remove(permission); // Ensure we don't have conflicting definitions for a permissions
|
permissions.Remove(permission); // Ensure we don't have conflicting definitions for a permissions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddPermission(string permission)
|
public void AddPermission(string permission)
|
||||||
{
|
{
|
||||||
if (permission.StartsWith("!"))
|
if (permission.StartsWith("!"))
|
||||||
{
|
{
|
||||||
NegatePermission(permission.Substring(1));
|
NegatePermission(permission.Substring(1));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Avoid duplicates
|
// Avoid duplicates
|
||||||
if (!permissions.Contains(permission))
|
if (!permissions.Contains(permission))
|
||||||
{
|
{
|
||||||
permissions.Add(permission);
|
permissions.Add(permission);
|
||||||
negatedpermissions.Remove(permission); // Ensure we don't have conflicting definitions for a permissions
|
negatedpermissions.Remove(permission); // Ensure we don't have conflicting definitions for a permissions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPermission(List<string> permission)
|
public void SetPermission(List<string> permission)
|
||||||
{
|
{
|
||||||
permissions.Clear();
|
permissions.Clear();
|
||||||
negatedpermissions.Clear();
|
negatedpermissions.Clear();
|
||||||
permission.ForEach(p => AddPermission(p));
|
permission.ForEach(p => AddPermission(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemovePermission(string permission)
|
public void RemovePermission(string permission)
|
||||||
{
|
{
|
||||||
if (permission.StartsWith("!"))
|
if (permission.StartsWith("!"))
|
||||||
{
|
{
|
||||||
negatedpermissions.Remove(permission.Substring(1));
|
negatedpermissions.Remove(permission.Substring(1));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
permissions.Remove(permission);
|
permissions.Remove(permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SuperAdminGroup : Group
|
public class SuperAdminGroup : Group
|
||||||
{
|
{
|
||||||
public SuperAdminGroup()
|
public SuperAdminGroup()
|
||||||
: base("superadmin")
|
: base("superadmin")
|
||||||
{
|
{
|
||||||
R = (byte) TShock.Config.SuperAdminChatRGB[0];
|
R = (byte) TShock.Config.SuperAdminChatRGB[0];
|
||||||
G = (byte) TShock.Config.SuperAdminChatRGB[1];
|
G = (byte) TShock.Config.SuperAdminChatRGB[1];
|
||||||
B = (byte) TShock.Config.SuperAdminChatRGB[2];
|
B = (byte) TShock.Config.SuperAdminChatRGB[2];
|
||||||
Prefix = TShock.Config.SuperAdminChatPrefix;
|
Prefix = TShock.Config.SuperAdminChatPrefix;
|
||||||
Suffix = TShock.Config.SuperAdminChatSuffix;
|
Suffix = TShock.Config.SuperAdminChatSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HasPermission(string permission)
|
public override bool HasPermission(string permission)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ namespace TShockAPI
|
||||||
if (ret is RestObject)
|
if (ret is RestObject)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
User user = (User)ret;
|
User user = (User)ret;
|
||||||
return new RestObject() { { "group", user.Group }, { "id", user.ID.ToString() }, { "name", user.Name } };
|
return new RestObject() { { "group", user.Group }, { "id", user.ID.ToString() }, { "name", user.Name } };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
2934
TShockAPI/TShock.cs
2934
TShockAPI/TShock.cs
File diff suppressed because it is too large
Load diff
|
|
@ -1,102 +1,102 @@
|
||||||
/*
|
/*
|
||||||
TShock, a server mod for Terraria
|
TShock, a server mod for Terraria
|
||||||
Copyright (C) 2011 The TShock Team
|
Copyright (C) 2011 The TShock Team
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace TShockAPI
|
namespace TShockAPI
|
||||||
{
|
{
|
||||||
internal class UpdateManager
|
internal class UpdateManager
|
||||||
{
|
{
|
||||||
private static string updateUrl = "http://shankshock.com/tshock-update.json";
|
private static string updateUrl = "http://shankshock.com/tshock-update.json";
|
||||||
public static DateTime lastcheck = DateTime.MinValue;
|
public static DateTime lastcheck = DateTime.MinValue;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check once every X minutes.
|
/// Check once every X minutes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static readonly int CheckXMinutes = 30;
|
private static readonly int CheckXMinutes = 30;
|
||||||
|
|
||||||
public static void UpdateProcedureCheck()
|
public static void UpdateProcedureCheck()
|
||||||
{
|
{
|
||||||
if ((DateTime.Now - lastcheck).TotalMinutes >= CheckXMinutes)
|
if ((DateTime.Now - lastcheck).TotalMinutes >= CheckXMinutes)
|
||||||
{
|
{
|
||||||
ThreadPool.QueueUserWorkItem(CheckUpdate);
|
ThreadPool.QueueUserWorkItem(CheckUpdate);
|
||||||
lastcheck = DateTime.Now;
|
lastcheck = DateTime.Now;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CheckUpdate(object o)
|
public static void CheckUpdate(object o)
|
||||||
{
|
{
|
||||||
var updates = ServerIsOutOfDate();
|
var updates = ServerIsOutOfDate();
|
||||||
if (updates != null)
|
if (updates != null)
|
||||||
{
|
{
|
||||||
NotifyAdministrators(updates);
|
NotifyAdministrators(updates);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks to see if the server is out of date.
|
/// Checks to see if the server is out of date.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static Dictionary<string, string> ServerIsOutOfDate()
|
private static Dictionary<string, string> ServerIsOutOfDate()
|
||||||
{
|
{
|
||||||
using (var client = new WebClient())
|
using (var client = new WebClient())
|
||||||
{
|
{
|
||||||
client.Headers.Add("user-agent",
|
client.Headers.Add("user-agent",
|
||||||
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705;)");
|
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705;)");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string updatejson = client.DownloadString(updateUrl);
|
string updatejson = client.DownloadString(updateUrl);
|
||||||
var update = JsonConvert.DeserializeObject<Dictionary<string, string>>(updatejson);
|
var update = JsonConvert.DeserializeObject<Dictionary<string, string>>(updatejson);
|
||||||
var version = new Version(update["version"]);
|
var version = new Version(update["version"]);
|
||||||
if (TShock.VersionNum.CompareTo(version) < 0)
|
if (TShock.VersionNum.CompareTo(version) < 0)
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error(e.ToString());
|
Log.Error(e.ToString());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void NotifyAdministrators(Dictionary<string, string> update)
|
private static void NotifyAdministrators(Dictionary<string, string> update)
|
||||||
{
|
{
|
||||||
var changes = update["changes"].Split(new[] {'\n'}, StringSplitOptions.RemoveEmptyEntries);
|
var changes = update["changes"].Split(new[] {'\n'}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
NotifyAdministrator(TSPlayer.Server, changes);
|
NotifyAdministrator(TSPlayer.Server, changes);
|
||||||
foreach (TSPlayer player in TShock.Players)
|
foreach (TSPlayer player in TShock.Players)
|
||||||
{
|
{
|
||||||
if (player != null && player.Active && player.Group.HasPermission(Permissions.maintenance))
|
if (player != null && player.Active && player.Group.HasPermission(Permissions.maintenance))
|
||||||
{
|
{
|
||||||
NotifyAdministrator(player, changes);
|
NotifyAdministrator(player, changes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void NotifyAdministrator(TSPlayer player, string[] changes)
|
private static void NotifyAdministrator(TSPlayer player, string[] changes)
|
||||||
{
|
{
|
||||||
player.SendMessage("The server is out of date.", Color.Red);
|
player.SendMessage("The server is out of date.", Color.Red);
|
||||||
for (int j = 0; j < changes.Length; j++)
|
for (int j = 0; j < changes.Length; j++)
|
||||||
{
|
{
|
||||||
player.SendMessage(changes[j], Color.Red);
|
player.SendMessage(changes[j], Color.Red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1564
TShockAPI/Utils.cs
1564
TShockAPI/Utils.cs
File diff suppressed because it is too large
Load diff
|
|
@ -1,36 +1,36 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("ClassLibrary1")]
|
[assembly: AssemblyTitle("ClassLibrary1")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("Multiplay")]
|
[assembly: AssemblyCompany("Multiplay")]
|
||||||
[assembly: AssemblyProduct("ClassLibrary1")]
|
[assembly: AssemblyProduct("ClassLibrary1")]
|
||||||
[assembly: AssemblyCopyright("Copyright © Multiplay 2012")]
|
[assembly: AssemblyCopyright("Copyright © Multiplay 2012")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
[assembly: Guid("c6aed7ee-6282-49a2-8177-b79cad20d6d3")]
|
[assembly: Guid("c6aed7ee-6282-49a2-8177-b79cad20d6d3")]
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|
|
||||||
|
|
@ -1,192 +1,192 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Script.Serialization;
|
using System.Web.Script.Serialization;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Microsoft.VisualStudio.TestTools.WebTesting;
|
using Microsoft.VisualStudio.TestTools.WebTesting;
|
||||||
using Microsoft.VisualStudio.TestTools.WebTesting.Rules;
|
using Microsoft.VisualStudio.TestTools.WebTesting.Rules;
|
||||||
using Rests;
|
using Rests;
|
||||||
|
|
||||||
namespace TshockRestTestPlugin
|
namespace TshockRestTestPlugin
|
||||||
{
|
{
|
||||||
[DisplayName("JSON Status")]
|
[DisplayName("JSON Status")]
|
||||||
[Description("Checks to see the that the JSON response has the specified status response")]
|
[Description("Checks to see the that the JSON response has the specified status response")]
|
||||||
public class JsonValidateStatus : JsonValidate
|
public class JsonValidateStatus : JsonValidate
|
||||||
{
|
{
|
||||||
public override void Validate(object sender, ValidationEventArgs e)
|
public override void Validate(object sender, ValidationEventArgs e)
|
||||||
{
|
{
|
||||||
if (null != ValidateJson(sender, e))
|
if (null != ValidateJson(sender, e))
|
||||||
e.IsValid = true;
|
e.IsValid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DisplayName("JSON Regexp Property")]
|
[DisplayName("JSON Regexp Property")]
|
||||||
[Description("Checks to see the that the JSON response contains the specified property and is matches the specified regexp")]
|
[Description("Checks to see the that the JSON response contains the specified property and is matches the specified regexp")]
|
||||||
public class JsonValidateRegexpProperty : JsonValidateProperty
|
public class JsonValidateRegexpProperty : JsonValidateProperty
|
||||||
{
|
{
|
||||||
// The name of the desired JSON property
|
// The name of the desired JSON property
|
||||||
[DisplayName("Regexp")]
|
[DisplayName("Regexp")]
|
||||||
[DefaultValue(true)]
|
[DefaultValue(true)]
|
||||||
public new bool UseRegularExpression { get { return base.UseRegularExpression; } set { base.UseRegularExpression = value; } }
|
public new bool UseRegularExpression { get { return base.UseRegularExpression; } set { base.UseRegularExpression = value; } }
|
||||||
}
|
}
|
||||||
|
|
||||||
[DisplayName("JSON Error")]
|
[DisplayName("JSON Error")]
|
||||||
[Description("Checks to see the that the JSON response contains the specified error")]
|
[Description("Checks to see the that the JSON response contains the specified error")]
|
||||||
public class JsonValidateError : JsonValidateProperty
|
public class JsonValidateError : JsonValidateProperty
|
||||||
{
|
{
|
||||||
// The status of the JSON request
|
// The status of the JSON request
|
||||||
[DisplayName("JSON Status")]
|
[DisplayName("JSON Status")]
|
||||||
[DefaultValue("400")]
|
[DefaultValue("400")]
|
||||||
public new string JSonStatus { get { return base.JSonStatus; } set { base.JSonStatus = value; } }
|
public new string JSonStatus { get { return base.JSonStatus; } set { base.JSonStatus = value; } }
|
||||||
|
|
||||||
// The name of the desired JSON property
|
// The name of the desired JSON property
|
||||||
[DisplayName("Property")]
|
[DisplayName("Property")]
|
||||||
[DefaultValue("error")]
|
[DefaultValue("error")]
|
||||||
public new string PropertyName { get { return base.PropertyName; } set { base.PropertyName = value; } }
|
public new string PropertyName { get { return base.PropertyName; } set { base.PropertyName = value; } }
|
||||||
}
|
}
|
||||||
|
|
||||||
[DisplayName("JSON Missing Parameter")]
|
[DisplayName("JSON Missing Parameter")]
|
||||||
[Description("Checks to see the that the JSON response indicates a missing or invalid parameter")]
|
[Description("Checks to see the that the JSON response indicates a missing or invalid parameter")]
|
||||||
public class JsonValidateMissingParameter : JsonValidateError
|
public class JsonValidateMissingParameter : JsonValidateError
|
||||||
{
|
{
|
||||||
// The value of the desired JSON property
|
// The value of the desired JSON property
|
||||||
[DisplayName("Missing Value")]
|
[DisplayName("Missing Value")]
|
||||||
public new string PropertyValue { get { return base.PropertyValue; } set { base.PropertyValue = String.Format("Missing or empty {0} parameter", value); } }
|
public new string PropertyValue { get { return base.PropertyValue; } set { base.PropertyValue = String.Format("Missing or empty {0} parameter", value); } }
|
||||||
}
|
}
|
||||||
|
|
||||||
[DisplayName("JSON Invalid Parameter")]
|
[DisplayName("JSON Invalid Parameter")]
|
||||||
[Description("Checks to see the that the JSON response indicates a missing or invalid parameter")]
|
[Description("Checks to see the that the JSON response indicates a missing or invalid parameter")]
|
||||||
public class JsonValidateInvalidParameter : JsonValidateError
|
public class JsonValidateInvalidParameter : JsonValidateError
|
||||||
{
|
{
|
||||||
// The value of the desired JSON property
|
// The value of the desired JSON property
|
||||||
[DisplayName("Invalid Value")]
|
[DisplayName("Invalid Value")]
|
||||||
public new string PropertyValue { get { return base.PropertyValue; } set { base.PropertyValue = String.Format("Missing or invalid {0} parameter", value); } }
|
public new string PropertyValue { get { return base.PropertyValue; } set { base.PropertyValue = String.Format("Missing or invalid {0} parameter", value); } }
|
||||||
}
|
}
|
||||||
|
|
||||||
[DisplayName("JSON Response")]
|
[DisplayName("JSON Response")]
|
||||||
[Description("Checks to see the that the JSON response contains the specified message")]
|
[Description("Checks to see the that the JSON response contains the specified message")]
|
||||||
public class JsonValidateResponse : JsonValidateProperty
|
public class JsonValidateResponse : JsonValidateProperty
|
||||||
{
|
{
|
||||||
// The name of the desired JSON property
|
// The name of the desired JSON property
|
||||||
[DisplayName("Response")]
|
[DisplayName("Response")]
|
||||||
[DefaultValue("response")]
|
[DefaultValue("response")]
|
||||||
public new string PropertyName { get { return base.PropertyName; } set { base.PropertyName = value; } }
|
public new string PropertyName { get { return base.PropertyName; } set { base.PropertyName = value; } }
|
||||||
}
|
}
|
||||||
|
|
||||||
[DisplayName("JSON Property")]
|
[DisplayName("JSON Property")]
|
||||||
[Description("Checks to see the that the JSON response contains the specified property and is set to the specified value")]
|
[Description("Checks to see the that the JSON response contains the specified property and is set to the specified value")]
|
||||||
public class JsonValidateProperty : JsonValidate
|
public class JsonValidateProperty : JsonValidate
|
||||||
{
|
{
|
||||||
// The name of the desired JSON property
|
// The name of the desired JSON property
|
||||||
[DisplayName("Property")]
|
[DisplayName("Property")]
|
||||||
public string PropertyName { get; set; }
|
public string PropertyName { get; set; }
|
||||||
|
|
||||||
// The value of the desired JSON property
|
// The value of the desired JSON property
|
||||||
[DisplayName("Value")]
|
[DisplayName("Value")]
|
||||||
public string PropertyValue { get; set; }
|
public string PropertyValue { get; set; }
|
||||||
|
|
||||||
// Is the value a regexp of the desired JSON property
|
// Is the value a regexp of the desired JSON property
|
||||||
[DisplayName("Regexp")]
|
[DisplayName("Regexp")]
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
public bool UseRegularExpression { get; set; }
|
public bool UseRegularExpression { get; set; }
|
||||||
|
|
||||||
public override void Validate(object sender, ValidationEventArgs e)
|
public override void Validate(object sender, ValidationEventArgs e)
|
||||||
{
|
{
|
||||||
RestObject response = ValidateJson(sender, e);
|
RestObject response = ValidateJson(sender, e);
|
||||||
if (null == response)
|
if (null == response)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (null == response[PropertyName])
|
if (null == response[PropertyName])
|
||||||
{
|
{
|
||||||
e.Message = String.Format("{0} Not Found", PropertyName);
|
e.Message = String.Format("{0} Not Found", PropertyName);
|
||||||
e.IsValid = false;
|
e.IsValid = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UseRegularExpression)
|
if (UseRegularExpression)
|
||||||
{
|
{
|
||||||
var re = new Regex(PropertyValue);
|
var re = new Regex(PropertyValue);
|
||||||
if (!re.IsMatch((string)response[PropertyName]))
|
if (!re.IsMatch((string)response[PropertyName]))
|
||||||
{
|
{
|
||||||
e.Message = String.Format("{0} => '{1}' !~ '{2}'", PropertyName, response[PropertyName], PropertyValue);
|
e.Message = String.Format("{0} => '{1}' !~ '{2}'", PropertyName, response[PropertyName], PropertyValue);
|
||||||
e.IsValid = false;
|
e.IsValid = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (PropertyValue != (string)response[PropertyName])
|
if (PropertyValue != (string)response[PropertyName])
|
||||||
{
|
{
|
||||||
e.Message = String.Format("{0} => '{1}' != '{2}'", PropertyName, response[PropertyName], PropertyValue);
|
e.Message = String.Format("{0} => '{1}' != '{2}'", PropertyName, response[PropertyName], PropertyValue);
|
||||||
e.IsValid = false;
|
e.IsValid = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e.IsValid = true;
|
e.IsValid = true;
|
||||||
//e.WebTest.Context.Add(ContextParameterName, propertyValue);
|
//e.WebTest.Context.Add(ContextParameterName, propertyValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DisplayName("JSON Has Properties")]
|
[DisplayName("JSON Has Properties")]
|
||||||
[Description("Checks to see the that the JSON response contains the specified properties (comma seperated)")]
|
[Description("Checks to see the that the JSON response contains the specified properties (comma seperated)")]
|
||||||
public class JsonHasProperties : JsonValidate
|
public class JsonHasProperties : JsonValidate
|
||||||
{
|
{
|
||||||
// The name of the desired JSON properties to check
|
// The name of the desired JSON properties to check
|
||||||
[DisplayName("Properties")]
|
[DisplayName("Properties")]
|
||||||
[Description("A comma seperated list of property names to check exist")]
|
[Description("A comma seperated list of property names to check exist")]
|
||||||
public string PropertyNames { get; set; }
|
public string PropertyNames { get; set; }
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
public override void Validate(object sender, ValidationEventArgs e)
|
public override void Validate(object sender, ValidationEventArgs e)
|
||||||
{
|
{
|
||||||
RestObject response = ValidateJson(sender, e);
|
RestObject response = ValidateJson(sender, e);
|
||||||
if (null == response)
|
if (null == response)
|
||||||
return;
|
return;
|
||||||
foreach (var p in PropertyNames.Split(','))
|
foreach (var p in PropertyNames.Split(','))
|
||||||
{
|
{
|
||||||
if (null == response[p])
|
if (null == response[p])
|
||||||
{
|
{
|
||||||
e.Message = String.Format("'{0}' Not Found", p);
|
e.Message = String.Format("'{0}' Not Found", p);
|
||||||
e.IsValid = false;
|
e.IsValid = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.IsValid = true;
|
e.IsValid = true;
|
||||||
|
|
||||||
//e.WebTest.Context.Add(ContextParameterName, propertyValue);
|
//e.WebTest.Context.Add(ContextParameterName, propertyValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class JsonValidate : ValidationRule
|
public abstract class JsonValidate : ValidationRule
|
||||||
{
|
{
|
||||||
// The status of the JSON request
|
// The status of the JSON request
|
||||||
[DisplayName("JSON Status")]
|
[DisplayName("JSON Status")]
|
||||||
[DefaultValue("200")]
|
[DefaultValue("200")]
|
||||||
public string JSonStatus { get; set; }
|
public string JSonStatus { get; set; }
|
||||||
|
|
||||||
public RestObject ValidateJson(object sender, ValidationEventArgs e)
|
public RestObject ValidateJson(object sender, ValidationEventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(e.Response.BodyString))
|
if (string.IsNullOrWhiteSpace(e.Response.BodyString))
|
||||||
{
|
{
|
||||||
e.IsValid = false;
|
e.IsValid = false;
|
||||||
e.Message = String.Format("Empty or null response {0}", e.Response.StatusCode);
|
e.Message = String.Format("Empty or null response {0}", e.Response.StatusCode);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
JavaScriptSerializer serialiser = new JavaScriptSerializer();
|
JavaScriptSerializer serialiser = new JavaScriptSerializer();
|
||||||
//dynamic data = serialiser.Deserialize<dynamic>(e.Response.BodyString);
|
//dynamic data = serialiser.Deserialize<dynamic>(e.Response.BodyString);
|
||||||
RestObject response = serialiser.Deserialize<RestObject>(e.Response.BodyString);
|
RestObject response = serialiser.Deserialize<RestObject>(e.Response.BodyString);
|
||||||
|
|
||||||
if (JSonStatus != response.Status)
|
if (JSonStatus != response.Status)
|
||||||
{
|
{
|
||||||
e.IsValid = false;
|
e.IsValid = false;
|
||||||
e.Message = String.Format("Response Status '{0}' not '{1}'", response.Status, JSonStatus);
|
e.Message = String.Format("Response Status '{0}' not '{1}'", response.Status, JSonStatus);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,62 +1,62 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
<ProductVersion>8.0.30703</ProductVersion>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{F2FEDAFB-58DE-4611-9168-A86112C346C7}</ProjectGuid>
|
<ProjectGuid>{F2FEDAFB-58DE-4611-9168-A86112C346C7}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>TshockRestTestPlugin</RootNamespace>
|
<RootNamespace>TshockRestTestPlugin</RootNamespace>
|
||||||
<AssemblyName>TshockRestTestPlugin</AssemblyName>
|
<AssemblyName>TshockRestTestPlugin</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Web.Extensions" />
|
<Reference Include="System.Web.Extensions" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="TShockRestTestPlugin.cs" />
|
<Compile Include="TShockRestTestPlugin.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\TShockAPI\TShockAPI.csproj">
|
<ProjectReference Include="..\TShockAPI\TShockAPI.csproj">
|
||||||
<Project>{49606449-072B-4CF5-8088-AA49DA586694}</Project>
|
<Project>{49606449-072B-4CF5-8088-AA49DA586694}</Project>
|
||||||
<Name>TShockAPI</Name>
|
<Name>TShockAPI</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
</Project>
|
</Project>
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue