Merge remote branch 'upstream/general-devel' into general-devel
This commit is contained in:
commit
e7889a7951
6 changed files with 18 additions and 10 deletions
|
|
@ -721,7 +721,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
args.Player.SendMessage("IP Address: " + players[0].IP + " Logged In As: " + players[0].UserAccountName + "Group: " + players[0].Group.Name, Color.Green);
|
args.Player.SendMessage("IP Address: " + players[0].IP + " Logged In As: " + players[0].UserAccountName + " Group: " + players[0].Group.Name, Color.Green);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,8 @@ namespace TShockAPI
|
||||||
|
|
||||||
[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("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;
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,11 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TileEditEventArgs : HandledEventArgs
|
public class TileEditEventArgs : HandledEventArgs
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The TSPlayer who made the tile edit
|
||||||
|
/// </summary>
|
||||||
|
public TSPlayer Player { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tile coordinate on the X plane
|
/// The tile coordinate on the X plane
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -82,13 +87,14 @@ namespace TShockAPI
|
||||||
/// TileEdit - called when a tile is placed or destroyed
|
/// TileEdit - called when a tile is placed or destroyed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<TileEditEventArgs> TileEdit;
|
public static HandlerList<TileEditEventArgs> TileEdit;
|
||||||
private static bool OnTileEdit(int x, int y, byte type, byte editType)
|
private static bool OnTileEdit(TSPlayer ply, int x, int y, byte type, byte editType)
|
||||||
{
|
{
|
||||||
if (TileEdit == null)
|
if (TileEdit == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var args = new TileEditEventArgs
|
var args = new TileEditEventArgs
|
||||||
{
|
{
|
||||||
|
Player = ply,
|
||||||
X = x,
|
X = x,
|
||||||
Y = y,
|
Y = y,
|
||||||
Type = type,
|
Type = type,
|
||||||
|
|
@ -1598,7 +1604,7 @@ namespace TShockAPI
|
||||||
var tileX = args.Data.ReadInt32();
|
var tileX = args.Data.ReadInt32();
|
||||||
var tileY = args.Data.ReadInt32();
|
var tileY = args.Data.ReadInt32();
|
||||||
var tiletype = args.Data.ReadInt8();
|
var tiletype = args.Data.ReadInt8();
|
||||||
if (OnTileEdit(tileX, tileY, tiletype, type))
|
if (OnTileEdit(args.Player, tileX, tileY, tiletype, type))
|
||||||
return true;
|
return true;
|
||||||
if (tileX < 0 || tileX >= Main.maxTilesX || tileY < 0 || tileY >= Main.maxTilesY)
|
if (tileX < 0 || tileX >= Main.maxTilesX || tileY < 0 || tileY >= Main.maxTilesY)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -196,15 +196,15 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
catch (ObjectDisposedException e)
|
catch (ObjectDisposedException e)
|
||||||
{
|
{
|
||||||
Log.Error(e.ToString());
|
Log.Warn(e.ToString());
|
||||||
}
|
}
|
||||||
catch (SocketException e)
|
catch (SocketException e)
|
||||||
{
|
{
|
||||||
Log.Error(e.ToString());
|
Log.Warn(e.ToString());
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
Log.Error(e.ToString());
|
Log.Warn(e.ToString());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,7 @@ namespace TShockAPI
|
||||||
LastCheck = DateTime.UtcNow;
|
LastCheck = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((DateTime.UtcNow - LastSave).TotalMinutes >= 15)
|
if ((DateTime.UtcNow - LastSave).TotalMinutes >= Config.ServerSideInventorySave)
|
||||||
{
|
{
|
||||||
foreach (TSPlayer player in Players)
|
foreach (TSPlayer player in Players)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,12 @@
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>..\..\..\Tshock Debug\ServerPlugins\</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>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<DocumentationFile>..\..\..\Tshock Debug\ServerPlugins\TShockAPI.XML</DocumentationFile>
|
<DocumentationFile>bin\Debug\TShockAPI.XML</DocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
|
|
@ -187,7 +187,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<UserProperties BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildAction="Both" BuildVersion_BuildVersioningStyle="None.None.None.MonthAndDayStamp" BuildVersion_StartDate="2011/6/17" BuildVersion_IncrementBeforeBuild="False" />
|
<UserProperties BuildVersion_IncrementBeforeBuild="False" BuildVersion_StartDate="2011/6/17" BuildVersion_BuildVersioningStyle="None.None.None.MonthAndDayStamp" BuildVersion_BuildAction="Both" BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<!-- 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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue