Cleanup & Fixes for .NET 5 (#309)
- [X] Fixes several bugs - [X] Updates more ordinal issues - [X] Cleans up the code a bit - [X] Turns classes static that should have been - [X] Changes TcpServer.Instances to a HashSet Bumps release version
This commit is contained in:
parent
4ad8811df2
commit
525cda5413
266 changed files with 1348 additions and 1800 deletions
|
|
@ -9,14 +9,14 @@
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<LangVersion>9</LangVersion>
|
<LangVersion>9</LangVersion>
|
||||||
<PublicRelease>true</PublicRelease>
|
<PublicRelease>true</PublicRelease>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<!-- <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>-->
|
||||||
<NoWarn>NU1603</NoWarn>
|
<NoWarn>NU1603</NoWarn>
|
||||||
<RuntimeIdentifiers>win-x64;debian.10-x64;debian.9-x64;ubuntu.16.04-x64;ubuntu.18.04-x64;ubuntu.20.04-x64;centos.7-x64;centos.8-x64;osx-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;debian.10-x64;debian.9-x64;ubuntu.16.04-x64;ubuntu.18.04-x64;ubuntu.20.04-x64;centos.7-x64;centos.8-x64;osx-x64</RuntimeIdentifiers>
|
||||||
<Configurations>Debug;Release;Analyze</Configurations>
|
<Configurations>Debug;Release;Analyze</Configurations>
|
||||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||||
<UseNETCoreGenerator>true</UseNETCoreGenerator>
|
<!-- <UseNETCoreGenerator>true</UseNETCoreGenerator>-->
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
<WarningsAsErrors />
|
<!-- <WarningsAsErrors />-->
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
|
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
|
||||||
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
|
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
|
||||||
|
|
@ -46,16 +46,18 @@
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Analyze'">
|
<PropertyGroup Condition="'$(Configuration)'=='Analyze'">
|
||||||
|
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||||
<CodeAnalysisRuleSet>..\..\Rules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>..\..\Rules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<AnalysisLevel>latest</AnalysisLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup Condition="'$(Configuration)'=='Analyze'">
|
<ItemGroup Condition="'$(Configuration)'=='Analyze'">
|
||||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.205" PrivateAssets="all" />
|
<!-- <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.205" PrivateAssets="all" />-->
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
|
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
|
||||||
<Version>3.0.0</Version>
|
<Version>3.3.1</Version>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<AdditionalFiles Include=".\stylecop.json" />
|
<!-- <AdditionalFiles Include=".\stylecop.json" />-->
|
||||||
<AdditionalFiles Include=".\Rules.ruleset" />
|
<AdditionalFiles Include=".\Rules.ruleset" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@ using Server.Network;
|
||||||
|
|
||||||
namespace Benchmarks
|
namespace Benchmarks
|
||||||
{
|
{
|
||||||
[MemoryDiagnoser]
|
[MemoryDiagnoser, SimpleJob(RuntimeMoniker.NetCoreApp31)]
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
|
|
||||||
public class BenchmarkPacketConstruction
|
public class BenchmarkPacketConstruction
|
||||||
{
|
{
|
||||||
public List<BuyItemState> m_States;
|
public List<BuyItemState> m_States;
|
||||||
|
|
|
||||||
|
|
@ -8,60 +8,59 @@ namespace Server.Tests.Network
|
||||||
{
|
{
|
||||||
public class CircularBufferReaderTests
|
public class CircularBufferReaderTests
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory, InlineData("Test String", "us-ascii", false, -1, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-u", false, -1, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16BE", false, -1, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16", false, -1, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "us-ascii", false, -1, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-u", false, -1, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16BE", false, -1, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16", false, -1, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "us-ascii", false, -1, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-u", false, -1, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16BE", false, -1, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16", false, -1, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "us-ascii", false, 8, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-u", false, 8, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16BE", false, 8, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16", false, 8, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "us-ascii", false, 8, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-u", false, 8, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16BE", false, 8, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16", false, 8, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "us-ascii", false, 8, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-u", false, 8, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16BE", false, 8, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16", false, 8, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "us-ascii", false, 20, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-u", false, 20, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16BE", false, 20, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16", false, 20, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "us-ascii", false, 20, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-u", false, 20, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16BE", false, 20, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16", false, 20, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "us-ascii", false, 20, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-u", false, 20, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16BE", false, 20, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16", false, 20, 1024, 1024, 1020)]
|
||||||
// First only, beginning
|
// First only, beginning
|
||||||
[InlineData("Test String", "us-ascii", false, -1, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-u", false, -1, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, -1, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16", false, -1, 1024, 1024, 0)]
|
|
||||||
|
|
||||||
// Second only
|
// Second only
|
||||||
[InlineData("Test String", "us-ascii", false, -1, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-u", false, -1, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, -1, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16", false, -1, 1024, 1024, 1030)]
|
|
||||||
|
|
||||||
// Split
|
// Split
|
||||||
[InlineData("Test String", "us-ascii", false, -1, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-u", false, -1, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, -1, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16", false, -1, 1024, 1024, 1020)]
|
|
||||||
|
|
||||||
// First only, beginning, fixed length smaller
|
// First only, beginning, fixed length smaller
|
||||||
[InlineData("Test String", "us-ascii", false, 8, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-u", false, 8, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, 8, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16", false, 8, 1024, 1024, 0)]
|
|
||||||
|
|
||||||
// Second only, fixed length smaller
|
// Second only, fixed length smaller
|
||||||
[InlineData("Test String", "us-ascii", false, 8, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-u", false, 8, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, 8, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16", false, 8, 1024, 1024, 1030)]
|
|
||||||
|
|
||||||
// Split, fixed length smaller
|
// Split, fixed length smaller
|
||||||
[InlineData("Test String", "us-ascii", false, 8, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-u", false, 8, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, 8, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16", false, 8, 1024, 1024, 1020)]
|
|
||||||
|
|
||||||
// First only, beginning, fixed length bigger
|
// First only, beginning, fixed length bigger
|
||||||
[InlineData("Test String", "us-ascii", false, 20, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-u", false, 20, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, 20, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16", false, 20, 1024, 1024, 0)]
|
|
||||||
|
|
||||||
// Second only, fixed length bigger
|
// Second only, fixed length bigger
|
||||||
[InlineData("Test String", "us-ascii", false, 20, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-u", false, 20, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, 20, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16", false, 20, 1024, 1024, 1030)]
|
|
||||||
|
|
||||||
// Split, fixed length bigger
|
// Split, fixed length bigger
|
||||||
[InlineData("Test String", "us-ascii", false, 20, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-u", false, 20, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16BE", false, 20, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16", false, 20, 1024, 1024, 1020)]
|
|
||||||
public void TestReadString(
|
public void TestReadString(
|
||||||
string value,
|
string value,
|
||||||
string encodingStr,
|
string encodingStr,
|
||||||
|
|
|
||||||
|
|
@ -7,54 +7,47 @@ namespace Server.Tests.Buffers
|
||||||
{
|
{
|
||||||
public class CircularBufferWriterTests
|
public class CircularBufferWriterTests
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory, InlineData("Test String", "us-ascii", -1, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-8", -1, 1024, 1024, 0), InlineData("Test String", "utf-16BE", -1, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16", -1, 1024, 1024, 0), InlineData("Test String", "us-ascii", -1, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-8", -1, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16BE", -1, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16", -1, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "us-ascii", -1, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-8", -1, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16BE", -1, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16", -1, 1024, 1024, 1020), InlineData("Test String", "us-ascii", 8, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16BE", 8, 1024, 1024, 0), InlineData("Test String", "utf-16", 8, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "us-ascii", 8, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16BE", 8, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16", 8, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "us-ascii", 8, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16BE", 8, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16", 8, 1024, 1024, 1020), InlineData("Test String", "us-ascii", 20, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "utf-16BE", 20, 1024, 1024, 0), InlineData("Test String", "utf-16", 20, 1024, 1024, 0),
|
||||||
|
InlineData("Test String", "us-ascii", 20, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16BE", 20, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "utf-16", 20, 1024, 1024, 1030),
|
||||||
|
InlineData("Test String", "us-ascii", 20, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16BE", 20, 1024, 1024, 1020),
|
||||||
|
InlineData("Test String", "utf-16", 20, 1024, 1024, 1020)]
|
||||||
// First only, beginning
|
// First only, beginning
|
||||||
[InlineData("Test String", "us-ascii", -1, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-8", -1, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16BE", -1, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16", -1, 1024, 1024, 0)]
|
|
||||||
|
|
||||||
// Second only
|
// Second only
|
||||||
[InlineData("Test String", "us-ascii", -1, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-8", -1, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16BE", -1, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16", -1, 1024, 1024, 1030)]
|
|
||||||
|
|
||||||
// Split
|
// Split
|
||||||
[InlineData("Test String", "us-ascii", -1, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-8", -1, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16BE", -1, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16", -1, 1024, 1024, 1020)]
|
|
||||||
|
|
||||||
// First only, beginning, fixed length smaller
|
// First only, beginning, fixed length smaller
|
||||||
[InlineData("Test String", "us-ascii", 8, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16BE", 8, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16", 8, 1024, 1024, 0)]
|
|
||||||
|
|
||||||
// Second only, fixed length smaller
|
// Second only, fixed length smaller
|
||||||
[InlineData("Test String", "us-ascii", 8, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16BE", 8, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16", 8, 1024, 1024, 1030)]
|
|
||||||
|
|
||||||
// Split, fixed length smaller
|
// Split, fixed length smaller
|
||||||
[InlineData("Test String", "us-ascii", 8, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16BE", 8, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16", 8, 1024, 1024, 1020)]
|
|
||||||
|
|
||||||
// First only, beginning, fixed length bigger
|
// First only, beginning, fixed length bigger
|
||||||
[InlineData("Test String", "us-ascii", 20, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16BE", 20, 1024, 1024, 0)]
|
|
||||||
[InlineData("Test String", "utf-16", 20, 1024, 1024, 0)]
|
|
||||||
|
|
||||||
// Second only, fixed length bigger
|
// Second only, fixed length bigger
|
||||||
[InlineData("Test String", "us-ascii", 20, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16BE", 20, 1024, 1024, 1030)]
|
|
||||||
[InlineData("Test String", "utf-16", 20, 1024, 1024, 1030)]
|
|
||||||
|
|
||||||
// Split, fixed length bigger
|
// Split, fixed length bigger
|
||||||
[InlineData("Test String", "us-ascii", 20, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16BE", 20, 1024, 1024, 1020)]
|
|
||||||
[InlineData("Test String", "utf-16", 20, 1024, 1024, 1020)]
|
|
||||||
public void TestWriteString(
|
public void TestWriteString(
|
||||||
string value,
|
string value,
|
||||||
string encodingStr,
|
string encodingStr,
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(ProtocolChanges.Version70610), InlineData(ProtocolChanges.Version6000)]
|
||||||
[InlineData(ProtocolChanges.Version70610)]
|
|
||||||
[InlineData(ProtocolChanges.Version6000)]
|
|
||||||
public void TestSupportedFeatures(ProtocolChanges protocolChanges)
|
public void TestSupportedFeatures(ProtocolChanges protocolChanges)
|
||||||
{
|
{
|
||||||
var firstMobile = new Mobile(0x1);
|
var firstMobile = new Mobile(0x1);
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(true), InlineData(false)]
|
||||||
[InlineData(true)]
|
|
||||||
[InlineData(false)]
|
|
||||||
public void TestSetWarMode(bool warmode)
|
public void TestSetWarMode(bool warmode)
|
||||||
{
|
{
|
||||||
var expected = new SetWarMode(warmode).Compile();
|
var expected = new SetWarMode(warmode).Compile();
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,7 @@ namespace Server.Tests.Network
|
||||||
{
|
{
|
||||||
public class DamagePacketTests : IClassFixture<ServerFixture>
|
public class DamagePacketTests : IClassFixture<ServerFixture>
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory, InlineData(10), InlineData(-5), InlineData(1024)]
|
||||||
[InlineData(10)]
|
|
||||||
[InlineData(-5)]
|
|
||||||
[InlineData(1024)]
|
|
||||||
public void TestDamagePacketOld(int inputAmount)
|
public void TestDamagePacketOld(int inputAmount)
|
||||||
{
|
{
|
||||||
Serial serial = 0x1024;
|
Serial serial = 0x1024;
|
||||||
|
|
@ -23,11 +20,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(10), InlineData(-5), InlineData(1024), InlineData(100000)]
|
||||||
[InlineData(10)]
|
|
||||||
[InlineData(-5)]
|
|
||||||
[InlineData(1024)]
|
|
||||||
[InlineData(100000)]
|
|
||||||
public void TestDamage(int inputAmount)
|
public void TestDamage(int inputAmount)
|
||||||
{
|
{
|
||||||
Serial serial = 0x1024;
|
Serial serial = 0x1024;
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,7 @@ namespace Server.Tests.Network
|
||||||
{
|
{
|
||||||
public class EffectPackets
|
public class EffectPackets
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory, InlineData(10, 1000, 10, 5)]
|
||||||
[InlineData(10, 1000, 10, 5)]
|
|
||||||
public void TestSoundEffect(ushort soundID, int x, int y, int z)
|
public void TestSoundEffect(ushort soundID, int x, int y, int z)
|
||||||
{
|
{
|
||||||
var p = new Point3D(x, y, z);
|
var p = new Point3D(x, y, z);
|
||||||
|
|
@ -91,9 +90,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(actual, expected);
|
AssertThat.Equal(actual, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(ScreenEffectType.DarkFlash), InlineData(ScreenEffectType.FadeInOut)]
|
||||||
[InlineData(ScreenEffectType.DarkFlash)]
|
|
||||||
[InlineData(ScreenEffectType.FadeInOut)]
|
|
||||||
public void TestScreenEffect(ScreenEffectType screenType)
|
public void TestScreenEffect(ScreenEffectType screenType)
|
||||||
{
|
{
|
||||||
var expected = new ScreenEffect(screenType).Compile();
|
var expected = new ScreenEffect(screenType).Compile();
|
||||||
|
|
|
||||||
|
|
@ -221,10 +221,8 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(ProtocolChanges.Version70610), InlineData(ProtocolChanges.Version400a),
|
||||||
[InlineData(ProtocolChanges.Version70610)]
|
InlineData(ProtocolChanges.Version502b)]
|
||||||
[InlineData(ProtocolChanges.Version400a)]
|
|
||||||
[InlineData(ProtocolChanges.Version502b)]
|
|
||||||
public void TestMobileStatusExtended(ProtocolChanges changes)
|
public void TestMobileStatusExtended(ProtocolChanges changes)
|
||||||
{
|
{
|
||||||
var beholder = new Mobile(0x1)
|
var beholder = new Mobile(0x1)
|
||||||
|
|
@ -340,10 +338,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData("None"), InlineData("Lesser"), InlineData("Lethal")]
|
||||||
[InlineData("None")]
|
|
||||||
[InlineData("Lesser")]
|
|
||||||
[InlineData("Lethal")]
|
|
||||||
public void TestHealthbarPoison(string pName)
|
public void TestHealthbarPoison(string pName)
|
||||||
{
|
{
|
||||||
var p = Poison.GetPoison(pName);
|
var p = Poison.GetPoison(pName);
|
||||||
|
|
@ -366,11 +361,7 @@ namespace Server.Tests.Network
|
||||||
Assert.Equal(p?.Level, m.Poison?.Level);
|
Assert.Equal(p?.Level, m.Poison?.Level);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(false, false), InlineData(true, false), InlineData(false, true), InlineData(true, true)]
|
||||||
[InlineData(false, false)]
|
|
||||||
[InlineData(true, false)]
|
|
||||||
[InlineData(false, true)]
|
|
||||||
[InlineData(true, true)]
|
|
||||||
public void TestYellowBar(bool isBlessed, bool isYellowHealth)
|
public void TestYellowBar(bool isBlessed, bool isYellowHealth)
|
||||||
{
|
{
|
||||||
var m = new Mobile(0x1);
|
var m = new Mobile(0x1);
|
||||||
|
|
@ -464,10 +455,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(0, 0, 0, 0), InlineData(10, 1024, 0, 0), InlineData(10, 1024, 11, 2048)]
|
||||||
[InlineData(0, 0, 0, 0)]
|
|
||||||
[InlineData(10, 1024, 0, 0)]
|
|
||||||
[InlineData(10, 1024, 11, 2048)]
|
|
||||||
public void TestMobileIncoming(int hairItemId, int hairHue, int facialHairItemId, int facialHairHue)
|
public void TestMobileIncoming(int hairItemId, int hairHue, int facialHairItemId, int facialHairHue)
|
||||||
{
|
{
|
||||||
var beholder = new Mobile(0x1)
|
var beholder = new Mobile(0x1)
|
||||||
|
|
@ -594,13 +582,11 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(ProtocolChanges.Version6000, 0, 0, 0, 0),
|
||||||
[InlineData(ProtocolChanges.Version6000, 0, 0, 0, 0)]
|
InlineData(ProtocolChanges.Version6000, 10, 1024, 0, 0),
|
||||||
[InlineData(ProtocolChanges.Version6000, 10, 1024, 0, 0)]
|
InlineData(ProtocolChanges.Version6000, 10, 1024, 11, 2048), InlineData(ProtocolChanges.Version7000, 0, 0, 0, 0),
|
||||||
[InlineData(ProtocolChanges.Version6000, 10, 1024, 11, 2048)]
|
InlineData(ProtocolChanges.Version7000, 10, 1024, 0, 0),
|
||||||
[InlineData(ProtocolChanges.Version7000, 0, 0, 0, 0)]
|
InlineData(ProtocolChanges.Version7000, 10, 1024, 11, 2048)]
|
||||||
[InlineData(ProtocolChanges.Version7000, 10, 1024, 0, 0)]
|
|
||||||
[InlineData(ProtocolChanges.Version7000, 10, 1024, 11, 2048)]
|
|
||||||
public void TestMobileIncomingOld(
|
public void TestMobileIncomingOld(
|
||||||
ProtocolChanges protocolChanges, int hairItemId, int hairHue, int facialHairItemId, int facialHairHue
|
ProtocolChanges protocolChanges, int hairItemId, int hairHue, int facialHairItemId, int facialHairHue
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,7 @@ namespace Server.Tests.Network
|
||||||
{
|
{
|
||||||
public class MovementPacketTests : IClassFixture<ServerFixture>
|
public class MovementPacketTests : IClassFixture<ServerFixture>
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory, InlineData(0), InlineData(1), InlineData(2)]
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(1)]
|
|
||||||
[InlineData(2)]
|
|
||||||
public void TestSpeedControl(byte speedControl)
|
public void TestSpeedControl(byte speedControl)
|
||||||
{
|
{
|
||||||
var data = new SpeedControl(speedControl).Compile();
|
var data = new SpeedControl(speedControl).Compile();
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(false), InlineData(true)]
|
||||||
[InlineData(false)]
|
|
||||||
[InlineData(true)]
|
|
||||||
public void TestDeathStatus(bool isDead)
|
public void TestDeathStatus(bool isDead)
|
||||||
{
|
{
|
||||||
var data = new DeathStatus(isDead).Compile();
|
var data = new DeathStatus(isDead).Compile();
|
||||||
|
|
@ -61,11 +59,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(0, true), InlineData(0, false), InlineData(100, true), InlineData(1000, false)]
|
||||||
[InlineData(0, true)]
|
|
||||||
[InlineData(0, false)]
|
|
||||||
[InlineData(100, true)]
|
|
||||||
[InlineData(1000, false)]
|
|
||||||
public void TestSpecialAbility(int abilityId, bool active)
|
public void TestSpecialAbility(int abilityId, bool active)
|
||||||
{
|
{
|
||||||
var data = new ToggleSpecialAbility(abilityId, active).Compile();
|
var data = new ToggleSpecialAbility(abilityId, active).Compile();
|
||||||
|
|
@ -82,9 +76,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData("This is a header", "This is a body", "This is a footer"), InlineData(null, null, null)]
|
||||||
[InlineData("This is a header", "This is a body", "This is a footer")]
|
|
||||||
[InlineData(null, null, null)]
|
|
||||||
public void TestDisplayProfile(string header, string body, string footer)
|
public void TestDisplayProfile(string header, string body, string footer)
|
||||||
{
|
{
|
||||||
Serial m = 0x1000;
|
Serial m = 0x1000;
|
||||||
|
|
@ -110,9 +102,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(LRReason.CannotLift), InlineData(LRReason.TryToSteal)]
|
||||||
[InlineData(LRReason.CannotLift)]
|
|
||||||
[InlineData(LRReason.TryToSteal)]
|
|
||||||
public void TestLiftRej(LRReason reason)
|
public void TestLiftRej(LRReason reason)
|
||||||
{
|
{
|
||||||
var data = new LiftRej(reason).Compile();
|
var data = new LiftRej(reason).Compile();
|
||||||
|
|
@ -140,9 +130,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(1, 2, 3), InlineData(4, 5, 6)]
|
||||||
[InlineData(1, 2, 3)]
|
|
||||||
[InlineData(4, 5, 6)]
|
|
||||||
public void TestWeather(int type, int density, int temp)
|
public void TestWeather(int type, int density, int temp)
|
||||||
{
|
{
|
||||||
var data = new Weather(type, density, temp).Compile();
|
var data = new Weather(type, density, temp).Compile();
|
||||||
|
|
@ -235,10 +223,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(0), InlineData(10), InlineData(255)]
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(10)]
|
|
||||||
[InlineData(255)]
|
|
||||||
public void TestSequence(byte num)
|
public void TestSequence(byte num)
|
||||||
{
|
{
|
||||||
var data = new Sequence(num).Compile();
|
var data = new Sequence(num).Compile();
|
||||||
|
|
@ -252,10 +237,8 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(SkillName.Alchemy, 0, 1), InlineData(SkillName.Archery, 10, 1000),
|
||||||
[InlineData(SkillName.Alchemy, 0, 1)]
|
InlineData(SkillName.Begging, 100000, 1000)]
|
||||||
[InlineData(SkillName.Archery, 10, 1000)]
|
|
||||||
[InlineData(SkillName.Begging, 100000, 1000)]
|
|
||||||
public void TestSkillChange(SkillName skillName, int baseFixedPoint, int capFixedPoint)
|
public void TestSkillChange(SkillName skillName, int baseFixedPoint, int capFixedPoint)
|
||||||
{
|
{
|
||||||
// TODO: Eliminate all of this and just create a Skill directly
|
// TODO: Eliminate all of this and just create a Skill directly
|
||||||
|
|
@ -287,10 +270,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(null), InlineData(""), InlineData("This is a URL, I promise")]
|
||||||
[InlineData(null)]
|
|
||||||
[InlineData("")]
|
|
||||||
[InlineData("This is a URL, I promise")]
|
|
||||||
public void TestLaunchBrowser(string url)
|
public void TestLaunchBrowser(string url)
|
||||||
{
|
{
|
||||||
var data = new LaunchBrowser(url).Compile();
|
var data = new LaunchBrowser(url).Compile();
|
||||||
|
|
@ -341,9 +321,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(1, false), InlineData(2, true)]
|
||||||
[InlineData(1, false)]
|
|
||||||
[InlineData(2, true)]
|
|
||||||
public void TestSeasonChange(int season, bool playSound)
|
public void TestSeasonChange(int season, bool playSound)
|
||||||
{
|
{
|
||||||
var data = new SeasonChange(season, playSound).Compile();
|
var data = new SeasonChange(season, playSound).Compile();
|
||||||
|
|
@ -358,10 +336,8 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(0x1024, "Test Title", true, true), InlineData(0x1024, "Test Title", false, true),
|
||||||
[InlineData(0x1024, "Test Title", true, true)]
|
InlineData(0x1024, "Test Title", true, false)]
|
||||||
[InlineData(0x1024, "Test Title", false, true)]
|
|
||||||
[InlineData(0x1024, "Test Title", true, false)]
|
|
||||||
public void TestDisplayPaperdoll(uint m, string title, bool warmode, bool canLift)
|
public void TestDisplayPaperdoll(uint m, string title, bool warmode, bool canLift)
|
||||||
{
|
{
|
||||||
var data = new DisplayPaperdoll(m, title, warmode, canLift).Compile();
|
var data = new DisplayPaperdoll(m, title, warmode, canLift).Compile();
|
||||||
|
|
@ -388,10 +364,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(MusicName.Approach), InlineData(MusicName.Combat1), InlineData(MusicName.ValoriaShips)]
|
||||||
[InlineData(MusicName.Approach)]
|
|
||||||
[InlineData(MusicName.Combat1)]
|
|
||||||
[InlineData(MusicName.ValoriaShips)]
|
|
||||||
public void TestPlayMusic(MusicName music)
|
public void TestPlayMusic(MusicName music)
|
||||||
{
|
{
|
||||||
var data = new PlayMusic(music).Compile();
|
var data = new PlayMusic(music).Compile();
|
||||||
|
|
@ -405,9 +378,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(10, 1, "Some text"), InlineData(100, 10, "Some more text")]
|
||||||
[InlineData(10, 1, "Some text")]
|
|
||||||
[InlineData(100, 10, "Some more text")]
|
|
||||||
public void TestScrollMessage(int type, int tip, string text)
|
public void TestScrollMessage(int type, int tip, string text)
|
||||||
{
|
{
|
||||||
var data = new ScrollMessage(type, tip, text).Compile();
|
var data = new ScrollMessage(type, tip, text).Compile();
|
||||||
|
|
@ -462,10 +433,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(0), InlineData(10), InlineData(100)]
|
||||||
[InlineData(0)]
|
|
||||||
[InlineData(10)]
|
|
||||||
[InlineData(100)]
|
|
||||||
public void TestPingAck(byte ping)
|
public void TestPingAck(byte ping)
|
||||||
{
|
{
|
||||||
var data = new PingAck(ping).Compile();
|
var data = new PingAck(ping).Compile();
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,8 @@ namespace Server.Tests.Network
|
||||||
{
|
{
|
||||||
public class SecureTradePacketTests : IClassFixture<ServerFixture>
|
public class SecureTradePacketTests : IClassFixture<ServerFixture>
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory, InlineData("short-name"),
|
||||||
[InlineData("short-name")]
|
InlineData("this is a really long name that is more than 30 characters, probably")]
|
||||||
[InlineData("this is a really long name that is more than 30 characters, probably")]
|
|
||||||
public void TestDisplaySecureTrade(string name)
|
public void TestDisplaySecureTrade(string name)
|
||||||
{
|
{
|
||||||
var m = new Mobile(0x1);
|
var m = new Mobile(0x1);
|
||||||
|
|
@ -59,9 +58,9 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(true, false), InlineData(false, true)]
|
||||||
[InlineData(true, false)] // Update first
|
// Update first
|
||||||
[InlineData(false, true)] // Update second
|
// Update second
|
||||||
public void TestUpdateSecureTrade(bool first, bool second)
|
public void TestUpdateSecureTrade(bool first, bool second)
|
||||||
{
|
{
|
||||||
var firstCont = new Container(World.NewItem);
|
var firstCont = new Container(World.NewItem);
|
||||||
|
|
@ -83,9 +82,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(data, expectedData);
|
AssertThat.Equal(data, expectedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(100000, 30, TradeFlag.UpdateGold), InlineData(250000, 50000, TradeFlag.UpdateLedger)]
|
||||||
[InlineData(100000, 30, TradeFlag.UpdateGold)]
|
|
||||||
[InlineData(250000, 50000, TradeFlag.UpdateLedger)]
|
|
||||||
public void TestUpdateGoldSecureTrade(int gold, int plat, TradeFlag flag)
|
public void TestUpdateGoldSecureTrade(int gold, int plat, TradeFlag flag)
|
||||||
{
|
{
|
||||||
var cont = new Container(World.NewItem);
|
var cont = new Container(World.NewItem);
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ namespace Server.Tests.Accounting
|
||||||
{
|
{
|
||||||
public class HexStringConverterTest
|
public class HexStringConverterTest
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory, InlineData("ABCDEF1234", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
||||||
[InlineData("ABCDEF1234", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
|
||||||
public void TestGetBytes(string input, byte[] bytes)
|
public void TestGetBytes(string input, byte[] bytes)
|
||||||
{
|
{
|
||||||
Span<byte> outputBytes = stackalloc byte[input.Length / 2];
|
Span<byte> outputBytes = stackalloc byte[input.Length / 2];
|
||||||
|
|
@ -16,8 +15,7 @@ namespace Server.Tests.Accounting
|
||||||
Assert.Equal(input, bytes.ToHexString());
|
Assert.Equal(input, bytes.ToHexString());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData("[AB, CD, EF, 12, 34]", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
||||||
[InlineData("[AB, CD, EF, 12, 34]", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
|
||||||
public void TestsGetStringDelimited(string expected, byte[] bytes)
|
public void TestsGetStringDelimited(string expected, byte[] bytes)
|
||||||
{
|
{
|
||||||
Assert.Equal(expected, bytes.ToDelimitedHexString());
|
Assert.Equal(expected, bytes.ToDelimitedHexString());
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,8 @@ namespace Server.Tests
|
||||||
{
|
{
|
||||||
public class TestStringHelpers
|
public class TestStringHelpers
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory, InlineData(null, "default value", "default value"), InlineData("", "default value", "default value"),
|
||||||
[InlineData(null, "default value", "default value")]
|
InlineData("this is a valid string", "default value", "this is a valid string")]
|
||||||
[InlineData("", "default value", "default value")]
|
|
||||||
[InlineData("this is a valid string", "default value", "this is a valid string")]
|
|
||||||
public void TestIsNullOrDefault(string value, string defaultValue, string expected)
|
public void TestIsNullOrDefault(string value, string defaultValue, string expected)
|
||||||
{
|
{
|
||||||
var actual = value.DefaultIfNullOrEmpty(defaultValue);
|
var actual = value.DefaultIfNullOrEmpty(defaultValue);
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ namespace System.Buffers
|
||||||
{
|
{
|
||||||
if (bytes.Length < Length)
|
if (bytes.Length < Length)
|
||||||
{
|
{
|
||||||
throw new ArgumentOutOfRangeException(nameof(bytes.Length));
|
throw new ArgumentOutOfRangeException(nameof(bytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_first.Length > 0)
|
if (_first.Length > 0)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ using Server;
|
||||||
|
|
||||||
namespace System.Buffers
|
namespace System.Buffers
|
||||||
{
|
{
|
||||||
ref struct SpanReader
|
public ref struct SpanReader
|
||||||
{
|
{
|
||||||
private readonly ReadOnlySpan<byte> _buffer;
|
private readonly ReadOnlySpan<byte> _buffer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Server
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var br1 = fmt.IndexOf('.');
|
var br1 = fmt.IndexOf('.', StringComparison.Ordinal);
|
||||||
var br2 = fmt.IndexOf('.', br1 + 1);
|
var br2 = fmt.IndexOf('.', br1 + 1);
|
||||||
|
|
||||||
var br3 = br2 + 1;
|
var br3 = br2 + 1;
|
||||||
|
|
@ -60,12 +60,15 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fmt.IndexOf("god", StringComparison.Ordinal) >= 0 || fmt.IndexOf("gq", StringComparison.Ordinal) >= 0)
|
if (fmt.Contains("god", StringComparison.Ordinal) || fmt.Contains("gq", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
Type = ClientType.God;
|
Type = ClientType.God;
|
||||||
}
|
}
|
||||||
else if (fmt.IndexOf("third dawn", StringComparison.Ordinal) >= 0 || fmt.IndexOf("uo:td", StringComparison.Ordinal) >= 0 || fmt.IndexOf("uotd", StringComparison.Ordinal) >= 0 ||
|
else if (fmt.Contains("third dawn", StringComparison.Ordinal) ||
|
||||||
fmt.IndexOf("uo3d", StringComparison.Ordinal) >= 0 || fmt.IndexOf("uo:3d", StringComparison.Ordinal) >= 0)
|
fmt.Contains("uo:td", StringComparison.Ordinal) ||
|
||||||
|
fmt.Contains("uotd", StringComparison.Ordinal) ||
|
||||||
|
fmt.Contains("uo3d", StringComparison.Ordinal) ||
|
||||||
|
fmt.Contains("uo:3d", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
Type = ClientType.UOTD;
|
Type = ClientType.UOTD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ namespace Server
|
||||||
|
|
||||||
public static bool Handle(Mobile from, string text, MessageType type = MessageType.Regular)
|
public static bool Handle(Mobile from, string text, MessageType type = MessageType.Regular)
|
||||||
{
|
{
|
||||||
if (!text.StartsWith(Prefix) && type != MessageType.Command)
|
if (!text.StartsWith(Prefix, StringComparison.Ordinal) && type != MessageType.Command)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +198,7 @@ namespace Server
|
||||||
text = text.Substring(Prefix.Length);
|
text = text.Substring(Prefix.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
var indexOf = text.IndexOf(' ');
|
var indexOf = text.IndexOf(' ', StringComparison.Ordinal);
|
||||||
|
|
||||||
string command;
|
string command;
|
||||||
string[] args;
|
string[] args;
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ namespace Server
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ipStr.IndexOf(':') == -1)
|
if (!ipStr.Contains(':', StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
ipStr += ":2593";
|
ipStr += ":2593";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ namespace Server
|
||||||
|
|
||||||
public static Point2D Parse(string value)
|
public static Point2D Parse(string value)
|
||||||
{
|
{
|
||||||
var start = value.IndexOf('(');
|
var start = value.IndexOf('(', StringComparison.Ordinal);
|
||||||
var end = value.IndexOf(',', start + 1);
|
var end = value.IndexOf(',', start + 1);
|
||||||
|
|
||||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out var x);
|
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out var x);
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ namespace Server
|
||||||
|
|
||||||
public static Point3D Parse(string value)
|
public static Point3D Parse(string value)
|
||||||
{
|
{
|
||||||
var start = value.IndexOf('(');
|
var start = value.IndexOf('(', StringComparison.Ordinal);
|
||||||
var end = value.IndexOf(',', start + 1);
|
var end = value.IndexOf(',', start + 1);
|
||||||
|
|
||||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out var x);
|
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out var x);
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@
|
||||||
* 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;
|
||||||
|
|
||||||
namespace Server
|
namespace Server
|
||||||
{
|
{
|
||||||
[NoSort]
|
[NoSort, Parsable, PropertyObject]
|
||||||
[Parsable]
|
|
||||||
[PropertyObject]
|
|
||||||
public struct Rectangle2D
|
public struct Rectangle2D
|
||||||
{
|
{
|
||||||
private Point2D m_Start;
|
private Point2D m_Start;
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Server
|
||||||
|
|
||||||
public static Rectangle2D Parse(string value)
|
public static Rectangle2D Parse(string value)
|
||||||
{
|
{
|
||||||
var start = value.IndexOf('(');
|
var start = value.IndexOf('(', StringComparison.Ordinal);
|
||||||
var end = value.IndexOf(',', start + 1);
|
var end = value.IndexOf(',', start + 1);
|
||||||
|
|
||||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out var x);
|
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out var x);
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,7 @@
|
||||||
|
|
||||||
namespace Server
|
namespace Server
|
||||||
{
|
{
|
||||||
[NoSort]
|
[NoSort, PropertyObject]
|
||||||
[PropertyObject]
|
|
||||||
public struct Rectangle3D
|
public struct Rectangle3D
|
||||||
{
|
{
|
||||||
private Point3D m_Start;
|
private Point3D m_Start;
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ namespace Server
|
||||||
|
|
||||||
public static WorldLocation Parse(string value)
|
public static WorldLocation Parse(string value)
|
||||||
{
|
{
|
||||||
var start = value.IndexOf('(');
|
var start = value.IndexOf('(', StringComparison.Ordinal);
|
||||||
var end = value.IndexOf(',', start + 1);
|
var end = value.IndexOf(',', start + 1);
|
||||||
|
|
||||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out var x);
|
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out var x);
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ namespace Server.Gumps
|
||||||
|
|
||||||
public bool Closable { get; set; } = true;
|
public bool Closable { get; set; } = true;
|
||||||
|
|
||||||
public static int GetTypeID(Type type) => type?.FullName?.GetHashCode() ?? -1;
|
public static int GetTypeID(Type type) => type?.FullName?.GetHashCode(StringComparison.Ordinal) ?? -1;
|
||||||
|
|
||||||
public void AddPage(int page)
|
public void AddPage(int page)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Server.Accounting
|
||||||
/// By default, when 1,000,000,000 Gold is accumulated, it will transform
|
/// By default, when 1,000,000,000 Gold is accumulated, it will transform
|
||||||
/// into 1 Platinum.
|
/// into 1 Platinum.
|
||||||
/// !!! WARNING !!!
|
/// !!! WARNING !!!
|
||||||
/// The client is designed to perceive the currency threashold at 1,000,000,000
|
/// The client is designed to perceive the currency threshold at 1,000,000,000
|
||||||
/// if you change this, it may cause unexpected results when using secure trading.
|
/// if you change this, it may cause unexpected results when using secure trading.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int CurrencyThreshold = 1000000000;
|
public static int CurrencyThreshold = 1000000000;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@ namespace Server
|
||||||
a != null && b != null && a.Length >= b.Length && Comparer.Compare(a.Substring(a.Length - b.Length), b) == 0;
|
a != null && b != null && a.Length >= b.Length && Comparer.Compare(a.Substring(a.Length - b.Length), b) == 0;
|
||||||
|
|
||||||
public static bool Contains(string a, string b) =>
|
public static bool Contains(string a, string b) =>
|
||||||
a != null && b != null && a.Length >= b.Length && a.IndexOf(b, StringComparison.OrdinalIgnoreCase) >= 0;
|
a != null && b != null && a.Length >= b.Length && a.Contains(b, StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1847,7 +1847,7 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
line = line.Trim();
|
line = line.Trim();
|
||||||
|
|
||||||
if (line.Length == 0 || line.StartsWith("#"))
|
if (line.Length == 0 || line.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -524,8 +524,7 @@ namespace Server
|
||||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||||
public int PileWeight => (int)Math.Ceiling(Weight * Amount);
|
public int PileWeight => (int)Math.Ceiling(Weight * Amount);
|
||||||
|
|
||||||
[Hue]
|
[Hue, CommandProperty(AccessLevel.GameMaster)]
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public virtual int Hue
|
public virtual int Hue
|
||||||
{
|
{
|
||||||
get => m_Hue;
|
get => m_Hue;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@ namespace System.Text.Json.Serialization
|
||||||
}
|
}
|
||||||
|
|
||||||
var structType = typeToConvert.GenericTypeArguments[0];
|
var structType = typeToConvert.GenericTypeArguments[0];
|
||||||
return !structType.IsPrimitive && structType.Namespace?.StartsWith(nameof(System)) != true && !structType.IsEnum;
|
return !structType.IsPrimitive &&
|
||||||
|
structType.Namespace?.StartsWith(nameof(System), StringComparison.Ordinal) != true &&
|
||||||
|
!structType.IsEnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) =>
|
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) =>
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,9 @@ namespace Server
|
||||||
public static bool IsRunningFromXUnit =>
|
public static bool IsRunningFromXUnit =>
|
||||||
m_IsRunningFromXUnit ??= AppDomain.CurrentDomain.GetAssemblies()
|
m_IsRunningFromXUnit ??= AppDomain.CurrentDomain.GetAssemblies()
|
||||||
.Any(
|
.Any(
|
||||||
a => a.FullName?.ToLowerInvariant().StartsWith("xunit") ?? false
|
a => a.FullName?
|
||||||
|
.ToUpperInvariant()
|
||||||
|
.StartsWith("XUNIT", StringComparison.Ordinal) ?? false
|
||||||
);
|
);
|
||||||
|
|
||||||
public static bool Profiling
|
public static bool Profiling
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Server
|
||||||
|
|
||||||
while ((line = ip.ReadLine()) != null)
|
while ((line = ip.ReadLine()) != null)
|
||||||
{
|
{
|
||||||
if (line.Length == 0 || line.StartsWith("#"))
|
if (line.Length == 0 || line.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -293,8 +293,7 @@ namespace Server
|
||||||
Locked
|
Locked
|
||||||
}
|
}
|
||||||
|
|
||||||
[CustomEnum(new[] { "North", "Right", "East", "Down", "South", "Left", "West", "Up" })]
|
[CustomEnum(new[] { "North", "Right", "East", "Down", "South", "Left", "West", "Up" }), Flags]
|
||||||
[Flags]
|
|
||||||
public enum Direction : byte
|
public enum Direction : byte
|
||||||
{
|
{
|
||||||
North = 0x0,
|
North = 0x0,
|
||||||
|
|
@ -1340,8 +1339,7 @@ namespace Server
|
||||||
|
|
||||||
public virtual int Luck => 0;
|
public virtual int Luck => 0;
|
||||||
|
|
||||||
[Hue]
|
[Hue, CommandProperty(AccessLevel.GameMaster)]
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public int HueMod
|
public int HueMod
|
||||||
{
|
{
|
||||||
get => m_HueMod;
|
get => m_HueMod;
|
||||||
|
|
@ -1356,8 +1354,7 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Hue]
|
[Hue, CommandProperty(AccessLevel.GameMaster)]
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public virtual int Hue
|
public virtual int Hue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -1778,8 +1775,7 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Body]
|
[Body, CommandProperty(AccessLevel.GameMaster)]
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public Body Body
|
public Body Body
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -1805,8 +1801,7 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Body]
|
[Body, CommandProperty(AccessLevel.GameMaster)]
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public int BodyValue
|
public int BodyValue
|
||||||
{
|
{
|
||||||
get => Body.BodyID;
|
get => Body.BodyID;
|
||||||
|
|
@ -2481,8 +2476,6 @@ namespace Server
|
||||||
get => m_Poison;
|
get => m_Poison;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
/*if (m_Poison != value && (m_Poison == null || value == null || m_Poison.Level < value.Level))
|
|
||||||
{*/
|
|
||||||
m_Poison = value;
|
m_Poison = value;
|
||||||
Delta(MobileDelta.HealthbarPoison);
|
Delta(MobileDelta.HealthbarPoison);
|
||||||
|
|
||||||
|
|
@ -2500,7 +2493,6 @@ namespace Server
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckStatTimers();
|
CheckStatTimers();
|
||||||
/*}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -9171,7 +9163,7 @@ namespace Server
|
||||||
CheckStatTimers();
|
CheckStatTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
private MobileDelta GetStatDelta(StatType type)
|
private static MobileDelta GetStatDelta(StatType type)
|
||||||
{
|
{
|
||||||
MobileDelta delta = 0;
|
MobileDelta delta = 0;
|
||||||
|
|
||||||
|
|
@ -9540,7 +9532,7 @@ namespace Server
|
||||||
Effects.SendTargetEffect(this, itemID, speed, duration, hue, renderMode);
|
Effects.SendTargetEffect(this, itemID, speed, duration, hue, renderMode);
|
||||||
|
|
||||||
public void FixedEffect(int itemID, int speed, int duration) =>
|
public void FixedEffect(int itemID, int speed, int duration) =>
|
||||||
Effects.SendTargetEffect(this, itemID, speed, duration, 0, 0);
|
Effects.SendTargetEffect(this, itemID, speed, duration);
|
||||||
|
|
||||||
public void FixedParticles(
|
public void FixedParticles(
|
||||||
int itemID, int speed, int duration, int effect, int hue, int renderMode, EffectLayer layer, int unknown
|
int itemID, int speed, int duration, int effect, int hue, int renderMode, EffectLayer layer, int unknown
|
||||||
|
|
@ -9550,13 +9542,13 @@ namespace Server
|
||||||
public void FixedParticles(
|
public void FixedParticles(
|
||||||
int itemID, int speed, int duration, int effect, int hue, int renderMode, EffectLayer layer
|
int itemID, int speed, int duration, int effect, int hue, int renderMode, EffectLayer layer
|
||||||
) =>
|
) =>
|
||||||
Effects.SendTargetParticles(this, itemID, speed, duration, hue, renderMode, effect, layer, 0);
|
Effects.SendTargetParticles(this, itemID, speed, duration, hue, renderMode, effect, layer);
|
||||||
|
|
||||||
public void FixedParticles(int itemID, int speed, int duration, int effect, EffectLayer layer, int unknown) =>
|
public void FixedParticles(int itemID, int speed, int duration, int effect, EffectLayer layer, int unknown) =>
|
||||||
Effects.SendTargetParticles(this, itemID, speed, duration, 0, 0, effect, layer, unknown);
|
Effects.SendTargetParticles(this, itemID, speed, duration, 0, 0, effect, layer, unknown);
|
||||||
|
|
||||||
public void FixedParticles(int itemID, int speed, int duration, int effect, EffectLayer layer) =>
|
public void FixedParticles(int itemID, int speed, int duration, int effect, EffectLayer layer) =>
|
||||||
Effects.SendTargetParticles(this, itemID, speed, duration, 0, 0, effect, layer, 0);
|
Effects.SendTargetParticles(this, itemID, speed, duration, 0, 0, effect, layer);
|
||||||
|
|
||||||
public void BoltEffect(int hue) => Effects.SendBoltEffect(this, true, hue);
|
public void BoltEffect(int hue) => Effects.SendBoltEffect(this, true, hue);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Server.Mobiles
|
||||||
public class MovementRecord
|
public class MovementRecord
|
||||||
{
|
{
|
||||||
private static readonly Queue<MovementRecord> m_InstancePool = new Queue<MovementRecord>();
|
private static readonly Queue<MovementRecord> m_InstancePool = new Queue<MovementRecord>();
|
||||||
public long m_End;
|
private long m_End;
|
||||||
|
|
||||||
private MovementRecord(long end) => m_End = end;
|
private MovementRecord(long end) => m_End = end;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -513,7 +513,7 @@ namespace Server.Network
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var bytesWritten = await Connection.SendAsync(result.Buffer, SocketFlags.None);
|
var bytesWritten = await Connection.SendAsync(result.Buffer, SocketFlags.None).ConfigureAwait(false);
|
||||||
|
|
||||||
if (bytesWritten > 0)
|
if (bytesWritten > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -567,7 +567,7 @@ namespace Server.Network
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var bytesWritten = await socket.ReceiveAsync(result.Buffer, SocketFlags.None);
|
var bytesWritten = await socket.ReceiveAsync(result.Buffer, SocketFlags.None).ConfigureAwait(false);
|
||||||
if (bytesWritten <= 0)
|
if (bytesWritten <= 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
@ -596,11 +596,9 @@ namespace Server.Network
|
||||||
|
|
||||||
public static void HandleAllReceives()
|
public static void HandleAllReceives()
|
||||||
{
|
{
|
||||||
var clients = TcpServer.Instances;
|
foreach (var ns in TcpServer.Instances)
|
||||||
|
|
||||||
for (int i = 0; i < clients.Count; ++i)
|
|
||||||
{
|
{
|
||||||
clients[i].HandleReceive();
|
ns.HandleReceive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -662,11 +660,9 @@ namespace Server.Network
|
||||||
|
|
||||||
public static void FlushAll()
|
public static void FlushAll()
|
||||||
{
|
{
|
||||||
var clients = TcpServer.Instances;
|
foreach (var ns in TcpServer.Instances)
|
||||||
|
|
||||||
for (int i = 0; i < clients.Count; ++i)
|
|
||||||
{
|
{
|
||||||
clients[i].Flush();
|
ns.Flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -685,11 +681,9 @@ namespace Server.Network
|
||||||
{
|
{
|
||||||
long curTicks = Core.TickCount;
|
long curTicks = Core.TickCount;
|
||||||
|
|
||||||
var clients = TcpServer.Instances;
|
foreach (var ns in TcpServer.Instances)
|
||||||
|
|
||||||
for (int i = 0; i < clients.Count; ++i)
|
|
||||||
{
|
{
|
||||||
clients[i].CheckAlive(curTicks);
|
ns.CheckAlive(curTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ namespace Server.Network
|
||||||
{
|
{
|
||||||
private const int CompressorBufferSize = 0x10000;
|
private const int CompressorBufferSize = 0x10000;
|
||||||
|
|
||||||
private const int BufferSize = 4096;
|
|
||||||
private readonly int m_Length;
|
private readonly int m_Length;
|
||||||
|
|
||||||
private byte[] m_CompiledBuffer;
|
private byte[] m_CompiledBuffer;
|
||||||
|
|
@ -120,9 +119,11 @@ namespace Server.Network
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readonly object _object = new object();
|
||||||
|
|
||||||
public byte[] Compile(bool compress, out int length)
|
public byte[] Compile(bool compress, out int length)
|
||||||
{
|
{
|
||||||
lock (this)
|
lock (_object)
|
||||||
{
|
{
|
||||||
if (m_CompiledBuffer == null)
|
if (m_CompiledBuffer == null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Server.Accounting;
|
|
||||||
using System.Buffers;
|
using System.Buffers;
|
||||||
|
using Server.Accounting;
|
||||||
|
|
||||||
namespace Server.Network
|
namespace Server.Network
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ namespace Server.Network
|
||||||
|
|
||||||
public static IPEndPoint[] ListeningAddresses { get; private set; }
|
public static IPEndPoint[] ListeningAddresses { get; private set; }
|
||||||
public static TcpListener[] Listeners { get; private set; }
|
public static TcpListener[] Listeners { get; private set; }
|
||||||
public static List<NetState> Instances { get; } = new List<NetState>(128);
|
public static HashSet<NetState> Instances { get; } = new HashSet<NetState>(128);
|
||||||
|
|
||||||
public static ConcurrentQueue<NetState> m_ConnectedQueue = new ConcurrentQueue<NetState>();
|
public static ConcurrentQueue<NetState> m_ConnectedQueue = new ConcurrentQueue<NetState>();
|
||||||
|
|
||||||
|
|
@ -180,7 +180,7 @@ namespace Server.Network
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
socket = await listener.AcceptSocketAsync();
|
socket = await listener.AcceptSocketAsync().ConfigureAwait(false);
|
||||||
if (Instances.Count >= MaxConnections)
|
if (Instances.Count >= MaxConnections)
|
||||||
{
|
{
|
||||||
socket.Send(socketRejected, SocketFlags.None);
|
socket.Send(socketRejected, SocketFlags.None);
|
||||||
|
|
@ -205,8 +205,10 @@ namespace Server.Network
|
||||||
|
|
||||||
if (_nextMaximumSocketsReachedMessage <= ticks)
|
if (_nextMaximumSocketsReachedMessage <= ticks)
|
||||||
{
|
{
|
||||||
var ipep = (IPEndPoint)socket!.RemoteEndPoint;
|
if (socket?.RemoteEndPoint is IPEndPoint ipep)
|
||||||
Console.WriteLine("Listener {0}:{1}: Failed (Maximum connections reached)", ipep.Address, ipep.Port);
|
{
|
||||||
|
Console.WriteLine("Listener {0}:{1}: Failed (Maximum connections reached)", ipep.Address, ipep.Port);
|
||||||
|
}
|
||||||
_nextMaximumSocketsReachedMessage = ticks + _listenerErrorMessageDelay;
|
_nextMaximumSocketsReachedMessage = ticks + _listenerErrorMessageDelay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
|
|
@ -99,7 +100,7 @@ namespace Server
|
||||||
}
|
}
|
||||||
|
|
||||||
AddHash(number);
|
AddHash(number);
|
||||||
AddHash(arguments.GetHashCode());
|
AddHash(arguments.GetHashCode(StringComparison.Ordinal));
|
||||||
|
|
||||||
Stream.Write(number);
|
Stream.Write(number);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,25 +31,25 @@ namespace Server
|
||||||
m_Position = m_File.Position;
|
m_Position = m_File.Position;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override long Position => m_Position + m_Index;
|
public override long Position => m_Position + Index;
|
||||||
|
|
||||||
|
|
||||||
protected override int BufferSize => 512;
|
protected override int BufferSize => 512;
|
||||||
|
|
||||||
public override void Flush()
|
public override void Flush()
|
||||||
{
|
{
|
||||||
if (m_Index > 0)
|
if (Index > 0)
|
||||||
{
|
{
|
||||||
m_Position += m_Index;
|
m_Position += Index;
|
||||||
|
|
||||||
m_File.Write(m_Buffer, 0, (int)m_Index);
|
m_File.Write(Buffer, 0, (int)Index);
|
||||||
m_Index = 0;
|
Index = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Close()
|
public override void Close()
|
||||||
{
|
{
|
||||||
if (m_Index > 0)
|
if (Index > 0)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ namespace Server
|
||||||
private readonly Encoding m_Encoding;
|
private readonly Encoding m_Encoding;
|
||||||
private readonly bool m_PrefixStrings;
|
private readonly bool m_PrefixStrings;
|
||||||
|
|
||||||
protected byte[] m_Buffer;
|
protected long Index { get; set; }
|
||||||
protected long m_Index;
|
|
||||||
|
|
||||||
private readonly char[] m_SingleCharBuffer = new char[1];
|
private readonly char[] m_SingleCharBuffer = new char[1];
|
||||||
|
|
||||||
|
|
@ -43,21 +42,21 @@ namespace Server
|
||||||
{
|
{
|
||||||
m_PrefixStrings = prefixStr;
|
m_PrefixStrings = prefixStr;
|
||||||
m_Encoding = Utility.UTF8;
|
m_Encoding = Utility.UTF8;
|
||||||
m_Buffer = buffer;
|
Buffer = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferWriter(bool prefixStr)
|
public BufferWriter(bool prefixStr)
|
||||||
{
|
{
|
||||||
m_PrefixStrings = prefixStr;
|
m_PrefixStrings = prefixStr;
|
||||||
m_Encoding = Utility.UTF8;
|
m_Encoding = Utility.UTF8;
|
||||||
m_Buffer = new byte[BufferSize];
|
Buffer = new byte[BufferSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual long Position => m_Index;
|
public virtual long Position => Index;
|
||||||
|
|
||||||
protected virtual int BufferSize => 256;
|
protected virtual int BufferSize => 256;
|
||||||
|
|
||||||
public byte[] Data => m_Buffer;
|
public byte[] Buffer { get; protected set; }
|
||||||
|
|
||||||
public virtual void Close()
|
public virtual void Close()
|
||||||
{
|
{
|
||||||
|
|
@ -68,28 +67,28 @@ namespace Server
|
||||||
public void Resize(int size)
|
public void Resize(int size)
|
||||||
{
|
{
|
||||||
var copy = new byte[size];
|
var copy = new byte[size];
|
||||||
Buffer.BlockCopy(m_Buffer, 0, copy, 0, Math.Min(size, m_Buffer.Length));
|
System.Buffer.BlockCopy(Buffer, 0, copy, 0, Math.Min(size, Buffer.Length));
|
||||||
m_Buffer = copy;
|
Buffer = copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Flush()
|
public virtual void Flush()
|
||||||
{
|
{
|
||||||
Resize(m_Buffer.Length * 2);
|
Resize(Buffer.Length * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
m_Index = 0;
|
Index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual long Seek(long offset, SeekOrigin origin)
|
public virtual long Seek(long offset, SeekOrigin origin)
|
||||||
{
|
{
|
||||||
return origin switch
|
return origin switch
|
||||||
{
|
{
|
||||||
SeekOrigin.Begin => m_Index = offset,
|
SeekOrigin.Begin => Index = offset,
|
||||||
SeekOrigin.Current => m_Index += offset,
|
SeekOrigin.Current => Index += offset,
|
||||||
SeekOrigin.End => m_Index = BufferSize - offset,
|
SeekOrigin.End => Index = BufferSize - offset,
|
||||||
_ => m_Index
|
_ => Index
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,21 +98,21 @@ namespace Server
|
||||||
|
|
||||||
while (v >= 0x80)
|
while (v >= 0x80)
|
||||||
{
|
{
|
||||||
if (m_Index + 1 > m_Buffer.Length)
|
if (Index + 1 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index++] = (byte)(v | 0x80);
|
Buffer[Index++] = (byte)(v | 0x80);
|
||||||
v >>= 7;
|
v >>= 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Index + 1 > m_Buffer.Length)
|
if (Index + 1 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index++] = (byte)v;
|
Buffer[Index++] = (byte)v;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(string value)
|
public void Write(string value)
|
||||||
|
|
@ -122,21 +121,21 @@ namespace Server
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
if (m_Index + 1 > m_Buffer.Length)
|
if (Index + 1 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index++] = 0;
|
Buffer[Index++] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_Index + 1 > m_Buffer.Length)
|
if (Index + 1 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index++] = 1;
|
Buffer[Index++] = 1;
|
||||||
|
|
||||||
InternalWriteString(value);
|
InternalWriteString(value);
|
||||||
}
|
}
|
||||||
|
|
@ -199,143 +198,143 @@ namespace Server
|
||||||
|
|
||||||
public void Write(long value)
|
public void Write(long value)
|
||||||
{
|
{
|
||||||
if (m_Index + 8 > m_Buffer.Length)
|
if (Index + 8 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index] = (byte)value;
|
Buffer[Index] = (byte)value;
|
||||||
m_Buffer[m_Index + 1] = (byte)(value >> 8);
|
Buffer[Index + 1] = (byte)(value >> 8);
|
||||||
m_Buffer[m_Index + 2] = (byte)(value >> 16);
|
Buffer[Index + 2] = (byte)(value >> 16);
|
||||||
m_Buffer[m_Index + 3] = (byte)(value >> 24);
|
Buffer[Index + 3] = (byte)(value >> 24);
|
||||||
m_Buffer[m_Index + 4] = (byte)(value >> 32);
|
Buffer[Index + 4] = (byte)(value >> 32);
|
||||||
m_Buffer[m_Index + 5] = (byte)(value >> 40);
|
Buffer[Index + 5] = (byte)(value >> 40);
|
||||||
m_Buffer[m_Index + 6] = (byte)(value >> 48);
|
Buffer[Index + 6] = (byte)(value >> 48);
|
||||||
m_Buffer[m_Index + 7] = (byte)(value >> 56);
|
Buffer[Index + 7] = (byte)(value >> 56);
|
||||||
m_Index += 8;
|
Index += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(ulong value)
|
public void Write(ulong value)
|
||||||
{
|
{
|
||||||
if (m_Index + 8 > m_Buffer.Length)
|
if (Index + 8 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index] = (byte)value;
|
Buffer[Index] = (byte)value;
|
||||||
m_Buffer[m_Index + 1] = (byte)(value >> 8);
|
Buffer[Index + 1] = (byte)(value >> 8);
|
||||||
m_Buffer[m_Index + 2] = (byte)(value >> 16);
|
Buffer[Index + 2] = (byte)(value >> 16);
|
||||||
m_Buffer[m_Index + 3] = (byte)(value >> 24);
|
Buffer[Index + 3] = (byte)(value >> 24);
|
||||||
m_Buffer[m_Index + 4] = (byte)(value >> 32);
|
Buffer[Index + 4] = (byte)(value >> 32);
|
||||||
m_Buffer[m_Index + 5] = (byte)(value >> 40);
|
Buffer[Index + 5] = (byte)(value >> 40);
|
||||||
m_Buffer[m_Index + 6] = (byte)(value >> 48);
|
Buffer[Index + 6] = (byte)(value >> 48);
|
||||||
m_Buffer[m_Index + 7] = (byte)(value >> 56);
|
Buffer[Index + 7] = (byte)(value >> 56);
|
||||||
m_Index += 8;
|
Index += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(int value)
|
public void Write(int value)
|
||||||
{
|
{
|
||||||
if (m_Index + 4 > m_Buffer.Length)
|
if (Index + 4 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index] = (byte)value;
|
Buffer[Index] = (byte)value;
|
||||||
m_Buffer[m_Index + 1] = (byte)(value >> 8);
|
Buffer[Index + 1] = (byte)(value >> 8);
|
||||||
m_Buffer[m_Index + 2] = (byte)(value >> 16);
|
Buffer[Index + 2] = (byte)(value >> 16);
|
||||||
m_Buffer[m_Index + 3] = (byte)(value >> 24);
|
Buffer[Index + 3] = (byte)(value >> 24);
|
||||||
m_Index += 4;
|
Index += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(uint value)
|
public void Write(uint value)
|
||||||
{
|
{
|
||||||
if (m_Index + 4 > m_Buffer.Length)
|
if (Index + 4 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index] = (byte)value;
|
Buffer[Index] = (byte)value;
|
||||||
m_Buffer[m_Index + 1] = (byte)(value >> 8);
|
Buffer[Index + 1] = (byte)(value >> 8);
|
||||||
m_Buffer[m_Index + 2] = (byte)(value >> 16);
|
Buffer[Index + 2] = (byte)(value >> 16);
|
||||||
m_Buffer[m_Index + 3] = (byte)(value >> 24);
|
Buffer[Index + 3] = (byte)(value >> 24);
|
||||||
m_Index += 4;
|
Index += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(short value)
|
public void Write(short value)
|
||||||
{
|
{
|
||||||
if (m_Index + 2 > m_Buffer.Length)
|
if (Index + 2 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index] = (byte)value;
|
Buffer[Index] = (byte)value;
|
||||||
m_Buffer[m_Index + 1] = (byte)(value >> 8);
|
Buffer[Index + 1] = (byte)(value >> 8);
|
||||||
m_Index += 2;
|
Index += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(ushort value)
|
public void Write(ushort value)
|
||||||
{
|
{
|
||||||
if (m_Index + 2 > m_Buffer.Length)
|
if (Index + 2 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index] = (byte)value;
|
Buffer[Index] = (byte)value;
|
||||||
m_Buffer[m_Index + 1] = (byte)(value >> 8);
|
Buffer[Index + 1] = (byte)(value >> 8);
|
||||||
m_Index += 2;
|
Index += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe void Write(double value)
|
public unsafe void Write(double value)
|
||||||
{
|
{
|
||||||
if (m_Index + 8 > m_Buffer.Length)
|
if (Index + 8 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed (byte* pBuffer = m_Buffer)
|
fixed (byte* pBuffer = Buffer)
|
||||||
{
|
{
|
||||||
*(double*)(pBuffer + m_Index) = value;
|
*(double*)(pBuffer + Index) = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Index += 8;
|
Index += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe void Write(float value)
|
public unsafe void Write(float value)
|
||||||
{
|
{
|
||||||
if (m_Index + 4 > m_Buffer.Length)
|
if (Index + 4 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed (byte* pBuffer = m_Buffer)
|
fixed (byte* pBuffer = Buffer)
|
||||||
{
|
{
|
||||||
*(float*)(pBuffer + m_Index) = value;
|
*(float*)(pBuffer + Index) = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Index += 4;
|
Index += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(char value)
|
public void Write(char value)
|
||||||
{
|
{
|
||||||
if (m_Index + 8 > m_Buffer.Length)
|
if (Index + 8 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_SingleCharBuffer[0] = value;
|
m_SingleCharBuffer[0] = value;
|
||||||
|
|
||||||
var byteCount = m_Encoding.GetBytes(m_SingleCharBuffer, 0, 1, m_Buffer, (int)m_Index);
|
var byteCount = m_Encoding.GetBytes(m_SingleCharBuffer, 0, 1, Buffer, (int)Index);
|
||||||
m_Index += byteCount;
|
Index += byteCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(byte value)
|
public void Write(byte value)
|
||||||
{
|
{
|
||||||
if (m_Index + 1 > m_Buffer.Length)
|
if (Index + 1 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index++] = value;
|
Buffer[Index++] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(byte[] value, int length)
|
public void Write(byte[] value, int length)
|
||||||
|
|
@ -345,15 +344,15 @@ namespace Server
|
||||||
|
|
||||||
while (remaining > 0)
|
while (remaining > 0)
|
||||||
{
|
{
|
||||||
int size = Math.Min(m_Buffer.Length - (int)m_Index, remaining);
|
int size = Math.Min(Buffer.Length - (int)Index, remaining);
|
||||||
Buffer.BlockCopy(value, idx, m_Buffer, (int)m_Index, size);
|
System.Buffer.BlockCopy(value, idx, Buffer, (int)Index, size);
|
||||||
// value.Slice(idx).CopyTo(m_Buffer.AsSpan(m_Index, size));
|
// value.Slice(idx).CopyTo(m_Buffer.AsSpan(m_Index, size));
|
||||||
|
|
||||||
remaining -= size;
|
remaining -= size;
|
||||||
m_Index += size;
|
Index += size;
|
||||||
idx += size;
|
idx += size;
|
||||||
|
|
||||||
if (m_Index == m_Buffer.Length)
|
if (Index == Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
@ -362,22 +361,22 @@ namespace Server
|
||||||
|
|
||||||
public void Write(sbyte value)
|
public void Write(sbyte value)
|
||||||
{
|
{
|
||||||
if (m_Index + 1 > m_Buffer.Length)
|
if (Index + 1 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index++] = (byte)value;
|
Buffer[Index++] = (byte)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(bool value)
|
public void Write(bool value)
|
||||||
{
|
{
|
||||||
if (m_Index + 1 > m_Buffer.Length)
|
if (Index + 1 > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer[m_Index++] = (byte)(value ? 1 : 0);
|
Buffer[Index++] = (byte)(value ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(Point3D value)
|
public void Write(Point3D value)
|
||||||
|
|
@ -773,13 +772,13 @@ namespace Server
|
||||||
var charCount = charsLeft > m_MaxBufferChars ? m_MaxBufferChars : charsLeft;
|
var charCount = charsLeft > m_MaxBufferChars ? m_MaxBufferChars : charsLeft;
|
||||||
var byteLength = m_Encoding.GetBytes(value, current, charCount, m_CharacterBuffer, 0);
|
var byteLength = m_Encoding.GetBytes(value, current, charCount, m_CharacterBuffer, 0);
|
||||||
|
|
||||||
if (m_Index + byteLength > m_Buffer.Length)
|
if (Index + byteLength > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
Buffer.BlockCopy(m_CharacterBuffer, 0, m_Buffer, (int)m_Index, byteLength);
|
System.Buffer.BlockCopy(m_CharacterBuffer, 0, Buffer, (int)Index, byteLength);
|
||||||
m_Index += byteLength;
|
Index += byteLength;
|
||||||
|
|
||||||
current += charCount;
|
current += charCount;
|
||||||
charsLeft -= charCount;
|
charsLeft -= charCount;
|
||||||
|
|
@ -789,13 +788,13 @@ namespace Server
|
||||||
{
|
{
|
||||||
var byteLength = m_Encoding.GetBytes(value, 0, value.Length, m_CharacterBuffer, 0);
|
var byteLength = m_Encoding.GetBytes(value, 0, value.Length, m_CharacterBuffer, 0);
|
||||||
|
|
||||||
if (m_Index + byteLength > m_Buffer.Length)
|
if (Index + byteLength > Buffer.Length)
|
||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
Buffer.BlockCopy(m_CharacterBuffer, 0, m_Buffer, (int)m_Index, byteLength);
|
System.Buffer.BlockCopy(m_CharacterBuffer, 0, Buffer, (int)Index, byteLength);
|
||||||
m_Index += byteLength;
|
Index += byteLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Zlib.Bindings" Version="1.4.0" />
|
<PackageReference Include="Zlib.Bindings" Version="1.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition="'$(Configuration)'=='Analyze'">
|
<!-- <ItemGroup Condition="'$(Configuration)'=='Analyze'">-->
|
||||||
<AdditionalFiles Include="..\..\stylecop.json" />
|
<!-- <AdditionalFiles Include="..\..\stylecop.json" />-->
|
||||||
<AdditionalFiles Include="..\..\Rules.ruleset" />
|
<!-- <AdditionalFiles Include="..\..\Rules.ruleset" />-->
|
||||||
</ItemGroup>
|
<!-- </ItemGroup>-->
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@ namespace Server
|
||||||
{
|
{
|
||||||
public class TileMatrixPatch
|
public class TileMatrixPatch
|
||||||
{
|
{
|
||||||
private readonly int m_LandBlocks;
|
|
||||||
private readonly int m_StaticBlocks;
|
|
||||||
|
|
||||||
private StaticTile[] m_TileBuffer = new StaticTile[128];
|
private StaticTile[] m_TileBuffer = new StaticTile[128];
|
||||||
|
|
||||||
public TileMatrixPatch(TileMatrix matrix, int index)
|
public TileMatrixPatch(TileMatrix matrix, int index)
|
||||||
|
|
@ -22,7 +19,7 @@ namespace Server
|
||||||
|
|
||||||
if (File.Exists(mapDataPath) && File.Exists(mapIndexPath))
|
if (File.Exists(mapDataPath) && File.Exists(mapIndexPath))
|
||||||
{
|
{
|
||||||
m_LandBlocks = PatchLand(matrix, mapDataPath, mapIndexPath);
|
LandBlocks = PatchLand(matrix, mapDataPath, mapIndexPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
var staDataPath = Core.FindDataFile($"stadif{index}.mul", false);
|
var staDataPath = Core.FindDataFile($"stadif{index}.mul", false);
|
||||||
|
|
@ -31,33 +28,16 @@ namespace Server
|
||||||
|
|
||||||
if (File.Exists(staDataPath) && File.Exists(staIndexPath) && File.Exists(staLookupPath))
|
if (File.Exists(staDataPath) && File.Exists(staIndexPath) && File.Exists(staLookupPath))
|
||||||
{
|
{
|
||||||
m_StaticBlocks = PatchStatics(matrix, staDataPath, staIndexPath, staLookupPath);
|
StaticBlocks = PatchStatics(matrix, staDataPath, staIndexPath, staLookupPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Use configuration
|
||||||
public static bool Enabled { get; set; } = true;
|
public static bool Enabled { get; set; } = true;
|
||||||
|
|
||||||
public int LandBlocks
|
public int LandBlocks { get; }
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (this)
|
|
||||||
{
|
|
||||||
return m_LandBlocks;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int StaticBlocks
|
public int StaticBlocks { get; }
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (this)
|
|
||||||
{
|
|
||||||
return m_StaticBlocks;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||||
private unsafe int PatchLand(TileMatrix matrix, string dataPath, string indexPath)
|
private unsafe int PatchLand(TileMatrix matrix, string dataPath, string indexPath)
|
||||||
|
|
|
||||||
|
|
@ -215,9 +215,9 @@ namespace Server
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
var hasOpen = str.IndexOf('<') >= 0;
|
var hasOpen = str.Contains('<', StringComparison.Ordinal);
|
||||||
var hasClose = str.IndexOf('>') >= 0;
|
var hasClose = str.Contains('>', StringComparison.Ordinal);
|
||||||
var hasPound = str.IndexOf('#') >= 0;
|
var hasPound = str.Contains('#', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (!hasOpen && !hasClose && !hasPound)
|
if (!hasOpen && !hasClose && !hasPound)
|
||||||
{
|
{
|
||||||
|
|
@ -891,23 +891,42 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<TOutput> CastListContravariant<TInput, TOutput>(List<TInput> list) where TInput : TOutput =>
|
public static List<TOutput> CastListContravariant<TInput, TOutput>(this IReadOnlyCollection<TInput> coll)
|
||||||
list.ConvertAll(value => (TOutput)value);
|
where TInput : TOutput
|
||||||
|
|
||||||
public static List<TOutput> CastListCovariant<TInput, TOutput>(List<TInput> list) where TOutput : TInput =>
|
|
||||||
list.ConvertAll(value => (TOutput)value);
|
|
||||||
|
|
||||||
public static List<TOutput> SafeConvertList<TInput, TOutput>(List<TInput> list) where TOutput : class
|
|
||||||
{
|
{
|
||||||
if ((list?.Capacity ?? 0) == 0)
|
var outputList = new List<TOutput>();
|
||||||
|
foreach (var entry in coll)
|
||||||
{
|
{
|
||||||
return new List<TOutput>();
|
outputList.Add(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
var output = new List<TOutput>(list.Capacity);
|
return outputList;
|
||||||
output.AddRange(list.OfType<TOutput>());
|
}
|
||||||
|
|
||||||
return output;
|
public static List<TOutput> CastListCovariant<TInput, TOutput>(this IReadOnlyCollection<TInput> coll)
|
||||||
|
where TOutput : TInput
|
||||||
|
{
|
||||||
|
var outputList = new List<TOutput>();
|
||||||
|
foreach (var entry in coll)
|
||||||
|
{
|
||||||
|
outputList.Add((TOutput)entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
return outputList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<TOutput> SafeConvertList<TInput, TOutput>(this IReadOnlyCollection<TInput> coll) where TOutput : class
|
||||||
|
{
|
||||||
|
var outputList = new List<TOutput>();
|
||||||
|
foreach (var entry in coll)
|
||||||
|
{
|
||||||
|
if (entry is TOutput outEntry)
|
||||||
|
{
|
||||||
|
outputList.Add(outEntry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return outputList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool ToBoolean(string value)
|
public static bool ToBoolean(string value)
|
||||||
|
|
@ -942,7 +961,7 @@ namespace Server
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#pragma warning disable CA1806 // Do not ignore method results
|
#pragma warning disable CA1806 // Do not ignore method results
|
||||||
if (value.StartsWith("0x"))
|
if (value.StartsWith("0x", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
int.TryParse(value.Substring(2), NumberStyles.HexNumber, null, out i);
|
int.TryParse(value.Substring(2), NumberStyles.HexNumber, null, out i);
|
||||||
}
|
}
|
||||||
|
|
@ -960,7 +979,7 @@ namespace Server
|
||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
#pragma warning disable CA1806 // Do not ignore method results
|
#pragma warning disable CA1806 // Do not ignore method results
|
||||||
if (value.StartsWith("0x"))
|
if (value.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
uint.TryParse(value.Substring(2), NumberStyles.HexNumber, null, out i);
|
uint.TryParse(value.Substring(2), NumberStyles.HexNumber, null, out i);
|
||||||
}
|
}
|
||||||
|
|
@ -974,12 +993,12 @@ namespace Server
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool ToInt32(string value, out int i) =>
|
public static bool ToInt32(string value, out int i) =>
|
||||||
value.StartsWith("0x")
|
value.StartsWith("0x", StringComparison.OrdinalIgnoreCase)
|
||||||
? int.TryParse(value.Substring(2), NumberStyles.HexNumber, null, out i)
|
? int.TryParse(value.Substring(2), NumberStyles.HexNumber, null, out i)
|
||||||
: int.TryParse(value, out i);
|
: int.TryParse(value, out i);
|
||||||
|
|
||||||
public static bool ToUInt32(string value, out uint i) =>
|
public static bool ToUInt32(string value, out uint i) =>
|
||||||
value.StartsWith("0x")
|
value.StartsWith("0x", StringComparison.OrdinalIgnoreCase)
|
||||||
? uint.TryParse(value.Substring(2), NumberStyles.HexNumber, null, out i)
|
? uint.TryParse(value.Substring(2), NumberStyles.HexNumber, null, out i)
|
||||||
: uint.TryParse(value, out i);
|
: uint.TryParse(value, out i);
|
||||||
|
|
||||||
|
|
@ -1034,7 +1053,7 @@ namespace Server
|
||||||
public static string GetAttribute(XmlElement node, string attributeName, string defaultValue = null) =>
|
public static string GetAttribute(XmlElement node, string attributeName, string defaultValue = null) =>
|
||||||
node?.Attributes[attributeName]?.Value ?? defaultValue;
|
node?.Attributes[attributeName]?.Value ?? defaultValue;
|
||||||
|
|
||||||
public static string GetText(XmlElement node, string defaultValue) => node == null ? defaultValue : node.InnerText;
|
public static string GetText(XmlElement node, string defaultValue) => node?.InnerText ?? defaultValue;
|
||||||
|
|
||||||
public static int GetAddressValue(IPAddress address) => BitConverter.ToInt32(address.GetAddressBytes(), 0);
|
public static int GetAddressValue(IPAddress address) => BitConverter.ToInt32(address.GetAddressBytes(), 0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,8 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception("No serials left to allocate for mobiles");
|
OutOfMemory("No serials left to allocate for mobiles");
|
||||||
|
return Serial.MinusOne;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,7 +99,8 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception("No serials left to allocate for items");
|
OutOfMemory("No serials left to allocate for items");
|
||||||
|
return Serial.MinusOne;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,6 +116,8 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void OutOfMemory(string message) => throw new OutOfMemoryException(message);
|
||||||
|
|
||||||
internal static int _Saves;
|
internal static int _Saves;
|
||||||
internal static List<Type> ItemTypes { get; } = new List<Type>();
|
internal static List<Type> ItemTypes { get; } = new List<Type>();
|
||||||
internal static List<Type> MobileTypes { get; } = new List<Type>();
|
internal static List<Type> MobileTypes { get; } = new List<Type>();
|
||||||
|
|
@ -157,15 +161,13 @@ namespace Server
|
||||||
p = new UnicodeMessage(Serial.MinusOne, -1, MessageType.Regular, hue, 3, "ENU", "System", text);
|
p = new UnicodeMessage(Serial.MinusOne, -1, MessageType.Regular, hue, 3, "ENU", "System", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
var list = TcpServer.Instances;
|
|
||||||
|
|
||||||
p.Acquire();
|
p.Acquire();
|
||||||
|
|
||||||
for (var i = 0; i < list.Count; ++i)
|
foreach (var ns in TcpServer.Instances)
|
||||||
{
|
{
|
||||||
if (list[i].Mobile != null)
|
if (ns.Mobile != null)
|
||||||
{
|
{
|
||||||
list[i].Send(p);
|
ns.Send(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,7 +340,7 @@ namespace Server
|
||||||
reader.Seek(entry.Position, SeekOrigin.Begin);
|
reader.Seek(entry.Position, SeekOrigin.Begin);
|
||||||
|
|
||||||
t.SaveBuffer = new BufferWriter(new byte[entry.Length], true);
|
t.SaveBuffer = new BufferWriter(new byte[entry.Length], true);
|
||||||
reader.Read(t.SaveBuffer.Data);
|
reader.Read(t.SaveBuffer.Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
reader.Close();
|
reader.Close();
|
||||||
|
|
@ -737,7 +739,7 @@ namespace Server
|
||||||
public static void SerializeTo(this ISerializable entity, IGenericWriter writer)
|
public static void SerializeTo(this ISerializable entity, IGenericWriter writer)
|
||||||
{
|
{
|
||||||
var saveBuffer = entity.SaveBuffer;
|
var saveBuffer = entity.SaveBuffer;
|
||||||
writer.Write(saveBuffer.Data, (int)saveBuffer.Position);
|
writer.Write(saveBuffer.Buffer, (int)saveBuffer.Position);
|
||||||
|
|
||||||
// Resize to exact buffer size
|
// Resize to exact buffer size
|
||||||
entity.SaveBuffer.Resize((int)entity.SaveBuffer.Position);
|
entity.SaveBuffer.Resize((int)entity.SaveBuffer.Position);
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,9 @@ namespace Server.Tests.Accounting.Security
|
||||||
{
|
{
|
||||||
private const string plainPassword = "hello-good-sir";
|
private const string plainPassword = "hello-good-sir";
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(typeof(Argon2PasswordProtection)), InlineData(typeof(PBKDF2PasswordProtection)),
|
||||||
[InlineData(typeof(Argon2PasswordProtection))]
|
InlineData(typeof(SHA2PasswordProtection)), InlineData(typeof(SHA1PasswordProtection)),
|
||||||
[InlineData(typeof(PBKDF2PasswordProtection))]
|
InlineData(typeof(MD5PasswordProtection))]
|
||||||
[InlineData(typeof(SHA2PasswordProtection))]
|
|
||||||
[InlineData(typeof(SHA1PasswordProtection))]
|
|
||||||
[InlineData(typeof(MD5PasswordProtection))]
|
|
||||||
public void TestValidates(Type protectionType)
|
public void TestValidates(Type protectionType)
|
||||||
{
|
{
|
||||||
var passwordProtection = Activator.CreateInstance(protectionType) as IPasswordProtection;
|
var passwordProtection = Activator.CreateInstance(protectionType) as IPasswordProtection;
|
||||||
|
|
@ -28,12 +25,9 @@ namespace Server.Tests.Accounting.Security
|
||||||
Assert.True(passwordProtection.ValidatePassword(encryptedPassword, plainPassword));
|
Assert.True(passwordProtection.ValidatePassword(encryptedPassword, plainPassword));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(typeof(Argon2PasswordProtection)), InlineData(typeof(PBKDF2PasswordProtection)),
|
||||||
[InlineData(typeof(Argon2PasswordProtection))]
|
InlineData(typeof(SHA2PasswordProtection)), InlineData(typeof(SHA1PasswordProtection)),
|
||||||
[InlineData(typeof(PBKDF2PasswordProtection))]
|
InlineData(typeof(MD5PasswordProtection))]
|
||||||
[InlineData(typeof(SHA2PasswordProtection))]
|
|
||||||
[InlineData(typeof(SHA1PasswordProtection))]
|
|
||||||
[InlineData(typeof(MD5PasswordProtection))]
|
|
||||||
public void TestPasswordDoesNotValidate(Type protectionType)
|
public void TestPasswordDoesNotValidate(Type protectionType)
|
||||||
{
|
{
|
||||||
var passwordProtection = Activator.CreateInstance(protectionType) as IPasswordProtection;
|
var passwordProtection = Activator.CreateInstance(protectionType) as IPasswordProtection;
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(0, 0), InlineData(100, 10), InlineData(100000, 100000)]
|
||||||
[InlineData(0, 0)]
|
|
||||||
[InlineData(100, 10)]
|
|
||||||
[InlineData(100000, 100000)]
|
|
||||||
public void TestSetArrow(int x, int y)
|
public void TestSetArrow(int x, int y)
|
||||||
{
|
{
|
||||||
var expected = new SetArrow(x, y).Compile();
|
var expected = new SetArrow(x, y).Compile();
|
||||||
|
|
@ -33,10 +30,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(0, 0), InlineData(100, 10), InlineData(100000, 100000)]
|
||||||
[InlineData(0, 0)]
|
|
||||||
[InlineData(100, 10)]
|
|
||||||
[InlineData(100000, 100000)]
|
|
||||||
public void TestCancelArrowHS(int x, int y)
|
public void TestCancelArrowHS(int x, int y)
|
||||||
{
|
{
|
||||||
Serial serial = 0x1024;
|
Serial serial = 0x1024;
|
||||||
|
|
@ -51,10 +45,7 @@ namespace Server.Tests.Network
|
||||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory, InlineData(0, 0), InlineData(100, 10), InlineData(100000, 100000)]
|
||||||
[InlineData(0, 0)]
|
|
||||||
[InlineData(100, 10)]
|
|
||||||
[InlineData(100000, 100000)]
|
|
||||||
public void TestSetArrowHS(int x, int y)
|
public void TestSetArrowHS(int x, int y)
|
||||||
{
|
{
|
||||||
Serial serial = 0x1024;
|
Serial serial = 0x1024;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace Server
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var ip = ((IPEndPoint)e.Connection.RemoteEndPoint).Address;
|
var ip = (e.Connection.RemoteEndPoint as IPEndPoint)?.Address;
|
||||||
|
|
||||||
if (Firewall.IsBlocked(ip))
|
if (Firewall.IsBlocked(ip))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -775,7 +775,7 @@ namespace Server.Accounting
|
||||||
}
|
}
|
||||||
|
|
||||||
m_PasswordAlgorithm = algorithm;
|
m_PasswordAlgorithm = algorithm;
|
||||||
Password = password?.Replace("-", string.Empty);
|
Password = password.Replace("-", string.Empty, StringComparison.Ordinal);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using Server.Regions;
|
||||||
|
|
||||||
namespace Server.Misc
|
namespace Server.Misc
|
||||||
{
|
{
|
||||||
public class AccountHandler
|
public static class AccountHandler
|
||||||
{
|
{
|
||||||
private static int MaxAccountsPerIP;
|
private static int MaxAccountsPerIP;
|
||||||
private static bool AutoAccountCreation;
|
private static bool AutoAccountCreation;
|
||||||
|
|
@ -100,10 +100,9 @@ namespace Server.Misc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Password <newPassword> <repeatPassword>")]
|
[Usage("Password <newPassword> <repeatPassword>"), Description(
|
||||||
[Description(
|
"Changes the password of the commanding players account. Requires the same C-class IP address as the account's creator."
|
||||||
"Changes the password of the commanding players account. Requires the same C-class IP address as the account's creator."
|
)]
|
||||||
)]
|
|
||||||
public static void Password_OnCommand(CommandEventArgs e)
|
public static void Password_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
|
|
@ -177,7 +176,7 @@ namespace Server.Misc
|
||||||
|
|
||||||
if (entry != null)
|
if (entry != null)
|
||||||
{
|
{
|
||||||
if (entry.Message.StartsWith("[Automated: Change Password]"))
|
if (entry.Message.StartsWith("[Automated: Change Password]", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
from.SendMessage("You already have a password change request in the help system queue.");
|
from.SendMessage("You already have a password change request in the help system queue.");
|
||||||
}
|
}
|
||||||
|
|
@ -289,7 +288,9 @@ namespace Server.Misc
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var isSafe = !(un.StartsWith(" ") || un.EndsWith(" ") || un.EndsWith("."));
|
var isSafe = !(un.StartsWith(" ", StringComparison.Ordinal) ||
|
||||||
|
un.EndsWith(" ", StringComparison.Ordinal) ||
|
||||||
|
un.EndsWith(".", StringComparison.Ordinal));
|
||||||
|
|
||||||
for (var i = 0; isSafe && i < un.Length; ++i)
|
for (var i = 0; isSafe && i < un.Length; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using System.Xml;
|
||||||
|
|
||||||
namespace Server.Accounting
|
namespace Server.Accounting
|
||||||
{
|
{
|
||||||
public class Accounts
|
public static class Accounts
|
||||||
{
|
{
|
||||||
private static Dictionary<string, IAccount> m_Accounts = new Dictionary<string, IAccount>();
|
private static Dictionary<string, IAccount> m_Accounts = new Dictionary<string, IAccount>();
|
||||||
|
|
||||||
|
|
@ -56,6 +56,11 @@ namespace Server.Accounting
|
||||||
|
|
||||||
var root = doc["accounts"];
|
var root = doc["accounts"];
|
||||||
|
|
||||||
|
if (root == null)
|
||||||
|
{
|
||||||
|
throw new FileLoadException("Unable to load xml file");
|
||||||
|
}
|
||||||
|
|
||||||
foreach (XmlElement account in root.GetElementsByTagName("account"))
|
foreach (XmlElement account in root.GetElementsByTagName("account"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
|
||||||
namespace Server
|
namespace Server
|
||||||
{
|
{
|
||||||
public class Firewall
|
public static class Firewall
|
||||||
{
|
{
|
||||||
static Firewall()
|
static Firewall()
|
||||||
{
|
{
|
||||||
|
|
@ -30,13 +31,13 @@ namespace Server
|
||||||
|
|
||||||
/*
|
/*
|
||||||
object toAdd;
|
object toAdd;
|
||||||
|
|
||||||
IPAddress addr;
|
IPAddress addr;
|
||||||
if (IPAddress.TryParse( line, out addr ))
|
if (IPAddress.TryParse( line, out addr ))
|
||||||
toAdd = addr;
|
toAdd = addr;
|
||||||
else
|
else
|
||||||
toAdd = line;
|
toAdd = line;
|
||||||
|
|
||||||
m_Blocked.Add( toAdd.ToString() );
|
m_Blocked.Add( toAdd.ToString() );
|
||||||
* */
|
* */
|
||||||
}
|
}
|
||||||
|
|
@ -47,22 +48,13 @@ namespace Server
|
||||||
|
|
||||||
public static IFirewallEntry ToFirewallEntry(object entry)
|
public static IFirewallEntry ToFirewallEntry(object entry)
|
||||||
{
|
{
|
||||||
if (entry is IFirewallEntry firewallEntry)
|
return entry switch
|
||||||
{
|
{
|
||||||
return firewallEntry;
|
IFirewallEntry firewallEntry => firewallEntry,
|
||||||
}
|
IPAddress address => new IPFirewallEntry(address),
|
||||||
|
string s => ToFirewallEntry(s),
|
||||||
if (entry is IPAddress address)
|
_ => null
|
||||||
{
|
};
|
||||||
return new IPFirewallEntry(address);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entry is string s)
|
|
||||||
{
|
|
||||||
return ToFirewallEntry(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IFirewallEntry ToFirewallEntry(string entry)
|
public static IFirewallEntry ToFirewallEntry(string entry)
|
||||||
|
|
@ -73,9 +65,9 @@ namespace Server
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try CIDR parse
|
// Try CIDR parse
|
||||||
var str = entry.Split('/');
|
var str = entry?.Split('/');
|
||||||
|
|
||||||
if (str.Length == 2)
|
if (str?.Length == 2)
|
||||||
{
|
{
|
||||||
if (IPAddress.TryParse(str[0], out var cidrPrefix))
|
if (IPAddress.TryParse(str[0], out var cidrPrefix))
|
||||||
{
|
{
|
||||||
|
|
@ -180,7 +172,7 @@ namespace Server
|
||||||
return false;
|
return false;
|
||||||
/*
|
/*
|
||||||
bool contains = false;
|
bool contains = false;
|
||||||
|
|
||||||
for ( int i = 0; !contains && i < m_Blocked.Count; ++i )
|
for ( int i = 0; !contains && i < m_Blocked.Count; ++i )
|
||||||
{
|
{
|
||||||
if (m_Blocked[i] is IPAddress)
|
if (m_Blocked[i] is IPAddress)
|
||||||
|
|
@ -188,14 +180,14 @@ namespace Server
|
||||||
else if (m_Blocked[i] is String)
|
else if (m_Blocked[i] is String)
|
||||||
{
|
{
|
||||||
string s = (string)m_Blocked[i];
|
string s = (string)m_Blocked[i];
|
||||||
|
|
||||||
contains = Utility.IPMatchCIDR( s, ip );
|
contains = Utility.IPMatchCIDR( s, ip );
|
||||||
|
|
||||||
if (!contains)
|
if (!contains)
|
||||||
contains = Utility.IPMatch( s, ip );
|
contains = Utility.IPMatch( s, ip );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return contains;
|
return contains;
|
||||||
* */
|
* */
|
||||||
}
|
}
|
||||||
|
|
@ -312,10 +304,10 @@ namespace Server
|
||||||
return obj.Equals(m_Entry);
|
return obj.Equals(m_Entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj is WildcardIPFirewallEntry entry && m_Entry.Equals(entry.m_Entry);
|
return obj is WildcardIPFirewallEntry entry && m_Entry == entry.m_Entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode() => m_Entry.GetHashCode();
|
public override int GetHashCode() => m_Entry.GetHashCode(StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@ using Server.Network;
|
||||||
|
|
||||||
namespace Server.Misc
|
namespace Server.Misc
|
||||||
{
|
{
|
||||||
public class IPLimiter
|
public static class IPLimiter
|
||||||
{
|
{
|
||||||
public static IPAddress[] Exemptions =
|
public static readonly IPAddress[] Exemptions =
|
||||||
{
|
{
|
||||||
// IPAddress.Parse( "127.0.0.1" ),
|
IPAddress.Parse( "127.0.0.1" )
|
||||||
};
|
};
|
||||||
|
|
||||||
public static bool Enabled { get; private set; }
|
public static bool Enabled { get; private set; }
|
||||||
|
|
@ -31,15 +31,11 @@ namespace Server.Misc
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var netStates = TcpServer.Instances;
|
|
||||||
|
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
for (var i = 0; i < netStates.Count; ++i)
|
foreach (var ns in TcpServer.Instances)
|
||||||
{
|
{
|
||||||
var compState = netStates[i];
|
if (ourAddress.Equals(ns.Address))
|
||||||
|
|
||||||
if (ourAddress.Equals(compState.Address))
|
|
||||||
{
|
{
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@ namespace Server.Accounting.Security
|
||||||
public class MD5PasswordProtection : IPasswordProtection
|
public class MD5PasswordProtection : IPasswordProtection
|
||||||
{
|
{
|
||||||
public static IPasswordProtection Instance = new MD5PasswordProtection();
|
public static IPasswordProtection Instance = new MD5PasswordProtection();
|
||||||
|
#pragma warning disable CA5351
|
||||||
private readonly MD5CryptoServiceProvider m_MD5HashProvider = new MD5CryptoServiceProvider();
|
private readonly MD5CryptoServiceProvider m_MD5HashProvider = new MD5CryptoServiceProvider();
|
||||||
|
#pragma warning restore CA5351
|
||||||
|
|
||||||
public string EncryptPassword(string plainPassword)
|
public string EncryptPassword(string plainPassword)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@ namespace Server.Accounting.Security
|
||||||
private const int m_SaltSize = 8;
|
private const int m_SaltSize = 8;
|
||||||
private const int m_HashSize = 32;
|
private const int m_HashSize = 32;
|
||||||
private const int m_OutputSize = 2 + m_SaltSize + m_HashSize;
|
private const int m_OutputSize = 2 + m_SaltSize + m_HashSize;
|
||||||
public static IPasswordProtection Instance = new PBKDF2PasswordProtection();
|
public static readonly IPasswordProtection Instance = new PBKDF2PasswordProtection();
|
||||||
private static readonly HashAlgorithmName m_Algorithm = HashAlgorithmName.SHA256;
|
|
||||||
|
|
||||||
public string EncryptPassword(string plainPassword)
|
public string EncryptPassword(string plainPassword)
|
||||||
{
|
{
|
||||||
|
|
@ -35,7 +34,7 @@ namespace Server.Accounting.Security
|
||||||
var iterations = Utility.RandomMinMax(m_MinIterations, m_MaxIterations);
|
var iterations = Utility.RandomMinMax(m_MinIterations, m_MaxIterations);
|
||||||
BinaryPrimitives.WriteUInt16LittleEndian(output.Slice(0, 2), (ushort)iterations);
|
BinaryPrimitives.WriteUInt16LittleEndian(output.Slice(0, 2), (ushort)iterations);
|
||||||
|
|
||||||
var rfc2898 = new Rfc2898DeriveBytes(plainPassword, m_SaltSize, iterations, m_Algorithm);
|
var rfc2898 = new Rfc2898DeriveBytes(plainPassword, m_SaltSize, iterations, HashAlgorithmName.SHA256);
|
||||||
rfc2898.Salt.CopyTo(output.Slice(2, m_SaltSize));
|
rfc2898.Salt.CopyTo(output.Slice(2, m_SaltSize));
|
||||||
rfc2898.GetBytes(m_HashSize).CopyTo(output.Slice(m_SaltSize + 2));
|
rfc2898.GetBytes(m_HashSize).CopyTo(output.Slice(m_SaltSize + 2));
|
||||||
|
|
||||||
|
|
@ -51,7 +50,7 @@ namespace Server.Accounting.Security
|
||||||
var salt = encryptedBytes.Slice(2, m_SaltSize);
|
var salt = encryptedBytes.Slice(2, m_SaltSize);
|
||||||
|
|
||||||
ReadOnlySpan<byte> hash =
|
ReadOnlySpan<byte> hash =
|
||||||
new Rfc2898DeriveBytes(plainPassword, salt.ToArray(), iterations, m_Algorithm).GetBytes(m_HashSize);
|
new Rfc2898DeriveBytes(plainPassword, salt.ToArray(), iterations, HashAlgorithmName.SHA256).GetBytes(m_HashSize);
|
||||||
|
|
||||||
return hash.SequenceEqual(encryptedBytes.Slice(m_SaltSize + 2));
|
return hash.SequenceEqual(encryptedBytes.Slice(m_SaltSize + 2));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@ namespace Server.Accounting.Security
|
||||||
public class SHA1PasswordProtection : IPasswordProtection
|
public class SHA1PasswordProtection : IPasswordProtection
|
||||||
{
|
{
|
||||||
public static IPasswordProtection Instance = new SHA1PasswordProtection();
|
public static IPasswordProtection Instance = new SHA1PasswordProtection();
|
||||||
|
#pragma warning disable CA5350
|
||||||
private readonly SHA1CryptoServiceProvider m_SHA1HashProvider = new SHA1CryptoServiceProvider();
|
private readonly SHA1CryptoServiceProvider m_SHA1HashProvider = new SHA1CryptoServiceProvider();
|
||||||
|
#pragma warning restore CA5350
|
||||||
|
|
||||||
public string EncryptPassword(string plainPassword)
|
public string EncryptPassword(string plainPassword)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
|
|
||||||
namespace Server
|
namespace Server
|
||||||
{
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Method)]
|
||||||
public class UsageAttribute : Attribute
|
public class UsageAttribute : Attribute
|
||||||
{
|
{
|
||||||
public UsageAttribute(string usage) => Usage = usage;
|
public UsageAttribute(string usage) => Usage = usage;
|
||||||
|
|
@ -9,6 +10,7 @@ namespace Server
|
||||||
public string Usage { get; }
|
public string Usage { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AttributeUsage(AttributeTargets.Method)]
|
||||||
public class DescriptionAttribute : Attribute
|
public class DescriptionAttribute : Attribute
|
||||||
{
|
{
|
||||||
public DescriptionAttribute(string description) => Description = description;
|
public DescriptionAttribute(string description) => Description = description;
|
||||||
|
|
@ -16,6 +18,7 @@ namespace Server
|
||||||
public string Description { get; }
|
public string Description { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AttributeUsage(AttributeTargets.Method)]
|
||||||
public class AliasesAttribute : Attribute
|
public class AliasesAttribute : Attribute
|
||||||
{
|
{
|
||||||
public AliasesAttribute(params string[] aliases) => Aliases = aliases;
|
public AliasesAttribute(params string[] aliases) => Aliases = aliases;
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("Batch", AccessLevel.Counselor, Batch_OnCommand);
|
CommandSystem.Register("Batch", AccessLevel.Counselor, Batch_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Batch")]
|
[Usage("Batch"), Description("Allows multiple commands to be run at the same time.")]
|
||||||
[Description("Allows multiple commands to be run at the same time.")]
|
|
||||||
public static void Batch_OnCommand(CommandEventArgs e)
|
public static void Batch_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.SendGump(new BatchGump(e.Mobile, new Batch()));
|
e.Mobile.SendGump(new BatchGump(e.Mobile, new Batch()));
|
||||||
|
|
@ -209,7 +208,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
public void GetDetails(out string command, out string argString, out string[] args)
|
public void GetDetails(out string command, out string argString, out string[] args)
|
||||||
{
|
{
|
||||||
var indexOf = Command.IndexOf(' ');
|
var indexOf = Command.IndexOf(' ', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ using Server.Network;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class Docs
|
public static class Docs
|
||||||
{
|
{
|
||||||
private const int Iron = 0xCCCCDD;
|
private const int Iron = 0xCCCCDD;
|
||||||
private const int DullCopper = 0xAAAAAA;
|
private const int DullCopper = 0xAAAAAA;
|
||||||
|
|
@ -109,8 +109,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("DocGen", AccessLevel.Administrator, DocGen_OnCommand);
|
CommandSystem.Register("DocGen", AccessLevel.Administrator, DocGen_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("DocGen")]
|
[Usage("DocGen"), Description("Generates RunUO documentation.")]
|
||||||
[Description("Generates RunUO documentation.")]
|
|
||||||
private static void DocGen_OnCommand(CommandEventArgs e)
|
private static void DocGen_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
World.Broadcast(0x35, true, "Documentation is being generated, please wait.");
|
World.Broadcast(0x35, true, "Documentation is being generated, please wait.");
|
||||||
|
|
@ -332,7 +331,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
if (type.IsGenericType)
|
if (type.IsGenericType)
|
||||||
{
|
{
|
||||||
var index = type.Name.IndexOf('`');
|
var index = type.Name.IndexOf('`', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (index > 0)
|
if (index > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -346,7 +345,7 @@ namespace Server.Commands
|
||||||
: new StringBuilder($"<a href=\"@directory@{rootType}-T-.html\">{rootType}</a>");
|
: new StringBuilder($"<a href=\"@directory@{rootType}-T-.html\">{rootType}</a>");
|
||||||
|
|
||||||
nameBuilder.Append("<");
|
nameBuilder.Append("<");
|
||||||
fnamBuilder.Append("-");
|
fnamBuilder.Append('-');
|
||||||
linkBuilder.Append("<");
|
linkBuilder.Append("<");
|
||||||
|
|
||||||
var typeArguments = type.GetGenericArguments();
|
var typeArguments = type.GetGenericArguments();
|
||||||
|
|
@ -364,7 +363,7 @@ namespace Server.Commands
|
||||||
var aliasedName = AliasForName(sanitizedName);
|
var aliasedName = AliasForName(sanitizedName);
|
||||||
|
|
||||||
nameBuilder.Append(sanitizedName);
|
nameBuilder.Append(sanitizedName);
|
||||||
fnamBuilder.Append("T");
|
fnamBuilder.Append('T');
|
||||||
if (DontLink(typeArguments[i]))
|
if (DontLink(typeArguments[i]))
|
||||||
{
|
{
|
||||||
linkBuilder.Append($"<font color=\"blue\">{aliasedName}</font>");
|
linkBuilder.Append($"<font color=\"blue\">{aliasedName}</font>");
|
||||||
|
|
@ -378,7 +377,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
nameBuilder.Append(">");
|
nameBuilder.Append(">");
|
||||||
fnamBuilder.Append("-");
|
fnamBuilder.Append('-');
|
||||||
linkBuilder.Append(">");
|
linkBuilder.Append(">");
|
||||||
|
|
||||||
name = nameBuilder.ToString();
|
name = nameBuilder.ToString();
|
||||||
|
|
@ -407,7 +406,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
public static string SanitizeType(string name)
|
public static string SanitizeType(string name)
|
||||||
{
|
{
|
||||||
var anonymousType = name.Contains("<");
|
var anonymousType = name.Contains('<', StringComparison.Ordinal);
|
||||||
var sb = new StringBuilder(name);
|
var sb = new StringBuilder(name);
|
||||||
for (var i = 0; i < ReplaceChars.Length; ++i)
|
for (var i = 0; i < ReplaceChars.Length; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -466,7 +465,7 @@ namespace Server.Commands
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.Namespace.StartsWith("Server"))
|
if (type.Namespace.StartsWith("Server", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -489,11 +488,12 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
var index = 0;
|
var index = 0;
|
||||||
var file = string.Concat(name, ext);
|
var file = $"{name}{ext}";
|
||||||
|
|
||||||
while (File.Exists(Path.Combine(root, file)))
|
while (File.Exists(Path.Combine(root, file)))
|
||||||
{
|
{
|
||||||
file = string.Concat(name, ++index, ext);
|
index++;
|
||||||
|
file = $"{name}{index}{ext}";
|
||||||
}
|
}
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
|
|
@ -604,7 +604,7 @@ namespace Server.Commands
|
||||||
if (realType?.IsGenericType == true)
|
if (realType?.IsGenericType == true)
|
||||||
{
|
{
|
||||||
FormatGeneric(realType, out _, out _, out var linkName);
|
FormatGeneric(realType, out _, out _, out var linkName);
|
||||||
aliased = linkName.Replace("@directory@", null);
|
aliased = linkName.Replace("@directory@", null, StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -621,7 +621,7 @@ namespace Server.Commands
|
||||||
aliased ??= realType?.Name ?? "";
|
aliased ??= realType?.Name ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return string.Concat(prepend, aliased, append, name);
|
return $"{prepend}{aliased}{append}{name}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool Document()
|
private static bool Document()
|
||||||
|
|
@ -1719,7 +1719,7 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
line = line.Trim();
|
line = line.Trim();
|
||||||
|
|
||||||
if (line.Length == 0 || line.StartsWith("#"))
|
if (line.Length == 0 || line.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -2029,16 +2029,11 @@ namespace Server.Commands
|
||||||
|
|
||||||
var aliases = attrs.Length == 0 ? null : attrs[0] as AliasesAttribute;
|
var aliases = attrs.Length == 0 ? null : attrs[0] as AliasesAttribute;
|
||||||
|
|
||||||
var descString = desc.Description.Replace("<", "<").Replace(">", ">");
|
var descString = desc.Description
|
||||||
|
.Replace("<", "<", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ">", StringComparison.Ordinal);
|
||||||
|
|
||||||
if (aliases == null)
|
list.Add(new DocCommandEntry(e.AccessLevel, e.Command, aliases?.Aliases, usage.Usage, descString));
|
||||||
{
|
|
||||||
list.Add(new DocCommandEntry(e.AccessLevel, e.Command, null, usage.Usage, descString));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list.Add(new DocCommandEntry(e.AccessLevel, e.Command, aliases.Aliases, usage.Usage, descString));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < TargetCommands.AllCommands.Count; ++i)
|
for (var i = 0; i < TargetCommands.AllCommands.Count; ++i)
|
||||||
|
|
@ -2062,7 +2057,9 @@ namespace Server.Commands
|
||||||
aliases[j] = cmds[j + 1];
|
aliases[j] = cmds[j + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
desc = desc.Replace("<", "<").Replace(">", ">");
|
desc = desc
|
||||||
|
.Replace("<", "<", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ">", StringComparison.Ordinal);
|
||||||
|
|
||||||
if (command.Supports != CommandSupport.Single)
|
if (command.Supports != CommandSupport.Single)
|
||||||
{
|
{
|
||||||
|
|
@ -2138,7 +2135,9 @@ namespace Server.Commands
|
||||||
aliases[j] = cmds[j + 1];
|
aliases[j] = cmds[j + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
desc = desc.Replace("<", "<").Replace(">", ">");
|
desc = desc
|
||||||
|
.Replace("<", "<", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ">", StringComparison.Ordinal);
|
||||||
|
|
||||||
list.Add(new DocCommandEntry(command.AccessLevel, cmd, aliases, usage, desc));
|
list.Add(new DocCommandEntry(command.AccessLevel, cmd, aliases, usage, desc));
|
||||||
}
|
}
|
||||||
|
|
@ -2237,7 +2236,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
html.Write(
|
html.Write(
|
||||||
"<td class=\"rentry\"><b>Usage: {0}</b><br>{1}</td>",
|
"<td class=\"rentry\"><b>Usage: {0}</b><br>{1}</td>",
|
||||||
usage.Replace("<", "<").Replace(">", ">"),
|
usage
|
||||||
|
.Replace("<", "<", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ">", StringComparison.Ordinal),
|
||||||
desc
|
desc
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -2245,7 +2246,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
html.Write(
|
html.Write(
|
||||||
"<td class=\"rentry\"><b>Usage: {0}</b><br>Alias{1}: ",
|
"<td class=\"rentry\"><b>Usage: {0}</b><br>Alias{1}: ",
|
||||||
usage.Replace("<", "<").Replace(">", ">"),
|
usage
|
||||||
|
.Replace("<", "<", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ">", StringComparison.Ordinal),
|
||||||
aliases.Length == 1 ? "" : "es"
|
aliases.Length == 1 ? "" : "es"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -2564,7 +2567,7 @@ namespace Server.Commands
|
||||||
if (ifaceInfo == null)
|
if (ifaceInfo == null)
|
||||||
{
|
{
|
||||||
FormatGeneric(iface, out _, out _, out var linkName);
|
FormatGeneric(iface, out _, out _, out var linkName);
|
||||||
typeHtml.Write($"<!-- DBG-2.1 -->{linkName.Replace("@directory@", null)}");
|
typeHtml.Write($"<!-- DBG-2.1 -->{linkName.Replace("@directory@", null, StringComparison.Ordinal)}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2910,7 +2913,7 @@ namespace Server.Commands
|
||||||
public string FileName => m_FileName;
|
public string FileName => m_FileName;
|
||||||
public string TypeName => m_TypeName;
|
public string TypeName => m_TypeName;
|
||||||
|
|
||||||
public string LinkName(string dirRoot) => m_LinkName.Replace("@directory@", dirRoot);
|
public string LinkName(string dirRoot) => m_LinkName.Replace("@directory@", dirRoot, StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SpeechEntry
|
private class SpeechEntry
|
||||||
|
|
@ -3009,7 +3012,7 @@ namespace Server.Commands
|
||||||
return Body == e?.Body && BodyType == e.BodyType && Name == e.Name;
|
return Body == e?.Body && BodyType == e.BodyType && Name == e.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode() => Body.BodyID ^ (int)BodyType ^ Name.GetHashCode();
|
public override int GetHashCode() => Body.BodyID ^ (int)BodyType ^ Name.GetHashCode(StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BodyEntrySorter : IComparer<BodyEntry>
|
public class BodyEntrySorter : IComparer<BodyEntry>
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("DragEffects", AccessLevel.Developer, DragEffects_OnCommand);
|
CommandSystem.Register("DragEffects", AccessLevel.Developer, DragEffects_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("DragEffects [enable=false]")]
|
[Usage("DragEffects [enable=false]"), Description("Enables or disables the item drag and drop effects.")]
|
||||||
[Description("Enables or disables the item drag and drop effects.")]
|
|
||||||
public static void DragEffects_OnCommand(CommandEventArgs e)
|
public static void DragEffects_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Length == 0)
|
if (e.Length == 0)
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("DupeInBag", AccessLevel.GameMaster, DupeInBag_OnCommand);
|
CommandSystem.Register("DupeInBag", AccessLevel.GameMaster, DupeInBag_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Dupe [amount]")]
|
[Usage("Dupe [amount]"), Description("Dupes a targeted item.")]
|
||||||
[Description("Dupes a targeted item.")]
|
|
||||||
private static void Dupe_OnCommand(CommandEventArgs e)
|
private static void Dupe_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var amount = 1;
|
var amount = 1;
|
||||||
|
|
@ -27,8 +26,7 @@ namespace Server.Commands
|
||||||
e.Mobile.SendMessage("What do you wish to dupe?");
|
e.Mobile.SendMessage("What do you wish to dupe?");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("DupeInBag <count>")]
|
[Usage("DupeInBag <count>"), Description("Dupes an item at it's current location (count) number of times.")]
|
||||||
[Description("Dupes an item at it's current location (count) number of times.")]
|
|
||||||
private static void DupeInBag_OnCommand(CommandEventArgs e)
|
private static void DupeInBag_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var amount = 1;
|
var amount = 1;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using Server.Items;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class ExportCommand
|
public static class ExportCommand
|
||||||
{
|
{
|
||||||
private const string ExportFile = @"C:\Uo\WorldForge\items.wsc";
|
private const string ExportFile = @"C:\Uo\WorldForge\items.wsc";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ using Server.Spells;
|
||||||
|
|
||||||
namespace Server.Commands.Generic
|
namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
public class TargetCommands
|
public static class TargetCommands
|
||||||
{
|
{
|
||||||
public static List<BaseCommand> AllCommands { get; } = new List<BaseCommand>();
|
public static List<BaseCommand> AllCommands { get; } = new List<BaseCommand>();
|
||||||
|
|
||||||
|
|
@ -788,7 +788,7 @@ namespace Server.Commands.Generic
|
||||||
var result = Properties.GetValue(e.Mobile, obj, e.GetString(i));
|
var result = Properties.GetValue(e.Mobile, obj, e.GetString(i));
|
||||||
|
|
||||||
if (result == "Property not found." || result == "Property is write only." ||
|
if (result == "Property not found." || result == "Property is write only." ||
|
||||||
result.StartsWith("Getting this property"))
|
result.StartsWith("Getting this property", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
LogFailure(result);
|
LogFailure(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ namespace Server.Commands.Generic
|
||||||
sb.Append(' ');
|
sb.Append(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[i].IndexOf(' ') >= 0)
|
if (args[i].Contains(' ', StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
sb.Append('"');
|
sb.Append('"');
|
||||||
sb.Append(args[i]);
|
sb.Append(args[i]);
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,8 @@ namespace Server.Commands.Generic
|
||||||
var list = new List<object>();
|
var list = new List<object>();
|
||||||
var addresses = new List<IPAddress>();
|
var addresses = new List<IPAddress>();
|
||||||
|
|
||||||
var states = TcpServer.Instances;
|
foreach (var ns in TcpServer.Instances)
|
||||||
|
|
||||||
for (var i = 0; i < states.Count; ++i)
|
|
||||||
{
|
{
|
||||||
var ns = states[i];
|
|
||||||
var mob = ns.Mobile;
|
var mob = ns.Mobile;
|
||||||
|
|
||||||
if (mob != null && !addresses.Contains(ns.Address) && ext.IsValid(mob))
|
if (mob != null && !addresses.Contains(ns.Address) && ext.IsValid(mob))
|
||||||
|
|
|
||||||
|
|
@ -103,22 +103,20 @@ namespace Server.Commands.Generic
|
||||||
return Empty;
|
return Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
var index = 0;
|
var objectType = AssemblyHandler.FindFirstTypeForName(args[offset], true);
|
||||||
|
|
||||||
var objectType = AssemblyHandler.FindFirstTypeForName(args[offset + index], true);
|
|
||||||
|
|
||||||
if (objectType == null)
|
if (objectType == null)
|
||||||
{
|
{
|
||||||
throw new Exception($"No type with that name ({args[offset + index]}) was found.");
|
throw new Exception($"No type with that name ({args[offset]}) was found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
++index;
|
|
||||||
|
|
||||||
var conditions = new List<ICondition[]>();
|
var conditions = new List<ICondition[]>();
|
||||||
var current = new List<ICondition>();
|
var current = new List<ICondition>();
|
||||||
|
|
||||||
current.Add(TypeCondition.Default);
|
current.Add(TypeCondition.Default);
|
||||||
|
|
||||||
|
var index = 1;
|
||||||
|
|
||||||
while (index < size)
|
while (index < size)
|
||||||
{
|
{
|
||||||
var cur = args[offset + index];
|
var cur = args[offset + index];
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,8 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
var list = new List<object>();
|
var list = new List<object>();
|
||||||
|
|
||||||
var states = TcpServer.Instances;
|
foreach (var ns in TcpServer.Instances)
|
||||||
|
|
||||||
for (var i = 0; i < states.Count; ++i)
|
|
||||||
{
|
{
|
||||||
var ns = states[i];
|
|
||||||
var mob = ns.Mobile;
|
var mob = ns.Mobile;
|
||||||
|
|
||||||
if (mob == null)
|
if (mob == null)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ using Server.Targets;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class CommandHandlers
|
public static class CommandHandlers
|
||||||
{
|
{
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -76,8 +76,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register(command, access, handler);
|
CommandSystem.Register(command, access, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("SpeedBoost [true|false]")]
|
[Usage("SpeedBoost [true|false]"), Description("Enables a speed boost for the invoker. Disable with parameters.")]
|
||||||
[Description("Enables a speed boost for the invoker. Disable with parameters.")]
|
|
||||||
private static void SpeedBoost_OnCommand(CommandEventArgs e)
|
private static void SpeedBoost_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
|
|
@ -101,8 +100,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Where")]
|
[Usage("Where"), Description("Tells the commanding player his coordinates, region, and facet.")]
|
||||||
[Description("Tells the commanding player his coordinates, region, and facet.")]
|
|
||||||
public static void Where_OnCommand(CommandEventArgs e)
|
public static void Where_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
|
|
@ -132,10 +130,9 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("DropHolding")]
|
[Usage("DropHolding"), Description(
|
||||||
[Description(
|
"Drops the item, if any, that a targeted player is holding. The item is placed into their backpack, or if that's full, at their feet."
|
||||||
"Drops the item, if any, that a targeted player is holding. The item is placed into their backpack, or if that's full, at their feet."
|
)]
|
||||||
)]
|
|
||||||
public static void DropHolding_OnCommand(CommandEventArgs e)
|
public static void DropHolding_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.BeginTarget(-1, false, TargetFlags.None, DropHolding_OnTarget);
|
e.Mobile.BeginTarget(-1, false, TargetFlags.None, DropHolding_OnTarget);
|
||||||
|
|
@ -221,8 +218,8 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("ClearFacet")]
|
[Usage("ClearFacet"),
|
||||||
[Description("Deletes all items and mobiles in your facet. Players and their inventory will not be deleted.")]
|
Description("Deletes all items and mobiles in your facet. Players and their inventory will not be deleted.")]
|
||||||
public static void ClearFacet_OnCommand(CommandEventArgs e)
|
public static void ClearFacet_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
|
|
@ -282,8 +279,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("GetFollowers")]
|
[Usage("GetFollowers"), Description("Teleports all pets of a targeted player to your location.")]
|
||||||
[Description("Teleports all pets of a targeted player to your location.")]
|
|
||||||
public static void GetFollowers_OnCommand(CommandEventArgs e)
|
public static void GetFollowers_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.BeginTarget(-1, false, TargetFlags.None, GetFollowers_OnTarget);
|
e.Mobile.BeginTarget(-1, false, TargetFlags.None, GetFollowers_OnTarget);
|
||||||
|
|
@ -376,17 +372,16 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("ViewEquip")]
|
[Usage("ViewEquip"),
|
||||||
[Description("Lists equipment of a targeted mobile. From the list you can move, delete, or open props.")]
|
Description("Lists equipment of a targeted mobile. From the list you can move, delete, or open props.")]
|
||||||
public static void ViewEquip_OnCommand(CommandEventArgs e)
|
public static void ViewEquip_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.Target = new ViewEqTarget();
|
e.Mobile.Target = new ViewEqTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Sound <index> [toAll=true]")]
|
[Usage("Sound <index> [toAll=true]"), Description(
|
||||||
[Description(
|
"Plays a sound to players within 12 tiles of you. The (toAll) argument specifies to everyone, or just those who can see you."
|
||||||
"Plays a sound to players within 12 tiles of you. The (toAll) argument specifies to everyone, or just those who can see you."
|
)]
|
||||||
)]
|
|
||||||
public static void Sound_OnCommand(CommandEventArgs e)
|
public static void Sound_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Length == 1)
|
if (e.Length == 1)
|
||||||
|
|
@ -433,8 +428,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Echo <text>")]
|
[Usage("Echo <text>"), Description("Relays (text) as a system message.")]
|
||||||
[Description("Relays (text) as a system message.")]
|
|
||||||
public static void Echo_OnCommand(CommandEventArgs e)
|
public static void Echo_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var toEcho = e.ArgString.Trim();
|
var toEcho = e.ArgString.Trim();
|
||||||
|
|
@ -449,29 +443,25 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Bank")]
|
[Usage("Bank"), Description("Opens the bank box of a given target.")]
|
||||||
[Description("Opens the bank box of a given target.")]
|
|
||||||
public static void Bank_OnCommand(CommandEventArgs e)
|
public static void Bank_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.Target = new BankTarget();
|
e.Mobile.Target = new BankTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Client")]
|
[Usage("Client"), Description("Opens the client gump menu for a given player.")]
|
||||||
[Description("Opens the client gump menu for a given player.")]
|
|
||||||
private static void Client_OnCommand(CommandEventArgs e)
|
private static void Client_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.Target = new ClientTarget();
|
e.Mobile.Target = new ClientTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Move")]
|
[Usage("Move"), Description("Repositions a targeted item or mobile.")]
|
||||||
[Description("Repositions a targeted item or mobile.")]
|
|
||||||
private static void Move_OnCommand(CommandEventArgs e)
|
private static void Move_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.Target = new PickMoveTarget();
|
e.Mobile.Target = new PickMoveTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Save")]
|
[Usage("Save"), Description("Saves the world.")]
|
||||||
[Description("Saves the world.")]
|
|
||||||
private static void Save_OnCommand(CommandEventArgs e)
|
private static void Save_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
AutoSave.Save();
|
AutoSave.Save();
|
||||||
|
|
@ -494,10 +484,9 @@ namespace Server.Commands
|
||||||
return validMap;
|
return validMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Go [name | serial | (x y [z]) | (deg min (N | S) deg min (E | W))]")]
|
[Usage("Go [name | serial | (x y [z]) | (deg min (N | S) deg min (E | W))]"), Description(
|
||||||
[Description(
|
"With no arguments, this command brings up the go menu. With one argument, (name), you are moved to that regions \"go location.\" Or, if a numerical value is specified for one argument, (serial), you are moved to that object. Two or three arguments, (x y [z]), will move your character to that location. When six arguments are specified, (deg min (N | S) deg min (E | W)), your character will go to an approximate of those sextant coordinates."
|
||||||
"With no arguments, this command brings up the go menu. With one argument, (name), you are moved to that regions \"go location.\" Or, if a numerical value is specified for one argument, (serial), you are moved to that object. Two or three arguments, (x y [z]), will move your character to that location. When six arguments are specified, (deg min (N | S) deg min (E | W)), your character will go to an approximate of those sextant coordinates."
|
)]
|
||||||
)]
|
|
||||||
private static void Go_OnCommand(CommandEventArgs e)
|
private static void Go_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
|
|
@ -707,8 +696,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Help")]
|
[Usage("Help"), Description("Lists all available commands.")]
|
||||||
[Description("Lists all available commands.")]
|
|
||||||
public static void Help_OnCommand(CommandEventArgs e)
|
public static void Help_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var m = e.Mobile;
|
var m = e.Mobile;
|
||||||
|
|
@ -755,17 +743,13 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("SMsg <text>")]
|
[Usage("SMsg <text>"), Aliases("S", "SM"), Description("Broadcasts a message to all online staff.")]
|
||||||
[Aliases("S", "SM")]
|
|
||||||
[Description("Broadcasts a message to all online staff.")]
|
|
||||||
public static void StaffMessage_OnCommand(CommandEventArgs e)
|
public static void StaffMessage_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
BroadcastMessage(AccessLevel.Counselor, e.Mobile.SpeechHue, $"[{e.Mobile.Name}] {e.ArgString}");
|
BroadcastMessage(AccessLevel.Counselor, e.Mobile.SpeechHue, $"[{e.Mobile.Name}] {e.ArgString}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("BCast <text>")]
|
[Usage("BCast <text>"), Aliases("B", "BC"), Description("Broadcasts a message to everyone online.")]
|
||||||
[Aliases("B", "BC")]
|
|
||||||
[Description("Broadcasts a message to everyone online.")]
|
|
||||||
public static void BroadcastMessage_OnCommand(CommandEventArgs e)
|
public static void BroadcastMessage_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
BroadcastMessage(AccessLevel.Player, 0x482, $"Staff message from {e.Mobile.Name}:");
|
BroadcastMessage(AccessLevel.Player, 0x482, $"Staff message from {e.Mobile.Name}:");
|
||||||
|
|
@ -785,9 +769,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("AutoPageNotify")]
|
[Usage("AutoPageNotify"), Aliases("APN"), Description("Toggles your auto-page-notify status.")]
|
||||||
[Aliases("APN")]
|
|
||||||
[Description("Toggles your auto-page-notify status.")]
|
|
||||||
public static void APN_OnCommand(CommandEventArgs e)
|
public static void APN_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var m = e.Mobile;
|
var m = e.Mobile;
|
||||||
|
|
@ -797,8 +779,8 @@ namespace Server.Commands
|
||||||
m.SendMessage("Your auto-page-notify has been turned {0}.", m.AutoPageNotify ? "on" : "off");
|
m.SendMessage("Your auto-page-notify has been turned {0}.", m.AutoPageNotify ? "on" : "off");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Animate <action> <frameCount> <repeatCount> <forward> <repeat> <delay>")]
|
[Usage("Animate <action> <frameCount> <repeatCount> <forward> <repeat> <delay>"),
|
||||||
[Description("Makes your character do a specified animation.")]
|
Description("Makes your character do a specified animation.")]
|
||||||
public static void Animate_OnCommand(CommandEventArgs e)
|
public static void Animate_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Length == 6)
|
if (e.Length == 6)
|
||||||
|
|
@ -818,8 +800,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Cast <name>")]
|
[Usage("Cast <name>"), Description("Casts a spell by name.")]
|
||||||
[Description("Casts a spell by name.")]
|
|
||||||
public static void Cast_OnCommand(CommandEventArgs e)
|
public static void Cast_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Length == 1)
|
if (e.Length == 1)
|
||||||
|
|
@ -846,22 +827,19 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Stuck")]
|
[Usage("Stuck"), Description("Opens a menu of towns, used for teleporting stuck mobiles.")]
|
||||||
[Description("Opens a menu of towns, used for teleporting stuck mobiles.")]
|
|
||||||
public static void Stuck_OnCommand(CommandEventArgs e)
|
public static void Stuck_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.Target = new StuckMenuTarget();
|
e.Mobile.Target = new StuckMenuTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Light <level>")]
|
[Usage("Light <level>"), Description("Set your local lightlevel.")]
|
||||||
[Description("Set your local lightlevel.")]
|
|
||||||
public static void Light_OnCommand(CommandEventArgs e)
|
public static void Light_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.LightLevel = e.GetInt32(0);
|
e.Mobile.LightLevel = e.GetInt32(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Stats")]
|
[Usage("Stats"), Description("View some stats about the server.")]
|
||||||
[Description("View some stats about the server.")]
|
|
||||||
public static void Stats_OnCommand(CommandEventArgs e)
|
public static void Stats_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.SendMessage("Open Connections: {0}", TcpServer.Instances.Count);
|
e.Mobile.SendMessage("Open Connections: {0}", TcpServer.Instances.Count);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Server.Commands.Generic;
|
using Server.Commands.Generic;
|
||||||
|
|
@ -8,7 +9,7 @@ using CommandInfoSorter = Server.Commands.Docs.CommandEntrySorter;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class HelpInfo
|
public static class HelpInfo
|
||||||
{
|
{
|
||||||
public static Dictionary<string, CommandInfo> HelpInfos { get; } = new Dictionary<string, CommandInfo>();
|
public static Dictionary<string, CommandInfo> HelpInfos { get; } = new Dictionary<string, CommandInfo>();
|
||||||
|
|
||||||
|
|
@ -22,10 +23,9 @@ namespace Server.Commands
|
||||||
FillTable();
|
FillTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("HelpInfo [<command>]")]
|
[Usage("HelpInfo [<command>]"), Description(
|
||||||
[Description(
|
"Gives information on a specified command, or when no argument specified, displays a gump containing all commands"
|
||||||
"Gives information on a specified command, or when no argument specified, displays a gump containing all commands"
|
)]
|
||||||
)]
|
|
||||||
private static void HelpInfo_OnCommand(CommandEventArgs e)
|
private static void HelpInfo_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Length > 0)
|
if (e.Length > 0)
|
||||||
|
|
@ -93,7 +93,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
var aliases = attrs.Length == 0 ? null : attrs[0] as AliasesAttribute;
|
var aliases = attrs.Length == 0 ? null : attrs[0] as AliasesAttribute;
|
||||||
|
|
||||||
var descString = desc.Description.Replace("<", "(").Replace(">", ")");
|
var descString = desc.Description
|
||||||
|
.Replace("<", "(", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ")", StringComparison.Ordinal);
|
||||||
|
|
||||||
if (aliases == null)
|
if (aliases == null)
|
||||||
{
|
{
|
||||||
|
|
@ -137,7 +139,9 @@ namespace Server.Commands
|
||||||
aliases[j] = cmds[j + 1];
|
aliases[j] = cmds[j + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
desc = desc.Replace("<", "(").Replace(">", ")");
|
desc = desc
|
||||||
|
.Replace("<", "(", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ")", StringComparison.Ordinal);
|
||||||
|
|
||||||
if (command.Supports != CommandSupport.Single)
|
if (command.Supports != CommandSupport.Single)
|
||||||
{
|
{
|
||||||
|
|
@ -224,7 +228,9 @@ namespace Server.Commands
|
||||||
aliases[j] = cmds[j + 1];
|
aliases[j] = cmds[j + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
desc = desc.Replace("<", ")").Replace(">", ")");
|
desc = desc
|
||||||
|
.Replace("<", ")", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ")", StringComparison.Ordinal);
|
||||||
|
|
||||||
list.Add(new CommandInfo(command.AccessLevel, cmd, aliases, usage, desc));
|
list.Add(new CommandInfo(command.AccessLevel, cmd, aliases, usage, desc));
|
||||||
|
|
||||||
|
|
@ -406,7 +412,10 @@ namespace Server.Commands
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
|
||||||
sb.Append("Usage: ");
|
sb.Append("Usage: ");
|
||||||
sb.Append(info.Usage.Replace("<", "(").Replace(">", ")"));
|
var usage = info.Usage
|
||||||
|
.Replace("<", "(", StringComparison.Ordinal)
|
||||||
|
.Replace(">", ")", StringComparison.Ordinal);
|
||||||
|
sb.Append(usage);
|
||||||
sb.Append("<BR>");
|
sb.Append("<BR>");
|
||||||
|
|
||||||
var aliases = info.Aliases;
|
var aliases = info.Aliases;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
|
||||||
using Server.Commands.Generic;
|
using Server.Commands.Generic;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
using Server.Targeting;
|
using Server.Targeting;
|
||||||
|
|
@ -43,9 +42,7 @@ namespace Server.Commands
|
||||||
graphics = new List<int>();
|
graphics = new List<int>();
|
||||||
foreach (var arg in e.Arguments)
|
foreach (var arg in e.Arguments)
|
||||||
{
|
{
|
||||||
var numberStyles = arg.ToLower().StartsWith("0x") ? NumberStyles.HexNumber : NumberStyles.Integer;
|
if (Utility.ToInt32(arg, out var result))
|
||||||
|
|
||||||
if (int.TryParse(arg, numberStyles, CultureInfo.InvariantCulture, out var result))
|
|
||||||
{
|
{
|
||||||
graphics.Add(result);
|
graphics.Add(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using Server.Accounting;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class CommandLogging
|
public static class CommandLogging
|
||||||
{
|
{
|
||||||
private static readonly char[] m_NotSafe = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
|
private static readonly char[] m_NotSafe = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
|
||||||
public static bool Enabled { get; set; } = true;
|
public static bool Enabled { get; set; } = true;
|
||||||
|
|
@ -44,25 +44,13 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static object Format(object o)
|
public static object Format(object o) =>
|
||||||
{
|
o switch
|
||||||
if (o is Mobile m)
|
|
||||||
{
|
{
|
||||||
if (m.Account == null)
|
Mobile m => m.Account == null ? $"{m} (no account)" : $"{m} ('{m.Account.Username}')",
|
||||||
{
|
Item item => $"0x{item.Serial.Value:X} ({item.GetType().Name})",
|
||||||
return $"{m} (no account)";
|
_ => o
|
||||||
}
|
};
|
||||||
|
|
||||||
return $"{m} ('{m.Account.Username}')";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (o is Item item)
|
|
||||||
{
|
|
||||||
return $"0x{item.Serial.Value:X} ({item.GetType().Name})";
|
|
||||||
}
|
|
||||||
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void WriteLine(Mobile from, string format, params object[] args)
|
public static void WriteLine(Mobile from, string format, params object[] args)
|
||||||
{
|
{
|
||||||
|
|
@ -126,7 +114,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; isSafe && i < m_NotSafe.Length; ++i)
|
for (var i = 0; isSafe && i < m_NotSafe.Length; ++i)
|
||||||
{
|
{
|
||||||
isSafe = ip.IndexOf(m_NotSafe[i]) == -1;
|
isSafe = !ip.Contains(m_NotSafe[i], StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSafe)
|
if (isSafe)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using CPA = Server.CommandPropertyAttribute;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class Add
|
public static class Add
|
||||||
{
|
{
|
||||||
private static readonly Type m_EntityType = typeof(IEntity);
|
private static readonly Type m_EntityType = typeof(IEntity);
|
||||||
|
|
||||||
|
|
@ -72,7 +72,7 @@ namespace Server.Commands
|
||||||
sb.AppendFormat("from {0} to {1} in {2}", start, end, from.Map);
|
sb.AppendFormat("from {0} to {1} in {2}", start, end, from.Map);
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.Append(":");
|
sb.Append(':');
|
||||||
|
|
||||||
for (var i = 0; i < args.Length; ++i)
|
for (var i = 0; i < args.Length; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -300,7 +300,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
object obj = value;
|
object obj = value;
|
||||||
|
|
||||||
if (value?.StartsWith("0x") == true)
|
if (value?.StartsWith("0x", StringComparison.Ordinal) == true)
|
||||||
{
|
{
|
||||||
if (IsSignedNumeric(type))
|
if (IsSignedNumeric(type))
|
||||||
{
|
{
|
||||||
|
|
@ -670,91 +670,81 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Tile <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("Tile <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name into a targeted bounding box. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name into a targeted bounding box. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void Tile_OnCommand(CommandEventArgs e)
|
public static void Tile_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
Internal_OnCommand(e, false);
|
Internal_OnCommand(e, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("TileRXYZ <x> <y> <w> <h> <z> <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("TileRXYZ <x> <y> <w> <h> <z> <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name into a given bounding box, (x, y) parameters are relative to your characters position. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name into a given bounding box, (x, y) parameters are relative to your characters position. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void TileRXYZ_OnCommand(CommandEventArgs e)
|
public static void TileRXYZ_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
InternalRXYZ_OnCommand(e, false);
|
InternalRXYZ_OnCommand(e, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("TileXYZ <x> <y> <w> <h> <z> <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("TileXYZ <x> <y> <w> <h> <z> <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name into a given bounding box. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name into a given bounding box. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void TileXYZ_OnCommand(CommandEventArgs e)
|
public static void TileXYZ_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
InternalXYZ_OnCommand(e, false);
|
InternalXYZ_OnCommand(e, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("TileZ <z> <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("TileZ <z> <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name into a targeted bounding box at a fixed Z location. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name into a targeted bounding box at a fixed Z location. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void TileZ_OnCommand(CommandEventArgs e)
|
public static void TileZ_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
InternalZ_OnCommand(e, false);
|
InternalZ_OnCommand(e, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("TileAvg <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("TileAvg <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name into a targeted bounding box on the map's average Z elevation. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name into a targeted bounding box on the map's average Z elevation. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void TileAvg_OnCommand(CommandEventArgs e)
|
public static void TileAvg_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
InternalAvg_OnCommand(e, false);
|
InternalAvg_OnCommand(e, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Outline <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("Outline <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name around a targeted bounding box. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name around a targeted bounding box. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void Outline_OnCommand(CommandEventArgs e)
|
public static void Outline_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
Internal_OnCommand(e, true);
|
Internal_OnCommand(e, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("OutlineRXYZ <x> <y> <w> <h> <z> <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("OutlineRXYZ <x> <y> <w> <h> <z> <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name around a given bounding box, (x, y) parameters are relative to your characters position. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name around a given bounding box, (x, y) parameters are relative to your characters position. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void OutlineRXYZ_OnCommand(CommandEventArgs e)
|
public static void OutlineRXYZ_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
InternalRXYZ_OnCommand(e, true);
|
InternalRXYZ_OnCommand(e, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("OutlineXYZ <x> <y> <w> <h> <z> <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("OutlineXYZ <x> <y> <w> <h> <z> <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name around a given bounding box. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name around a given bounding box. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void OutlineXYZ_OnCommand(CommandEventArgs e)
|
public static void OutlineXYZ_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
InternalXYZ_OnCommand(e, true);
|
InternalXYZ_OnCommand(e, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("OutlineZ <z> <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("OutlineZ <z> <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name around a targeted bounding box at a fixed Z location. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name around a targeted bounding box at a fixed Z location. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void OutlineZ_OnCommand(CommandEventArgs e)
|
public static void OutlineZ_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
InternalZ_OnCommand(e, true);
|
InternalZ_OnCommand(e, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("OutlineAvg <name> [params] [set {<propertyName> <value> ...}]")]
|
[Usage("OutlineAvg <name> [params] [set {<propertyName> <value> ...}]"), Description(
|
||||||
[Description(
|
"Tiles an item or npc by name around a targeted bounding box on the map's average Z elevation. Optional constructor parameters. Optional set property list."
|
||||||
"Tiles an item or npc by name around a targeted bounding box on the map's average Z elevation. Optional constructor parameters. Optional set property list."
|
)]
|
||||||
)]
|
|
||||||
public static void OutlineAvg_OnCommand(CommandEventArgs e)
|
public static void OutlineAvg_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
InternalAvg_OnCommand(e, true);
|
InternalAvg_OnCommand(e, true);
|
||||||
|
|
|
||||||
|
|
@ -93,10 +93,9 @@ namespace Server.Gumps
|
||||||
CommandSystem.Register("AddMenu", AccessLevel.GameMaster, AddMenu_OnCommand);
|
CommandSystem.Register("AddMenu", AccessLevel.GameMaster, AddMenu_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("AddMenu [searchString]")]
|
[Usage("AddMenu [searchString]"), Description(
|
||||||
[Description(
|
"Opens an add menu, with an optional initial search string. This menu allows you to search for Items or Mobiles and add them interactively."
|
||||||
"Opens an add menu, with an optional initial search string. This menu allows you to search for Items or Mobiles and add them interactively."
|
)]
|
||||||
)]
|
|
||||||
private static void AddMenu_OnCommand(CommandEventArgs e)
|
private static void AddMenu_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var val = e.ArgString.Trim();
|
var val = e.ArgString.Trim();
|
||||||
|
|
@ -135,7 +134,7 @@ namespace Server.Gumps
|
||||||
var t = types[i];
|
var t = types[i];
|
||||||
|
|
||||||
if ((typeofMobile.IsAssignableFrom(t) || typeofItem.IsAssignableFrom(t)) &&
|
if ((typeofMobile.IsAssignableFrom(t) || typeofItem.IsAssignableFrom(t)) &&
|
||||||
t.Name.ToLower().IndexOf(match, StringComparison.Ordinal) >= 0 && !results.Contains(t))
|
t.Name.ToLower().Contains(match, StringComparison.Ordinal) && !results.Contains(t))
|
||||||
{
|
{
|
||||||
var ctors = t.GetConstructors();
|
var ctors = t.GetConstructors();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("RebuildCategorization", AccessLevel.Administrator, RebuildCategorization_OnCommand);
|
CommandSystem.Register("RebuildCategorization", AccessLevel.Administrator, RebuildCategorization_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("RebuildCategorization")]
|
[Usage("RebuildCategorization"), Description("Rebuilds the categorization data file used by the Add command.")]
|
||||||
[Description("Rebuilds the categorization data file used by the Add command.")]
|
|
||||||
public static void RebuildCategorization_OnCommand(CommandEventArgs e)
|
public static void RebuildCategorization_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var root = new CategoryEntry(null, "Add Menu", new[] { Items, Mobiles });
|
var root = new CategoryEntry(null, "Add Menu", new[] { Items, Mobiles });
|
||||||
|
|
@ -305,7 +304,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
var text = lines[index].Text;
|
var text = lines[index].Text;
|
||||||
|
|
||||||
var start = text.IndexOf('(');
|
var start = text.IndexOf('(', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("Decorate", AccessLevel.Administrator, Decorate_OnCommand);
|
CommandSystem.Register("Decorate", AccessLevel.Administrator, Decorate_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Decorate")]
|
[Usage("Decorate"), Description("Generates world decoration.")]
|
||||||
[Description("Generates world decoration.")]
|
|
||||||
private static void Decorate_OnCommand(CommandEventArgs e)
|
private static void Decorate_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
m_Mobile = e.Mobile;
|
m_Mobile = e.Mobile;
|
||||||
|
|
@ -104,9 +103,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("LabelNumber"))
|
if (m_Params[i].StartsWith("LabelNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -124,9 +123,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("LabelNumber"))
|
if (m_Params[i].StartsWith("LabelNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -172,9 +171,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
locked = true;
|
locked = true;
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("TargetMap"))
|
else if (m_Params[i].StartsWith("TargetMap", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -201,54 +200,54 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Range"))
|
if (m_Params[i].StartsWith("Range", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("WarningString"))
|
else if (m_Params[i].StartsWith("WarningString", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
messageString = m_Params[i].Substring(++indexOf);
|
messageString = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("WarningNumber"))
|
else if (m_Params[i].StartsWith("WarningNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("HintString"))
|
else if (m_Params[i].StartsWith("HintString", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
hintString = m_Params[i].Substring(++indexOf);
|
hintString = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("HintNumber"))
|
else if (m_Params[i].StartsWith("HintNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
hintNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
hintNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("ResetDelay"))
|
else if (m_Params[i].StartsWith("ResetDelay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -274,36 +273,36 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Range"))
|
if (m_Params[i].StartsWith("Range", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("WarningString"))
|
else if (m_Params[i].StartsWith("WarningString", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
messageString = m_Params[i].Substring(++indexOf);
|
messageString = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("WarningNumber"))
|
else if (m_Params[i].StartsWith("WarningNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("ResetDelay"))
|
else if (m_Params[i].StartsWith("ResetDelay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -325,9 +324,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("CannonDirection"))
|
if (m_Params[i].StartsWith("CannonDirection", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -349,27 +348,27 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Word"))
|
if (m_Params[i].StartsWith("Word", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
word = m_Params[i].Substring(++indexOf);
|
word = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestStart"))
|
else if (m_Params[i].StartsWith("DestStart", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
destination.Start = Point2D.Parse(m_Params[i].Substring(++indexOf));
|
destination.Start = Point2D.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestEnd"))
|
else if (m_Params[i].StartsWith("DestEnd", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -387,9 +386,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; !fill && i < m_Params.Length; ++i)
|
for (var i = 0; !fill && i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Content"))
|
if (m_Params[i].StartsWith("Content", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -418,9 +417,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Facing"))
|
if (m_Params[i].StartsWith("Facing", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -448,9 +447,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("SpawnLocation"))
|
if (m_Params[i].StartsWith("SpawnLocation", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -516,45 +515,45 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Spawn"))
|
if (m_Params[i].StartsWith("Spawn", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.AddEntry(m_Params[i].Substring(++indexOf));
|
sp.AddEntry(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MinDelay"))
|
else if (m_Params[i].StartsWith("MinDelay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.MinDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
sp.MinDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MaxDelay"))
|
else if (m_Params[i].StartsWith("MaxDelay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.MaxDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
sp.MaxDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("NextSpawn"))
|
else if (m_Params[i].StartsWith("NextSpawn", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.NextSpawn = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
sp.NextSpawn = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Count"))
|
else if (m_Params[i].StartsWith("Count", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -565,36 +564,36 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Team"))
|
else if (m_Params[i].StartsWith("Team", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.Team = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
sp.Team = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("HomeRange"))
|
else if (m_Params[i].StartsWith("HomeRange", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.HomeRange = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
sp.HomeRange = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Running"))
|
else if (m_Params[i].StartsWith("Running", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.Running = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
sp.Running = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Group"))
|
else if (m_Params[i].StartsWith("Group", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -607,36 +606,36 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Description"))
|
if (m_Params[i].StartsWith("Description", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
rune.Description = m_Params[i].Substring(++indexOf);
|
rune.Description = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Marked"))
|
else if (m_Params[i].StartsWith("Marked", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
rune.Marked = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
rune.Marked = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("TargetMap"))
|
else if (m_Params[i].StartsWith("TargetMap", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
rune.TargetMap = Map.Parse(m_Params[i].Substring(++indexOf));
|
rune.TargetMap = Map.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Target"))
|
else if (m_Params[i].StartsWith("Target", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -649,108 +648,108 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Skill"))
|
if (m_Params[i].StartsWith("Skill", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.Skill = (SkillName)Enum.Parse(typeof(SkillName), m_Params[i].Substring(++indexOf), true);
|
st.Skill = (SkillName)Enum.Parse(typeof(SkillName), m_Params[i].Substring(++indexOf), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("RequiredFixedPoint"))
|
else if (m_Params[i].StartsWith("RequiredFixedPoint", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.Required = Utility.ToInt32(m_Params[i].Substring(++indexOf)) * 0.1;
|
st.Required = Utility.ToInt32(m_Params[i].Substring(++indexOf)) * 0.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Required"))
|
else if (m_Params[i].StartsWith("Required", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.Required = Utility.ToDouble(m_Params[i].Substring(++indexOf));
|
st.Required = Utility.ToDouble(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MessageString"))
|
else if (m_Params[i].StartsWith("MessageString", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MessageString = m_Params[i].Substring(++indexOf);
|
st.MessageString = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MessageNumber"))
|
else if (m_Params[i].StartsWith("MessageNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MessageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
st.MessageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("PointDest"))
|
else if (m_Params[i].StartsWith("PointDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
st.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MapDest"))
|
else if (m_Params[i].StartsWith("MapDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
st.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Creatures"))
|
else if (m_Params[i].StartsWith("Creatures", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
st.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SourceEffect"))
|
else if (m_Params[i].StartsWith("SourceEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
st.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestEffect"))
|
else if (m_Params[i].StartsWith("DestEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
st.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SoundID"))
|
else if (m_Params[i].StartsWith("SoundID", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
st.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Delay"))
|
else if (m_Params[i].StartsWith("Delay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -768,90 +767,90 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Substring"))
|
if (m_Params[i].StartsWith("Substring", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.Substring = m_Params[i].Substring(++indexOf);
|
kt.Substring = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Keyword"))
|
else if (m_Params[i].StartsWith("Keyword", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.Keyword = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
kt.Keyword = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Range"))
|
else if (m_Params[i].StartsWith("Range", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.Range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
kt.Range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("PointDest"))
|
else if (m_Params[i].StartsWith("PointDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
kt.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MapDest"))
|
else if (m_Params[i].StartsWith("MapDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
kt.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Creatures"))
|
else if (m_Params[i].StartsWith("Creatures", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
kt.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SourceEffect"))
|
else if (m_Params[i].StartsWith("SourceEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
kt.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestEffect"))
|
else if (m_Params[i].StartsWith("DestEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
kt.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SoundID"))
|
else if (m_Params[i].StartsWith("SoundID", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
kt.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Delay"))
|
else if (m_Params[i].StartsWith("Delay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -869,63 +868,63 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("PointDest"))
|
if (m_Params[i].StartsWith("PointDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
tp.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MapDest"))
|
else if (m_Params[i].StartsWith("MapDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
tp.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Creatures"))
|
else if (m_Params[i].StartsWith("Creatures", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
tp.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SourceEffect"))
|
else if (m_Params[i].StartsWith("SourceEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
tp.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestEffect"))
|
else if (m_Params[i].StartsWith("DestEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
tp.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SoundID"))
|
else if (m_Params[i].StartsWith("SoundID", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
tp.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Delay"))
|
else if (m_Params[i].StartsWith("Delay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -943,9 +942,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("ContentType"))
|
if (m_Params[i].StartsWith("ContentType", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -972,18 +971,18 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Light"))
|
if (m_Params[i].StartsWith("Light", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
item.Light = (LightType)Enum.Parse(typeof(LightType), m_Params[i].Substring(++indexOf), true);
|
item.Light = (LightType)Enum.Parse(typeof(LightType), m_Params[i].Substring(++indexOf), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Hue"))
|
else if (m_Params[i].StartsWith("Hue", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -999,18 +998,18 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Name"))
|
else if (m_Params[i].StartsWith("Name", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
item.Name = m_Params[i].Substring(++indexOf);
|
item.Name = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Amount"))
|
else if (m_Params[i].StartsWith("Amount", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -1249,7 +1248,7 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
line = line.Trim();
|
line = line.Trim();
|
||||||
|
|
||||||
if (line.Length > 0 && !line.StartsWith("#"))
|
if (line.Length > 0 && !line.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1262,7 +1261,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
var list = new DecorationList();
|
var list = new DecorationList();
|
||||||
|
|
||||||
var indexOf = line.IndexOf(' ');
|
var indexOf = line.IndexOf(' ', StringComparison.Ordinal);
|
||||||
|
|
||||||
list.m_Type = AssemblyHandler.FindFirstTypeForName(line.Substring(0, indexOf++), true);
|
list.m_Type = AssemblyHandler.FindFirstTypeForName(line.Substring(0, indexOf++), true);
|
||||||
|
|
||||||
|
|
@ -1272,14 +1271,14 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
line = line.Substring(indexOf);
|
line = line.Substring(indexOf);
|
||||||
indexOf = line.IndexOf('(');
|
indexOf = line.IndexOf('(', StringComparison.Ordinal);
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
list.m_ItemID = Utility.ToInt32(line.Substring(0, indexOf - 1));
|
list.m_ItemID = Utility.ToInt32(line.Substring(0, indexOf - 1));
|
||||||
|
|
||||||
var parms = line.Substring(++indexOf);
|
var parms = line.Substring(++indexOf);
|
||||||
|
|
||||||
if (line.EndsWith(")"))
|
if (line.EndsWith(")", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
parms = parms.Substring(0, parms.Length - 1);
|
parms = parms.Substring(0, parms.Length - 1);
|
||||||
}
|
}
|
||||||
|
|
@ -1308,7 +1307,7 @@ namespace Server.Commands
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.StartsWith("#"))
|
if (line.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -1338,7 +1337,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
public static void Pop(out string v, ref string line)
|
public static void Pop(out string v, ref string line)
|
||||||
{
|
{
|
||||||
var space = line.IndexOf(' ');
|
var space = line.IndexOf(' ', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (space >= 0)
|
if (space >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("DecorateMag", AccessLevel.Administrator, DecorateMag_OnCommand);
|
CommandSystem.Register("DecorateMag", AccessLevel.Administrator, DecorateMag_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("DecorateMag")]
|
[Usage("DecorateMag"), Description("Generates world decoration.")]
|
||||||
[Description("Generates world decoration.")]
|
|
||||||
private static void DecorateMag_OnCommand(CommandEventArgs e)
|
private static void DecorateMag_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
m_Mobile = e.Mobile;
|
m_Mobile = e.Mobile;
|
||||||
|
|
@ -101,9 +100,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("LabelNumber"))
|
if (m_Params[i].StartsWith("LabelNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -121,9 +120,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("LabelNumber"))
|
if (m_Params[i].StartsWith("LabelNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -169,9 +168,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
locked = true;
|
locked = true;
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("TargetMap"))
|
else if (m_Params[i].StartsWith("TargetMap", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -198,54 +197,54 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Range"))
|
if (m_Params[i].StartsWith("Range", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("WarningString"))
|
else if (m_Params[i].StartsWith("WarningString", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
messageString = m_Params[i].Substring(++indexOf);
|
messageString = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("WarningNumber"))
|
else if (m_Params[i].StartsWith("WarningNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("HintString"))
|
else if (m_Params[i].StartsWith("HintString", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
hintString = m_Params[i].Substring(++indexOf);
|
hintString = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("HintNumber"))
|
else if (m_Params[i].StartsWith("HintNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
hintNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
hintNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("ResetDelay"))
|
else if (m_Params[i].StartsWith("ResetDelay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -271,36 +270,36 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Range"))
|
if (m_Params[i].StartsWith("Range", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("WarningString"))
|
else if (m_Params[i].StartsWith("WarningString", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
messageString = m_Params[i].Substring(++indexOf);
|
messageString = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("WarningNumber"))
|
else if (m_Params[i].StartsWith("WarningNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("ResetDelay"))
|
else if (m_Params[i].StartsWith("ResetDelay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -322,9 +321,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("CannonDirection"))
|
if (m_Params[i].StartsWith("CannonDirection", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -346,27 +345,27 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Word"))
|
if (m_Params[i].StartsWith("Word", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
word = m_Params[i].Substring(++indexOf);
|
word = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestStart"))
|
else if (m_Params[i].StartsWith("DestStart", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
destination.Start = Point2D.Parse(m_Params[i].Substring(++indexOf));
|
destination.Start = Point2D.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestEnd"))
|
else if (m_Params[i].StartsWith("DestEnd", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -384,9 +383,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; !fill && i < m_Params.Length; ++i)
|
for (var i = 0; !fill && i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Content"))
|
if (m_Params[i].StartsWith("Content", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -415,9 +414,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Facing"))
|
if (m_Params[i].StartsWith("Facing", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -445,9 +444,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("SpawnLocation"))
|
if (m_Params[i].StartsWith("SpawnLocation", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -513,45 +512,45 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Spawn"))
|
if (m_Params[i].StartsWith("Spawn", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.AddEntry(m_Params[i].Substring(++indexOf));
|
sp.AddEntry(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MinDelay"))
|
else if (m_Params[i].StartsWith("MinDelay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.MinDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
sp.MinDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MaxDelay"))
|
else if (m_Params[i].StartsWith("MaxDelay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.MaxDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
sp.MaxDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("NextSpawn"))
|
else if (m_Params[i].StartsWith("NextSpawn", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.NextSpawn = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
sp.NextSpawn = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Count"))
|
else if (m_Params[i].StartsWith("Count", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -562,36 +561,36 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Team"))
|
else if (m_Params[i].StartsWith("Team", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.Team = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
sp.Team = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("HomeRange"))
|
else if (m_Params[i].StartsWith("HomeRange", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.HomeRange = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
sp.HomeRange = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Running"))
|
else if (m_Params[i].StartsWith("Running", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
sp.Running = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
sp.Running = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Group"))
|
else if (m_Params[i].StartsWith("Group", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -604,36 +603,36 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Description"))
|
if (m_Params[i].StartsWith("Description", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
rune.Description = m_Params[i].Substring(++indexOf);
|
rune.Description = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Marked"))
|
else if (m_Params[i].StartsWith("Marked", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
rune.Marked = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
rune.Marked = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("TargetMap"))
|
else if (m_Params[i].StartsWith("TargetMap", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
rune.TargetMap = Map.Parse(m_Params[i].Substring(++indexOf));
|
rune.TargetMap = Map.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Target"))
|
else if (m_Params[i].StartsWith("Target", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -646,108 +645,108 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Skill"))
|
if (m_Params[i].StartsWith("Skill", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.Skill = (SkillName)Enum.Parse(typeof(SkillName), m_Params[i].Substring(++indexOf), true);
|
st.Skill = (SkillName)Enum.Parse(typeof(SkillName), m_Params[i].Substring(++indexOf), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("RequiredFixedPoint"))
|
else if (m_Params[i].StartsWith("RequiredFixedPoint", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.Required = Utility.ToInt32(m_Params[i].Substring(++indexOf)) * 0.1;
|
st.Required = Utility.ToInt32(m_Params[i].Substring(++indexOf)) * 0.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Required"))
|
else if (m_Params[i].StartsWith("Required", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.Required = Utility.ToDouble(m_Params[i].Substring(++indexOf));
|
st.Required = Utility.ToDouble(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MessageString"))
|
else if (m_Params[i].StartsWith("MessageString", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MessageString = m_Params[i].Substring(++indexOf);
|
st.MessageString = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MessageNumber"))
|
else if (m_Params[i].StartsWith("MessageNumber", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MessageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
st.MessageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("PointDest"))
|
else if (m_Params[i].StartsWith("PointDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
st.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MapDest"))
|
else if (m_Params[i].StartsWith("MapDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
st.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Creatures"))
|
else if (m_Params[i].StartsWith("Creatures", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
st.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SourceEffect"))
|
else if (m_Params[i].StartsWith("SourceEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
st.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestEffect"))
|
else if (m_Params[i].StartsWith("DestEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
st.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SoundID"))
|
else if (m_Params[i].StartsWith("SoundID", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
st.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Delay"))
|
else if (m_Params[i].StartsWith("Delay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -765,90 +764,90 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Substring"))
|
if (m_Params[i].StartsWith("Substring", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.Substring = m_Params[i].Substring(++indexOf);
|
kt.Substring = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Keyword"))
|
else if (m_Params[i].StartsWith("Keyword", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.Keyword = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
kt.Keyword = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Range"))
|
else if (m_Params[i].StartsWith("Range", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.Range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
kt.Range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("PointDest"))
|
else if (m_Params[i].StartsWith("PointDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
kt.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MapDest"))
|
else if (m_Params[i].StartsWith("MapDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
kt.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Creatures"))
|
else if (m_Params[i].StartsWith("Creatures", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
kt.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SourceEffect"))
|
else if (m_Params[i].StartsWith("SourceEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
kt.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestEffect"))
|
else if (m_Params[i].StartsWith("DestEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
kt.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SoundID"))
|
else if (m_Params[i].StartsWith("SoundID", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
kt.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
kt.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Delay"))
|
else if (m_Params[i].StartsWith("Delay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -866,63 +865,63 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("PointDest"))
|
if (m_Params[i].StartsWith("PointDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
tp.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("MapDest"))
|
else if (m_Params[i].StartsWith("MapDest", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
tp.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Creatures"))
|
else if (m_Params[i].StartsWith("Creatures", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
tp.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SourceEffect"))
|
else if (m_Params[i].StartsWith("SourceEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
tp.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("DestEffect"))
|
else if (m_Params[i].StartsWith("DestEffect", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
tp.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("SoundID"))
|
else if (m_Params[i].StartsWith("SoundID", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
tp.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
tp.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Delay"))
|
else if (m_Params[i].StartsWith("Delay", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -940,9 +939,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("ContentType"))
|
if (m_Params[i].StartsWith("ContentType", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -969,18 +968,18 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (var i = 0; i < m_Params.Length; ++i)
|
for (var i = 0; i < m_Params.Length; ++i)
|
||||||
{
|
{
|
||||||
if (m_Params[i].StartsWith("Light"))
|
if (m_Params[i].StartsWith("Light", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
item.Light = (LightType)Enum.Parse(typeof(LightType), m_Params[i].Substring(++indexOf), true);
|
item.Light = (LightType)Enum.Parse(typeof(LightType), m_Params[i].Substring(++indexOf), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Hue"))
|
else if (m_Params[i].StartsWith("Hue", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -996,18 +995,18 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Name"))
|
else if (m_Params[i].StartsWith("Name", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
item.Name = m_Params[i].Substring(++indexOf);
|
item.Name = m_Params[i].Substring(++indexOf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWith("Amount"))
|
else if (m_Params[i].StartsWith("Amount", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
var indexOf = m_Params[i].IndexOf('=');
|
var indexOf = m_Params[i].IndexOf('=', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -1236,7 +1235,7 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
line = line.Trim();
|
line = line.Trim();
|
||||||
|
|
||||||
if (line.Length > 0 && !line.StartsWith("#"))
|
if (line.Length > 0 && !line.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1249,7 +1248,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
var list = new DecorationListMag();
|
var list = new DecorationListMag();
|
||||||
|
|
||||||
var indexOf = line.IndexOf(' ');
|
var indexOf = line.IndexOf(' ', StringComparison.Ordinal);
|
||||||
|
|
||||||
list.m_Type = AssemblyHandler.FindFirstTypeForName(line.Substring(0, indexOf++), true);
|
list.m_Type = AssemblyHandler.FindFirstTypeForName(line.Substring(0, indexOf++), true);
|
||||||
|
|
||||||
|
|
@ -1259,14 +1258,14 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
line = line.Substring(indexOf);
|
line = line.Substring(indexOf);
|
||||||
indexOf = line.IndexOf('(');
|
indexOf = line.IndexOf('(', StringComparison.Ordinal);
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
list.m_ItemID = Utility.ToInt32(line.Substring(0, indexOf - 1));
|
list.m_ItemID = Utility.ToInt32(line.Substring(0, indexOf - 1));
|
||||||
|
|
||||||
var parms = line.Substring(++indexOf);
|
var parms = line.Substring(++indexOf);
|
||||||
|
|
||||||
if (line.EndsWith(")"))
|
if (line.EndsWith(")", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
parms = parms.Substring(0, parms.Length - 1);
|
parms = parms.Substring(0, parms.Length - 1);
|
||||||
}
|
}
|
||||||
|
|
@ -1295,7 +1294,7 @@ namespace Server.Commands
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.StartsWith("#"))
|
if (line.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -1325,7 +1324,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
public void Pop(out string v, ref string line)
|
public void Pop(out string v, ref string line)
|
||||||
{
|
{
|
||||||
var space = line.IndexOf(' ');
|
var space = line.IndexOf(' ', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (space >= 0)
|
if (space >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,6 @@ namespace Server.Commands
|
||||||
public bool Back { get; set; }
|
public bool Back { get; set; }
|
||||||
|
|
||||||
public override string ToString() => $"{{{Source},{Destination},{Back}}}";
|
public override string ToString() => $"{{{Source},{Destination},{Back}}}";
|
||||||
|
|
||||||
public bool Equals(TeleporterDefinition other) =>
|
|
||||||
Source.Equals(other.Source) && Destination.Equals(other.Destination) && Back == other.Back;
|
|
||||||
|
|
||||||
public override bool Equals(object obj) => obj is TeleporterDefinition other && Equals(other);
|
|
||||||
|
|
||||||
public override int GetHashCode() => HashCode.Combine(Source, Destination, Back);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GenTeleporter
|
public static class GenTeleporter
|
||||||
|
|
@ -39,8 +32,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("TelGenDelete", AccessLevel.Administrator, TelGenDelete_OnCommand);
|
CommandSystem.Register("TelGenDelete", AccessLevel.Administrator, TelGenDelete_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("TelGenDelete")]
|
[Usage("TelGenDelete"), Description("Destroys world/dungeon teleporters for all facets.")]
|
||||||
[Description("Destroys world/dungeon teleporters for all facets.")]
|
|
||||||
public static void TelGenDelete_OnCommand(CommandEventArgs e)
|
public static void TelGenDelete_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
|
|
@ -70,8 +62,7 @@ namespace Server.Commands
|
||||||
from.SendMessage(WarningHue, $"{count} Teleporters Removed.");
|
from.SendMessage(WarningHue, $"{count} Teleporters Removed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("TelGen")]
|
[Usage("TelGen"), Description("Generates world/dungeon teleporters for all facets.")]
|
||||||
[Description("Generates world/dungeon teleporters for all facets.")]
|
|
||||||
public static void GenTeleporter_OnCommand(CommandEventArgs e)
|
public static void GenTeleporter_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("SetProfiles", AccessLevel.Administrator, SetProfiles_OnCommand);
|
CommandSystem.Register("SetProfiles", AccessLevel.Administrator, SetProfiles_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("WriteProfiles")]
|
[Usage("WriteProfiles"), Description("Generates a log files containing performance diagnostic information.")]
|
||||||
[Description("Generates a log files containing performance diagnostic information.")]
|
|
||||||
public static void WriteProfiles_OnCommand(CommandEventArgs e)
|
public static void WriteProfiles_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -55,8 +54,8 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("SetProfiles [true | false]")]
|
[Usage("SetProfiles [true | false]"),
|
||||||
[Description("Enables, disables, or toggles the state of core packet and timer profiling.")]
|
Description("Enables, disables, or toggles the state of core packet and timer profiling.")]
|
||||||
public static void SetProfiles_OnCommand(CommandEventArgs e)
|
public static void SetProfiles_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Length == 1)
|
if (e.Length == 1)
|
||||||
|
|
@ -71,8 +70,8 @@ namespace Server.Commands
|
||||||
e.Mobile.SendMessage("Profiling has been {0}.", Core.Profiling ? "enabled" : "disabled");
|
e.Mobile.SendMessage("Profiling has been {0}.", Core.Profiling ? "enabled" : "disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("DumpTimers")]
|
[Usage("DumpTimers"),
|
||||||
[Description("Generates a log file of all currently executing timers. Used for tracing timer leaks.")]
|
Description("Generates a log file of all currently executing timers. Used for tracing timer leaks.")]
|
||||||
public static void DumpTimers_OnCommand(CommandEventArgs e)
|
public static void DumpTimers_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -86,8 +85,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("CountObjects")]
|
[Usage("CountObjects"), Description("Generates a log file detailing all item and mobile types in the world.")]
|
||||||
[Description("Generates a log file detailing all item and mobile types in the world.")]
|
|
||||||
public static void CountObjects_OnCommand(CommandEventArgs e)
|
public static void CountObjects_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
using (var op = new StreamWriter("objects.log"))
|
using (var op = new StreamWriter("objects.log"))
|
||||||
|
|
@ -141,8 +139,7 @@ namespace Server.Commands
|
||||||
e.Mobile.SendMessage("Object table has been generated. See the file : <runuo root>/objects.log");
|
e.Mobile.SendMessage("Object table has been generated. See the file : <runuo root>/objects.log");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("TraceExpanded")]
|
[Usage("TraceExpanded"), Description("Generates a log file describing all items using expanded memory.")]
|
||||||
[Description("Generates a log file describing all items using expanded memory.")]
|
|
||||||
public static void TraceExpanded_OnCommand(CommandEventArgs e)
|
public static void TraceExpanded_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var typeTable = new Dictionary<Type, int[]>();
|
var typeTable = new Dictionary<Type, int[]>();
|
||||||
|
|
@ -253,8 +250,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("TraceInternal")]
|
[Usage("TraceInternal"), Description("Generates a log file describing all items in the 'internal' map.")]
|
||||||
[Description("Generates a log file describing all items in the 'internal' map.")]
|
|
||||||
public static void TraceInternal_OnCommand(CommandEventArgs e)
|
public static void TraceInternal_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var totalCount = 0;
|
var totalCount = 0;
|
||||||
|
|
@ -297,8 +293,8 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("ProfileWorld")]
|
[Usage("ProfileWorld"),
|
||||||
[Description("Prints the amount of data serialized for every object type in your world file.")]
|
Description("Prints the amount of data serialized for every object type in your world file.")]
|
||||||
public static void ProfileWorld_OnCommand(CommandEventArgs e)
|
public static void ProfileWorld_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
ProfileWorld("items", "worldprofile_items.log");
|
ProfileWorld("items", "worldprofile_items.log");
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,8 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("Props", AccessLevel.Counselor, Props_OnCommand);
|
CommandSystem.Register("Props", AccessLevel.Counselor, Props_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Props [serial]")]
|
[Usage("Props [serial]"),
|
||||||
[Description("Opens a menu where you can view and edit all properties of a targeted (or specified) object.")]
|
Description("Opens a menu where you can view and edit all properties of a targeted (or specified) object.")]
|
||||||
private static void Props_OnCommand(CommandEventArgs e)
|
private static void Props_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Length == 1)
|
if (e.Length == 1)
|
||||||
|
|
@ -254,7 +254,7 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
var valueString = args[1 + i * 2];
|
var valueString = args[1 + i * 2];
|
||||||
|
|
||||||
if (valueString.StartsWith("0x"))
|
if (valueString.StartsWith("0x", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
realValues[i] = Convert.ToInt32(valueString.Substring(2), 16);
|
realValues[i] = Convert.ToInt32(valueString.Substring(2), 16);
|
||||||
}
|
}
|
||||||
|
|
@ -483,7 +483,7 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
toSet = null;
|
toSet = null;
|
||||||
}
|
}
|
||||||
else if (value.StartsWith("0x") && IsNumeric(type))
|
else if (value.StartsWith("0x", StringComparison.Ordinal) && IsNumeric(type))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -620,7 +620,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
namespace Server
|
namespace Server
|
||||||
{
|
{
|
||||||
public abstract class PropertyException : ApplicationException
|
public abstract class PropertyException : Exception
|
||||||
{
|
{
|
||||||
protected Property m_Property;
|
protected Property m_Property;
|
||||||
|
|
||||||
|
|
@ -739,13 +739,15 @@ namespace Server
|
||||||
|
|
||||||
public PropertyAccess Access { get; private set; }
|
public PropertyAccess Access { get; private set; }
|
||||||
|
|
||||||
|
private void NotYetBound() => throw new NotYetBoundException(this);
|
||||||
|
|
||||||
public PropertyInfo[] Chain
|
public PropertyInfo[] Chain
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (!IsBound)
|
if (!IsBound)
|
||||||
{
|
{
|
||||||
throw new NotYetBoundException(this);
|
NotYetBound();
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_Chain;
|
return m_Chain;
|
||||||
|
|
@ -758,7 +760,7 @@ namespace Server
|
||||||
{
|
{
|
||||||
if (!IsBound)
|
if (!IsBound)
|
||||||
{
|
{
|
||||||
throw new NotYetBoundException(this);
|
NotYetBound();
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_Chain[^1].PropertyType;
|
return m_Chain[^1].PropertyType;
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class ShardTime
|
public static class ShardTime
|
||||||
{
|
{
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
CommandSystem.Register("Time", AccessLevel.Player, Time_OnCommand);
|
CommandSystem.Register("Time", AccessLevel.Player, Time_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Time")]
|
[Usage("Time"), Description("Returns the server's local time.")]
|
||||||
[Description("Returns the server's local time.")]
|
|
||||||
private static void Time_OnCommand(CommandEventArgs e)
|
private static void Time_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.SendMessage(DateTime.UtcNow.ToString());
|
e.Mobile.SendMessage(DateTime.UtcNow.ToString(CultureInfo.InvariantCulture));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class SignParser
|
public static class SignParser
|
||||||
{
|
{
|
||||||
private static readonly Queue<Item> m_ToDelete = new Queue<Item>();
|
private static readonly Queue<Item> m_ToDelete = new Queue<Item>();
|
||||||
|
|
||||||
|
|
@ -13,8 +14,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("SignGen", AccessLevel.Administrator, SignGen_OnCommand);
|
CommandSystem.Register("SignGen", AccessLevel.Administrator, SignGen_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("SignGen")]
|
[Usage("SignGen"), Description("Generates world/shop signs on all facets.")]
|
||||||
[Description("Generates world/shop signs on all facets.")]
|
|
||||||
public static void SignGen_OnCommand(CommandEventArgs c)
|
public static void SignGen_OnCommand(CommandEventArgs c)
|
||||||
{
|
{
|
||||||
Parse(c.Mobile);
|
Parse(c.Mobile);
|
||||||
|
|
@ -108,14 +108,13 @@ namespace Server.Commands
|
||||||
|
|
||||||
Item sign;
|
Item sign;
|
||||||
|
|
||||||
if (name.StartsWith("#"))
|
if (name.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
sign = new LocalizedSign(itemID, Utility.ToInt32(name.Substring(1)));
|
sign = new LocalizedSign(itemID, Utility.ToInt32(name.Substring(1)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sign = new Sign(itemID);
|
sign = new Sign(itemID) { Name = name };
|
||||||
sign.Name = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map == Map.Malas)
|
if (map == Map.Malas)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using Server.Targeting;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class SkillsCommand
|
public static class SkillsCommand
|
||||||
{
|
{
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -12,8 +12,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("SetAllSkills", AccessLevel.GameMaster, SetAllSkills_OnCommand);
|
CommandSystem.Register("SetAllSkills", AccessLevel.GameMaster, SetAllSkills_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("SetSkill <name> <value>")]
|
[Usage("SetSkill <name> <value>"), Description("Sets a skill value by name of a targeted mobile.")]
|
||||||
[Description("Sets a skill value by name of a targeted mobile.")]
|
|
||||||
public static void SetSkill_OnCommand(CommandEventArgs arg)
|
public static void SetSkill_OnCommand(CommandEventArgs arg)
|
||||||
{
|
{
|
||||||
if (arg.Length != 2)
|
if (arg.Length != 2)
|
||||||
|
|
@ -33,8 +32,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("SetAllSkills <name> <value>")]
|
[Usage("SetAllSkills <name> <value>"), Description("Sets all skill values of a targeted mobile.")]
|
||||||
[Description("Sets all skill values of a targeted mobile.")]
|
|
||||||
public static void SetAllSkills_OnCommand(CommandEventArgs arg)
|
public static void SetAllSkills_OnCommand(CommandEventArgs arg)
|
||||||
{
|
{
|
||||||
if (arg.Length != 1)
|
if (arg.Length != 1)
|
||||||
|
|
@ -47,8 +45,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("GetSkill <name>")]
|
[Usage("GetSkill <name>"), Description("Gets a skill value by name of a targeted mobile.")]
|
||||||
[Description("Gets a skill value by name of a targeted mobile.")]
|
|
||||||
public static void GetSkill_OnCommand(CommandEventArgs arg)
|
public static void GetSkill_OnCommand(CommandEventArgs arg)
|
||||||
{
|
{
|
||||||
if (arg.Length != 1)
|
if (arg.Length != 1)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using Server.Targeting;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class Skills
|
public static class SkillsMenu
|
||||||
{
|
{
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -15,8 +15,7 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("Skills", AccessLevel.Counselor, Skills_OnCommand);
|
CommandSystem.Register("Skills", AccessLevel.Counselor, Skills_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Skills")]
|
[Usage("Skills"), Description("Opens a menu where you can view or edit skills of a targeted mobile.")]
|
||||||
[Description("Opens a menu where you can view or edit skills of a targeted mobile.")]
|
|
||||||
private static void Skills_OnCommand(CommandEventArgs e)
|
private static void Skills_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
e.Mobile.Target = new SkillsTarget();
|
e.Mobile.Target = new SkillsTarget();
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using Server.Items;
|
||||||
|
|
||||||
namespace Server
|
namespace Server
|
||||||
{
|
{
|
||||||
public class Statics
|
public static class Statics
|
||||||
{
|
{
|
||||||
public delegate void FreezeCallback(Mobile from, bool okay, StateInfo si);
|
public delegate void FreezeCallback(Mobile from, bool okay, StateInfo si);
|
||||||
|
|
||||||
|
|
@ -47,16 +47,14 @@ namespace Server
|
||||||
CommandSystem.Register("UnfreezeWorld", AccessLevel.Administrator, UnfreezeWorld_OnCommand);
|
CommandSystem.Register("UnfreezeWorld", AccessLevel.Administrator, UnfreezeWorld_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Freeze")]
|
[Usage("Freeze"), Description("Makes a targeted area of dynamic items static.")]
|
||||||
[Description("Makes a targeted area of dynamic items static.")]
|
|
||||||
public static void Freeze_OnCommand(CommandEventArgs e)
|
public static void Freeze_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
BoundingBoxPicker.Begin(from, (map, start, end) => FreezeBox_Callback(from, map, start, end));
|
BoundingBoxPicker.Begin(from, (map, start, end) => FreezeBox_Callback(from, map, start, end));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("FreezeMap")]
|
[Usage("FreezeMap"), Description("Makes every dynamic item in your map static.")]
|
||||||
[Description("Makes every dynamic item in your map static.")]
|
|
||||||
public static void FreezeMap_OnCommand(CommandEventArgs e)
|
public static void FreezeMap_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
|
|
@ -76,8 +74,7 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("FreezeWorld")]
|
[Usage("FreezeWorld"), Description("Makes every dynamic item on all maps static.")]
|
||||||
[Description("Makes every dynamic item on all maps static.")]
|
|
||||||
public static void FreezeWorld_OnCommand(CommandEventArgs e)
|
public static void FreezeWorld_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
SendWarning(
|
SendWarning(
|
||||||
|
|
@ -406,16 +403,14 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Unfreeze")]
|
[Usage("Unfreeze"), Description("Makes a targeted area of static items dynamic.")]
|
||||||
[Description("Makes a targeted area of static items dynamic.")]
|
|
||||||
public static void Unfreeze_OnCommand(CommandEventArgs e)
|
public static void Unfreeze_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var from = e.Mobile;
|
var from = e.Mobile;
|
||||||
BoundingBoxPicker.Begin(from, (map, start, end) => UnfreezeBox_Callback(from, map, start, end));
|
BoundingBoxPicker.Begin(from, (map, start, end) => UnfreezeBox_Callback(from, map, start, end));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("UnfreezeMap")]
|
[Usage("UnfreezeMap"), Description("Makes every static item in your map dynamic.")]
|
||||||
[Description("Makes every static item in your map dynamic.")]
|
|
||||||
public static void UnfreezeMap_OnCommand(CommandEventArgs e)
|
public static void UnfreezeMap_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var map = e.Mobile.Map;
|
var map = e.Mobile.Map;
|
||||||
|
|
@ -434,8 +429,7 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("UnfreezeWorld")]
|
[Usage("UnfreezeWorld"), Description("Makes every static item on all maps dynamic.")]
|
||||||
[Description("Makes every static item on all maps dynamic.")]
|
|
||||||
public static void UnfreezeWorld_OnCommand(CommandEventArgs e)
|
public static void UnfreezeWorld_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
SendWarning(
|
SendWarning(
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,9 @@ namespace Server.Commands
|
||||||
(m as PlayerMobile)?.VisibilityList.Clear();
|
(m as PlayerMobile)?.VisibilityList.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Vis")]
|
[Usage("Vis"), Description(
|
||||||
[Description(
|
"Adds or removes a targeted player from your visibility list. Anyone on your visibility list will be able to see you at all times, even when you're hidden."
|
||||||
"Adds or removes a targeted player from your visibility list. Anyone on your visibility list will be able to see you at all times, even when you're hidden."
|
)]
|
||||||
)]
|
|
||||||
public static void Vis_OnCommand(CommandEventArgs e)
|
public static void Vis_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Mobile is PlayerMobile)
|
if (e.Mobile is PlayerMobile)
|
||||||
|
|
@ -34,8 +33,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("VisList")]
|
[Usage("VisList"), Description("Shows the names of everyone in your visibility list.")]
|
||||||
[Description("Shows the names of everyone in your visibility list.")]
|
|
||||||
public static void VisList_OnCommand(CommandEventArgs e)
|
public static void VisList_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Mobile is PlayerMobile pm)
|
if (e.Mobile is PlayerMobile pm)
|
||||||
|
|
@ -58,8 +56,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("VisClear")]
|
[Usage("VisClear"), Description("Removes everyone from your visibility list.")]
|
||||||
[Description("Removes everyone from your visibility list.")]
|
|
||||||
public static void VisClear_OnCommand(CommandEventArgs e)
|
public static void VisClear_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Mobile is PlayerMobile pm)
|
if (e.Mobile is PlayerMobile pm)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using Server.Multis;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class Wipe
|
public static class Wipe
|
||||||
{
|
{
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum WipeType
|
public enum WipeType
|
||||||
|
|
@ -24,29 +24,25 @@ namespace Server.Commands
|
||||||
CommandSystem.Register("WipeMultis", AccessLevel.GameMaster, WipeMultis_OnCommand);
|
CommandSystem.Register("WipeMultis", AccessLevel.GameMaster, WipeMultis_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("Wipe")]
|
[Usage("Wipe"), Description("Wipes all items and npcs in a targeted bounding box.")]
|
||||||
[Description("Wipes all items and npcs in a targeted bounding box.")]
|
|
||||||
private static void WipeAll_OnCommand(CommandEventArgs e)
|
private static void WipeAll_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
BeginWipe(e.Mobile, WipeType.Items | WipeType.Mobiles);
|
BeginWipe(e.Mobile, WipeType.Items | WipeType.Mobiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("WipeItems")]
|
[Usage("WipeItems"), Description("Wipes all items in a targeted bounding box.")]
|
||||||
[Description("Wipes all items in a targeted bounding box.")]
|
|
||||||
private static void WipeItems_OnCommand(CommandEventArgs e)
|
private static void WipeItems_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
BeginWipe(e.Mobile, WipeType.Items);
|
BeginWipe(e.Mobile, WipeType.Items);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("WipeNPCs")]
|
[Usage("WipeNPCs"), Description("Wipes all npcs in a targeted bounding box.")]
|
||||||
[Description("Wipes all npcs in a targeted bounding box.")]
|
|
||||||
private static void WipeNPCs_OnCommand(CommandEventArgs e)
|
private static void WipeNPCs_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
BeginWipe(e.Mobile, WipeType.Mobiles);
|
BeginWipe(e.Mobile, WipeType.Mobiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("WipeMultis")]
|
[Usage("WipeMultis"), Description("Wipes all multis in a targeted bounding box.")]
|
||||||
[Description("Wipes all multis in a targeted bounding box.")]
|
|
||||||
private static void WipeMultis_OnCommand(CommandEventArgs e)
|
private static void WipeMultis_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
BeginWipe(e.Mobile, WipeType.Multis);
|
BeginWipe(e.Mobile, WipeType.Multis);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
using Server.Network;
|
|
||||||
using Server.Targeting;
|
using Server.Targeting;
|
||||||
|
|
||||||
namespace Server.ContextMenus
|
namespace Server.ContextMenus
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Server.Engines.BulkOrders
|
||||||
Leather
|
Leather
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BGTClassifier
|
public static class BGTClassifier
|
||||||
{
|
{
|
||||||
public static BulkGenericType Classify(BODType deedType, Type itemType)
|
public static BulkGenericType Classify(BODType deedType, Type itemType)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
while ((line = ip.ReadLine()) != null)
|
while ((line = ip.ReadLine()) != null)
|
||||||
{
|
{
|
||||||
if (line.Length == 0 || line.StartsWith("#"))
|
if (line.Length == 0 || line.StartsWith("#", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Server.Engines.Chat
|
namespace Server.Engines.Chat
|
||||||
{
|
{
|
||||||
public class ChatActionHandlers
|
public static class ChatActionHandlers
|
||||||
{
|
{
|
||||||
private static readonly ChatActionHandler[] m_Handlers;
|
private static readonly ChatActionHandler[] m_Handlers;
|
||||||
|
|
||||||
|
|
@ -84,7 +86,7 @@ namespace Server.Engines.Chat
|
||||||
|
|
||||||
public static void PrivateMessage(ChatUser from, Channel channel, string param)
|
public static void PrivateMessage(ChatUser from, Channel channel, string param)
|
||||||
{
|
{
|
||||||
var indexOf = param.IndexOf(' ');
|
var indexOf = param.IndexOf(' ', StringComparison.Ordinal);
|
||||||
|
|
||||||
var name = param.Substring(0, indexOf);
|
var name = param.Substring(0, indexOf);
|
||||||
var text = param.Substring(indexOf + 1);
|
var text = param.Substring(indexOf + 1);
|
||||||
|
|
@ -171,7 +173,7 @@ namespace Server.Engines.Chat
|
||||||
string name;
|
string name;
|
||||||
string password = null;
|
string password = null;
|
||||||
|
|
||||||
var start = param.IndexOf('\"');
|
var start = param.IndexOf('\"', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (start >= 0)
|
if (start >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -189,7 +191,7 @@ namespace Server.Engines.Chat
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var indexOf = param.IndexOf(' ');
|
var indexOf = param.IndexOf(' ', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
|
|
@ -226,7 +228,7 @@ namespace Server.Engines.Chat
|
||||||
string name;
|
string name;
|
||||||
string password = null;
|
string password = null;
|
||||||
|
|
||||||
var start = param.IndexOf('{');
|
var start = param.IndexOf('{', StringComparison.Ordinal);
|
||||||
|
|
||||||
if (start >= 0)
|
if (start >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -800,7 +800,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
if (!m_Bomb.m_Flying && m_Bomb.Map != Map.Internal)
|
if (!m_Bomb.m_Flying && m_Bomb.Map != Map.Internal)
|
||||||
{
|
{
|
||||||
Effects.SendLocationEffect(m_Bomb.GetWorldLocation(), m_Bomb.Map, 0x377A, 16, 10, m_Bomb.Hue, 0);
|
Effects.SendLocationEffect(m_Bomb.GetWorldLocation(), m_Bomb.Map, 0x377A, 16, 10, m_Bomb.Hue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Bomb.Location != m_Bomb.m_Game.Controller.BombHome)
|
if (m_Bomb.Location != m_Bomb.m_Game.Controller.BombHome)
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace Server.Engines.ConPVP
|
||||||
hasAppended = true;
|
hasAppended = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.Append(".");
|
sb.Append('.');
|
||||||
|
|
||||||
part.AddLog(sb.ToString());
|
part.AddLog(sb.ToString());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
@ -25,7 +26,7 @@ namespace Server.Engines.ConPVP
|
||||||
private const int BlackColor32 = 0x000008;
|
private const int BlackColor32 = 0x000008;
|
||||||
private const int LabelColor32 = 0xFFFFFF;
|
private const int LabelColor32 = 0xFFFFFF;
|
||||||
private readonly Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
private readonly List<object> m_List;
|
private List<object> m_List;
|
||||||
private readonly object m_Object;
|
private readonly object m_Object;
|
||||||
private readonly int m_Page;
|
private readonly int m_Page;
|
||||||
private readonly Tournament m_Tournament;
|
private readonly Tournament m_Tournament;
|
||||||
|
|
@ -279,9 +280,8 @@ namespace Server.Engines.ConPVP
|
||||||
AddPage(0);
|
AddPage(0);
|
||||||
AddBackground(0, 0, 300, 300, 9380);
|
AddBackground(0, 0, 300, 300, 9380);
|
||||||
|
|
||||||
var pList = m_List != null
|
var pList = m_List?.CastListCovariant<object, TourneyParticipant>()
|
||||||
? Utility.CastListCovariant<object, TourneyParticipant>(m_List)
|
?? new List<TourneyParticipant>(tourney.Participants);
|
||||||
: new List<TourneyParticipant>(tourney.Participants);
|
|
||||||
|
|
||||||
AddLeftArrow(25, 11, ToButtonID(0, 0));
|
AddLeftArrow(25, 11, ToButtonID(0, 0));
|
||||||
AddHtml(25, 35, 250, 20, Center($"{pList.Count} Participant{(pList.Count == 1 ? "" : "s")}"));
|
AddHtml(25, 35, 250, 20, Center($"{pList.Count} Participant{(pList.Count == 1 ? "" : "s")}"));
|
||||||
|
|
@ -440,7 +440,7 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
var matchesList = m_List != null
|
var matchesList = m_List != null
|
||||||
? Utility.CastListCovariant<object, TourneyMatch>(m_List)
|
? m_List.CastListCovariant<object, TourneyMatch>()
|
||||||
: new List<TourneyMatch>(level.Matches);
|
: new List<TourneyMatch>(level.Matches);
|
||||||
|
|
||||||
AddRightArrow(
|
AddRightArrow(
|
||||||
|
|
@ -522,31 +522,14 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
if (m_Tournament.ParticipantsPerMatch == 4)
|
if (m_Tournament.ParticipantsPerMatch == 4)
|
||||||
{
|
{
|
||||||
var name = "(null)";
|
var name = j switch
|
||||||
|
|
||||||
switch (j)
|
|
||||||
{
|
{
|
||||||
case 0:
|
0 => "Minax",
|
||||||
{
|
1 => "Council of Mages",
|
||||||
name = "Minax";
|
2 => "True Britannians",
|
||||||
break;
|
3 => "Shadowlords",
|
||||||
}
|
_ => "(null)"
|
||||||
case 1:
|
};
|
||||||
{
|
|
||||||
name = "Council of Mages";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
name = "True Britannians";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
name = "Shadowlords";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
txt = $"{name} ({part.Players.Count})";
|
txt = $"{name} ({part.Players.Count})";
|
||||||
}
|
}
|
||||||
|
|
@ -658,31 +641,14 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
if (m_Tournament.ParticipantsPerMatch == 4)
|
if (m_Tournament.ParticipantsPerMatch == 4)
|
||||||
{
|
{
|
||||||
var name = "(null)";
|
var name = i switch
|
||||||
|
|
||||||
switch (i)
|
|
||||||
{
|
{
|
||||||
case 0:
|
0 => "Minax",
|
||||||
{
|
1 => "Council of Mages",
|
||||||
name = "Minax";
|
2 => "True Britannians",
|
||||||
break;
|
3 => "Shadowlords",
|
||||||
}
|
_ => "(null)"
|
||||||
case 1:
|
};
|
||||||
{
|
|
||||||
name = "Council of Mages";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
name = "True Britannians";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
name = "Shadowlords";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AddRightArrow(
|
AddRightArrow(
|
||||||
25,
|
25,
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,7 @@ namespace Server.Engines.ConPVP
|
||||||
hasAppended = true;
|
hasAppended = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.Append(".");
|
sb.Append('.');
|
||||||
|
|
||||||
if (TourneyType == TourneyType.Standard)
|
if (TourneyType == TourneyType.Standard)
|
||||||
{
|
{
|
||||||
|
|
@ -784,35 +784,14 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
if (m_ParticipantsPerMatch == 4)
|
if (m_ParticipantsPerMatch == 4)
|
||||||
{
|
{
|
||||||
var name = "(null)";
|
var name = Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) switch
|
||||||
|
|
||||||
switch (Pyramid.Levels[0]
|
|
||||||
.Matches[0]
|
|
||||||
.Participants.IndexOf(
|
|
||||||
winner
|
|
||||||
))
|
|
||||||
{
|
{
|
||||||
case 0:
|
0 => "Minax",
|
||||||
{
|
1 => "Council of Mages",
|
||||||
name = "Minax";
|
2 => "True Britannians",
|
||||||
break;
|
3 => "Shadowlords",
|
||||||
}
|
_ => "(null)"
|
||||||
case 1:
|
};
|
||||||
{
|
|
||||||
name = "Council of Mages";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
name = "True Britannians";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
name = "Shadowlords";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Alert("The tournament has completed!", $"The {name} team has won!");
|
Alert("The tournament has completed!", $"The {name} team has won!");
|
||||||
}
|
}
|
||||||
|
|
@ -940,33 +919,14 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
if (m_ParticipantsPerMatch == 4)
|
if (m_ParticipantsPerMatch == 4)
|
||||||
{
|
{
|
||||||
var name = "(null)";
|
var name = Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) switch
|
||||||
|
|
||||||
switch (Pyramid.Levels[0]
|
|
||||||
.Matches[0]
|
|
||||||
.Participants.IndexOf(winner))
|
|
||||||
{
|
{
|
||||||
case 0:
|
0 => "Minax",
|
||||||
{
|
1 => "Council of Mages",
|
||||||
name = "Minax";
|
2 => "True Britannians",
|
||||||
break;
|
3 => "Shadowlords",
|
||||||
}
|
_ => "(null)"
|
||||||
case 1:
|
};
|
||||||
{
|
|
||||||
name = "Council of Mages";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
name = "True Britannians";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
name = "Shadowlords";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Alert("The tournament has completed!", $"The {name} team has won!");
|
Alert("The tournament has completed!", $"The {name} team has won!");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,7 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if (types.Length != amounts.Length)
|
if (types.Length != amounts.Length)
|
||||||
{
|
{
|
||||||
throw new ArgumentException();
|
throw new ArgumentOutOfRangeException(nameof(types));
|
||||||
}
|
}
|
||||||
|
|
||||||
var items = new Item[types.Length][];
|
var items = new Item[types.Length][];
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Server.Engines.Craft
|
||||||
NoSkill
|
NoSkill
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Enhance
|
public static class Enhance
|
||||||
{
|
{
|
||||||
public static EnhanceResult Invoke(
|
public static EnhanceResult Invoke(
|
||||||
Mobile from, CraftSystem craftSystem, BaseTool tool, Item item,
|
Mobile from, CraftSystem craftSystem, BaseTool tool, Item item,
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,7 @@ namespace Server.Engines.Craft
|
||||||
CommandSystem.Register("ForgetAllRecipes", AccessLevel.GameMaster, ForgetAllRecipes_OnCommand);
|
CommandSystem.Register("ForgetAllRecipes", AccessLevel.GameMaster, ForgetAllRecipes_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("LearnAllRecipes")]
|
[Usage("LearnAllRecipes"), Description("Teaches a player all available recipes.")]
|
||||||
[Description("Teaches a player all available recipes.")]
|
|
||||||
private static void LearnAllRecipes_OnCommand(CommandEventArgs e)
|
private static void LearnAllRecipes_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var m = e.Mobile;
|
var m = e.Mobile;
|
||||||
|
|
@ -73,8 +72,7 @@ namespace Server.Engines.Craft
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("ForgetAllRecipes")]
|
[Usage("ForgetAllRecipes"), Description("Makes a player forget all the recipes they've learned.")]
|
||||||
[Description("Makes a player forget all the recipes they've learned.")]
|
|
||||||
private static void ForgetAllRecipes_OnCommand(CommandEventArgs e)
|
private static void ForgetAllRecipes_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
var m = e.Mobile;
|
var m = e.Mobile;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using Server.Targeting;
|
||||||
|
|
||||||
namespace Server.Engines.Craft
|
namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
public class Repair
|
public static class Repair
|
||||||
{
|
{
|
||||||
public static void Do(Mobile from, CraftSystem craftSystem, BaseTool tool)
|
public static void Do(Mobile from, CraftSystem craftSystem, BaseTool tool)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1351,10 +1351,12 @@ namespace Server.Engines.Craft
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
public class ForgeAttribute : Attribute
|
public class ForgeAttribute : Attribute
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
public class AnvilAttribute : Attribute
|
public class AnvilAttribute : Attribute
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -189,8 +189,7 @@ namespace Server.Engines.Doom
|
||||||
CommandSystem.Register("GenLeverPuzzle", AccessLevel.Administrator, GenLampPuzzle_OnCommand);
|
CommandSystem.Register("GenLeverPuzzle", AccessLevel.Administrator, GenLampPuzzle_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Usage("GenLeverPuzzle")]
|
[Usage("GenLeverPuzzle"), Description("Generates lamp room and lever puzzle in doom.")]
|
||||||
[Description("Generates lamp room and lever puzzle in doom.")]
|
|
||||||
public static void GenLampPuzzle_OnCommand(CommandEventArgs e)
|
public static void GenLampPuzzle_OnCommand(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
if (Map.Malas.GetItemsInRange(lp_Center, 0).OfType<LeverPuzzleController>().Any())
|
if (Map.Malas.GetItemsInRange(lp_Center, 0).OfType<LeverPuzzleController>().Any())
|
||||||
|
|
@ -372,7 +371,7 @@ namespace Server.Engines.Doom
|
||||||
SendLocationEffect(lp_Center, 0x1153, 0, 60, 1);
|
SendLocationEffect(lp_Center, 0x1153, 0, 60, 1);
|
||||||
PlaySounds(lp_Center, cs1);
|
PlaySounds(lp_Center, cs1);
|
||||||
|
|
||||||
Effects.SendBoltEffect(player, true);
|
Effects.SendBoltEffect(player);
|
||||||
player.MoveToWorld(lr_Enter, Map.Malas);
|
player.MoveToWorld(lr_Enter, Map.Malas);
|
||||||
|
|
||||||
m_Timer = new LampRoomTimer(this);
|
m_Timer = new LampRoomTimer(this);
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue