From eaf1db1ee1a219e150864b8436cfe16117f98d82 Mon Sep 17 00:00:00 2001 From: Li Date: Mon, 14 Nov 2022 23:09:22 +1300 Subject: [PATCH] Begin work on Unit Tests --- .gitignore | 7 +- HorseIsleServer/HISP.sln | 110 +- HorseIsleServer/HISPd/HISPd.csproj | 106 +- HorseIsleServer/HISPd/Program.cs | 2 +- .../HISPd/Properties/AssemblyInfo.cs | 4 +- .../HISPd/Resources/DEBIAN/control | 2 +- HorseIsleServer/HISPtests/HISPtests.csproj | 169 ++ HorseIsleServer/HISPtests/Program.cs | 20 + .../HISPtests/Properties/AssemblyInfo.cs | 35 + .../PublishProfiles/AndroidARM.pubxml | 20 + .../PublishProfiles/AndroidARM64.pubxml | 20 + .../Properties/PublishProfiles/Linux64.pubxml | 19 + .../PublishProfiles/LinuxARM.pubxml | 19 + .../PublishProfiles/LinuxARM64.pubxml | 19 + .../Properties/PublishProfiles/Osx64.pubxml | 19 + .../PublishProfiles/OsxARM64.pubxml | 19 + .../Properties/PublishProfiles/Win32.pubxml | 19 + .../Properties/PublishProfiles/Win64.pubxml | 19 + .../Properties/PublishProfiles/WinARM.pubxml | 19 + .../PublishProfiles/WinARM64.pubxml | 19 + .../Properties/PublishProfiles/iOSARM.pubxml | 19 + .../PublishProfiles/iOSARM64.pubxml | 19 + .../Properties/Resources.Designer.cs | 74 + .../HISPtests/Properties/Resources.resx | 124 ++ .../HISPtests/Properties/launchSettings.json | 7 + .../Resources/PacketTestDataSet.json | 256 +++ HorseIsleServer/HISPtests/ResultLogger.cs | 51 + .../HISPtests/UnitTests/AuthenticationTest.cs | 59 + .../HISPtests/UnitTests/PacketTest.cs | 418 ++++ .../HISPtests/UnitTests/ServerStartTest.cs | 40 + .../HISPtests/UnitTests/UserTest.cs | 172 ++ HorseIsleServer/HISPtests/icon.ico | Bin 0 -> 3646 bytes HorseIsleServer/LibHISP/Game/Arena.cs | 2 +- HorseIsleServer/LibHISP/Game/Chat/Command.cs | 2 +- HorseIsleServer/LibHISP/Game/Messages.cs | 4 +- HorseIsleServer/LibHISP/Game/Quest.cs | 2 +- HorseIsleServer/LibHISP/Game/Treasure.cs | 2 +- HorseIsleServer/LibHISP/Player/Award.cs | 198 +- HorseIsleServer/LibHISP/Player/Dance.cs | 2 +- HorseIsleServer/LibHISP/Player/User.cs | 1412 ++++++------- .../LibHISP/Properties/AssemblyInfo.cs | 4 +- .../LibHISP/Security/Authentication.cs | 222 ++- HorseIsleServer/LibHISP/Security/RandomID.cs | 46 +- .../LibHISP/Server/ConfigReader.cs | 280 +-- HorseIsleServer/LibHISP/Server/Database.cs | 17 + HorseIsleServer/LibHISP/Server/GameServer.cs | 60 +- .../LibHISP/Server/PacketBuilder.cs | 1762 ++++++++--------- HorseIsleServer/LibHISP/Util/Helper.cs | 29 +- .../MPN00BS/Properties/AssemblyInfo.cs | 4 +- .../MPN00BS/RegisterWindow.axaml.cs | 21 +- HorseIsleServer/MPN00BS/ServerStarter.cs | 10 +- 51 files changed, 3883 insertions(+), 2101 deletions(-) create mode 100644 HorseIsleServer/HISPtests/HISPtests.csproj create mode 100644 HorseIsleServer/HISPtests/Program.cs create mode 100644 HorseIsleServer/HISPtests/Properties/AssemblyInfo.cs create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/AndroidARM.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/AndroidARM64.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/Linux64.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/LinuxARM.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/LinuxARM64.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/Osx64.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/OsxARM64.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/Win32.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/Win64.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/WinARM.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/WinARM64.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/iOSARM.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/PublishProfiles/iOSARM64.pubxml create mode 100644 HorseIsleServer/HISPtests/Properties/Resources.Designer.cs create mode 100644 HorseIsleServer/HISPtests/Properties/Resources.resx create mode 100644 HorseIsleServer/HISPtests/Properties/launchSettings.json create mode 100644 HorseIsleServer/HISPtests/Resources/PacketTestDataSet.json create mode 100644 HorseIsleServer/HISPtests/ResultLogger.cs create mode 100644 HorseIsleServer/HISPtests/UnitTests/AuthenticationTest.cs create mode 100644 HorseIsleServer/HISPtests/UnitTests/PacketTest.cs create mode 100644 HorseIsleServer/HISPtests/UnitTests/ServerStartTest.cs create mode 100644 HorseIsleServer/HISPtests/UnitTests/UserTest.cs create mode 100644 HorseIsleServer/HISPtests/icon.ico diff --git a/.gitignore b/.gitignore index 4f4d78e..7499fc4 100755 --- a/.gitignore +++ b/.gitignore @@ -16,10 +16,15 @@ HorseIsleServer/MPN00BS/bin/* HorseIsleServer/HISPd/obj/* HorseIsleServer/HISPd/bin/* -HorseIsleServer/Installer/Windows/* +HorseIsleServer/HISPtests/obj/* +HorseIsleServer/HISPtests/bin/* + HorseIsleServer/LibHISP/obj/* HorseIsleServer/LibHISP/bin/* HorseIsleServer/LibHISP/Resources/Versioning/* +HorseIsleServer/Installer/Windows/* + + HorseIsleServer/.vs/* diff --git a/HorseIsleServer/HISP.sln b/HorseIsleServer/HISP.sln index 075fa0c..1bda296 100755 --- a/HorseIsleServer/HISP.sln +++ b/HorseIsleServer/HISP.sln @@ -8,9 +8,8 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HISPd", "HISPd\HISPd.csproj", "{DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MPN00BS", "MPN00BS\MPN00BS.csproj", "{72EF95FC-03DB-4E61-A696-E0095DD42A4E}" - ProjectSection(ProjectDependencies) = postProject - {C48CBD82-AB30-494A-8FFA-4DE7069B5827} = {C48CBD82-AB30-494A-8FFA-4DE7069B5827} - EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HISPtests", "HISPtests\HISPtests.csproj", "{689FB972-1612-440E-817D-BE290F655AA8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -39,6 +38,11 @@ Global MacOS|ARM64 = MacOS|ARM64 MacOS|x64 = MacOS|x64 MacOS|x86 = MacOS|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 Windows|Any CPU = Windows|Any CPU Windows|ARM = Windows|ARM Windows|ARM64 = Windows|ARM64 @@ -95,6 +99,16 @@ Global {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.MacOS|x64.Build.0 = MacOS|x64 {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.MacOS|x86.ActiveCfg = MacOS|x86 {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.MacOS|x86.Build.0 = MacOS|x86 + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|Any CPU.ActiveCfg = Windows|Any CPU + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|Any CPU.Build.0 = Windows|Any CPU + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|ARM.ActiveCfg = Windows|ARM + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|ARM.Build.0 = Windows|ARM + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|ARM64.ActiveCfg = Windows|ARM64 + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|ARM64.Build.0 = Windows|ARM64 + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|x64.ActiveCfg = Windows|x64 + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|x64.Build.0 = Windows|x64 + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|x86.ActiveCfg = Windows|x86 + {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Release|x86.Build.0 = Windows|x86 {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Windows|Any CPU.ActiveCfg = Windows|Any CPU {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Windows|Any CPU.Build.0 = Windows|Any CPU {C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Windows|ARM.ActiveCfg = Windows|ARM @@ -154,6 +168,16 @@ Global {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.MacOS|x64.Build.0 = MacOS|x64 {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.MacOS|x86.ActiveCfg = MacOS|x86 {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.MacOS|x86.Build.0 = MacOS|x86 + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|Any CPU.ActiveCfg = Windows|Any CPU + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|Any CPU.Build.0 = Windows|Any CPU + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|ARM.ActiveCfg = Windows|ARM + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|ARM.Build.0 = Windows|ARM + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|ARM64.ActiveCfg = Windows|ARM64 + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|ARM64.Build.0 = Windows|ARM64 + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|x64.ActiveCfg = Windows|x64 + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|x64.Build.0 = Windows|x64 + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|x86.ActiveCfg = Windows|x86 + {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Release|x86.Build.0 = Windows|x86 {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Windows|Any CPU.ActiveCfg = Windows|Any CPU {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Windows|Any CPU.Build.0 = Windows|Any CPU {DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}.Windows|ARM.ActiveCfg = Windows|ARM @@ -214,6 +238,16 @@ Global {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.MacOS|x64.Build.0 = MacOS|x64 {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.MacOS|x86.ActiveCfg = MacOS|x86 {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.MacOS|x86.Build.0 = MacOS|x86 + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|Any CPU.ActiveCfg = Windows|Any CPU + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|Any CPU.Build.0 = Windows|Any CPU + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|ARM.ActiveCfg = Windows|ARM + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|ARM.Build.0 = Windows|ARM + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|ARM64.ActiveCfg = Windows|ARM64 + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|ARM64.Build.0 = Windows|ARM64 + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|x64.ActiveCfg = Windows|x64 + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|x64.Build.0 = Windows|x64 + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|x86.ActiveCfg = Windows|x86 + {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Release|x86.Build.0 = Windows|x86 {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Windows|Any CPU.ActiveCfg = Windows|Any CPU {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Windows|Any CPU.Build.0 = Windows|Any CPU {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Windows|ARM.ActiveCfg = Windows|ARM @@ -224,6 +258,76 @@ Global {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Windows|x64.Build.0 = Windows|x64 {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Windows|x86.ActiveCfg = Windows|x86 {72EF95FC-03DB-4E61-A696-E0095DD42A4E}.Windows|x86.Build.0 = Windows|x86 + {689FB972-1612-440E-817D-BE290F655AA8}.Android|Any CPU.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|Any CPU.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|ARM.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|ARM.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|ARM64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|ARM64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|x64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|x64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|x86.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Android|x86.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|ARM.ActiveCfg = Debug|ARM + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|ARM.Build.0 = Debug|ARM + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|ARM64.Build.0 = Debug|ARM64 + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|x64.ActiveCfg = Debug|x64 + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|x64.Build.0 = Debug|x64 + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|x86.ActiveCfg = Debug|x86 + {689FB972-1612-440E-817D-BE290F655AA8}.Debug|x86.Build.0 = Debug|x86 + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|Any CPU.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|Any CPU.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|ARM.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|ARM.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|ARM64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|ARM64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|x64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|x64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|x86.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.iOS|x86.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|Any CPU.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|Any CPU.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|ARM.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|ARM.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|ARM64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|ARM64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|x64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|x64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|x86.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Linux|x86.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|Any CPU.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|Any CPU.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|ARM.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|ARM.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|ARM64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|ARM64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|x64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|x64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|x86.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.MacOS|x86.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|Any CPU.Build.0 = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|ARM.ActiveCfg = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|ARM.Build.0 = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|ARM64.ActiveCfg = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|ARM64.Build.0 = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|x64.ActiveCfg = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|x64.Build.0 = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|x86.ActiveCfg = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Release|x86.Build.0 = Release|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|Any CPU.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|Any CPU.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|ARM.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|ARM.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|ARM64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|ARM64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|x64.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|x64.Build.0 = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|x86.ActiveCfg = Debug|Any CPU + {689FB972-1612-440E-817D-BE290F655AA8}.Windows|x86.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/HorseIsleServer/HISPd/HISPd.csproj b/HorseIsleServer/HISPd/HISPd.csproj index 5e84bfc..3b356ec 100755 --- a/HorseIsleServer/HISPd/HISPd.csproj +++ b/HorseIsleServer/HISPd/HISPd.csproj @@ -158,112 +158,12 @@ - - ARM + False - DEBUG;TRACE;OS_DEBUG;ARCH_ARM - none + DEBUG;TRACE;OS_DEBUG + full - - ARM64 - False - DEBUG;TRACE;OS_DEBUG;ARCH_ARM64 - none - - - - - False - DEBUG;TRACE;OS_DEBUG;ARCH_X86_64 - none - - - - - False - DEBUG;TRACE;OS_DEBUG;ARCH_X86 - none - - - - - True - OS_MACOS;ARCH_X86 - none - - - - - True - OS_LINUX;ARCH_X86 - none - - - - - False - OS_LINUX;ARCH_ANYCPU - none - - - - - False - OS_WINDOWS;ARCH_ANYCPU - none - - - - - False - OS_MACOS;ARCH_ANYCPU - none - - - - - True - OS_MACOS;ARCH_ARM - none - - - - - 3 - none - - - - - none - - - - - none - - - - - none - - - - - none - - - - - none - - - - - none - - diff --git a/HorseIsleServer/HISPd/Program.cs b/HorseIsleServer/HISPd/Program.cs index 88d3a4e..7b05f43 100755 --- a/HorseIsleServer/HISPd/Program.cs +++ b/HorseIsleServer/HISPd/Program.cs @@ -79,6 +79,7 @@ namespace HISP.Cli string BaseDir = Directory.GetCurrentDirectory(); Logger.SetCallback(LogStdout); + Entry.SetShutdownCallback(OnShutdown); string HispConfVar = Environment.GetEnvironmentVariable("HISP_CONF_FILE"); string HispLogVar = Environment.GetEnvironmentVariable("HISP_LOG_FILE"); @@ -145,7 +146,6 @@ namespace HISP.Cli Directory.SetCurrentDirectory(BaseDir); } - Entry.SetShutdownCallback(OnShutdown); Entry.Start(); shutdownHandle = new EventWaitHandle(false, EventResetMode.ManualReset); diff --git a/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs b/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs index fe2f6ee..aa433bd 100755 --- a/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs +++ b/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.8.23.0")] -[assembly: AssemblyFileVersion("1.8.23.0")] +[assembly: AssemblyVersion("1.8.30.0")] +[assembly: AssemblyFileVersion("1.8.30.0")] diff --git a/HorseIsleServer/HISPd/Resources/DEBIAN/control b/HorseIsleServer/HISPd/Resources/DEBIAN/control index 0884fd4..388bc17 100755 --- a/HorseIsleServer/HISPd/Resources/DEBIAN/control +++ b/HorseIsleServer/HISPd/Resources/DEBIAN/control @@ -1,5 +1,5 @@ Package: hisp -Version: 1.8.23 +Version: 1.8.30 Depends: coreutils,systemd,mariadb-server,libsqlite3-dev,zlib1g-dev,libicu-dev,libkrb5-dev Maintainer: Li Homepage: https://islehorse.com diff --git a/HorseIsleServer/HISPtests/HISPtests.csproj b/HorseIsleServer/HISPtests/HISPtests.csproj new file mode 100644 index 0000000..d4d9e5a --- /dev/null +++ b/HorseIsleServer/HISPtests/HISPtests.csproj @@ -0,0 +1,169 @@ + + + Exe + HISP.Tests + 10.0 + x64;x86;ARM;ARM64;AnyCPU + Debug;Windows;Linux;MacOS;Android;iOS + + + + + + + Resources.resx + True + True + + + + + Resources.Designer.cs + PublicResXFileCodeGenerator + + + + false + false + + + net7.0 + false + true + icon.ico + HISP.Tests.Program + OnBuildSuccess + embedded + False + none + False + Public Domain, 2022 + https://islehorse.com + https://github.com/islehorse/HISP + git + 3 + 1701;1702;2026;IL2026 + + + + partial + false + true + + + + win-x86 + true + x86 + x86 + OS_WINDOWS;ARCH_X86 + none + + + win-x64 + true + x64 + x64 + OS_WINDOWS;ARCH_X86_64 + none + + + win-arm + true + ARM + OS_WINDOWS;ARCH_ARM + none + + + win-arm64 + true + ARM64 + OS_WINDOWS;ARCH_ARM64 + none + + + + + android-arm + true + ARM + OS_ANDROID;ARCH_ARM + 3 + + none + + + android-arm64 + true + ARM64 + OS_ANDROID;ARCH_ARM64 + none + + + + linux-x64 + true + x64 + OS_LINUX;ARCH_X86_64 + none + + + linux-arm + ARM + true + OS_LINUX;ARCH_ARM + none + + + linux-arm64 + ARM64 + true + OS_LINUX;ARCH_ARM64 + none + + + + osx-x64 + true + x64 + OS_MACOS;ARCH_X86_64 + none + + + osx-arm64 + true + OS_MACOS;ARCH_ARM64 + none + + + + ios-arm + true + ARM + OS_IOS;ARCH_ARM + none + + + ios-arm64 + true + ARM64 + OS_IOS;ARCH_ARM64 + none + + + + win-x86;win-x64;win-arm;win-arm64;linux-x64;linux-arm;linux-arm64;osx-x64;osx-arm64 + True + OS_ALL;ARCH_ANYCPU + + + + + False + DEBUG;TRACE;OS_DEBUG + full + + + + + diff --git a/HorseIsleServer/HISPtests/Program.cs b/HorseIsleServer/HISPtests/Program.cs new file mode 100644 index 0000000..8a11d3d --- /dev/null +++ b/HorseIsleServer/HISPtests/Program.cs @@ -0,0 +1,20 @@ +using HISP.Server; +using HISP.Tests.UnitTests; +using System; +using System.Threading.Tasks; + +namespace HISP.Tests +{ + public static class Program + { + + public static async Task Main(string[] args) + { + ServerStartTest.RunServerStartTest(); + AuthenticationTest.RunAuthenticationTest(); + await UserTest.RunUserTest(); + PacketTest.RunPacketTest(); + } + } + +} \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/AssemblyInfo.cs b/HorseIsleServer/HISPtests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..aa433bd --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HISPd")] +[assembly: AssemblyDescription("Server Emulator for \"Horse Isle\"")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Li")] +[assembly: AssemblyProduct("HISP")] +[assembly: AssemblyCopyright("Public Domain � 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("57264c6b-1461-41d6-9304-3890cf6c8390")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.8.30.0")] +[assembly: AssemblyFileVersion("1.8.30.0")] diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/AndroidARM.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/AndroidARM.pubxml new file mode 100644 index 0000000..e1eff10 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/AndroidARM.pubxml @@ -0,0 +1,20 @@ + + + + + Android + ARM + bin\arm\Android\net7.0\android-arm\publish\ + FileSystem + net7.0 + android-arm + True + True + True + True + True + OS_ANDROID;ARCH_ARM + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/AndroidARM64.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/AndroidARM64.pubxml new file mode 100644 index 0000000..59f44f0 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/AndroidARM64.pubxml @@ -0,0 +1,20 @@ + + + + + Android + ARM64 + bin\arm64\Android\net7.0\android-arm64\publish\ + FileSystem + net7.0 + android-arm64 + True + True + True + True + True + OS_ANDROID;ARCH_ARM64 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/Linux64.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/Linux64.pubxml new file mode 100644 index 0000000..c5f1582 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/Linux64.pubxml @@ -0,0 +1,19 @@ + + + + + Linux + x64 + bin\x64\Linux\net7.0\linux-x64\publish\ + FileSystem + net7.0 + linux-x64 + True + True + True + True + OS_LINUX;ARCH_X86_64 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/LinuxARM.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/LinuxARM.pubxml new file mode 100644 index 0000000..06bcf27 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/LinuxARM.pubxml @@ -0,0 +1,19 @@ + + + + + Linux + ARM + bin\ARM\Linux\net7.0\linux-arm\publish\ + FileSystem + net7.0 + linux-arm + True + True + True + True + OS_LINUX;ARCH_ARM + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/LinuxARM64.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/LinuxARM64.pubxml new file mode 100644 index 0000000..b4cdb5b --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/LinuxARM64.pubxml @@ -0,0 +1,19 @@ + + + + + Linux + ARM64 + bin\ARM64\Linux\net7.0\linux-arm64\publish\ + FileSystem + net7.0 + linux-arm64 + True + True + True + True + OS_LINUX;ARCH_ARM64 + + diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/Osx64.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/Osx64.pubxml new file mode 100644 index 0000000..ced4af4 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/Osx64.pubxml @@ -0,0 +1,19 @@ + + + + + MacOS + x64 + bin\x64\MacOS\net7.0\osx-x64\publish\ + FileSystem + net7.0 + osx-x64 + True + True + True + True + OS_MACOS;ARCH_X86_64 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/OsxARM64.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/OsxARM64.pubxml new file mode 100644 index 0000000..cc18457 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/OsxARM64.pubxml @@ -0,0 +1,19 @@ + + + + + MacOS + ARM64 + bin\arm64\MacOS\net7.0\osx-arm64\publish\ + FileSystem + net7.0 + osx-arm64 + True + True + True + True + OS_MACOS;ARCH_ARM64 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/Win32.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/Win32.pubxml new file mode 100644 index 0000000..2763365 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/Win32.pubxml @@ -0,0 +1,19 @@ + + + + + Windows + x86 + bin\x86\Windows\net7.0\win-x86\publish\ + FileSystem + net7.0 + win-x86 + True + True + True + True + OS_WINDOWS;ARCH_X86 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/Win64.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/Win64.pubxml new file mode 100644 index 0000000..4d554ad --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/Win64.pubxml @@ -0,0 +1,19 @@ + + + + + Windows + x64 + bin\x64\Windows\net7.0\win-x64\publish\ + FileSystem + net7.0 + win-x64 + True + True + True + True + OS_WINDOWS;ARCH_X86_64 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/WinARM.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/WinARM.pubxml new file mode 100644 index 0000000..a64c8c0 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/WinARM.pubxml @@ -0,0 +1,19 @@ + + + + + Windows + ARM + bin\arm\Windows\net7.0\win-arm\publish\ + FileSystem + net7.0 + win-arm + True + True + True + True + OS_WINDOWS;ARCH_ARM + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/WinARM64.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/WinARM64.pubxml new file mode 100644 index 0000000..0ce204c --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/WinARM64.pubxml @@ -0,0 +1,19 @@ + + + + + Windows + ARM64 + bin\arm64\Windows\net7.0\win-arm64\publish\ + FileSystem + net7.0 + win-arm64 + True + True + True + True + OS_WINDOWS;ARCH_ARM64 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/iOSARM.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/iOSARM.pubxml new file mode 100644 index 0000000..3312d3f --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/iOSARM.pubxml @@ -0,0 +1,19 @@ + + + + + iOS + ARM + bin\arm\iOS\net7.0\ios-arm\publish\ + FileSystem + net7.0 + ios-arm + True + False + False + True + OS_IOS;ARCH_ARM + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/PublishProfiles/iOSARM64.pubxml b/HorseIsleServer/HISPtests/Properties/PublishProfiles/iOSARM64.pubxml new file mode 100644 index 0000000..14fe938 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/PublishProfiles/iOSARM64.pubxml @@ -0,0 +1,19 @@ + + + + + iOS + ARM64 + bin\arm64\iOS\net7.0\ios-arm64\publish\ + FileSystem + net7.0 + ios-arm64 + True + False + False + True + OS_IOS;ARCH_ARM64 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/Resources.Designer.cs b/HorseIsleServer/HISPtests/Properties/Resources.Designer.cs new file mode 100644 index 0000000..c28d931 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/Resources.Designer.cs @@ -0,0 +1,74 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HISP.Tests.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HISP.Tests.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to { + /// "2PlayerClose": "UFgA", + /// "BirdMap_OutsideMapTop": "dgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ [rest of string was truncated]";. + /// + public static string PacketTestDataSet { + get { + return ResourceManager.GetString("PacketTestDataSet", resourceCulture); + } + } + } +} diff --git a/HorseIsleServer/HISPtests/Properties/Resources.resx b/HorseIsleServer/HISPtests/Properties/Resources.resx new file mode 100644 index 0000000..6e82436 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\PacketTestDataSet.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Properties/launchSettings.json b/HorseIsleServer/HISPtests/Properties/launchSettings.json new file mode 100644 index 0000000..6cef0b0 --- /dev/null +++ b/HorseIsleServer/HISPtests/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "HISPtests": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/Resources/PacketTestDataSet.json b/HorseIsleServer/HISPtests/Resources/PacketTestDataSet.json new file mode 100644 index 0000000..54e5ee4 --- /dev/null +++ b/HorseIsleServer/HISPtests/Resources/PacketTestDataSet.json @@ -0,0 +1,256 @@ +{ + "2PlayerClose": "UFgA", + "BirdMap_OutsideMapTop": "dgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE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BfDYyfEFEVkVOVFVSRXwzMzZ8MTU3fF5BfDYzfE1ZfDE3MXw1N3xeQXw2NHxZT1V8NzJ8MTU3fF5BfDY1fE9VUnwyNzB8MjA3fF5BfDY2fElTfDE4OHwyMjh8XkF8Njd8VEhFfDEwNXwxNjJ8XkF8Njh8R1JFQVRFU1R8NXwxOTV8XkF8Njl8TE9WRXwxODR8MTk1fF5BfDcwfFdPTkRFUkZVTHw5NXwxNTl8XkF8NzF8VkVSWXwyMTF8NzF8XkF8NzJ8SVN8MjY3fDE0NHxeQXw3M3xIRXwxNzd8ODN8XkF8NzR8U0hFfDI2NHwxMDl8XkF8NzV8QkVZT05EfDE0NXw1OXxeQXw3NnxBR0FJTlNUfDMxMXw2M3xeQXw3N3xCRXw1NXwyNDZ8XkF8Nzh8SU5UT3wzNDJ8Mjl8XkF8Nzl8QU5EfDMzM3wyMTR8XkF8ODB8QUxTT3wyOTN8MjIyfF5BfDgxfEJFQ0FVU0V8MzIwfDIzNnxeQXw4MnxGT1JFVkVSfDI4NXwxOTF8XkF8ODN8QUxXQVlTfDI3MHwxOTh8XkF8Mjg1fFRPfDQ0fDQwfF5BfDI4NnxCRXwxNzR8MjcyfF5BfDI4N3xJTlRPfDE3fDE4fF5BfDI4OHxUSFJPVUdIfDI4fDIzNnxeQXwyODl8QVJPVU5EfDMyNnw1fF5BfDQ1NXxTSUxWRVJ8MzV8MTkyfF4A", + "BrickPoetMove": "UFV8MzB8MTg3fDEzN3xeAA==", + "ChatBottomLeft": "FBRUcmFucyBSaWdodHMA", + "ChatBottomRight": "FBVBcmUgSHVtYW4A", + "ChatDmRight": "FBZSaWdodHMA", + "ChatMotd": "fkVuYmllcyBhcmUgdmFsaWQhAA==", + "DrawingRoomUpdate": "UEM5NTl8NjReNjd8NjZeNzN8NjheNzl8NjleODcA", + "DressupRoomPeiceLoad": "UAA=", + "DressupRoomPeiceMove": "UDExfDE0LjR8Mi40fF4A", + "ForwardedSwfModule_516152": "UFFhUgA=", + "ForwardedSwfModule_AF8D91C8": "UK+NkcgA", + "KeepAlive": "fAA=", + "KickMessage": "gFRyYW5zcGhvYmlhAA==", + "LoginSuccess": "fxQA", + "LoginFail": "fxUA", + "LoginFail_ReasonBanned": "fxZZb3UgYXJlIGJhbm5lZC4A", + "CreateMeta": "Hl5SMVRyYW5zIFJpZ2h0c15YXloA", + "MoneyPlayerCountAndMail": "ezEwMHwxfDQwfAA=", + "Movement_DirectionUpMoveUpInsideMapWalk": "FRU0FhYUFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveDownInsideMapWalk": "FRVLFj0UFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveLeftInsideMapWalk": "FRciFi8UFCIrFa8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionUpMoveRightInsideMapWalk": "FRRDFEgUFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveUpdateInsideMapWalk": "FRUqFikUFBUeFQA=", + "Movement_DirectionUpMoveEscapeInsideMapWalk": "FRUnFD4UFBssFQEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionDownMoveUpInsideMapWalk": "FRU0FhYWFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveDownInsideMapWalk": "FRVLFj0WFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveLeftInsideMapWalk": "FRciFi8WFCIrFa8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionDownMoveRightInsideMapWalk": "FRRDFEgWFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveUpdateInsideMapWalk": "FRUqFikWFBUeFQA=", + "Movement_DirectionDownMoveEscapeInsideMapWalk": "FRUnFD4WFBssFQEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionLeftMoveUpInsideMapWalk": "FRU0FhYXFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveDownInsideMapWalk": "FRVLFj0XFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveLeftInsideMapWalk": "FRciFi8XFCIrFa8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionLeftMoveRightInsideMapWalk": "FRRDFEgXFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveUpdateInsideMapWalk": "FRUqFikXFBUeFQA=", + "Movement_DirectionLeftMoveEscapeInsideMapWalk": "FRUnFD4XFBssFQEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionRightMoveUpInsideMapWalk": "FRU0FhYVFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveDownInsideMapWalk": "FRVLFj0VFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveLeftInsideMapWalk": "FRciFi8VFCIrFa8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionRightMoveRightInsideMapWalk": "FRRDFEgVFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveUpdateInsideMapWalk": "FRUqFikVFBUeFQA=", + "Movement_DirectionRightMoveEscapeInsideMapWalk": "FRUnFD4VFBssFQEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionTeleportMoveUpInsideMapWalk": "FRU0FhYYFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveDownInsideMapWalk": "FRVLFj0YFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveLeftInsideMapWalk": "FRciFi8YFCIrFa8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionTeleportMoveRightInsideMapWalk": "FRRDFEgYFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveUpdateInsideMapWalk": "FRUqFikYFBUeFQA=", + "Movement_DirectionTeleportMoveEscapeInsideMapWalk": "FRUnFD4YFBssFQEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionNoneMoveUpInsideMapWalk": "FRU0FhYeFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveDownInsideMapWalk": "FRVLFj0eFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveLeftInsideMapWalk": "FRciFi8eFCIrFa8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionNoneMoveRightInsideMapWalk": "FRRDFEgeFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveUpdateInsideMapWalk": "FRUqFikeFBUeFQA=", + "Movement_DirectionNoneMoveEscapeInsideMapWalk": "FRUnFD4eFBssFQEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionUpMoveUpInsideMap": "FRU0FhYUFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveDownInsideMap": "FRVLFj0UFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveLeftInsideMap": "FRciFi8UFCIrFK8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionUpMoveRightInsideMap": "FRRDFEgUFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveUpdateInsideMap": "FRUqFikUFBUeFAA=", + "Movement_DirectionUpMoveEscapeInsideMap": "FRUnFD4UFBssFAEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionDownMoveUpInsideMap": "FRU0FhYWFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveDownInsideMap": "FRVLFj0WFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveLeftInsideMap": "FRciFi8WFCIrFK8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionDownMoveRightInsideMap": "FRRDFEgWFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveUpdateInsideMap": "FRUqFikWFBUeFAA=", + "Movement_DirectionDownMoveEscapeInsideMap": "FRUnFD4WFBssFAEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionLeftMoveUpInsideMap": "FRU0FhYXFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveDownInsideMap": "FRVLFj0XFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveLeftInsideMap": "FRciFi8XFCIrFK8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionLeftMoveRightInsideMap": "FRRDFEgXFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveUpdateInsideMap": "FRUqFikXFBUeFAA=", + "Movement_DirectionLeftMoveEscapeInsideMap": "FRUnFD4XFBssFAEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionRightMoveUpInsideMap": "FRU0FhYVFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveDownInsideMap": "FRVLFj0VFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveLeftInsideMap": "FRciFi8VFCIrFK8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionRightMoveRightInsideMap": "FRRDFEgVFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveUpdateInsideMap": "FRUqFikVFBUeFAA=", + "Movement_DirectionRightMoveEscapeInsideMap": "FRUnFD4VFBssFAEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionTeleportMoveUpInsideMap": "FRU0FhYYFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveDownInsideMap": "FRVLFj0YFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveLeftInsideMap": "FRciFi8YFCIrFK8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionTeleportMoveRightInsideMap": "FRRDFEgYFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveUpdateInsideMap": "FRUqFikYFBUeFAA=", + "Movement_DirectionTeleportMoveEscapeInsideMap": "FRUnFD4YFBssFAEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionNoneMoveUpInsideMap": "FRU0FhYeFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveDownInsideMap": "FRVLFj0eFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveLeftInsideMap": "FRciFi8eFCIrFK8tpwGrAUABPgE/AT4BQAE/AUABsb5zr75fpwGjAaMBowGjAaMBowGjAQA=", + "Movement_DirectionNoneMoveRightInsideMap": "FRRDFEgeFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveUpdateInsideMap": "FRUqFikeFBUeFAA=", + "Movement_DirectionNoneMoveEscapeInsideMap": "FRUnFD4eFBssFAEBAQEBAQEBAQEBAQwBCAEOARABFQEgAR8BAQEBAQEBAQEBAQEBAQEMAQgBDwEVAR4BIQEBAQEBAQEBAQEBAQEBAQEBBQERARwBGAEhAQEBAQEBAQEBAQEBAQEBAQEMAQgBEQEcARgBAQEBAQEBAQEBAQEBAQEBAQEBDAEIARABHAEBAQEBAQEBAQEBAQEBAQEBAQEBAQwBCAERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEMAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionUpMoveUpOutsideMapTopWalk": "FRPsEhAUFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveDownOutsideMapTopWalk": "FRPVEukUFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveLeftOutsideMapTopWalk": "FRH+EvcUFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveRightOutsideMapTopWalk": "FRTdFN4UFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveUpdateOutsideMapTopWalk": "FRP2Ev0UFBUeFQA=", + "Movement_DirectionUpMoveEscapeOutsideMapTopWalk": "FRP5FOgUFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionDownMoveUpOutsideMapTopWalk": "FRPsEhAWFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveDownOutsideMapTopWalk": "FRPVEukWFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveLeftOutsideMapTopWalk": "FRH+EvcWFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveRightOutsideMapTopWalk": "FRTdFN4WFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveUpdateOutsideMapTopWalk": "FRP2Ev0WFBUeFQA=", + "Movement_DirectionDownMoveEscapeOutsideMapTopWalk": "FRP5FOgWFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionLeftMoveUpOutsideMapTopWalk": "FRPsEhAXFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveDownOutsideMapTopWalk": "FRPVEukXFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveLeftOutsideMapTopWalk": "FRH+EvcXFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveRightOutsideMapTopWalk": "FRTdFN4XFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveUpdateOutsideMapTopWalk": "FRP2Ev0XFBUeFQA=", + "Movement_DirectionLeftMoveEscapeOutsideMapTopWalk": "FRP5FOgXFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionRightMoveUpOutsideMapTopWalk": "FRPsEhAVFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveDownOutsideMapTopWalk": "FRPVEukVFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveLeftOutsideMapTopWalk": "FRH+EvcVFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveRightOutsideMapTopWalk": "FRTdFN4VFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveUpdateOutsideMapTopWalk": "FRP2Ev0VFBUeFQA=", + "Movement_DirectionRightMoveEscapeOutsideMapTopWalk": "FRP5FOgVFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionTeleportMoveUpOutsideMapTopWalk": "FRPsEhAYFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveDownOutsideMapTopWalk": "FRPVEukYFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveLeftOutsideMapTopWalk": "FRH+EvcYFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveRightOutsideMapTopWalk": "FRTdFN4YFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveUpdateOutsideMapTopWalk": "FRP2Ev0YFBUeFQA=", + "Movement_DirectionTeleportMoveEscapeOutsideMapTopWalk": "FRP5FOgYFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionNoneMoveUpOutsideMapTopWalk": "FRPsEhAeFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveDownOutsideMapTopWalk": "FRPVEukeFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveLeftOutsideMapTopWalk": "FRH+EvceFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveRightOutsideMapTopWalk": "FRTdFN4eFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveUpdateOutsideMapTopWalk": "FRP2Ev0eFBUeFQA=", + "Movement_DirectionNoneMoveEscapeOutsideMapTopWalk": "FRP5FOgeFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionUpMoveUpOutsideMapTop": "FRPsEhAUFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveDownOutsideMapTop": "FRPVEukUFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveLeftOutsideMapTop": "FRH+EvcUFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveRightOutsideMapTop": "FRTdFN4UFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveUpdateOutsideMapTop": "FRP2Ev0UFBUeFAA=", + "Movement_DirectionUpMoveEscapeOutsideMapTop": "FRP5FOgUFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionDownMoveUpOutsideMapTop": "FRPsEhAWFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveDownOutsideMapTop": "FRPVEukWFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveLeftOutsideMapTop": "FRH+EvcWFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveRightOutsideMapTop": "FRTdFN4WFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveUpdateOutsideMapTop": "FRP2Ev0WFBUeFAA=", + "Movement_DirectionDownMoveEscapeOutsideMapTop": "FRP5FOgWFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionLeftMoveUpOutsideMapTop": "FRPsEhAXFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveDownOutsideMapTop": "FRPVEukXFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveLeftOutsideMapTop": "FRH+EvcXFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveRightOutsideMapTop": "FRTdFN4XFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveUpdateOutsideMapTop": "FRP2Ev0XFBUeFAA=", + "Movement_DirectionLeftMoveEscapeOutsideMapTop": "FRP5FOgXFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionRightMoveUpOutsideMapTop": "FRPsEhAVFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveDownOutsideMapTop": "FRPVEukVFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveLeftOutsideMapTop": "FRH+EvcVFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveRightOutsideMapTop": "FRTdFN4VFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveUpdateOutsideMapTop": "FRP2Ev0VFBUeFAA=", + "Movement_DirectionRightMoveEscapeOutsideMapTop": "FRP5FOgVFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionTeleportMoveUpOutsideMapTop": "FRPsEhAYFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveDownOutsideMapTop": "FRPVEukYFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveLeftOutsideMapTop": "FRH+EvcYFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveRightOutsideMapTop": "FRTdFN4YFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveUpdateOutsideMapTop": "FRP2Ev0YFBUeFAA=", + "Movement_DirectionTeleportMoveEscapeOutsideMapTop": "FRP5FOgYFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionNoneMoveUpOutsideMapTop": "FRPsEhAeFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveDownOutsideMapTop": "FRPVEukeFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveLeftOutsideMapTop": "FRH+EvceFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveRightOutsideMapTop": "FRTdFN4eFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveUpdateOutsideMapTop": "FRP2Ev0eFBUeFAA=", + "Movement_DirectionNoneMoveEscapeOutsideMapTop": "FRP5FOgeFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionUpMoveUpOutsideMapBottomWalk": "FSUcHUoUFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveDownOutsideMapBottomWalk": "FSUzHjEUFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveLeftOutsideMapBottomWalk": "FSZKHiMUFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveRightOutsideMapBottomWalk": "FSQrHDwUFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveUpdateOutsideMapBottomWalk": "FSRSHh0UFBUeFQA=", + "Movement_DirectionUpMoveEscapeOutsideMapBottomWalk": "FSRPHDIUFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionDownMoveUpOutsideMapBottomWalk": "FSUcHUoWFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveDownOutsideMapBottomWalk": "FSUzHjEWFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveLeftOutsideMapBottomWalk": "FSZKHiMWFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveRightOutsideMapBottomWalk": "FSQrHDwWFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveUpdateOutsideMapBottomWalk": "FSRSHh0WFBUeFQA=", + "Movement_DirectionDownMoveEscapeOutsideMapBottomWalk": "FSRPHDIWFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionLeftMoveUpOutsideMapBottomWalk": "FSUcHUoXFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveDownOutsideMapBottomWalk": "FSUzHjEXFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveLeftOutsideMapBottomWalk": "FSZKHiMXFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveRightOutsideMapBottomWalk": "FSQrHDwXFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveUpdateOutsideMapBottomWalk": "FSRSHh0XFBUeFQA=", + "Movement_DirectionLeftMoveEscapeOutsideMapBottomWalk": "FSRPHDIXFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionRightMoveUpOutsideMapBottomWalk": "FSUcHUoVFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveDownOutsideMapBottomWalk": "FSUzHjEVFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveLeftOutsideMapBottomWalk": "FSZKHiMVFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveRightOutsideMapBottomWalk": "FSQrHDwVFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveUpdateOutsideMapBottomWalk": "FSRSHh0VFBUeFQA=", + "Movement_DirectionRightMoveEscapeOutsideMapBottomWalk": "FSRPHDIVFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionTeleportMoveUpOutsideMapBottomWalk": "FSUcHUoYFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveDownOutsideMapBottomWalk": "FSUzHjEYFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveLeftOutsideMapBottomWalk": "FSZKHiMYFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveRightOutsideMapBottomWalk": "FSQrHDwYFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveUpdateOutsideMapBottomWalk": "FSRSHh0YFBUeFQA=", + "Movement_DirectionTeleportMoveEscapeOutsideMapBottomWalk": "FSRPHDIYFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionNoneMoveUpOutsideMapBottomWalk": "FSUcHUoeFB4oFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveDownOutsideMapBottomWalk": "FSUzHjEeFCApFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveLeftOutsideMapBottomWalk": "FSZKHiMeFCIrFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveRightOutsideMapBottomWalk": "FSQrHDweFCQqFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveUpdateOutsideMapBottomWalk": "FSRSHh0eFBUeFQA=", + "Movement_DirectionNoneMoveEscapeOutsideMapBottomWalk": "FSRPHDIeFBssFQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionUpMoveUpOutsideMapBottom": "FSUcHUoUFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveDownOutsideMapBottom": "FSUzHjEUFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveLeftOutsideMapBottom": "FSZKHiMUFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveRightOutsideMapBottom": "FSQrHDwUFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionUpMoveUpdateOutsideMapBottom": "FSRSHh0UFBUeFAA=", + "Movement_DirectionUpMoveEscapeOutsideMapBottom": "FSRPHDIUFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionDownMoveUpOutsideMapBottom": "FSUcHUoWFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveDownOutsideMapBottom": "FSUzHjEWFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveLeftOutsideMapBottom": "FSZKHiMWFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveRightOutsideMapBottom": "FSQrHDwWFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionDownMoveUpdateOutsideMapBottom": "FSRSHh0WFBUeFAA=", + "Movement_DirectionDownMoveEscapeOutsideMapBottom": "FSRPHDIWFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionLeftMoveUpOutsideMapBottom": "FSUcHUoXFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveDownOutsideMapBottom": "FSUzHjEXFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveLeftOutsideMapBottom": "FSZKHiMXFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveRightOutsideMapBottom": "FSQrHDwXFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionLeftMoveUpdateOutsideMapBottom": "FSRSHh0XFBUeFAA=", + "Movement_DirectionLeftMoveEscapeOutsideMapBottom": "FSRPHDIXFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionRightMoveUpOutsideMapBottom": "FSUcHUoVFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveDownOutsideMapBottom": "FSUzHjEVFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveLeftOutsideMapBottom": "FSZKHiMVFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveRightOutsideMapBottom": "FSQrHDwVFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionRightMoveUpdateOutsideMapBottom": "FSRSHh0VFBUeFAA=", + "Movement_DirectionRightMoveEscapeOutsideMapBottom": "FSRPHDIVFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionTeleportMoveUpOutsideMapBottom": "FSUcHUoYFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveDownOutsideMapBottom": "FSUzHjEYFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveLeftOutsideMapBottom": "FSZKHiMYFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveRightOutsideMapBottom": "FSQrHDwYFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionTeleportMoveUpdateOutsideMapBottom": "FSRSHh0YFBUeFAA=", + "Movement_DirectionTeleportMoveEscapeOutsideMapBottom": "FSRPHDIYFBssFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAA==", + "Movement_DirectionNoneMoveUpOutsideMapBottom": "FSUcHUoeFB4oFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveDownOutsideMapBottom": "FSUzHjEeFCApFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveLeftOutsideMapBottom": "FSZKHiMeFCIrFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMoveRightOutsideMapBottom": "FSQrHDweFCQqFAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEA", + "Movement_DirectionNoneMo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EbLTZUaGUgQ2xvdWQgSXNsZXNeSRopHTQWLhlGMEhvcnNlIElzbGVeSRU8GRsUShgdNUp1bmdsZSBJc2xlAA==", + "PlayerInfoUpdateOrCreate": "FhUVNBcbFBQeTGkA", + "PlayerLeave": "FhZMaQA=", + "PlaySound": "I1BNAA==", + "ProfilePage": "GFRSQU5TIFJJR0hUUyBBUkUgSFVNQU4gUklHSFRTAA==", + "SecCode_AdminMod": "gVJzQ1VBAA==", + "SecCode_Admin": "gXVTRVVBAA==", + "SecCode_Mod": "gUMzM1VNAA==", + "SecCode_User": "gTNTNVVOAA==", + "SwfModule_Force": "KHRlc3Quc3dmAA==", + "SwfModule_Gentle": "KnRlc3Quc3dmAA==", + "SwfModule_Cutscene": "KXRlc3Quc3dmAA==", + "TileClickInfo": "d1RyYW5zIFJpZ2h0cyBBcmUgSHVtYW4gUmlnaHRzAA==", + "TileOverlayFlags": "dTEyMzEyMzEyMwA=", + "TimeAndWeatherUpdate": "ehQeFBgcMVNVTk4A", + "WeatherUpdate": "ehNDTE9VRAA=" +} \ No newline at end of file diff --git a/HorseIsleServer/HISPtests/ResultLogger.cs b/HorseIsleServer/HISPtests/ResultLogger.cs new file mode 100644 index 0000000..3dc1f1b --- /dev/null +++ b/HorseIsleServer/HISPtests/ResultLogger.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HISP.Tests +{ + public class ResultLogger + { + public static void LogTestStatus(bool successful, string testname, string message) + { + if (successful) + { + Console.ForegroundColor = ConsoleColor.Cyan; + Console.Out.Write("[ " + testname + " ] "); + + Console.ForegroundColor = ConsoleColor.Green; + Console.Out.WriteLine("* " + message + " *"); + } + else + { + Console.ForegroundColor = ConsoleColor.Cyan; + Console.Error.Write("[ " + testname + " ] "); + + Console.ForegroundColor = ConsoleColor.Red; + Console.Error.WriteLine("* " + message + " *"); + } + } + + public static void LogTestResult(bool successful, string testname, string message, string expected) + { + if (successful) + { + Console.ForegroundColor = ConsoleColor.Cyan; + Console.Out.Write("[ " + testname + " ] "); + + Console.ForegroundColor = ConsoleColor.Green; + Console.Out.WriteLine("* " + message + " == " + expected + " *"); + } + else + { + Console.ForegroundColor = ConsoleColor.Cyan; + Console.Error.Write("[ " + testname + " ] "); + + Console.ForegroundColor = ConsoleColor.Red; + Console.Error.WriteLine("* " + message + " != " + expected + " *"); + } + } + } +} diff --git a/HorseIsleServer/HISPtests/UnitTests/AuthenticationTest.cs b/HorseIsleServer/HISPtests/UnitTests/AuthenticationTest.cs new file mode 100644 index 0000000..9bbd4bc --- /dev/null +++ b/HorseIsleServer/HISPtests/UnitTests/AuthenticationTest.cs @@ -0,0 +1,59 @@ +using HISP.Security; +using HISP.Util; +using System.Collections.Generic; + +namespace HISP.Tests.UnitTests +{ + public class AuthenticationTest + { + + private const string ALLOWED_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"; + public static bool Test(string testName, object value, object valueComp) + { + bool result = value.Equals(valueComp); + if (result) + ResultLogger.LogTestStatus(true, "AUTH_TEST " + testName, "Success."); + else + ResultLogger.LogTestResult(false, "AUTH_TEST " + testName, value.ToString(), valueComp.ToString()); + + return result; + } + + public static bool RunAuthenticationTest() + { + List results = new List(); + + // Test Login Encrypt/Decrypt + for(int i = 0; i <= 100; i++) + { + string rngStr = Helper.RandomString(ALLOWED_CHARS); + string cipherText = Authentication.EncryptLogin(rngStr); + string plainText = Authentication.DecryptLogin(cipherText); + + results.Add(Test("LoginEncryptDecrypt" + i.ToString(), plainText, rngStr)); + + } + + + string username = Helper.RandomString(ALLOWED_CHARS); + string password = Helper.RandomString(ALLOWED_CHARS); + + string wrongPassword = Helper.RandomString(ALLOWED_CHARS); + string wrongUsername = Helper.RandomString(ALLOWED_CHARS); + + Authentication.CreateAccount(username, password, "DEMIGIRL", true, true); + + // Test Login function + results.Add(Test("CorrectUsernameAndPassword", Authentication.CheckPassword(username, password), true)); + results.Add(Test("CorrectUsernameWrongPassword", Authentication.CheckPassword(username, wrongPassword), false)); + results.Add(Test("WrongPasswordAndUsername", Authentication.CheckPassword(wrongUsername, wrongPassword), false)); + results.Add(Test("WrongUsernameCorrectPassword", Authentication.CheckPassword(wrongUsername, password), false)); + + + foreach (bool result in results) + if (!result) + return false; + return true; + } + } +} diff --git a/HorseIsleServer/HISPtests/UnitTests/PacketTest.cs b/HorseIsleServer/HISPtests/UnitTests/PacketTest.cs new file mode 100644 index 0000000..d022de8 --- /dev/null +++ b/HorseIsleServer/HISPtests/UnitTests/PacketTest.cs @@ -0,0 +1,418 @@ +using HISP.Tests.Properties; +using HISP.Game.SwfModules; +using HISP.Game; +using HISP.Server; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.IO; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace HISP.Tests.UnitTests +{ + public class PacketTest + { + private const bool GENERATE = false; + + private static Dictionary knownGoodPackets = new Dictionary(); + + public static bool Test(string name, byte[] packet) + { + + if (GENERATE) + { + knownGoodPackets.Add(name, Convert.ToBase64String(packet)); + } + else + { + string goodPacketStr = null; + knownGoodPackets.TryGetValue(name, out goodPacketStr); + byte[] goodPacket = Convert.FromBase64String(goodPacketStr); + + + if(!goodPacket.SequenceEqual(packet)) + { + ResultLogger.LogTestResult(false, "PACKET_TEST "+name, BitConverter.ToString(packet).Replace("-", ""), goodPacket.ToString().Replace("-", "")); + } + else + { + ResultLogger.LogTestStatus(true, "PACKET_TEST " + name, "Success."); + } + } + return true; + } + + public static bool RunPacketTest() + { + if (!GENERATE) + { + JObject jobj = JsonConvert.DeserializeObject(Resources.PacketTestDataSet) as JObject; + knownGoodPackets = jobj.ToObject>(); + } + + List results = new List(); + + results.Add(Test("2PlayerClose", PacketBuilder.Create2PlayerClose())); + + // Test Map + results.Add(Test("BirdMap_OutsideMapTop", PacketBuilder.CreateBirdMap(-100, -800))); + results.Add(Test("BirdMap_OutsideMapBottom", PacketBuilder.CreateBirdMap(Map.Height+100, Map.Width+600))); + results.Add(Test("BirdMap_InsideMap", PacketBuilder.CreateBirdMap(100, 200))); + + // Test Brickpoet + results.Add(Test("BrickPoetList", PacketBuilder.CreateBrickPoetList(Brickpoet.GetPoetryRoom(1)))); + results.Add(Test("BrickPoetMove", PacketBuilder.CreateBrickPoetMove(Brickpoet.GetPoetryPeice(Brickpoet.GetPoetryRoom(1), 30)))); + + // Test Chat + results.Add(Test("ChatBottomLeft", PacketBuilder.CreateChat("Trans Rights", PacketBuilder.CHAT_BOTTOM_LEFT))); + results.Add(Test("ChatBottomRight", PacketBuilder.CreateChat("Are Human", PacketBuilder.CHAT_BOTTOM_RIGHT))); + results.Add(Test("ChatDmRight", PacketBuilder.CreateChat("Rights", PacketBuilder.CHAT_DM_RIGHT))); + results.Add(Test("ChatMotd", PacketBuilder.CreateMotd("Enbies are valid!"))); + + // Test Drawing Room + results.Add(Test("DrawingRoomUpdate", PacketBuilder.CreateDrawingUpdate("C959|64^67|66^73|68^79|69^87"))); + + // Test Dressup Room + results.Add(Test("DressupRoomPeiceLoad", PacketBuilder.CreateDressupRoomPeiceLoad(Dressup.GetDressupRoom(2).DressupPeices))); + results.Add(Test("DressupRoomPeiceMove", PacketBuilder.CreateDressupRoomPeiceMove(11, 14.4, 2.4, true))); + + // Test SwfModule Forwarding + results.Add(Test("ForwardedSwfModule_516152", PacketBuilder.CreateForwardedSwfModule(new byte[] { 0x51, 0x61, 0x52 }))); + results.Add(Test("ForwardedSwfModule_AF8D91C8", PacketBuilder.CreateForwardedSwfModule(new byte[] { 0xAF, 0x8D, 0x91, 0xC8 }))); + + // Test KeepAlive + results.Add(Test("KeepAlive", PacketBuilder.CreateKeepAlive())); + + // Test KickMessage + results.Add(Test("KickMessage", PacketBuilder.CreateKickMessage("Transphobia"))); + + // Test Login + results.Add(Test("LoginSuccess", PacketBuilder.CreateLogin(true))); + results.Add(Test("LoginFail", PacketBuilder.CreateLogin(false))); + results.Add(Test("LoginFail_ReasonBanned", PacketBuilder.CreateLogin(false, "You are banned."))); + + // Test Meta + results.Add(Test("CreateMeta", PacketBuilder.CreateMeta("^R1Trans Rights^X^Z"))); + + // Test Money, PlayerCount, Mail + results.Add(Test("MoneyPlayerCountAndMail", PacketBuilder.CreateMoneyPlayerCountAndMail(100, 1, 40))); + + // Test Movement + results.Add(Test("Movement_DirectionUpMoveUpInsideMapWalk", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionUpMoveDownInsideMapWalk", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionUpMoveLeftInsideMapWalk", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionUpMoveRightInsideMapWalk", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionUpMoveUpdateInsideMapWalk", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionUpMoveEscapeInsideMapWalk", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionDownMoveUpInsideMapWalk", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionDownMoveDownInsideMapWalk", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionDownMoveLeftInsideMapWalk", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionDownMoveRightInsideMapWalk", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionDownMoveUpdateInsideMapWalk", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionDownMoveEscapeInsideMapWalk", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionLeftMoveUpInsideMapWalk", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionLeftMoveDownInsideMapWalk", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionLeftMoveLeftInsideMapWalk", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionLeftMoveRightInsideMapWalk", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionLeftMoveUpdateInsideMapWalk", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionLeftMoveEscapeInsideMapWalk", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionRightMoveUpInsideMapWalk", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionRightMoveDownInsideMapWalk", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionRightMoveLeftInsideMapWalk", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionRightMoveRightInsideMapWalk", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionRightMoveUpdateInsideMapWalk", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionRightMoveEscapeInsideMapWalk", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionTeleportMoveUpInsideMapWalk", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionTeleportMoveDownInsideMapWalk", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionTeleportMoveLeftInsideMapWalk", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionTeleportMoveRightInsideMapWalk", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionTeleportMoveUpdateInsideMapWalk", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionTeleportMoveEscapeInsideMapWalk", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionNoneMoveUpInsideMapWalk", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionNoneMoveDownInsideMapWalk", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionNoneMoveLeftInsideMapWalk", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionNoneMoveRightInsideMapWalk", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionNoneMoveUpdateInsideMapWalk", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionNoneMoveEscapeInsideMapWalk", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_ESCAPE, true))); + + // walk = false + + results.Add(Test("Movement_DirectionUpMoveUpInsideMap", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionUpMoveDownInsideMap", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionUpMoveLeftInsideMap", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionUpMoveRightInsideMap", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionUpMoveUpdateInsideMap", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionUpMoveEscapeInsideMap", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionDownMoveUpInsideMap", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionDownMoveDownInsideMap", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionDownMoveLeftInsideMap", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionDownMoveRightInsideMap", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionDownMoveUpdateInsideMap", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionDownMoveEscapeInsideMap", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionLeftMoveUpInsideMap", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionLeftMoveDownInsideMap", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionLeftMoveLeftInsideMap", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionLeftMoveRightInsideMap", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionLeftMoveUpdateInsideMap", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionLeftMoveEscapeInsideMap", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionRightMoveUpInsideMap", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionRightMoveDownInsideMap", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionRightMoveLeftInsideMap", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionRightMoveRightInsideMap", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionRightMoveUpdateInsideMap", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionRightMoveEscapeInsideMap", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionTeleportMoveUpInsideMap", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionTeleportMoveDownInsideMap", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionTeleportMoveLeftInsideMap", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionTeleportMoveRightInsideMap", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionTeleportMoveUpdateInsideMap", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionTeleportMoveEscapeInsideMap", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionNoneMoveUpInsideMap", PacketBuilder.CreateMovement(100, 131, 10, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionNoneMoveDownInsideMap", PacketBuilder.CreateMovement(123, 170, 12, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionNoneMoveLeftInsideMap", PacketBuilder.CreateMovement(210, 156, 14, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionNoneMoveRightInsideMap", PacketBuilder.CreateMovement(51, 53, 16, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionNoneMoveUpdateInsideMap", PacketBuilder.CreateMovement(90, 150, 1, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionNoneMoveEscapeInsideMap", PacketBuilder.CreateMovement(87, 43, 7, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_ESCAPE, false))); + + /* + * Test Outside Map (From Top) + */ + + results.Add(Test("Movement_DirectionUpMoveUpOutsideMapTopWalk", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionUpMoveDownOutsideMapTopWalk", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionUpMoveLeftOutsideMapTopWalk", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionUpMoveRightOutsideMapTopWalk", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionUpMoveUpdateOutsideMapTopWalk", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionUpMoveEscapeOutsideMapTopWalk", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionDownMoveUpOutsideMapTopWalk", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionDownMoveDownOutsideMapTopWalk", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionDownMoveLeftOutsideMapTopWalk", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionDownMoveRightOutsideMapTopWalk", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionDownMoveUpdateOutsideMapTopWalk", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionDownMoveEscapeOutsideMapTopWalk", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionLeftMoveUpOutsideMapTopWalk", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionLeftMoveDownOutsideMapTopWalk", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionLeftMoveLeftOutsideMapTopWalk", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionLeftMoveRightOutsideMapTopWalk", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionLeftMoveUpdateOutsideMapTopWalk", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionLeftMoveEscapeOutsideMapTopWalk", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionRightMoveUpOutsideMapTopWalk", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionRightMoveDownOutsideMapTopWalk", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionRightMoveLeftOutsideMapTopWalk", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionRightMoveRightOutsideMapTopWalk", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionRightMoveUpdateOutsideMapTopWalk", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionRightMoveEscapeOutsideMapTopWalk", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionTeleportMoveUpOutsideMapTopWalk", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionTeleportMoveDownOutsideMapTopWalk", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionTeleportMoveLeftOutsideMapTopWalk", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionTeleportMoveRightOutsideMapTopWalk", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionTeleportMoveUpdateOutsideMapTopWalk", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionTeleportMoveEscapeOutsideMapTopWalk", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionNoneMoveUpOutsideMapTopWalk", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionNoneMoveDownOutsideMapTopWalk", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionNoneMoveLeftOutsideMapTopWalk", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionNoneMoveRightOutsideMapTopWalk", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionNoneMoveUpdateOutsideMapTopWalk", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionNoneMoveEscapeOutsideMapTopWalk", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_ESCAPE, true))); + + // walk = false + + results.Add(Test("Movement_DirectionUpMoveUpOutsideMapTop", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionUpMoveDownOutsideMapTop", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionUpMoveLeftOutsideMapTop", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionUpMoveRightOutsideMapTop", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionUpMoveUpdateOutsideMapTop", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionUpMoveEscapeOutsideMapTop", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionDownMoveUpOutsideMapTop", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionDownMoveDownOutsideMapTop", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionDownMoveLeftOutsideMapTop", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionDownMoveRightOutsideMapTop", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionDownMoveUpdateOutsideMapTop", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionDownMoveEscapeOutsideMapTop", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionLeftMoveUpOutsideMapTop", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionLeftMoveDownOutsideMapTop", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionLeftMoveLeftOutsideMapTop", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionLeftMoveRightOutsideMapTop", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionLeftMoveUpdateOutsideMapTop", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionLeftMoveEscapeOutsideMapTop", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionRightMoveUpOutsideMapTop", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionRightMoveDownOutsideMapTop", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionRightMoveLeftOutsideMapTop", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionRightMoveRightOutsideMapTop", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionRightMoveUpdateOutsideMapTop", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionRightMoveEscapeOutsideMapTop", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionTeleportMoveUpOutsideMapTop", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionTeleportMoveDownOutsideMapTop", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionTeleportMoveLeftOutsideMapTop", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionTeleportMoveRightOutsideMapTop", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionTeleportMoveUpdateOutsideMapTop", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionTeleportMoveEscapeOutsideMapTop", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionNoneMoveUpOutsideMapTop", PacketBuilder.CreateMovement(-100, -131, 10, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionNoneMoveDownOutsideMapTop", PacketBuilder.CreateMovement(-123, -170, 12, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionNoneMoveLeftOutsideMapTop", PacketBuilder.CreateMovement(-210, -156, 14, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionNoneMoveRightOutsideMapTop", PacketBuilder.CreateMovement(-51, -53, 16, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionNoneMoveUpdateOutsideMapTop", PacketBuilder.CreateMovement(-90, -150, 1, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionNoneMoveEscapeOutsideMapTop", PacketBuilder.CreateMovement(-87, -43, 7, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_ESCAPE, false))); + + /* + * Test Outside Map (From Bottom) + */ + + results.Add(Test("Movement_DirectionUpMoveUpOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionUpMoveDownOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionUpMoveLeftOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionUpMoveRightOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionUpMoveUpdateOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionUpMoveEscapeOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionDownMoveUpOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionDownMoveDownOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionDownMoveLeftOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionDownMoveRightOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionDownMoveUpdateOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionDownMoveEscapeOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionLeftMoveUpOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionLeftMoveDownOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionLeftMoveLeftOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionLeftMoveRightOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionLeftMoveUpdateOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionLeftMoveEscapeOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionRightMoveUpOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionRightMoveDownOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionRightMoveLeftOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionRightMoveRightOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionRightMoveUpdateOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionRightMoveEscapeOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionTeleportMoveUpOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionTeleportMoveDownOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionTeleportMoveLeftOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionTeleportMoveRightOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionTeleportMoveUpdateOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionTeleportMoveEscapeOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_ESCAPE, true))); + + results.Add(Test("Movement_DirectionNoneMoveUpOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UP, true))); + results.Add(Test("Movement_DirectionNoneMoveDownOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_DOWN, true))); + results.Add(Test("Movement_DirectionNoneMoveLeftOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_LEFT, true))); + results.Add(Test("Movement_DirectionNoneMoveRightOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_RIGHT, true))); + results.Add(Test("Movement_DirectionNoneMoveUpdateOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UPDATE, true))); + results.Add(Test("Movement_DirectionNoneMoveEscapeOutsideMapBottomWalk", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_ESCAPE, true))); + + // walk = false + + results.Add(Test("Movement_DirectionUpMoveUpOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionUpMoveDownOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionUpMoveLeftOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionUpMoveRightOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionUpMoveUpdateOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionUpMoveEscapeOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_UP, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionDownMoveUpOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionDownMoveDownOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionDownMoveLeftOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionDownMoveRightOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionDownMoveUpdateOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionDownMoveEscapeOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_DOWN, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionLeftMoveUpOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionLeftMoveDownOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionLeftMoveLeftOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionLeftMoveRightOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionLeftMoveUpdateOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionLeftMoveEscapeOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_LEFT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionRightMoveUpOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionRightMoveDownOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionRightMoveLeftOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionRightMoveRightOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionRightMoveUpdateOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionRightMoveEscapeOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_RIGHT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionTeleportMoveUpOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionTeleportMoveDownOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionTeleportMoveLeftOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionTeleportMoveRightOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionTeleportMoveUpdateOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionTeleportMoveEscapeOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_TELEPORT, PacketBuilder.MOVE_ESCAPE, false))); + + results.Add(Test("Movement_DirectionNoneMoveUpOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+100, Map.Height+131, 10, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UP, false))); + results.Add(Test("Movement_DirectionNoneMoveDownOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+123, Map.Height+170, 12, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_DOWN, false))); + results.Add(Test("Movement_DirectionNoneMoveLeftOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+210, Map.Height+156, 14, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_LEFT, false))); + results.Add(Test("Movement_DirectionNoneMoveRightOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+51, Map.Height+53, 16, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_RIGHT, false))); + results.Add(Test("Movement_DirectionNoneMoveUpdateOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+90, Map.Height+150, 1, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_UPDATE, false))); + results.Add(Test("Movement_DirectionNoneMoveEscapeOutsideMapBottom", PacketBuilder.CreateMovement(Map.Width+87, Map.Height+43, 7, PacketBuilder.DIRECTION_NONE, PacketBuilder.MOVE_ESCAPE, false))); + + // Test Place Data Packet + results.Add(Test("PlaceData", PacketBuilder.CreatePlaceData(World.Isles.ToArray(), World.Towns.ToArray(), World.Areas.ToArray()))); + + // Test Player Update + results.Add(Test("PlayerInfoUpdateOrCreate", PacketBuilder.CreatePlayerInfoUpdateOrCreate(100, 200, PacketBuilder.DIRECTION_UP, 10, "Li"))); + results.Add(Test("PlayerLeave", PacketBuilder.CreatePlayerLeave("Li"))); + + // Test PlaySound Packet + results.Add(Test("PlaySound", PacketBuilder.CreatePlaySound("PM"))); + + // Test Profile Page + results.Add(Test("ProfilePage", PacketBuilder.CreateProfilePage("TRANS RIGHTS ARE HUMAN RIGHTS"))); + + // Test SecCode + results.Add(Test("SecCode_AdminMod", PacketBuilder.CreateSecCode(new byte[] { 0x31, 0x52, 0x22 }, 0x34, true, true))); + results.Add(Test("SecCode_Admin", PacketBuilder.CreateSecCode(new byte[] { 0x54, 0x32, 0x24 }, 0x34, true, false))); + results.Add(Test("SecCode_Mod", PacketBuilder.CreateSecCode(new byte[] { 0x22, 0x12, 0x12 }, 0x34, false, true))); + results.Add(Test("SecCode_User", PacketBuilder.CreateSecCode(new byte[] { 0x12, 0x32, 0x14 }, 0x34, false, false))); + + // Test SwfModule + results.Add(Test("SwfModule_Force", PacketBuilder.CreateSwfModule("test.swf", PacketBuilder.PACKET_SWF_MODULE_FORCE))); + results.Add(Test("SwfModule_Gentle", PacketBuilder.CreateSwfModule("test.swf", PacketBuilder.PACKET_SWF_MODULE_GENTLE))); + results.Add(Test("SwfModule_Cutscene", PacketBuilder.CreateSwfModule("test.swf", PacketBuilder.PACKET_SWF_MODULE_CUTSCENE))); + + // Test TileClickInfo + results.Add(Test("TileClickInfo", PacketBuilder.CreateTileClickInfo("Trans Rights Are Human Rights"))); + + // Test TileOverlayFlags + results.Add(Test("TileOverlayFlags", PacketBuilder.CreateTileOverlayFlags(new int[] { 1, 2, 3, 1, 2, 3, 1, 2, 3 }))); + + // Test TimeAndWeatherUpdate + results.Add(Test("TimeAndWeatherUpdate", PacketBuilder.CreateTimeAndWeatherUpdate(10, 4, 541, "SUNNY"))); + results.Add(Test("WeatherUpdate", PacketBuilder.CreateWeatherUpdate("CLOUD"))); + + if (GENERATE) + { + string resultsStr = JsonConvert.SerializeObject(knownGoodPackets, Formatting.Indented); + File.WriteAllText("test.json", resultsStr); + } + + foreach(bool result in results) + { + if (result == false) + return false; + } + return true; + } + } +} diff --git a/HorseIsleServer/HISPtests/UnitTests/ServerStartTest.cs b/HorseIsleServer/HISPtests/UnitTests/ServerStartTest.cs new file mode 100644 index 0000000..a1ad156 --- /dev/null +++ b/HorseIsleServer/HISPtests/UnitTests/ServerStartTest.cs @@ -0,0 +1,40 @@ +using HISP.Server; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HISP.Tests.UnitTests +{ + public class ServerStartTest + { + + public static void OnShutdown() + { + ResultLogger.LogTestStatus(false, "START_SERVER", "OnShutdown called"); + } + public static void LogStdout(bool error, string type, string text) + { + if (type == "CRASH") + ResultLogger.LogTestStatus(false, "START_SERVER", text); + } + + public static bool RunServerStartTest() + { + try + { + Logger.SetCallback(LogStdout); + Entry.SetShutdownCallback(OnShutdown); + Entry.Start(); + ResultLogger.LogTestStatus(true, "START_SERVER_TEST", "Success."); + return true; + } + catch (Exception e) + { + ResultLogger.LogTestStatus(false, "START_SERVER_TEST", e.Message); + return false; + } + } + } +} diff --git a/HorseIsleServer/HISPtests/UnitTests/UserTest.cs b/HorseIsleServer/HISPtests/UnitTests/UserTest.cs new file mode 100644 index 0000000..5a600c8 --- /dev/null +++ b/HorseIsleServer/HISPtests/UnitTests/UserTest.cs @@ -0,0 +1,172 @@ +using HISP.Game; +using HISP.Player; +using HISP.Security; +using HISP.Server; +using HISP.Util; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Sockets; +using System.Text; +using System.Threading.Tasks; + +namespace HISP.Tests.UnitTests +{ + public class UserTest + { + private const string ALLOWED_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"; + + private static byte[] createLoginPacket(string username, string password) + { + byte[] loginInformation = Encoding.UTF8.GetBytes("91|" + Authentication.EncryptLogin(username) + "|" + Authentication.EncryptLogin(password) + "|"); + byte[] loginPacket = new byte[1 * 3 + loginInformation.Length]; + loginPacket[0] = PacketBuilder.PACKET_LOGIN; + loginPacket[loginPacket.Length - 2] = PacketBuilder.PACKET_CLIENT_TERMINATOR; + loginPacket[loginPacket.Length - 1] = PacketBuilder.PACKET_TERMINATOR; + + Array.ConstrainedCopy(loginInformation, 0, loginPacket, 1, loginInformation.Length); + + return loginPacket; + } + + private static byte[] createUserInfoPacket() + { + byte[] packet = new byte[] { PacketBuilder.PACKET_LOGIN, PacketBuilder.PACKET_CLIENT_TERMINATOR, PacketBuilder.PACKET_TERMINATOR}; + return packet; + } + + public static bool Test(string testName, object value, object valueComp) + { + bool result = value.Equals(valueComp); + if (result) + ResultLogger.LogTestStatus(true, "USER_TEST "+testName, "Success."); + else + ResultLogger.LogTestResult(false, "USER_TEST " + testName, value.ToString(), valueComp.ToString()); + + return result; + } + + private static async Task receiveAsync(Socket s) + { + byte[] buffer = new byte[s.Available]; + await s.ReceiveAsync(buffer); + return buffer; + } + + public static async Task RunUserTest() + { + List results = new List(); + + string username = Helper.RandomString(ALLOWED_CHARS); + string password = Helper.RandomString(ALLOWED_CHARS); + + int userId = Authentication.CreateAccount(username, password, "GENDERFLUID", true, true); + + // Connect to running server via TCP; + using (Socket hispServer = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) + { + // This is already a pretty good unit test; confirming we can actually login to the game, + + try + { + await hispServer.ConnectAsync("127.0.0.1", ConfigReader.Port); + + // Login to the game; + await hispServer.SendAsync(createLoginPacket(username, password)); + await receiveAsync(hispServer); + + await hispServer.SendAsync(createUserInfoPacket()); + await receiveAsync(hispServer); + + + ResultLogger.LogTestStatus(true, "GAME_LOGIN_TEST", "Success."); + } + catch (Exception e) + { + ResultLogger.LogTestStatus(false, "GAME_LOGIN_TEST", e.Message); + return false; + } + + + + // While were here; lets do a bunch of tests on HISPs "User" object. + User user = GameServer.GetUserById(userId); + + + // Test Maximums + + user.SetMoney(Int32.MaxValue); + user.AddMoney(1000); + results.Add(Test("MoneyOverflow", user.Money, Int32.MaxValue)); + + user.Hunger = 8000; + results.Add(Test("HungerMaximumEnforcement", user.Hunger, 1000)); + user.Hunger = -8000; + results.Add(Test("HungerMinimumEnforcement", user.Hunger, 0)); + + user.BankMoney = 9999999999.9999; + user.BankMoney += 1000.0; + results.Add(Test("BankMoneyMaximumEnforcement", user.BankMoney, 9999999999.9999)); + + user.BankInterest = 9999999999.9999; + user.BankInterest += 1000.0; + results.Add(Test("BankInterestMaximumEnforcement", user.BankInterest, 9999999999.9999)); + + // Test Gender Setting + user.Gender = "GENDERFLUID"; + results.Add(Test("GenderedPronounsTestTheir", user.GetPronouns(true), Messages.PronounNeutralTheir)); + results.Add(Test("GenderedPronounsTestThey", user.GetPronouns(false), Messages.PronounNeutralThey)); + + user.Gender = "MALE"; + results.Add(Test("GenderedPronounsTestHis", user.GetPronouns(true), Messages.PronounMaleHis)); + results.Add(Test("GenderedPronounsTestHe", user.GetPronouns(false), Messages.PronounMaleHe)); + + user.Gender = "FEMALE"; + results.Add(Test("GenderedPronounsTestHer", user.GetPronouns(true), Messages.PronounFemaleHer)); + results.Add(Test("GenderedPronounsTestShe", user.GetPronouns(false), Messages.PronounFemaleShe)); + + // Test icon + + results.Add(Test("IconTestAdmin", user.GetPlayerListIcon(), Messages.AdminIcon)); + user.Administrator = false; + results.Add(Test("IconTestModerator", user.GetPlayerListIcon(), Messages.ModeratorIcon)); + user.Moderator = false; + results.Add(Test("IconTestNew", user.GetPlayerListIcon(), Messages.NewUserIcon)); + user.NewPlayer = false; + results.Add(Test("IconTestNone", user.GetPlayerListIcon(), -1)); + + user.SubscribedUntil = DateTime.UtcNow.AddMonths(1); + user.Subscribed = true; + results.Add(Test("IconTest1Month", user.GetPlayerListIcon(), Messages.MonthSubscriptionIcon)); + user.SubscribedUntil = DateTime.UtcNow.AddMonths(3); + results.Add(Test("IconTest3Month", user.GetPlayerListIcon(), Messages.ThreeMonthSubscripitionIcon)); + user.SubscribedUntil = DateTime.UtcNow.AddYears(1).AddMonths(3); + results.Add(Test("IconTest1Year", user.GetPlayerListIcon(), Messages.YearSubscriptionIcon)); + + // SecCode + user.SecCodeSeeds[0] = 0x34; + user.SecCodeSeeds[1] = 0x39; + user.SecCodeSeeds[2] = 0x2a; + user.SecCodeInc = 0x3e; + + byte[] expectedSecCodeResult = { 0x55, 0x3C, 0x4B, 0x58 }; + byte[] gotSecCode = user.GenerateSecCode(); + + results.Add(Test("GenerateSecCode", gotSecCode.SequenceEqual(expectedSecCodeResult), true)); + + + + foreach (bool result in results) + if (!result) + return false; + + return true; + + } + + + } + + } +} + diff --git a/HorseIsleServer/HISPtests/icon.ico b/HorseIsleServer/HISPtests/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..1c3ca8d7ca651149cbe275fde8fa2afd72dc323d GIT binary patch literal 3646 zcmb`K2~Xv7cZ;2gaV6!n`Qn>s%6$?wb{?8KOO= zgkrEi{QAbdX70rK^H=0y&Jp_*Qf2Bi$@IRy{wi9n)>a#%aS4{{)U0uX+31U4IAfGU zd2GeeOl9_k!5Ct%f={2BWtol0o|c_grZe5~8|4WAXS{i9iwMizWph{E-)5W-05v=vT0S_yz zm7xvQtO~Y^iQ#8{WR8ajaTDC&<}worU&lgsaRi)LOVKwp3mM=(O%i7QBN7p1!#N6S zAzIWL#?(J7E!us9xT5w~|J!4vXR-$IZv4zChL~1Yj2V@K%o{n#`Wx#_%tjV}F_mR# zF0!#1>kx&A&J-m5(+8^QDtL>wZI~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hgz@O*shF|ApcixkXK7s2pBF-mV{BG=fT{U`M)$E)Dy6h@=%gLk%ll5@gD2S=s7;)Y<75-eUb1Oa!0WBJ∈m zSn{Ka=W;%Zr~(V99bI%8AJKcbNJYGN3}p97{k-3S&kYSzY&`D92{Wk$X3oV+^gEu@ zD|mku@4Gp!qRwA&o#)+gi~f^r4b(Qp(E}lY!9&N{OxQbBrr`C~Xj$vUHCW6`(e|Z> zIz2eadwb)ZOyrmcvio!WBl+y)?&P^#Ay<7{%zLM}#&_{|5%tWH&2&KMp`$o0>fFsh zPJJvA9DdH$!0i&Kd{y>S1OWgOw{q-ELiygdfnXuq~Hu9FSj$;yM|FgK9yqs+OqybHA`_@)I zH(2&dNg4UegRX@SiX0s~DB)SiK+OFNK9}+(ZxgodY?hku#Yp20v7epF$*MDao(|Ax zHP1xLYUG4|pFs_T1Y78dqGt?xz1*j`r`MK7Ln>g53z8X)vGKx*M6msWbYZsjJ|zdtDf ceJ=vgk3WG|Cwc%^CWi>UL=DVo=3MW80UBw&KmY&$ literal 0 HcmV?d00001 diff --git a/HorseIsleServer/LibHISP/Game/Arena.cs b/HorseIsleServer/LibHISP/Game/Arena.cs index 3a22eff..b577283 100755 --- a/HorseIsleServer/LibHISP/Game/Arena.cs +++ b/HorseIsleServer/LibHISP/Game/Arena.cs @@ -201,7 +201,7 @@ namespace HISP.Game break; } byte[] startingUpEventPacket = PacketBuilder.CreateChat(message, PacketBuilder.CHAT_BOTTOM_RIGHT); - byte[] swfModulePacket = PacketBuilder.CreateSwfModule(swf, PacketBuilder.PACKET_SWF_CUTSCENE); + byte[] swfModulePacket = PacketBuilder.CreateSwfModule(swf, PacketBuilder.PACKET_SWF_MODULE_CUTSCENE); Logger.DebugPrint(entry.EnteredUser.Username + " Loading swf: " + swf); entry.EnteredUser.LoggedinClient.SendPacket(swfModulePacket); entry.EnteredUser.LoggedinClient.SendPacket(startingUpEventPacket); diff --git a/HorseIsleServer/LibHISP/Game/Chat/Command.cs b/HorseIsleServer/LibHISP/Game/Chat/Command.cs index 32ecdc6..1a5ab65 100755 --- a/HorseIsleServer/LibHISP/Game/Chat/Command.cs +++ b/HorseIsleServer/LibHISP/Game/Chat/Command.cs @@ -766,7 +766,7 @@ namespace HISP.Game.Chat } playSwf:; - byte[] swfPacket = PacketBuilder.CreateSwfModule("warpcutscene", PacketBuilder.PACKET_SWF_CUTSCENE); + byte[] swfPacket = PacketBuilder.CreateSwfModule("warpcutscene", PacketBuilder.PACKET_SWF_MODULE_CUTSCENE); user.LoggedinClient.SendPacket(swfPacket); diff --git a/HorseIsleServer/LibHISP/Game/Messages.cs b/HorseIsleServer/LibHISP/Game/Messages.cs index c00f83a..4fe8dab 100755 --- a/HorseIsleServer/LibHISP/Game/Messages.cs +++ b/HorseIsleServer/LibHISP/Game/Messages.cs @@ -3008,9 +3008,9 @@ namespace HISP.Game return LogoutMessageFormat.Replace("%USERNAME%", username); } - public static string FormatMOTD() + public static string FormatMotd(string Motd) { - return MotdFormat.Replace("%MOTD%", ConfigReader.Motd); + return MotdFormat.Replace("%MOTD%", Motd); } public static string FormatWelcomeMessage(string username) { diff --git a/HorseIsleServer/LibHISP/Game/Quest.cs b/HorseIsleServer/LibHISP/Game/Quest.cs index 9104f6f..fb8160c 100755 --- a/HorseIsleServer/LibHISP/Game/Quest.cs +++ b/HorseIsleServer/LibHISP/Game/Quest.cs @@ -264,7 +264,7 @@ namespace HISP.Game // Is cloud isles quest? if (quest.Id == CloudIslesQuest) { - byte[] swfLoadPacket = PacketBuilder.CreateSwfModule("ballooncutscene", PacketBuilder.PACKET_SWF_CUTSCENE); + byte[] swfLoadPacket = PacketBuilder.CreateSwfModule("ballooncutscene", PacketBuilder.PACKET_SWF_MODULE_CUTSCENE); user.LoggedinClient.SendPacket(swfLoadPacket); } diff --git a/HorseIsleServer/LibHISP/Game/Treasure.cs b/HorseIsleServer/LibHISP/Game/Treasure.cs index 71ab958..3774762 100755 --- a/HorseIsleServer/LibHISP/Game/Treasure.cs +++ b/HorseIsleServer/LibHISP/Game/Treasure.cs @@ -139,7 +139,7 @@ namespace HISP.Game Database.DeleteTreasure(this.RandomId); GenerateTreasure(); - byte[] MovementPacket = PacketBuilder.CreateMovementPacket(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); + byte[] MovementPacket = PacketBuilder.CreateMovement(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); user.LoggedinClient.SendPacket(MovementPacket); user.AddMoney(Value); diff --git a/HorseIsleServer/LibHISP/Player/Award.cs b/HorseIsleServer/LibHISP/Player/Award.cs index cc6e32e..df51f87 100755 --- a/HorseIsleServer/LibHISP/Player/Award.cs +++ b/HorseIsleServer/LibHISP/Player/Award.cs @@ -1,100 +1,100 @@ -using HISP.Server; +using HISP.Server; using HISP.Util; -using System; -using System.Collections.Generic; - -namespace HISP.Player -{ - public class Award - { - public struct AwardEntry - { - public int Id; - public int Sort; - public string Title; - public int IconId; - public int MoneyBonus; - public string CompletionText; - public string Description; - } - - public static AwardEntry[] GlobalAwardList; - - public static AwardEntry GetAwardById(int id) - { - //99% fo the time this will work - try - { - AwardEntry award = GlobalAwardList[id - 1]; - if (award.Id == id) - return award; - } - catch (Exception) { }; - - // Incase it doesnt... - foreach(AwardEntry award in GlobalAwardList) - { - if (award.Id == id) - return award; - } - - throw new KeyNotFoundException("Award ID " + id + " Does not exist."); - } - - - private ThreadSafeList awardsEarned; - private User baseUser; - public AwardEntry[] AwardsEarned - { - get - { - return awardsEarned.ToArray(); - } - } - - public bool HasAward(AwardEntry award) - { - foreach(AwardEntry awardEntry in AwardsEarned) - { - if (awardEntry.Id == award.Id) - return true; - } - return false; - } - - public void AddAward(AwardEntry award,bool addToDatabase=true) - { - if (HasAward(award)) - return; - - if (addToDatabase) - { - Database.AddAward(baseUser.Id, award.Id); - - baseUser.AddMoney(award.MoneyBonus); - - byte[] chatPacket = PacketBuilder.CreateChat(award.CompletionText, PacketBuilder.CHAT_BOTTOM_RIGHT); - baseUser.LoggedinClient.SendPacket(chatPacket); - } - - - awardsEarned.Add(award); - } - - public Award(User user) - { - baseUser = user; - int[] awards = Database.GetAwards(user.Id); - awardsEarned = new ThreadSafeList(); - - foreach (int awardid in awards) - { - AddAward(GetAwardById(awardid), false); - } - - } - - - - } -} +using System; +using System.Collections.Generic; + +namespace HISP.Player +{ + public class Award + { + public struct AwardEntry + { + public int Id; + public int Sort; + public string Title; + public int IconId; + public int MoneyBonus; + public string CompletionText; + public string Description; + } + + public static AwardEntry[] GlobalAwardList; + + public static AwardEntry GetAwardById(int id) + { + //99% fo the time this will work + try + { + AwardEntry award = GlobalAwardList[id - 1]; + if (award.Id == id) + return award; + } + catch (Exception) { }; + + // Incase it doesnt... + foreach(AwardEntry award in GlobalAwardList) + { + if (award.Id == id) + return award; + } + + throw new KeyNotFoundException("Award ID " + id + " Does not exist."); + } + + + private ThreadSafeList awardsEarned; + private User baseUser; + public AwardEntry[] AwardsEarned + { + get + { + return awardsEarned.ToArray(); + } + } + + public bool HasAward(AwardEntry award) + { + foreach(AwardEntry awardEntry in AwardsEarned) + { + if (awardEntry.Id == award.Id) + return true; + } + return false; + } + + public void AddAward(AwardEntry award,bool addToDatabase=true) + { + if (HasAward(award)) + return; + + if (addToDatabase) + { + Database.AddAward(baseUser.Id, award.Id); + + baseUser.AddMoney(award.MoneyBonus); + + byte[] chatPacket = PacketBuilder.CreateChat(award.CompletionText, PacketBuilder.CHAT_BOTTOM_RIGHT); + baseUser.LoggedinClient.SendPacket(chatPacket); + } + + + awardsEarned.Add(award); + } + + public Award(User user) + { + baseUser = user; + int[] awards = Database.GetAwards(user.Id); + awardsEarned = new ThreadSafeList(); + + foreach (int awardid in awards) + { + AddAward(GetAwardById(awardid), false); + } + + } + + + + } +} diff --git a/HorseIsleServer/LibHISP/Player/Dance.cs b/HorseIsleServer/LibHISP/Player/Dance.cs index 9ce152c..b728be5 100755 --- a/HorseIsleServer/LibHISP/Player/Dance.cs +++ b/HorseIsleServer/LibHISP/Player/Dance.cs @@ -62,7 +62,7 @@ namespace HISP.Player baseUser.Facing = direction + (onHorse * 5); - byte[] moveResponse = PacketBuilder.CreateMovementPacket(baseUser.X, baseUser.Y, baseUser.CharacterId, baseUser.Facing, PacketBuilder.DIRECTION_NONE, false); + byte[] moveResponse = PacketBuilder.CreateMovement(baseUser.X, baseUser.Y, baseUser.CharacterId, baseUser.Facing, PacketBuilder.DIRECTION_NONE, false); baseUser.LoggedinClient.SendPacket(moveResponse); GameServer.UpdateUserFacingAndLocation(baseUser); diff --git a/HorseIsleServer/LibHISP/Player/User.cs b/HorseIsleServer/LibHISP/Player/User.cs index 2471f49..9dfc07a 100755 --- a/HorseIsleServer/LibHISP/Player/User.cs +++ b/HorseIsleServer/LibHISP/Player/User.cs @@ -1,587 +1,600 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using HISP.Game; -using HISP.Server; -using HISP.Player.Equips; -using HISP.Game.Services; -using HISP.Game.Inventory; -using HISP.Game.Horse; -using HISP.Util; - - -namespace HISP.Player -{ - public class User - { - private List bids = new List(); - private List beingSocializedBy = new List(); - - private int chatViolations; - private int charId; - private int subscribedUntil; - private bool subscribed; - private string profilePage; - private string privateNotes; - private int x; - private bool stealth = false; - private int y; - private int questPoints; - private double bankMoney; - private int experience; - private int hunger; - private int thirst; - private int tired; - private bool noClip = false; - - public bool NoClip - { - get - { - if(CurrentlyRidingHorse != null) - { - if(CurrentlyRidingHorse.Breed != null) - { - if (CurrentlyRidingHorse.Breed.Type == "pegasus") - { - return true; - } - if (CurrentlyRidingHorse.Breed.Id == 170) - { - return true; - } - } - } - return noClip; - } - set - { - noClip = true; - } - } - public Trade TradingWith = null; - public int AttemptingToOfferItem; - public bool TradeMenuPriority = false; - public byte[] SecCodeSeeds = new byte[3]; - public int SecCodeInc = 0; - public int SecCodeCount = 0; - public int Id; - public string Username; - public bool Administrator = false; - public bool Moderator = false; - public bool NewPlayer = false; - public GameClient LoggedinClient; - public CompetitionGear EquipedCompetitionGear; - public Jewelry EquipedJewelry; - public bool MuteAds = false; - public bool MuteGlobal = false; - public bool MuteIsland = false; - public bool MuteNear = false; - public bool MuteHere = false; - public bool MuteBuddy = false; - public bool MutePrivateMessage = false; - public bool MuteBuddyRequests = false; - public bool MuteSocials = false; - public bool MuteAll = false; - public bool MuteLogins = false; - public string Gender; - public bool UserInfoSend = false; - public bool MajorPriority = false; - public bool MinorPriority = false; - public bool HorseWindowOpen = false; - public bool Idle; - public int Facing; - public HorseInfo.Breed PawneerOrderBreed = null; - public string PawneerOrderColor = ""; - public string PawneerOrderGender = ""; - public bool InRealTimeQuiz = false; - public int PendingTradeTo; - public Mailbox MailBox; - public Friends Friends; - public string Password; // For chat filter. - public PlayerInventory Inventory; - public Npc.NpcEntry LastTalkedToNpc; - public Shop LastShoppedAt; - public Inn LastVisitedInn; - public HorseInventory HorseInventory; - public HorseInstance LastViewedHorse; - public HorseInstance LastViewedHorseOther; - public int LastRiddenHorse = 0; - public HorseInstance CurrentlyRidingHorse; - public Tracking TrackedItems; - public Ranch OwnedRanch = null; - public PlayerQuests Quests; - public Highscore Highscores; - public MutedPlayers MutePlayer; - public Riddler LastRiddle; - public Award Awards; - public User SocializingWith; - public User PendingBuddyRequestTo; - public Dance ActiveDance; - public bool CanUseAdsChat = true; - public int CapturingHorseId; - public DateTime LoginTime; - public string LastSeenWeather; - public string AutoReplyText = ""; - public int LastClickedRanchBuilding = 0; - public int TotalGlobalChatMessages = 1; - public User[] BeingSocializedBy - { - get - { - return beingSocializedBy.ToArray(); - } - } - public Auction.AuctionBid[] Bids - { - get - { - return bids.ToArray(); - } - } - public int MaxItems - { - get - { - int baseValue = 40; - if (Subscribed) - { - if (OwnedRanch != null) - { - baseValue += 20 * OwnedRanch.GetBuildingCount(4); // Shed - if (baseValue > 80) // 2 sheds max! - baseValue = 80; - } - } - return baseValue; - } - } - public int MaxHorses - { - get - { - if (Subscribed) - { - int baseValue = 11; - if(OwnedRanch != null) - { - baseValue += OwnedRanch.GetBuildingCount(1) * 4; // Barn - baseValue += OwnedRanch.GetBuildingCount(10) * 8; // Big Barn - baseValue += OwnedRanch.GetBuildingCount(11) * 12; // Gold Barn - } - return baseValue; - } - - return 7; // will change when ranches are implemented. - } - } - - public void TakeMoney(int amount) - { - int money = Money; - money -= amount; - Database.SetPlayerMoney(money, Id); - GameServer.UpdatePlayer(LoggedinClient); - } - - public void AddMoney(int amount) - { - int money = Money; - try - { - checked - { - money += amount; - } - } - catch(OverflowException) - { - money = 2147483647; - } - - Database.SetPlayerMoney(money, Id); - GameServer.UpdatePlayer(LoggedinClient); - } - public string GetWeatherSeen() - { - string weather = "SUNNY"; - if (World.InTown(this.X, this.Y)) - weather = World.GetTown(this.X, this.Y).Weather; - if (World.InIsle(this.X, this.Y)) - weather = World.GetIsle(this.X, this.Y).Weather; - LastSeenWeather = weather; - return weather; - } - public void DoRanchActions() - { - if(OwnedRanch != null) - { - Tiredness = 1000; // All ranches fully rest you. - - if(OwnedRanch.GetBuildingCount(2) > 0) - { - Thirst = 1000; - foreach (HorseInstance horse in HorseInventory.HorseList) - horse.BasicStats.Thirst = 1000; - } - - if (OwnedRanch.GetBuildingCount(3) > 0) - { - foreach (HorseInstance horse in HorseInventory.HorseList) - horse.BasicStats.Hunger = 1000; - } - if(OwnedRanch.GetBuildingCount(9) > 0) - { - Hunger = 1000; - } - if( (OwnedRanch.GetBuildingCount(1) > 0)|| (OwnedRanch.GetBuildingCount(10) > 0) || (OwnedRanch.GetBuildingCount(11) > 0)) - { - - foreach (HorseInstance horse in HorseInventory.HorseList) - horse.BasicStats.Tiredness = 1000; - } - - } - } - public DateTime SubscribedUntil - { - get - { - return Helper.UnixTimeStampToDateTime(subscribedUntil); - } - } - public int FreeMinutes - { - get - { - int freeTime = Database.GetFreeTime(Id); - return freeTime; - } - set - { - Database.SetFreeTime(Id, value); - } - } - public bool Subscribed - { - get - { - if (ConfigReader.AllUsersSubbed) - return true; - - if (Administrator) - return true; - - int Timestamp = Convert.ToInt32(new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds()); - if(Timestamp > subscribedUntil && subscribed) // sub expired. - { - Logger.InfoPrint(Username + "'s Subscription expired. (timestamp now: " + Timestamp + " exp date: " + subscribedUntil+" )"); - Database.SetUserSubscriptionStatus(this.Id, false); - subscribed = false; - } - - return subscribed; - } - set - { - Database.SetUserSubscriptionStatus(this.Id, value); - } - } - public bool Stealth - { - get - { - return stealth; - } - set - { - if (value) - Database.RemoveOnlineUser(this.Id); - else - Database.AddOnlineUser(this.Id, this.Administrator, this.Moderator, this.Subscribed, this.NewPlayer); - - stealth = value; - } - } - public int ChatViolations - { - get - { - return chatViolations; - } - set - { - Database.SetChatViolations(value,Id); - chatViolations = value; - } - } - - public string PrivateNotes - { - get - { - return privateNotes; - } - set - { - - privateNotes = value.Trim(); - Database.SetPlayerNotes(Id, privateNotes); - - } - } - public string ProfilePage { - get - { - return profilePage; - } - set - { - profilePage = value.TrimEnd(); - Database.SetPlayerProfile(profilePage, Id); - } - } - - public int Money - { - get - { - return Database.GetPlayerMoney(Id); - } - } - - - public int Experience - { - get - { - return experience; - } - set - { - Database.SetExperience(Id, value); - experience = value; - } - } - public int QuestPoints - { - get - { - return questPoints; - } - set - { - Database.SetPlayerQuestPoints(value, Id); - questPoints = value; - } - } - - public double BankInterest - { - get - { - return Database.GetPlayerBankInterest(Id); - } - set - { - if (value > 9999999999.9999) - value = 9999999999.9999; - - Database.SetPlayerBankInterest(value, Id); - } - } - public double BankMoney - { - get - { - return bankMoney; - } - set - { - if (value > 9999999999.9999) - value = 9999999999.9999; - - Database.SetPlayerBankMoney(value, Id); - bankMoney = value; - BankInterest = value; - } - } - - public int X - { - get - { - return x; - } - set - { - Database.SetPlayerX(value, Id); - x = value; - } - } - - public int Y - { - get - { - return y; - } - set - { - Database.SetPlayerY(value, Id); - y = value; - } - } - - public int CharacterId - { - get - { - return charId; - } - set - { - Database.SetPlayerCharId(value, Id); - charId = value; - } - } - - - public int Hunger - { - get - { - return hunger; - } - set - { - if (value >= 1000) - value = 1000; - if (value <= 0) - value = 0; - Database.SetPlayerHunger(Id, value); - hunger = value; - } - } - - public int Thirst - { - get - { - return thirst; - } - set - { - if (value >= 1000) - value = 1000; - if (value <= 0) - value = 0; - Database.SetPlayerThirst(Id, value); - thirst = value; - } - } - - public int Tiredness - { - get - { - return tired; - } - set - { - if (value >= 1000) - value = 1000; - if (value <= 0) - value = 0; - Database.SetPlayerTiredness(Id, value); - tired = value; - } - } - public void ClearSocailizedWith() - { - beingSocializedBy.Clear(); - } - public void RemoveSocailizedWith(User user) - { - beingSocializedBy.Remove(user); - } - public void AddSocailizedWith(User user) - { - beingSocializedBy.Add(user); - } - public void AddBid(Auction.AuctionBid bid) - { - bids.Add(bid); - } - - public void RemoveBid(Auction.AuctionBid bid) - { - bids.Remove(bid); - } - public int GetPlayerListIcon() - { - int icon = -1; - if (NewPlayer) - icon = Messages.NewUserIcon; - if (Subscribed) - { - int months = (SubscribedUntil.Month - DateTime.UtcNow.Month) + ((SubscribedUntil.Year - DateTime.UtcNow.Year) * 12); - if (months >= 3) - icon = Messages.ThreeMonthSubscripitionIcon; - else if(months >= (12+3)) - icon = Messages.YearSubscriptionIcon; - else - icon = Messages.MonthSubscriptionIcon; - } - if (Moderator) - icon = Messages.ModeratorIcon; - if (Administrator) - icon = Messages.AdminIcon; - - return icon; - } - public void Teleport(int newX, int newY) - { - Logger.DebugPrint("Teleporting: " + Username + " to: " + newX.ToString() + "," + newY.ToString()); - - User[] onScreenBefore = GameServer.GetOnScreenUsers(X, Y, true, true); - User[] onScreenNow = GameServer.GetOnScreenUsers(newX, newY, true, true); - - X = newX; - Y = newY; - - byte[] MovementPacket = PacketBuilder.CreateMovementPacket(X, Y, CharacterId, Facing, PacketBuilder.DIRECTION_TELEPORT, true); - LoggedinClient.SendPacket(MovementPacket); - GameServer.UpdateWeather(LoggedinClient); - - - User[] goneOffScreen = onScreenBefore.Except(onScreenNow).ToArray(); - User[] goneOnScreen = onScreenNow.Except(onScreenBefore).ToArray(); - - - // Players now offscreen tell the client is at 1000,1000. - foreach (User offScreenUsers in goneOffScreen) - { - if (offScreenUsers.Id == this.Id) - continue; - - byte[] playerInfoBytes = PacketBuilder.CreatePlayerInfoUpdateOrCreate(1000 + 4, 1000 + 1, this.Facing, this.CharacterId, this.Username); - offScreenUsers.LoggedinClient.SendPacket(playerInfoBytes); - } - - // Tell players now on screen there locations - foreach (User onScreenUsers in goneOnScreen) - { - if (onScreenUsers.Id == this.Id) - continue; - - byte[] playerInfoBytes = PacketBuilder.CreatePlayerInfoUpdateOrCreate(onScreenUsers.X, onScreenUsers.Y, onScreenUsers.Facing, onScreenUsers.CharacterId, onScreenUsers.Username); - LoggedinClient.SendPacket(playerInfoBytes); - } - - - GameServer.Update(LoggedinClient); +using System; +using System.Collections.Generic; +using System.Linq; + +using HISP.Game; +using HISP.Server; +using HISP.Player.Equips; +using HISP.Game.Services; +using HISP.Game.Inventory; +using HISP.Game.Horse; +using HISP.Util; + + +namespace HISP.Player +{ + public class User + { + private List bids = new List(); + private List beingSocializedBy = new List(); + + private int chatViolations; + private int charId; + private int subscribedUntil; + private bool subscribed; + private string profilePage; + private string privateNotes; + private int x; + private bool stealth = false; + private int y; + private int questPoints; + private double bankMoney; + private int experience; + private int hunger; + private int thirst; + private int tired; + private bool noClip = false; + + public bool NoClip + { + get + { + if(CurrentlyRidingHorse != null) + { + if(CurrentlyRidingHorse.Breed != null) + { + if (CurrentlyRidingHorse.Breed.Type == "pegasus") + { + return true; + } + if (CurrentlyRidingHorse.Breed.Id == 170) + { + return true; + } + } + } + return noClip; + } + set + { + noClip = true; + } + } + public Trade TradingWith = null; + public int AttemptingToOfferItem; + public bool TradeMenuPriority = false; + public byte[] SecCodeSeeds = new byte[3]; + public int SecCodeInc = 0; + public int SecCodeCount = 0; + public int Id; + public string Username; + public bool Administrator = false; + public bool Moderator = false; + public bool NewPlayer = false; + public GameClient LoggedinClient; + public CompetitionGear EquipedCompetitionGear; + public Jewelry EquipedJewelry; + public bool MuteAds = false; + public bool MuteGlobal = false; + public bool MuteIsland = false; + public bool MuteNear = false; + public bool MuteHere = false; + public bool MuteBuddy = false; + public bool MutePrivateMessage = false; + public bool MuteBuddyRequests = false; + public bool MuteSocials = false; + public bool MuteAll = false; + public bool MuteLogins = false; + public string Gender; + public bool UserInfoSend = false; + public bool MajorPriority = false; + public bool MinorPriority = false; + public bool HorseWindowOpen = false; + public bool Idle; + public int Facing; + public HorseInfo.Breed PawneerOrderBreed = null; + public string PawneerOrderColor = ""; + public string PawneerOrderGender = ""; + public bool InRealTimeQuiz = false; + public int PendingTradeTo; + public Mailbox MailBox; + public Friends Friends; + public string Password; // For chat filter. + public PlayerInventory Inventory; + public Npc.NpcEntry LastTalkedToNpc; + public Shop LastShoppedAt; + public Inn LastVisitedInn; + public HorseInventory HorseInventory; + public HorseInstance LastViewedHorse; + public HorseInstance LastViewedHorseOther; + public int LastRiddenHorse = 0; + public HorseInstance CurrentlyRidingHorse; + public Tracking TrackedItems; + public Ranch OwnedRanch = null; + public PlayerQuests Quests; + public Highscore Highscores; + public MutedPlayers MutePlayer; + public Riddler LastRiddle; + public Award Awards; + public User SocializingWith; + public User PendingBuddyRequestTo; + public Dance ActiveDance; + public bool CanUseAdsChat = true; + public int CapturingHorseId; + public DateTime LoginTime; + public string LastSeenWeather; + public string AutoReplyText = ""; + public int LastClickedRanchBuilding = 0; + public int TotalGlobalChatMessages = 1; + public User[] BeingSocializedBy + { + get + { + return beingSocializedBy.ToArray(); + } + } + public Auction.AuctionBid[] Bids + { + get + { + return bids.ToArray(); + } + } + public int MaxItems + { + get + { + int baseValue = 40; + if (Subscribed) + { + if (OwnedRanch != null) + { + baseValue += 20 * OwnedRanch.GetBuildingCount(4); // Shed + if (baseValue > 80) // 2 sheds max! + baseValue = 80; + } + } + return baseValue; + } + } + public int MaxHorses + { + get + { + if (Subscribed) + { + int baseValue = 11; + if(OwnedRanch != null) + { + baseValue += OwnedRanch.GetBuildingCount(1) * 4; // Barn + baseValue += OwnedRanch.GetBuildingCount(10) * 8; // Big Barn + baseValue += OwnedRanch.GetBuildingCount(11) * 12; // Gold Barn + } + return baseValue; + } + + return 7; + } + } + + public void TakeMoney(int amount) + { + int money = Money; + money -= amount; + Database.SetPlayerMoney(money, Id); + GameServer.UpdatePlayer(LoggedinClient); + } + + public void SetMoney(int amount) + { + Database.SetPlayerMoney(amount, Id); + GameServer.UpdatePlayer(LoggedinClient); + } + + public void AddMoney(int amount) + { + int money = Money; + try + { + checked + { + money += amount; + } + } + catch(OverflowException) + { + money = Int32.MaxValue; + } + + Database.SetPlayerMoney(money, Id); + GameServer.UpdatePlayer(LoggedinClient); + } + public string GetWeatherSeen() + { + string weather = "SUNNY"; + if (World.InTown(this.X, this.Y)) + weather = World.GetTown(this.X, this.Y).Weather; + if (World.InIsle(this.X, this.Y)) + weather = World.GetIsle(this.X, this.Y).Weather; + LastSeenWeather = weather; + return weather; + } + public void DoRanchActions() + { + if(OwnedRanch != null) + { + Tiredness = 1000; // All ranches fully rest you. + + if(OwnedRanch.GetBuildingCount(2) > 0) + { + Thirst = 1000; + foreach (HorseInstance horse in HorseInventory.HorseList) + horse.BasicStats.Thirst = 1000; + } + + if (OwnedRanch.GetBuildingCount(3) > 0) + { + foreach (HorseInstance horse in HorseInventory.HorseList) + horse.BasicStats.Hunger = 1000; + } + if(OwnedRanch.GetBuildingCount(9) > 0) + { + Hunger = 1000; + } + if( (OwnedRanch.GetBuildingCount(1) > 0)|| (OwnedRanch.GetBuildingCount(10) > 0) || (OwnedRanch.GetBuildingCount(11) > 0)) + { + + foreach (HorseInstance horse in HorseInventory.HorseList) + horse.BasicStats.Tiredness = 1000; + } + + } + } + public DateTime SubscribedUntil + { + get + { + return Helper.UnixTimeStampToDateTime(subscribedUntil); + } + set + { + subscribedUntil = Convert.ToInt32(((DateTimeOffset)value).ToUnixTimeSeconds()); + Database.SetUserSubscriptionStatus(Id, subscribedUntil); + } + } + public int FreeMinutes + { + get + { + int freeTime = Database.GetFreeTime(Id); + return freeTime; + } + set + { + Database.SetFreeTime(Id, value); + } + } + public bool Subscribed + { + get + { + if (ConfigReader.AllUsersSubbed) + return true; + + if (Administrator) + return true; + + int Timestamp = Convert.ToInt32(new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds()); + if(Timestamp > subscribedUntil && subscribed) // sub expired. + { + Logger.InfoPrint(Username + "'s Subscription expired. (timestamp now: " + Timestamp + " exp date: " + subscribedUntil+" )"); + Database.SetUserSubscriptionStatus(this.Id, false); + subscribed = false; + } + + return subscribed; + } + set + { + subscribed = value; + Database.SetUserSubscriptionStatus(this.Id, value); + } + } + public bool Stealth + { + get + { + return stealth; + } + set + { + if (value) + Database.RemoveOnlineUser(this.Id); + else + Database.AddOnlineUser(this.Id, this.Administrator, this.Moderator, this.Subscribed, this.NewPlayer); + + stealth = value; + } + } + public int ChatViolations + { + get + { + return chatViolations; + } + set + { + Database.SetChatViolations(value,Id); + chatViolations = value; + } + } + + public string PrivateNotes + { + get + { + return privateNotes; + } + set + { + + privateNotes = value.Trim(); + Database.SetPlayerNotes(Id, privateNotes); + + } + } + public string ProfilePage { + get + { + return profilePage; + } + set + { + profilePage = value.TrimEnd(); + Database.SetPlayerProfile(profilePage, Id); + } + } + + public int Money + { + get + { + return Database.GetPlayerMoney(Id); + } + } + + + public int Experience + { + get + { + return experience; + } + set + { + Database.SetExperience(Id, value); + experience = value; + } + } + public int QuestPoints + { + get + { + return questPoints; + } + set + { + Database.SetPlayerQuestPoints(value, Id); + questPoints = value; + } + } + + public double BankInterest + { + get + { + return Database.GetPlayerBankInterest(Id); + } + set + { + if (value > 9999999999.9999) + value = 9999999999.9999; + + Database.SetPlayerBankInterest(value, Id); + } + } + public double BankMoney + { + get + { + return bankMoney; + } + set + { + if (value > 9999999999.9999) + value = 9999999999.9999; + + Database.SetPlayerBankMoney(value, Id); + bankMoney = value; + BankInterest = value; + } + } + + public int X + { + get + { + return x; + } + set + { + Database.SetPlayerX(value, Id); + x = value; + } + } + + public int Y + { + get + { + return y; + } + set + { + Database.SetPlayerY(value, Id); + y = value; + } + } + + public int CharacterId + { + get + { + return charId; + } + set + { + Database.SetPlayerCharId(value, Id); + charId = value; + } + } + + + public int Hunger + { + get + { + return hunger; + } + set + { + if (value >= 1000) + value = 1000; + if (value <= 0) + value = 0; + Database.SetPlayerHunger(Id, value); + hunger = value; + } + } + + public int Thirst + { + get + { + return thirst; + } + set + { + if (value >= 1000) + value = 1000; + if (value <= 0) + value = 0; + Database.SetPlayerThirst(Id, value); + thirst = value; + } + } + + public int Tiredness + { + get + { + return tired; + } + set + { + if (value >= 1000) + value = 1000; + if (value <= 0) + value = 0; + Database.SetPlayerTiredness(Id, value); + tired = value; + } + } + public void ClearSocailizedWith() + { + beingSocializedBy.Clear(); + } + public void RemoveSocailizedWith(User user) + { + beingSocializedBy.Remove(user); + } + public void AddSocailizedWith(User user) + { + beingSocializedBy.Add(user); + } + public void AddBid(Auction.AuctionBid bid) + { + bids.Add(bid); + } + + public void RemoveBid(Auction.AuctionBid bid) + { + bids.Remove(bid); + } + public int GetPlayerListIcon() + { + int icon = -1; + if (NewPlayer) + icon = Messages.NewUserIcon; + if (Subscribed) + { + int months = Helper.GetMonthsBetweenTwoDateTimes(DateTime.UtcNow, SubscribedUntil); + + if(months >= 12 + 3) + icon = Messages.YearSubscriptionIcon; + else if (months >= 3) + icon = Messages.ThreeMonthSubscripitionIcon; + else + icon = Messages.MonthSubscriptionIcon; + } + if (Moderator) + icon = Messages.ModeratorIcon; + if (Administrator) + icon = Messages.AdminIcon; + + return icon; + } + public void Teleport(int newX, int newY) + { + Logger.DebugPrint("Teleporting: " + Username + " to: " + newX.ToString() + "," + newY.ToString()); + + User[] onScreenBefore = GameServer.GetOnScreenUsers(X, Y, true, true); + User[] onScreenNow = GameServer.GetOnScreenUsers(newX, newY, true, true); + + X = newX; + Y = newY; + + byte[] MovementPacket = PacketBuilder.CreateMovement(X, Y, CharacterId, Facing, PacketBuilder.DIRECTION_TELEPORT, true); + LoggedinClient.SendPacket(MovementPacket); + GameServer.UpdateWeather(LoggedinClient); + + + User[] goneOffScreen = onScreenBefore.Except(onScreenNow).ToArray(); + User[] goneOnScreen = onScreenNow.Except(onScreenBefore).ToArray(); + + + // Players now offscreen tell the client is at 1000,1000. + foreach (User offScreenUsers in goneOffScreen) + { + if (offScreenUsers.Id == this.Id) + continue; + + byte[] playerInfoBytes = PacketBuilder.CreatePlayerInfoUpdateOrCreate(1000 + 4, 1000 + 1, this.Facing, this.CharacterId, this.Username); + offScreenUsers.LoggedinClient.SendPacket(playerInfoBytes); + } + + // Tell players now on screen there locations + foreach (User onScreenUsers in goneOnScreen) + { + if (onScreenUsers.Id == this.Id) + continue; + + byte[] playerInfoBytes = PacketBuilder.CreatePlayerInfoUpdateOrCreate(onScreenUsers.X, onScreenUsers.Y, onScreenUsers.Facing, onScreenUsers.CharacterId, onScreenUsers.Username); + LoggedinClient.SendPacket(playerInfoBytes); + } + + + GameServer.Update(LoggedinClient); } // Insert LGBT Patch here @@ -593,118 +606,119 @@ namespace HISP.Player return possessive ? Messages.PronounMaleHis : Messages.PronounMaleHe; else return possessive ? Messages.PronounNeutralTheir : Messages.PronounNeutralThey; - } - - public byte[] GenerateSecCode() - { - var i = 0; - SecCodeCount++; - SecCodeSeeds[SecCodeCount % 3] = (byte)(SecCodeSeeds[SecCodeCount % 3] + SecCodeInc); - SecCodeSeeds[SecCodeCount % 3] = (byte)(SecCodeSeeds[SecCodeCount % 3] % 92); - i = SecCodeSeeds[0] + SecCodeSeeds[1] * SecCodeSeeds[2] - SecCodeSeeds[1]; - i = Math.Abs(i); - i = i % 92; - - byte[] SecCode = new byte[4]; - SecCode[0] = (byte)(SecCodeSeeds[0] + 33); - SecCode[1] = (byte)(SecCodeSeeds[1] + 33); - SecCode[2] = (byte)(SecCodeSeeds[2] + 33); - SecCode[3] = (byte)(i + 33); - Logger.DebugPrint("Expecting "+Username+" To send Sec Code: "+BitConverter.ToString(SecCode).Replace("-", " ")); - return SecCode; - } - - - public User(GameClient baseClient, int UserId) - { - if (!Database.CheckUserExist(UserId)) - throw new KeyNotFoundException("User " + UserId + " not found in database!"); - - if (!Database.CheckUserExtExists(UserId)) - { - Database.CreateUserExt(UserId); - NewPlayer = true; - - } - - - EquipedCompetitionGear = new CompetitionGear(UserId); - EquipedJewelry = new Jewelry(UserId); - - Id = UserId; - Username = Database.GetUsername(UserId); - - Administrator = Database.CheckUserIsAdmin(Username); - Moderator = Database.CheckUserIsModerator(Username); - - chatViolations = Database.GetChatViolations(UserId); - x = Database.GetPlayerX(UserId); - y = Database.GetPlayerY(UserId); - charId = Database.GetPlayerCharId(UserId); - - Facing = PacketBuilder.DIRECTION_DOWN; - experience = Database.GetExperience(UserId); - //money = Database.GetPlayerMoney(UserId); - bankMoney = Database.GetPlayerBankMoney(UserId); - questPoints = Database.GetPlayerQuestPoints(UserId); - subscribed = Database.IsUserSubscribed(UserId); - subscribedUntil = Database.GetUserSubscriptionExpireDate(UserId); - profilePage = Database.GetPlayerProfile(UserId); - privateNotes = Database.GetPlayerNotes(UserId); - hunger = Database.GetPlayerHunger(UserId); - thirst = Database.GetPlayerThirst(UserId); - tired = Database.GetPlayerTiredness(UserId); - - if(Ranch.IsRanchOwned(this.Id)) - { - OwnedRanch = Ranch.GetRanchOwnedBy(this.Id); - } - - Gender = Database.GetGender(UserId); - MailBox = new Mailbox(this); - Highscores = new Highscore(this); - Awards = new Award(this); - MutePlayer = new MutedPlayers(this); - TrackedItems = new Tracking(this); - HorseInventory = new HorseInventory(this); - - // Generate SecCodes - - - SecCodeSeeds[0] = (byte)GameServer.RandomNumberGenerator.Next(40, 60); - SecCodeSeeds[1] = (byte)GameServer.RandomNumberGenerator.Next(40, 60); - SecCodeSeeds[2] = (byte)GameServer.RandomNumberGenerator.Next(40, 60); - SecCodeInc = (byte)GameServer.RandomNumberGenerator.Next(40, 60); - - - Friends = new Friends(this); - LoginTime = DateTime.UtcNow; - LoggedinClient = baseClient; - Inventory = new PlayerInventory(this); - Quests = new PlayerQuests(this); - - // Get auctions - foreach(Auction auction in Auction.AuctionRooms) - { - foreach(Auction.AuctionEntry auctionEntry in auction.AuctionEntries) - { - if(auctionEntry.HighestBidder == this.Id) - { - Auction.AuctionBid bid = new Auction.AuctionBid(); - bid.BidUser = this; - bid.BidAmount = auctionEntry.HighestBid; - bid.AuctionItem = auctionEntry; - - if(bid.BidAmount > 0) - { - bids.Add(bid); - auctionEntry.AddBid(bid); - } - - } - } - } - - } - } -} + } + + public byte[] GenerateSecCode() + { + SecCodeCount = ((SecCodeCount + 1) % 3); + + SecCodeSeeds[SecCodeCount] = (byte)(SecCodeSeeds[SecCodeCount] + SecCodeInc); + SecCodeSeeds[SecCodeCount] = (byte)(SecCodeSeeds[SecCodeCount] % '\\'); + + double i = SecCodeSeeds[0] + SecCodeSeeds[1] * SecCodeSeeds[2] - SecCodeSeeds[1]; + i = Math.Abs(i); + i %= '\\'; + + byte[] SecCode = new byte[4]; + + SecCode[0] = (byte)(SecCodeSeeds[0] + '!'); + SecCode[1] = (byte)(SecCodeSeeds[1] + '!'); + SecCode[2] = (byte)(SecCodeSeeds[2] + '!'); + SecCode[3] = (byte)(i + '!'); + + Logger.DebugPrint("Expecting "+Username+" To send Sec Code: "+BitConverter.ToString(SecCode).Replace("-", " ")); + return SecCode; + } + + + public User(GameClient baseClient, int UserId) + { + if (!Database.CheckUserExist(UserId)) + throw new KeyNotFoundException("User " + UserId + " not found in database!"); + + if (!Database.CheckUserExtExists(UserId)) + { + Database.CreateUserExt(UserId); + NewPlayer = true; + + } + + + EquipedCompetitionGear = new CompetitionGear(UserId); + EquipedJewelry = new Jewelry(UserId); + + Id = UserId; + Username = Database.GetUsername(UserId); + + Administrator = Database.CheckUserIsAdmin(Username); + Moderator = Database.CheckUserIsModerator(Username); + + chatViolations = Database.GetChatViolations(UserId); + x = Database.GetPlayerX(UserId); + y = Database.GetPlayerY(UserId); + charId = Database.GetPlayerCharId(UserId); + + Facing = PacketBuilder.DIRECTION_DOWN; + experience = Database.GetExperience(UserId); + + bankMoney = Database.GetPlayerBankMoney(UserId); + questPoints = Database.GetPlayerQuestPoints(UserId); + subscribed = Database.IsUserSubscribed(UserId); + subscribedUntil = Database.GetUserSubscriptionExpireDate(UserId); + profilePage = Database.GetPlayerProfile(UserId); + privateNotes = Database.GetPlayerNotes(UserId); + hunger = Database.GetPlayerHunger(UserId); + thirst = Database.GetPlayerThirst(UserId); + tired = Database.GetPlayerTiredness(UserId); + + if(Ranch.IsRanchOwned(this.Id)) + OwnedRanch = Ranch.GetRanchOwnedBy(this.Id); + + Gender = Database.GetGender(UserId); + MailBox = new Mailbox(this); + Highscores = new Highscore(this); + Awards = new Award(this); + MutePlayer = new MutedPlayers(this); + TrackedItems = new Tracking(this); + HorseInventory = new HorseInventory(this); + + // Generate SecCodes + + + SecCodeSeeds[0] = (byte)GameServer.RandomNumberGenerator.Next('!', '\\'); + SecCodeSeeds[1] = (byte)GameServer.RandomNumberGenerator.Next('!', '\\'); + SecCodeSeeds[2] = (byte)GameServer.RandomNumberGenerator.Next('!', '\\'); + SecCodeInc = (byte)GameServer.RandomNumberGenerator.Next('!', '\\'); + + + Friends = new Friends(this); + LoginTime = DateTime.UtcNow; + LoggedinClient = baseClient; + Inventory = new PlayerInventory(this); + Quests = new PlayerQuests(this); + + // Get auctions + foreach(Auction auction in Auction.AuctionRooms) + { + foreach(Auction.AuctionEntry auctionEntry in auction.AuctionEntries) + { + if(auctionEntry.HighestBidder == this.Id) + { + Auction.AuctionBid bid = new Auction.AuctionBid(); + bid.BidUser = this; + bid.BidAmount = auctionEntry.HighestBid; + bid.AuctionItem = auctionEntry; + + if(bid.BidAmount > 0) + { + bids.Add(bid); + auctionEntry.AddBid(bid); + } + + } + } + } + + } + } +} diff --git a/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs b/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs index b9ef665..d813a22 100755 --- a/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs +++ b/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.8.23.0")] -[assembly: AssemblyFileVersion("1.8.23.0")] +[assembly: AssemblyVersion("1.8.30.0")] +[assembly: AssemblyFileVersion("1.8.30.0")] diff --git a/HorseIsleServer/LibHISP/Security/Authentication.cs b/HorseIsleServer/LibHISP/Security/Authentication.cs index b74cce3..105e0b6 100755 --- a/HorseIsleServer/LibHISP/Security/Authentication.cs +++ b/HorseIsleServer/LibHISP/Security/Authentication.cs @@ -1,88 +1,134 @@ - -using System.Security.Cryptography; -using System.Text; -using System.Linq; - -using HISP.Server; - -namespace HISP.Security -{ - public class Authentication - { - public static string DecryptLogin(string encpass) - { - string decrypt = ""; - string ROTPOOL = "bl7Jgk61IZdnY mfDN5zjM2XLqTCty4WSEoKR3BFVQsaUhHOAx0rPwp9uc8iGve"; - string POSPOOL = "DQc3uxiGsKZatMmOS5qYveN71zoPTk8yU0H2w9VjprBXWn l4FJd6IRbhgACfEL"; - string ROTPOOL2 = "evGi8cu9pwPr0xAOHhUasQVFB3RKoESW4ytCTqLX2Mjz5NDfm YndZI16kgJ7lb"; - - - int i = 0; - int ii = 0; - while (i < encpass.Length) - { - int ROT = ROTPOOL.IndexOf(encpass[i].ToString()); - int POS = POSPOOL.IndexOf(encpass[i + 1].ToString()); - POS -= (ROT + ii); - if (POS < 0) - { - POS = (POS / -1) - 1; - - while (POS >= ROTPOOL.Length) - { - POS -= ROTPOOL.Length; - } - - decrypt += ROTPOOL2[POS]; - } - else - { - while (POS >= ROTPOOL.Length) - { - POS -= ROTPOOL.Length; - } - - decrypt += ROTPOOL[POS]; - } - - i += 2; - ii += 1; - } - return decrypt.Replace(" ", ""); - } - - - - public static byte[] HashAndSalt(string plaintext, byte[] salt) - { - byte[] plaintextBytes = Encoding.UTF8.GetBytes(plaintext); - - SHA512 sha512 = SHA512.Create(); - byte[] hash = sha512.ComputeHash(plaintextBytes); - - for (int i = 0; i < hash.Length; i++) - { - hash[i] ^= salt[i]; - } - - byte[] finalHash = sha512.ComputeHash(hash); - - return finalHash; - } - - public static bool CheckPassword(string username, string password) - { - if(Database.CheckUserExist(username)) - { - byte[] expectedPassword = Database.GetPasswordHash(username); - byte[] salt = Database.GetPasswordSalt(username); - byte[] hashedPassword = HashAndSalt(password, salt); - - if (Enumerable.SequenceEqual(expectedPassword, hashedPassword)) - return true; - } - return false; - } - - } -} + +using System.Security.Cryptography; +using System.Text; +using System.Linq; + +using HISP.Server; +using System; +using HISP.Util; + +namespace HISP.Security +{ + public class Authentication + { + + public const string ROTPOOL = "bl7Jgk61IZdnY mfDN5zjM2XLqTCty4WSEoKR3BFVQsaUhHOAx0rPwp9uc8iGve"; + public const string POSPOOL = "DQc3uxiGsKZatMmOS5qYveN71zoPTk8yU0H2w9VjprBXWn l4FJd6IRbhgACfEL"; + + public static string EncryptLogin(string plainpass) + { + string encrypt = ""; + + int i = 0; + while (i < plainpass.Length) + { + int rotation = GameServer.RandomNumberGenerator.Next(0, ROTPOOL.Length); + int position = ROTPOOL.IndexOf(plainpass[i]); + + position = position + (rotation + i); + while (position >= ROTPOOL.Length) + position -= ROTPOOL.Length; + encrypt += ROTPOOL[rotation]; + encrypt += POSPOOL[position]; + + i++; + } + return encrypt; + + } + public static string DecryptLogin(string encpass) + { + string decrypt = ""; + + int i = 0; + int rotationCycle = 0; + while (i < encpass.Length) + { + int rotation = ROTPOOL.IndexOf(encpass[i].ToString()); + int position = POSPOOL.IndexOf(encpass[i + 1].ToString()); + position -= (rotation + rotationCycle); + if (position < 0) + { + position = (position / -1) - 1; + + while (position >= ROTPOOL.Length) + position -= ROTPOOL.Length; + + decrypt += Helper.ReverseString(ROTPOOL)[position]; + } + else + { + while (position >= ROTPOOL.Length) + position -= ROTPOOL.Length; + + decrypt += ROTPOOL[position]; + } + + i += 2; + rotationCycle++; + } + return decrypt.Replace(" ", ""); + } + + public static byte[] Sha512Digest(byte[] message) + { + using (SHA512 sha512 = SHA512.Create()) + return sha512.ComputeHash(message); + } + + public static byte[] XorBytes(byte[] plaintext, byte[] key) + { + int length = Math.Min(plaintext.Length, key.Length); + + byte[] ciphertext = new byte[length]; + for(int i = 0; i < length; i++) + ciphertext[i] = Convert.ToByte(plaintext[i] ^ key[i]); + + return ciphertext; + } + + public static byte[] HashAndSalt(string plaintext, byte[] salt) + { + byte[] plaintextBytes = Encoding.UTF8.GetBytes(plaintext); + + byte[] hash = Sha512Digest(plaintextBytes); + byte[] saltedHash = XorBytes(hash, salt); + byte[] finalHash = Sha512Digest(saltedHash); + + return finalHash; + } + + public static bool CheckPassword(string username, string password) + { + if(Database.CheckUserExist(username)) + { + byte[] expectedPassword = Database.GetPasswordHash(username); + byte[] salt = Database.GetPasswordSalt(username); + byte[] hashedPassword = HashAndSalt(password, salt); + + if (Enumerable.SequenceEqual(expectedPassword, hashedPassword)) + return true; + } + return false; + } + + public static int CreateAccount(string username, string password, string gender, bool admin, bool moderator) + { + // Get a free user id + int userId = Database.GetNextFreeUserId(); + + // Generate salt value + byte[] salt = new byte[64]; + GameServer.RandomNumberGenerator.NextBytes(salt); + string saltText = BitConverter.ToString(salt).Replace("-", ""); + string hashsalt = BitConverter.ToString(Authentication.HashAndSalt(password, salt)).Replace("-", ""); + + // Add user to database + Database.CreateUser(userId, username, hashsalt, saltText, gender, admin, moderator); + + return userId; + } + + + } +} diff --git a/HorseIsleServer/LibHISP/Security/RandomID.cs b/HorseIsleServer/LibHISP/Security/RandomID.cs index 20e1da5..d64d203 100755 --- a/HorseIsleServer/LibHISP/Security/RandomID.cs +++ b/HorseIsleServer/LibHISP/Security/RandomID.cs @@ -1,27 +1,27 @@ using System.Threading; -namespace HISP.Security -{ - public class RandomID - { - private static Mutex rndmIdMutex = new Mutex(); - private static int prevId = 0; - public static int NextRandomId(int randomId=-1) - { - int rndmId = 0; - rndmIdMutex.WaitOne(); - - if (randomId == -1) - rndmId = prevId+1; - else - rndmId = randomId; - - if (rndmId >= prevId) +namespace HISP.Security +{ + public class RandomID + { + private static Mutex rndmIdMutex = new Mutex(); + private static int prevId = 0; + public static int NextRandomId(int randomId=-1) + { + int rndmId = 0; + rndmIdMutex.WaitOne(); + + if (randomId == -1) + rndmId = prevId+1; + else + rndmId = randomId; + + if (rndmId >= prevId) prevId = rndmId; - rndmIdMutex.ReleaseMutex(); - - return rndmId; - } - } -} + rndmIdMutex.ReleaseMutex(); + + return rndmId; + } + } +} diff --git a/HorseIsleServer/LibHISP/Server/ConfigReader.cs b/HorseIsleServer/LibHISP/Server/ConfigReader.cs index 224377e..e78095d 100755 --- a/HorseIsleServer/LibHISP/Server/ConfigReader.cs +++ b/HorseIsleServer/LibHISP/Server/ConfigReader.cs @@ -1,141 +1,141 @@ -using HISP.Properties; -using System.IO; - -namespace HISP.Server -{ - - public class ConfigReader - { - public static int Port = 12321; - public static string BindIP = "0.0.0.0"; - - public static string DatabaseIP = "127.0.0.1"; - public static string DatabaseName = "game1"; - public static string DatabaseUsername = "root"; - public static string DatabasePassword = "test123"; - - public static int DatabasePort = 3306; - public static int IntrestRate = 3333; - public static string Motd = "April 11, 2020. New breed, Camarillo White Horse. Two new quests."; - public static string MapFile = "HI1.MAP"; - public static string GameData = "gamedata.json"; - public static string CrossDomainPolicyFile = "CrossDomainPolicy.xml"; - - public static string ModsFolder = "mods"; - public static int LogLevel = 4; - - public static bool SqlLite = false; - public static bool EnableSpamFilter = true; - public static bool AllUsersSubbed = false; - public static bool FixOfficalBugs = false; - public static bool EnableSwearFilter = true; - public static bool EnableCorrections = true; - public static bool EnableNonViolations = true; - - public static string ConfigurationFileName = "server.properties"; - public static void OpenConfig() - { - if (!File.Exists(ConfigurationFileName)) - { - Logger.WarnPrint(ConfigurationFileName+" not found! writing default."); - File.WriteAllText(ConfigurationFileName, Resources.DefaultServerProperties); - Logger.WarnPrint("! Its very likely database connection will fail..."); - } - - string[] configFile = File.ReadAllLines(ConfigurationFileName); - foreach (string setting in configFile) - { - /* - * Avoid crashing. - */ - if (setting.Length < 1) - continue; - if (setting[0] == '#') - continue; - if (!setting.Contains("=")) - continue; - - string[] dataPair = setting.Split('='); - - string key = dataPair[0]; - string data = dataPair[1]; - /* - * Parse configuration file - */ - - switch (key) - { - case "port": - Port = int.Parse(data); - break; - case "ip": - BindIP = data; - break; - case "db_ip": - DatabaseIP = data; - break; - case "db_username": - DatabaseUsername = data; - break; - case "db_password": - DatabasePassword = data; - break; - case "db_name": - DatabaseName = data; - break; - case "db_port": - DatabasePort = int.Parse(data); - break; - case "map": - MapFile = data; - break; - case "motd": - Motd = data; - break; - case "gamedata": - GameData = data; - break; - case "crossdomain": - CrossDomainPolicyFile = data; - break; - case "all_users_subscribed": - AllUsersSubbed = data == "true"; - break; - case "enable_corrections": - EnableCorrections = data == "true"; - break; - case "sql_lite": - SqlLite = data == "true"; - break; - case "enable_non_violation_check": - EnableNonViolations = data == "true"; - break; - case "enable_spam_filter": - EnableSpamFilter = data == "true"; - break; - case "fix_offical_bugs": - FixOfficalBugs = data == "true"; - break; - case "enable_word_filter": - EnableSwearFilter = data == "true"; +using HISP.Properties; +using System.IO; + +namespace HISP.Server +{ + + public class ConfigReader + { + public static int Port = 12321; + public static string BindIP = "0.0.0.0"; + + public static string DatabaseIP = "127.0.0.1"; + public static string DatabaseName = "game1"; + public static string DatabaseUsername = "root"; + public static string DatabasePassword = "test123"; + + public static int DatabasePort = 3306; + public static int IntrestRate = 3333; + public static string Motd = "April 11, 2020. New breed, Camarillo White Horse. Two new quests."; + public static string MapFile = "HI1.MAP"; + public static string GameData = "gamedata.json"; + public static string CrossDomainPolicyFile = "CrossDomainPolicy.xml"; + + public static string ModsFolder = "mods"; + public static int LogLevel = 4; + + public static bool SqlLite = false; + public static bool EnableSpamFilter = true; + public static bool AllUsersSubbed = false; + public static bool FixOfficalBugs = false; + public static bool EnableSwearFilter = true; + public static bool EnableCorrections = true; + public static bool EnableNonViolations = true; + + public static string ConfigurationFileName = "server.properties"; + public static void OpenConfig() + { + if (!File.Exists(ConfigurationFileName)) + { + Logger.WarnPrint(ConfigurationFileName+" not found! writing default."); + File.WriteAllText(ConfigurationFileName, Resources.DefaultServerProperties); + Logger.WarnPrint("! Its very likely database connection will fail..."); + } + + string[] configFile = File.ReadAllLines(ConfigurationFileName); + foreach (string setting in configFile) + { + /* + * Avoid crashing. + */ + if (setting.Length < 1) + continue; + if (setting[0] == '#') + continue; + if (!setting.Contains("=")) + continue; + + string[] dataPair = setting.Split('='); + + string key = dataPair[0]; + string data = dataPair[1]; + /* + * Parse configuration file + */ + + switch (key) + { + case "port": + Port = int.Parse(data); break; - case "mods_folder": - ModsFolder = data; - break; - case "intrest_rate": - IntrestRate = int.Parse(data); - break; - case "log_level": - LogLevel = int.Parse(data); - break; - } - - - - } - - - } - - } -} + case "ip": + BindIP = data; + break; + case "db_ip": + DatabaseIP = data; + break; + case "db_username": + DatabaseUsername = data; + break; + case "db_password": + DatabasePassword = data; + break; + case "db_name": + DatabaseName = data; + break; + case "db_port": + DatabasePort = int.Parse(data); + break; + case "map": + MapFile = data; + break; + case "motd": + Motd = data; + break; + case "gamedata": + GameData = data; + break; + case "crossdomain": + CrossDomainPolicyFile = data; + break; + case "all_users_subscribed": + AllUsersSubbed = data == "true"; + break; + case "enable_corrections": + EnableCorrections = data == "true"; + break; + case "sql_lite": + SqlLite = data == "true"; + break; + case "enable_non_violation_check": + EnableNonViolations = data == "true"; + break; + case "enable_spam_filter": + EnableSpamFilter = data == "true"; + break; + case "fix_offical_bugs": + FixOfficalBugs = data == "true"; + break; + case "enable_word_filter": + EnableSwearFilter = data == "true"; + break; + case "mods_folder": + ModsFolder = data; + break; + case "intrest_rate": + IntrestRate = int.Parse(data); + break; + case "log_level": + LogLevel = int.Parse(data); + break; + } + + + + } + + + } + + } +} diff --git a/HorseIsleServer/LibHISP/Server/Database.cs b/HorseIsleServer/LibHISP/Server/Database.cs index f038bc1..91421d8 100755 --- a/HorseIsleServer/LibHISP/Server/Database.cs +++ b/HorseIsleServer/LibHISP/Server/Database.cs @@ -4128,6 +4128,23 @@ namespace HISP.Server return subscribedUntil; } } + + public static void SetUserSubscriptionStatus(int playerId, int subscribedUntil) + { + using (DbConnection db = connectDb()) + { + db.Open(); + DbCommand sqlCommand = db.CreateCommand(); + + sqlCommand.CommandText = "UPDATE UserExt SET SubscribedUntil=@subscribedUntil WHERE Id=@playerId"; + addWithValue(sqlCommand, "@subscribedUntil", subscribedUntil); + addWithValue(sqlCommand, "@playerId", playerId); + sqlCommand.Prepare(); + sqlCommand.ExecuteNonQuery(); + + } + } + public static bool IsUserAdmin(int playerId) { using (DbConnection db = connectDb()) diff --git a/HorseIsleServer/LibHISP/Server/GameServer.cs b/HorseIsleServer/LibHISP/Server/GameServer.cs index 3ee3812..65f4022 100755 --- a/HorseIsleServer/LibHISP/Server/GameServer.cs +++ b/HorseIsleServer/LibHISP/Server/GameServer.cs @@ -693,7 +693,7 @@ namespace HISP.Server if (user.MuteAll || user.MuteSocials) continue; - byte[] soundEffect = PacketBuilder.CreatePlaysoundPacket(social.SoundEffect); + byte[] soundEffect = PacketBuilder.CreatePlaySound(social.SoundEffect); user.LoggedinClient.SendPacket(soundEffect); } } @@ -3694,7 +3694,7 @@ namespace HISP.Server User user = sender.LoggedinUser; // Send player current location & map data - byte[] MovementPacket = PacketBuilder.CreateMovementPacket(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); + byte[] MovementPacket = PacketBuilder.CreateMovement(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); sender.SendPacket(MovementPacket); // Send "Welcome to the Secret Land of Horses" message. @@ -3770,7 +3770,7 @@ namespace HISP.Server sender.SendPacket(TileFlags); // Send Todays Note: - byte[] MotdData = PacketBuilder.CreateAnnouncement(Messages.FormatMOTD()); + byte[] MotdData = PacketBuilder.CreateMotd(Messages.FormatMotd(ConfigReader.Motd)); sender.SendPacket(MotdData); // Send riddle annoucement @@ -3918,7 +3918,7 @@ namespace HISP.Server if(room.Drawing != "") { - byte[] drawingPacket = PacketBuilder.CreateDrawingUpdatePacket(room.Drawing); + byte[] drawingPacket = PacketBuilder.CreateDrawingUpdate(room.Drawing); sender.SendPacket(drawingPacket); } @@ -4117,7 +4117,7 @@ namespace HISP.Server break; } // Send list of peices - byte[] poetPacket = PacketBuilder.CreateBrickPoetListPacket(room); + byte[] poetPacket = PacketBuilder.CreateBrickPoetList(room); sender.SendPacket(poetPacket); } @@ -4173,7 +4173,7 @@ namespace HISP.Server if (user.Id == sender.LoggedinUser.Id) continue; - byte[] updatePoetRoomPacket = PacketBuilder.CreateBrickPoetMovePacket(peice); + byte[] updatePoetRoomPacket = PacketBuilder.CreateBrickPoetMove(peice); user.LoggedinClient.SendPacket(updatePoetRoomPacket); } @@ -4206,7 +4206,7 @@ namespace HISP.Server if (room.DressupPeices.Length > 0) { - byte[] allDressupsResponse = PacketBuilder.CreateDressupRoomPeiceLoad(room.DressupPeices.ToArray()); + byte[] allDressupsResponse = PacketBuilder.CreateDressupRoomPeiceLoad(room.DressupPeices); sender.SendPacket(allDressupsResponse); } @@ -4280,7 +4280,7 @@ namespace HISP.Server } break; case PacketBuilder.SWFMODULE_BANDHALL: - byte[] response = PacketBuilder.CreateForwardedSwfRequest(packet); + byte[] response = PacketBuilder.CreateForwardedSwfModule(packet); foreach (User user in GetUsersAt(sender.LoggedinUser.X, sender.LoggedinUser.Y)) { if (user.Id == sender.LoggedinUser.Id) @@ -4299,7 +4299,7 @@ namespace HISP.Server else if (twoPlayerGame.Inviting.Id == sender.LoggedinUser.Id) otherUser = twoPlayerGame.Invitee; - response = PacketBuilder.CreateForwardedSwfRequest(packet); + response = PacketBuilder.CreateForwardedSwfModule(packet); otherUser.LoggedinClient.SendPacket(response); } break; @@ -4326,7 +4326,7 @@ namespace HISP.Server if (Arena.UserHasEnteredHorseInAnyArena(sender.LoggedinUser)) { Arena arena = Arena.GetArenaUserEnteredIn(sender.LoggedinUser); - response = PacketBuilder.CreateForwardedSwfRequest(packet); + response = PacketBuilder.CreateForwardedSwfModule(packet); foreach (Arena.ArenaEntry entry in arena.Entries.ToArray()) { if (entry.EnteredUser.Id == sender.LoggedinUser.Id) @@ -5088,7 +5088,7 @@ namespace HISP.Server loggedInUser.Facing = Direction + (onHorse * 5); Logger.DebugPrint("Exiting player: " + loggedInUser.Username + " to: " + loggedInUser.X + "," + loggedInUser.Y); - byte[] moveResponse = PacketBuilder.CreateMovementPacket(loggedInUser.X, loggedInUser.Y, loggedInUser.CharacterId, loggedInUser.Facing, Direction, true); + byte[] moveResponse = PacketBuilder.CreateMovement(loggedInUser.X, loggedInUser.Y, loggedInUser.CharacterId, loggedInUser.Facing, Direction, true); sender.SendPacket(moveResponse); goto Complete; } @@ -5177,12 +5177,12 @@ namespace HISP.Server } } - byte[] moveResponse = PacketBuilder.CreateMovementPacket(loggedInUser.X, loggedInUser.Y, loggedInUser.CharacterId, loggedInUser.Facing, direction, true); + byte[] moveResponse = PacketBuilder.CreateMovement(loggedInUser.X, loggedInUser.Y, loggedInUser.CharacterId, loggedInUser.Facing, direction, true); sender.SendPacket(moveResponse); } else { - byte[] moveResponse = PacketBuilder.CreateMovementPacket(loggedInUser.X, loggedInUser.Y, loggedInUser.CharacterId, loggedInUser.Facing, PacketBuilder.DIRECTION_NONE, false); + byte[] moveResponse = PacketBuilder.CreateMovement(loggedInUser.X, loggedInUser.Y, loggedInUser.CharacterId, loggedInUser.Facing, PacketBuilder.DIRECTION_NONE, false); sender.SendPacket(moveResponse); } Complete:; @@ -5396,7 +5396,7 @@ namespace HISP.Server if (transportLocation.Type != "ROWBOAT") { - byte[] swfModulePacket = PacketBuilder.CreateSwfModule(swfToLoad, PacketBuilder.PACKET_SWF_CUTSCENE); + byte[] swfModulePacket = PacketBuilder.CreateSwfModule(swfToLoad, PacketBuilder.PACKET_SWF_MODULE_CUTSCENE); sender.SendPacket(swfModulePacket); } @@ -5491,7 +5491,7 @@ namespace HISP.Server User[] users = GetUsersAt(sender.LoggedinUser.X, sender.LoggedinUser.Y, true, true); foreach (User user in users) { - byte[] MovementPacket = PacketBuilder.CreateMovementPacket(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); + byte[] MovementPacket = PacketBuilder.CreateMovement(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); user.LoggedinClient.SendPacket(MovementPacket); } UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y, true); @@ -5531,7 +5531,7 @@ namespace HISP.Server User[] users = GetUsersAt(sender.LoggedinUser.X, sender.LoggedinUser.Y, true, true); foreach (User user in users) { - byte[] MovementPacket = PacketBuilder.CreateMovementPacket(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); + byte[] MovementPacket = PacketBuilder.CreateMovement(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); user.LoggedinClient.SendPacket(MovementPacket); } UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y, true); @@ -6017,7 +6017,7 @@ namespace HISP.Server byte[] chatPacketOthers = PacketBuilder.CreateChat(formattedMessage, chatSide); byte[] chatPacketSender = PacketBuilder.CreateChat(formattedMessageSender, chatSide); - byte[] playDmSound = PacketBuilder.CreatePlaysoundPacket(Chat.PrivateMessageSound); + byte[] playDmSound = PacketBuilder.CreatePlaySound(Chat.PrivateMessageSound); // Send to clients ... foreach (GameClient recipiant in recipiants) @@ -7389,7 +7389,7 @@ namespace HISP.Server if(Database.IsUserBanned(userId)) { Logger.DebugPrint(sender.RemoteIp + " Tried to login to : " + username + " but, the account was banned."); - byte[] userBannedPacket = PacketBuilder.CreateLoginPacket(false, Messages.LoginFailedReasonBanned); + byte[] userBannedPacket = PacketBuilder.CreateLogin(false, Messages.LoginFailedReasonBanned); sender.SendPacket(userBannedPacket); return; } @@ -7397,18 +7397,15 @@ namespace HISP.Server if(Database.IsIpBanned(sender.RemoteIp)) { Logger.DebugPrint(sender.RemoteIp + " Tried to login to : " + username + " but, the IP was banned."); - byte[] ipBannedPacket = PacketBuilder.CreateLoginPacket(false, Messages.FormatIpBannedMessage(sender.RemoteIp)); + byte[] ipBannedPacket = PacketBuilder.CreateLogin(false, Messages.FormatIpBannedMessage(sender.RemoteIp)); sender.SendPacket(ipBannedPacket); return; } - - - sender.Login(userId); sender.LoggedinUser.Password = password; - byte[] ResponsePacket = PacketBuilder.CreateLoginPacket(true); + byte[] ResponsePacket = PacketBuilder.CreateLogin(true); sender.SendPacket(ResponsePacket); Logger.DebugPrint(sender.RemoteIp + " Logged into : " + sender.LoggedinUser.Username + " (ADMIN: " + sender.LoggedinUser.Administrator + " MOD: " + sender.LoggedinUser.Moderator + ")"); @@ -7417,7 +7414,7 @@ namespace HISP.Server else { Logger.WarnPrint(sender.RemoteIp + " Attempted to login to: " + username + " with incorrect password "); - byte[] ResponsePacket = PacketBuilder.CreateLoginPacket(false); + byte[] ResponsePacket = PacketBuilder.CreateLogin(false); sender.SendPacket(ResponsePacket); } } @@ -7467,7 +7464,7 @@ namespace HISP.Server client.SendPacket(logoutMessageBytes); // Tell clients of diconnect (remove from chat) - byte[] playerRemovePacket = PacketBuilder.CreatePlayerLeavePacket(sender.LoggedinUser.Username); + byte[] playerRemovePacket = PacketBuilder.CreatePlayerLeave(sender.LoggedinUser.Username); foreach (GameClient client in GameClient.ConnectedClients) if (client.LoggedIn) if (client.LoggedinUser.Id != sender.LoggedinUser.Id) @@ -7755,7 +7752,7 @@ namespace HISP.Server if (user.MailBox.UnreadMailCount > 0) { - byte[] RipOffAOLSound = PacketBuilder.CreatePlaysoundPacket(Messages.MailSe); + byte[] RipOffAOLSound = PacketBuilder.CreatePlaySound(Messages.MailSe); user.LoggedinClient.SendPacket(RipOffAOLSound); byte[] mailReceivedText = PacketBuilder.CreateChat(Messages.MailReceivedMessage, PacketBuilder.CHAT_BOTTOM_RIGHT); @@ -7830,7 +7827,7 @@ namespace HISP.Server if (user.Id == sender.LoggedinUser.Id) continue; - byte[] patchDrawing = PacketBuilder.CreateDrawingUpdatePacket(drawing); + byte[] patchDrawing = PacketBuilder.CreateDrawingUpdate(drawing); user.LoggedinClient.SendPacket(patchDrawing); } } @@ -7876,7 +7873,7 @@ namespace HISP.Server string weather = forClient.LoggedinUser.GetWeatherSeen(); if (lastWeather != weather) { - byte[] WeatherUpdate = PacketBuilder.CreateWeatherUpdatePacket(weather); + byte[] WeatherUpdate = PacketBuilder.CreateWeatherUpdate(weather); forClient.SendPacket(WeatherUpdate); } } @@ -8159,7 +8156,7 @@ namespace HISP.Server UpdateUserFacingAndLocation(sender.LoggedinUser); - byte[] updatePlayer = PacketBuilder.CreateMovementPacket(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, PacketBuilder.DIRECTION_NONE, true); + byte[] updatePlayer = PacketBuilder.CreateMovement(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, PacketBuilder.DIRECTION_NONE, true); sender.SendPacket(updatePlayer); if (sender.LoggedinUser.HorseWindowOpen) @@ -8188,7 +8185,7 @@ namespace HISP.Server sender.LoggedinUser.Facing %= 5; UpdateUserFacingAndLocation(sender.LoggedinUser); - byte[] updatePlayer = PacketBuilder.CreateMovementPacket(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, PacketBuilder.DIRECTION_NONE, true); + byte[] updatePlayer = PacketBuilder.CreateMovement(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, PacketBuilder.DIRECTION_NONE, true); sender.SendPacket(updatePlayer); if (sender.LoggedinUser.HorseWindowOpen) @@ -8222,7 +8219,7 @@ namespace HISP.Server int overlay = Map.GetTileId(tile.X, tile.Y, true); if (tileset == 6 && overlay == 249) // warp point { - byte[] swfPacket = PacketBuilder.CreateSwfModule("warpcutscene", PacketBuilder.PACKET_SWF_CUTSCENE); + byte[] swfPacket = PacketBuilder.CreateSwfModule("warpcutscene", PacketBuilder.PACKET_SWF_MODULE_CUTSCENE); forClient.SendPacket(swfPacket); } } @@ -8271,6 +8268,7 @@ namespace HISP.Server Entry.OnShutdown(); } + public static void StartServer() { ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); diff --git a/HorseIsleServer/LibHISP/Server/PacketBuilder.cs b/HorseIsleServer/LibHISP/Server/PacketBuilder.cs index 5d89314..05cec6c 100755 --- a/HorseIsleServer/LibHISP/Server/PacketBuilder.cs +++ b/HorseIsleServer/LibHISP/Server/PacketBuilder.cs @@ -1,233 +1,233 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text; - -using HISP.Game; -using HISP.Game.SwfModules; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; + +using HISP.Game; +using HISP.Game.SwfModules; using HISP.Util; -namespace HISP.Server -{ - public class PacketBuilder - { - public const byte PACKET_TERMINATOR = 0x00; - public const byte PACKET_CLIENT_TERMINATOR = 0x0A; - public const byte PACKET_FLASH_XML_CROSSDOMAIN = 0x3C; - - public const byte PACKET_LOGIN = 0x7F; - public const byte PACKET_CHAT = 0x14; - public const byte PACKET_MOVE = 0x15; - public const byte PACKET_CLICK = 0x77; - public const byte PACKET_SEC_CODE = 0x81; - public const byte PACKET_WORLD = 0x7A; - public const byte PACKET_BASE_STATS = 0x7B; - public const byte PACKET_RANCH = 0x23; - public const byte PACKET_SWF_CUTSCENE = 0x29; - public const byte PACKET_SWF_MODULE_FORCE = 0x28; - public const byte PACKET_SWF_MODULE_GENTLE = 0x2A; - public const byte PACKET_META = 0x1E; - public const byte PACKET_BIRDMAP = 0x76; - public const byte PACKET_HORSE = 0x19; - public const byte PACKET_AREA_DEFS = 0x79; - public const byte PACKET_ITEM_INTERACTION = 0x1E; - public const byte PACKET_ANNOUNCEMENT = 0x7E; - public const byte PACKET_TILE_FLAGS = 0x75; - public const byte PACKET_PLAYSOUND = 0x23; - public const byte PACKET_KEEP_ALIVE = 0x7C; - public const byte PACKET_DYNAMIC_BUTTON = 0x45; - public const byte PACKET_DYNAMIC_INPUT = 0x46; - public const byte PACKET_ARENA_SCORE = 0x2D; - public const byte PACKET_PLAYER = 0x18; - public const byte PACKET_INVENTORY = 0x17; - public const byte PACKET_TRANSPORT = 0x29; - public const byte PACKET_KICK = 0x80; - public const byte PACKET_LEAVE = 0x7D; - public const byte PACKET_NPC = 0x28; - public const byte PACKET_QUIT = 0x7D; - public const byte PACKET_PLAYERINFO = 0x16; - public const byte PACKET_INFORMATION = 0x28; - public const byte PACKET_WISH = 0x2C; - public const byte PACKET_SWFMODULE = 0x50; - public const byte PACKET_AUCTION = 0x24; - public const byte PACKET_PLAYER_INTERACTION = 0x2A; - public const byte PACKET_SOCIALS = 0x5A; - - public const byte SOCIALS_MENU = 0x14; - public const byte SOCIALS_USE = 0x15; - - public const byte PLAYER_INTERACTION_PROFILE = 0x14; - public const byte PLAYER_INTERACTION_TAG = 0x23; - public const byte PLAYER_INTERACTION_TRADE = 0x28; - public const byte PLAYER_INTERACTION_ADD_ITEM = 0x29; - public const byte PLAYER_INTERACTION_ACCEPT = 0x2A; - public const byte PLAYER_INTERACTION_TRADE_REJECT = 0x2B; - public const byte PLAYER_INTERACTION_ADD_BUDDY = 0x1E; - public const byte PLAYER_INTERACTION_REMOVE_BUDDY = 0x1F; - public const byte PLAYER_INTERACTION_MUTE = 0x32; - public const byte PLAYER_INTERACTION_UNMUTE = 0x33; - - public const byte AUCTION_BID_100 = 0x29; - public const byte AUCTION_BID_1K = 0x2A; - public const byte AUCTION_BID_10K = 0x2B; - public const byte AUCTION_BID_100K = 0x2C; - public const byte AUCTION_BID_1M = 0x2D; - public const byte AUCTION_BID_10M = 0x2E; - public const byte AUCITON_BID_100M = 0x2F; - - public const byte RANCH_BUY = 0x14; - public const byte RANCH_INFO = 0x16; - public const byte RANCH_CLICK = 0x17; - public const byte RANCH_UPGRADE = 0x18; - public const byte RANCH_SELL = 0x15; - public const byte RANCH_BUILD = 0x19; - public const byte RANCH_REMOVE = 0x1A; - public const byte RANCH_CLICK_NORM = 0x14; - public const byte RANCH_CLICK_BUILD = 0x15; - - public const byte HORSE_LIST = 0x0A; - public const byte HORSE_LOOK = 0x14; - public const byte HORSE_FEED = 0x15; - public const byte HORSE_ENTER_ARENA = 0x2D; - public const byte HORSE_PET = 0x18; - public const byte HORSE_PROFILE = 0x2C; - public const byte HORSE_PROFILE_EDIT = 0x14; - public const byte HORSE_TRY_CAPTURE = 0x1C; - public const byte HORSE_RELEASE = 0x19; - public const byte HORSE_TACK = 0x16; - public const byte HORSE_DRINK = 0x2B; - public const byte HORSE_GIVE_FEED = 0x1B; - public const byte HORSE_TACK_EQUIP = 0x3C; - public const byte HORSE_TACK_UNEQUIP = 0x3D; - public const byte HORSE_VET_SERVICE = 0x2A; - public const byte HORSE_VET_SERVICE_ALL = 0x2F; - public const byte HORSE_GROOM_SERVICE_ALL = 0x33; - public const byte HORSE_GROOM_SERVICE = 0x32; - public const byte HORSE_BARN_SERVICE = 0x37; - public const byte HORSE_BARN_SERVICE_ALL = 0x38; - public const byte HORSE_SHOE_IRON = 0x28; - public const byte HORSE_SHOE_STEEL = 0x29; - public const byte HORSE_SHOE_ALL = 0x2E; - public const byte HORSE_TRAIN = 0x1A; - public const byte HORSE_MOUNT = 0x46; - public const byte HORSE_DISMOUNT = 0x47; - public const byte HORSE_ESCAPE = 0x1E; - public const byte HORSE_CAUGHT = 0x1D; - - public const byte SWFMODULE_INVITE = 0x14; - public const byte SWFMODULE_ACCEPT = 0x15; - public const byte SWFMODULE_CLOSE = 0x16; - - public const byte SWFMODULE_2PLAYER_CLOSED = 0x58; - public const byte SWFMODULE_2PLAYER = 0x50; - public const byte SWFMODULE_ARENA = 0x52; - public const byte SWFMODULE_BRICKPOET = 0x5A; - public const byte SWFMODULE_DRAWINGROOM = 0x5B; - public const byte SWFMODULE_DRESSUPROOM = 0x5C; - public const byte SWFMODULE_BANDHALL = 0x51; - - public const byte DRAWINGROOM_GET_DRAWING = 0x14; - public const byte DRAWINGROOM_SAVE = 0x15; - public const byte DRAWINGROOM_LOAD = 0x16; - - public const byte BRICKPOET_LIST_ALL = 0x14; - public const byte BRICKPOET_MOVE = 0x55; - - public const byte DRESSUPROOM_LIST_ALL = 0x14; - - public const byte WISH_MONEY = 0x31; - public const byte WISH_ITEMS = 0x32; - public const byte WISH_WORLDPEACE = 0x33; - - public const byte SECCODE_QUEST = 0x32; - public const byte SECCODE_GIVE_ITEM = 0x28; - public const byte SECCODE_DELETE_ITEM = 0x29; - public const byte SECCODE_SCORE = 0x3D; - public const byte SECCODE_WINLOOSE = 0x3C; - public const byte SECCODE_TIME = 0x3E; - public const byte SECCODE_MONEY = 0x1E; - public const byte SECCODE_AWARD = 0x33; - - public const byte WINLOOSE_WIN = 0x14; - public const byte WINLOOSE_LOOSE = 0x15; - - public const byte NPC_START_CHAT = 0x14; - public const byte NPC_CONTINUE_CHAT = 0x15; - - public const byte PLAYERINFO_LEAVE = 0x16; - public const byte PLAYERINFO_UPDATE_OR_CREATE = 0x15; - public const byte PLAYERINFO_PLAYER_LIST = 0x14; - - public const byte PROFILE_WINLOOSE_LIST = 0x50; - public const byte PROFILE_HIGHSCORES_LIST = 0x51; - public const byte PROFILE_BESTTIMES_LIST = 0x52; - - public const byte VIEW_PROFILE = 0x14; - public const byte SAVE_PROFILE = 0x15; - - public const byte AREA_SEPERATOR = 0x5E; - public const byte AREA_TOWN = 0x54; - public const byte AREA_AREA = 0x41; - public const byte AREA_ISLE = 0x49; - - public const byte MOVE_UP = 0x14; - public const byte MOVE_DOWN = 0x15; - public const byte MOVE_RIGHT = 0x16; - public const byte MOVE_LEFT = 0x17; - public const byte MOVE_ESCAPE = 0x18; - public const byte MOVE_UPDATE = 0x0A; - - - public const byte CHAT_BOTTOM_LEFT = 0x14; - public const byte CHAT_BOTTOM_RIGHT = 0x15; - public const byte CHAT_DM_RIGHT = 0x16; - - public const byte ITEM_INFORMATON = 0x14; - public const byte ITEM_INFORMATON_ID = 0x15; - public const byte NPC_INFORMATION = 0x16; - - public const byte ITEM_DROP = 0x1E; - public const byte ITEM_PICKUP = 0x14; - public const byte ITEM_PICKUP_ALL = 0x15; - public const byte ITEM_BUY = 0x33; - public const byte ITEM_BUY_AND_CONSUME = 0x34; - public const byte ITEM_BUY_5 = 0x35; - public const byte ITEM_BUY_25 = 0x37; - public const byte ITEM_SELL = 0x3C; - public const byte ITEM_WRAP = 0x17; - public const byte ITEM_SELL_ALL = 0x3D; - public const byte ITEM_VIEW = 0x2A; - public const byte ITEM_LOOK = 0x4C; - public const byte ITEM_READ = 0x52; - public const byte ITEM_RIP = 0x2B; - public const byte ITEM_OPEN = 0x16; - public const byte ITEM_WEAR = 0x46; - public const byte ITEM_REMOVE = 0x47; - public const byte ITEM_CONSUME = 0x51; - public const byte ITEM_DRINK = 0x52; - public const byte ITEM_BINOCULARS = 0x5C; - public const byte ITEM_THROW = 0x1F; - public const byte ITEM_MAGNIFYING = 0x5D; - public const byte ITEM_CRAFT = 0x64; - public const byte ITEM_USE = 0x5F; - public const byte ITEM_RAKE = 0x5B; - public const byte ITEM_SHOVEL = 0x5A; - - public const byte LOGIN_INVALID_USER_PASS = 0x15; - public const byte LOGIN_CUSTOM_MESSAGE = 0x16; - public const byte LOGIN_SUCCESS = 0x14; - - public const byte WEATHER_UPDATE = 0x13; - - public const byte DIRECTION_UP = 0; - public const byte DIRECTION_RIGHT = 1; - public const byte DIRECTION_DOWN = 2; - public const byte DIRECTION_LEFT = 3; - public const byte DIRECTION_TELEPORT = 4; - public const byte DIRECTION_NONE = 10; - - // Helper function for packets that return map data, (eg CreateMovementPacket or CreateBirdMap) - // To encode tile data and add it to a given packet represented as a List. +namespace HISP.Server +{ + public class PacketBuilder + { + public const byte PACKET_TERMINATOR = 0x00; + public const byte PACKET_CLIENT_TERMINATOR = 0x0A; + public const byte PACKET_FLASH_XML_CROSSDOMAIN = 0x3C; + + public const byte PACKET_LOGIN = 0x7F; + public const byte PACKET_CHAT = 0x14; + public const byte PACKET_MOVE = 0x15; + public const byte PACKET_CLICK = 0x77; + public const byte PACKET_SEC_CODE = 0x81; + public const byte PACKET_WORLD = 0x7A; + public const byte PACKET_BASE_STATS = 0x7B; + public const byte PACKET_RANCH = 0x23; + public const byte PACKET_SWF_MODULE_CUTSCENE = 0x29; + public const byte PACKET_SWF_MODULE_FORCE = 0x28; + public const byte PACKET_SWF_MODULE_GENTLE = 0x2A; + public const byte PACKET_META = 0x1E; + public const byte PACKET_BIRDMAP = 0x76; + public const byte PACKET_HORSE = 0x19; + public const byte PACKET_AREA_DEFS = 0x79; + public const byte PACKET_ITEM_INTERACTION = 0x1E; + public const byte PACKET_ANNOUNCEMENT = 0x7E; + public const byte PACKET_TILE_FLAGS = 0x75; + public const byte PACKET_PLAYSOUND = 0x23; + public const byte PACKET_KEEP_ALIVE = 0x7C; + public const byte PACKET_DYNAMIC_BUTTON = 0x45; + public const byte PACKET_DYNAMIC_INPUT = 0x46; + public const byte PACKET_ARENA_SCORE = 0x2D; + public const byte PACKET_PLAYER = 0x18; + public const byte PACKET_INVENTORY = 0x17; + public const byte PACKET_TRANSPORT = 0x29; + public const byte PACKET_KICK = 0x80; + public const byte PACKET_LEAVE = 0x7D; + public const byte PACKET_NPC = 0x28; + public const byte PACKET_QUIT = 0x7D; + public const byte PACKET_PLAYERINFO = 0x16; + public const byte PACKET_INFORMATION = 0x28; + public const byte PACKET_WISH = 0x2C; + public const byte PACKET_SWFMODULE = 0x50; + public const byte PACKET_AUCTION = 0x24; + public const byte PACKET_PLAYER_INTERACTION = 0x2A; + public const byte PACKET_SOCIALS = 0x5A; + + public const byte SOCIALS_MENU = 0x14; + public const byte SOCIALS_USE = 0x15; + + public const byte PLAYER_INTERACTION_PROFILE = 0x14; + public const byte PLAYER_INTERACTION_TAG = 0x23; + public const byte PLAYER_INTERACTION_TRADE = 0x28; + public const byte PLAYER_INTERACTION_ADD_ITEM = 0x29; + public const byte PLAYER_INTERACTION_ACCEPT = 0x2A; + public const byte PLAYER_INTERACTION_TRADE_REJECT = 0x2B; + public const byte PLAYER_INTERACTION_ADD_BUDDY = 0x1E; + public const byte PLAYER_INTERACTION_REMOVE_BUDDY = 0x1F; + public const byte PLAYER_INTERACTION_MUTE = 0x32; + public const byte PLAYER_INTERACTION_UNMUTE = 0x33; + + public const byte AUCTION_BID_100 = 0x29; + public const byte AUCTION_BID_1K = 0x2A; + public const byte AUCTION_BID_10K = 0x2B; + public const byte AUCTION_BID_100K = 0x2C; + public const byte AUCTION_BID_1M = 0x2D; + public const byte AUCTION_BID_10M = 0x2E; + public const byte AUCITON_BID_100M = 0x2F; + + public const byte RANCH_BUY = 0x14; + public const byte RANCH_INFO = 0x16; + public const byte RANCH_CLICK = 0x17; + public const byte RANCH_UPGRADE = 0x18; + public const byte RANCH_SELL = 0x15; + public const byte RANCH_BUILD = 0x19; + public const byte RANCH_REMOVE = 0x1A; + public const byte RANCH_CLICK_NORM = 0x14; + public const byte RANCH_CLICK_BUILD = 0x15; + + public const byte HORSE_LIST = 0x0A; + public const byte HORSE_LOOK = 0x14; + public const byte HORSE_FEED = 0x15; + public const byte HORSE_ENTER_ARENA = 0x2D; + public const byte HORSE_PET = 0x18; + public const byte HORSE_PROFILE = 0x2C; + public const byte HORSE_PROFILE_EDIT = 0x14; + public const byte HORSE_TRY_CAPTURE = 0x1C; + public const byte HORSE_RELEASE = 0x19; + public const byte HORSE_TACK = 0x16; + public const byte HORSE_DRINK = 0x2B; + public const byte HORSE_GIVE_FEED = 0x1B; + public const byte HORSE_TACK_EQUIP = 0x3C; + public const byte HORSE_TACK_UNEQUIP = 0x3D; + public const byte HORSE_VET_SERVICE = 0x2A; + public const byte HORSE_VET_SERVICE_ALL = 0x2F; + public const byte HORSE_GROOM_SERVICE_ALL = 0x33; + public const byte HORSE_GROOM_SERVICE = 0x32; + public const byte HORSE_BARN_SERVICE = 0x37; + public const byte HORSE_BARN_SERVICE_ALL = 0x38; + public const byte HORSE_SHOE_IRON = 0x28; + public const byte HORSE_SHOE_STEEL = 0x29; + public const byte HORSE_SHOE_ALL = 0x2E; + public const byte HORSE_TRAIN = 0x1A; + public const byte HORSE_MOUNT = 0x46; + public const byte HORSE_DISMOUNT = 0x47; + public const byte HORSE_ESCAPE = 0x1E; + public const byte HORSE_CAUGHT = 0x1D; + + public const byte SWFMODULE_INVITE = 0x14; + public const byte SWFMODULE_ACCEPT = 0x15; + public const byte SWFMODULE_CLOSE = 0x16; + + public const byte SWFMODULE_2PLAYER_CLOSED = 0x58; + public const byte SWFMODULE_2PLAYER = 0x50; + public const byte SWFMODULE_ARENA = 0x52; + public const byte SWFMODULE_BRICKPOET = 0x5A; + public const byte SWFMODULE_DRAWINGROOM = 0x5B; + public const byte SWFMODULE_DRESSUPROOM = 0x5C; + public const byte SWFMODULE_BANDHALL = 0x51; + + public const byte DRAWINGROOM_GET_DRAWING = 0x14; + public const byte DRAWINGROOM_SAVE = 0x15; + public const byte DRAWINGROOM_LOAD = 0x16; + + public const byte BRICKPOET_LIST_ALL = 0x14; + public const byte BRICKPOET_MOVE = 0x55; + + public const byte DRESSUPROOM_LIST_ALL = 0x14; + + public const byte WISH_MONEY = 0x31; + public const byte WISH_ITEMS = 0x32; + public const byte WISH_WORLDPEACE = 0x33; + + public const byte SECCODE_QUEST = 0x32; + public const byte SECCODE_GIVE_ITEM = 0x28; + public const byte SECCODE_DELETE_ITEM = 0x29; + public const byte SECCODE_SCORE = 0x3D; + public const byte SECCODE_WINLOOSE = 0x3C; + public const byte SECCODE_TIME = 0x3E; + public const byte SECCODE_MONEY = 0x1E; + public const byte SECCODE_AWARD = 0x33; + + public const byte WINLOOSE_WIN = 0x14; + public const byte WINLOOSE_LOOSE = 0x15; + + public const byte NPC_START_CHAT = 0x14; + public const byte NPC_CONTINUE_CHAT = 0x15; + + public const byte PLAYERINFO_LEAVE = 0x16; + public const byte PLAYERINFO_UPDATE_OR_CREATE = 0x15; + public const byte PLAYERINFO_PLAYER_LIST = 0x14; + + public const byte PROFILE_WINLOOSE_LIST = 0x50; + public const byte PROFILE_HIGHSCORES_LIST = 0x51; + public const byte PROFILE_BESTTIMES_LIST = 0x52; + + public const byte VIEW_PROFILE = 0x14; + public const byte SAVE_PROFILE = 0x15; + + public const byte AREA_SEPERATOR = 0x5E; + public const byte AREA_TOWN = 0x54; + public const byte AREA_AREA = 0x41; + public const byte AREA_ISLE = 0x49; + + public const byte MOVE_UP = 0x14; + public const byte MOVE_DOWN = 0x15; + public const byte MOVE_RIGHT = 0x16; + public const byte MOVE_LEFT = 0x17; + public const byte MOVE_ESCAPE = 0x18; + public const byte MOVE_UPDATE = 0x0A; + + + public const byte CHAT_BOTTOM_LEFT = 0x14; + public const byte CHAT_BOTTOM_RIGHT = 0x15; + public const byte CHAT_DM_RIGHT = 0x16; + + public const byte ITEM_INFORMATON = 0x14; + public const byte ITEM_INFORMATON_ID = 0x15; + public const byte NPC_INFORMATION = 0x16; + + public const byte ITEM_DROP = 0x1E; + public const byte ITEM_PICKUP = 0x14; + public const byte ITEM_PICKUP_ALL = 0x15; + public const byte ITEM_BUY = 0x33; + public const byte ITEM_BUY_AND_CONSUME = 0x34; + public const byte ITEM_BUY_5 = 0x35; + public const byte ITEM_BUY_25 = 0x37; + public const byte ITEM_SELL = 0x3C; + public const byte ITEM_WRAP = 0x17; + public const byte ITEM_SELL_ALL = 0x3D; + public const byte ITEM_VIEW = 0x2A; + public const byte ITEM_LOOK = 0x4C; + public const byte ITEM_READ = 0x52; + public const byte ITEM_RIP = 0x2B; + public const byte ITEM_OPEN = 0x16; + public const byte ITEM_WEAR = 0x46; + public const byte ITEM_REMOVE = 0x47; + public const byte ITEM_CONSUME = 0x51; + public const byte ITEM_DRINK = 0x52; + public const byte ITEM_BINOCULARS = 0x5C; + public const byte ITEM_THROW = 0x1F; + public const byte ITEM_MAGNIFYING = 0x5D; + public const byte ITEM_CRAFT = 0x64; + public const byte ITEM_USE = 0x5F; + public const byte ITEM_RAKE = 0x5B; + public const byte ITEM_SHOVEL = 0x5A; + + public const byte LOGIN_INVALID_USER_PASS = 0x15; + public const byte LOGIN_CUSTOM_MESSAGE = 0x16; + public const byte LOGIN_SUCCESS = 0x14; + + public const byte WEATHER_UPDATE = 0x13; + + public const byte DIRECTION_UP = 0; + public const byte DIRECTION_RIGHT = 1; + public const byte DIRECTION_DOWN = 2; + public const byte DIRECTION_LEFT = 3; + public const byte DIRECTION_TELEPORT = 4; + public const byte DIRECTION_NONE = 10; + + // Helper function for packets that return map data, (eg CreateMovement or CreateBirdMap) + // To encode tile data and add it to a given packet represented as a List. private static void encodeTileDataAndAddToPacket(List packet, int tileId, int otileId) { if (tileId >= 190) @@ -243,677 +243,677 @@ namespace HISP.Server otileId -= 100; } packet.Add((byte)otileId); - } - - // Creates a byte array of a packet to inform the client that Player 2 in the current 2Player game - // has actually left / quit the game. - public static byte[] Create2PlayerClose() - { - byte[] packet = new byte[3]; - packet[0] = PACKET_SWFMODULE; - packet[1] = SWFMODULE_2PLAYER_CLOSED; - packet[2] = PACKET_TERMINATOR; - - return packet; - } - - // Creates a byte array of a packet to inform the client that a peice in a dressup room - // was moved to another location. - public static byte[] CreateDressupRoomPeiceMove(int peiceId, double x, double y, bool active) - { - string peiceMoveStr = ""; - peiceMoveStr += peiceId.ToString() + "|"; - if (active) - { - peiceMoveStr += x.ToString() + "|"; - peiceMoveStr += y.ToString() + "|"; - } - else - { - peiceMoveStr += "D|D|"; - } - peiceMoveStr += "^"; + } + + // Creates a byte array of a packet to inform the client that Player 2 in the current 2Player game + // has actually left / quit the game. + public static byte[] Create2PlayerClose() + { + byte[] packet = new byte[3]; + packet[0] = PACKET_SWFMODULE; + packet[1] = SWFMODULE_2PLAYER_CLOSED; + packet[2] = PACKET_TERMINATOR; + + return packet; + } + + // Creates a byte array of a packet to inform the client that a peice in a dressup room + // was moved to another location. + public static byte[] CreateDressupRoomPeiceMove(int peiceId, double x, double y, bool active) + { + string peiceMoveStr = ""; + peiceMoveStr += peiceId.ToString() + "|"; + if (active) + { + peiceMoveStr += x.ToString() + "|"; + peiceMoveStr += y.ToString() + "|"; + } + else + { + peiceMoveStr += "D|D|"; + } + peiceMoveStr += "^"; byte[] peiceMoveBytes = Encoding.UTF8.GetBytes(peiceMoveStr); - byte[] packet = new byte[(1 * 2) + peiceMoveBytes.Length]; - - packet[0] = PACKET_SWFMODULE; - Array.Copy(peiceMoveBytes, 0, packet, 1, peiceMoveBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet to inform the client of all the peices - // in a given dressup room. - public static byte[] CreateDressupRoomPeiceLoad(Dressup.DressupPeice[] dressupPeices) - { - string peiceLoadStr = ""; - foreach(Dressup.DressupPeice peice in dressupPeices) - { - if (!peice.Active) - continue; - - peiceLoadStr += peice.PeiceId.ToString() + "|"; - peiceLoadStr += peice.X.ToString() + "|"; - peiceLoadStr += peice.Y.ToString() + "|"; - peiceLoadStr += "^"; - } - - byte[] peiceLoadBytes = Encoding.UTF8.GetBytes(peiceLoadStr); + byte[] packet = new byte[(1 * 2) + peiceMoveBytes.Length]; + + packet[0] = PACKET_SWFMODULE; + Array.Copy(peiceMoveBytes, 0, packet, 1, peiceMoveBytes.Length); + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet to inform the client of all the peices + // in a given dressup room. + public static byte[] CreateDressupRoomPeiceLoad(Dressup.DressupPeice[] dressupPeices) + { + string peiceLoadStr = ""; + foreach(Dressup.DressupPeice peice in dressupPeices) + { + if (!peice.Active) + continue; + + peiceLoadStr += peice.PeiceId.ToString() + "|"; + peiceLoadStr += peice.X.ToString() + "|"; + peiceLoadStr += peice.Y.ToString() + "|"; + peiceLoadStr += "^"; + } + + byte[] peiceLoadBytes = Encoding.UTF8.GetBytes(peiceLoadStr); byte[] packet = new byte[(1 * 2) + peiceLoadBytes.Length]; - packet[0] = PACKET_SWFMODULE; - Array.Copy(peiceLoadBytes, 0, packet, 1, peiceLoadBytes.Length); + packet[0] = PACKET_SWFMODULE; + Array.Copy(peiceLoadBytes, 0, packet, 1, peiceLoadBytes.Length); packet[packet.Length - 1] = PACKET_TERMINATOR; - return packet; - } - // Creates a byte array that contains the contents of a request byte array - // as the response, it basically just forwards it onwards - // this is used for *most* SwfModule - public static byte[] CreateForwardedSwfRequest(byte[] request) - { - byte[] packet = new byte[(1 * 2) + request.Length]; - packet[0] = PACKET_SWFMODULE; - Array.Copy(request, 0, packet, 1, request.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - return packet; - } - // Creates a byte array that contains "Bird Map" data + return packet; + } + // Creates a byte array that contains the contents of a request byte array + // as the response, it basically just forwards it onwards + // this is used for *most* SwfModule + public static byte[] CreateForwardedSwfModule(byte[] request) + { + byte[] packet = new byte[(1 * 2) + request.Length]; + packet[0] = PACKET_SWFMODULE; + Array.Copy(request, 0, packet, 1, request.Length); + packet[packet.Length - 1] = PACKET_TERMINATOR; + return packet; + } + // Creates a byte array that contains "Bird Map" data // From a given X/Y Position, this is primarily used to handle - // using the telescope item in game - public static byte[] CreateBirdMap(int X, int Y) - { - // The size is always fixed in this case, but i still have to use a List because - // encodeTileDataAndAddToPacket expects packet as a List. - List packet = new List(); - - // Calculate top left corner of BirdMap viewport - // from given X/Y position. - int startX = X - 24; - int startY = Y - 15; - - packet.Add(PACKET_BIRDMAP); - - for (int rely = 0; rely <= 30; rely++) - { - for (int relx = 0; relx <= 48; relx++) - { - int tileId = Map.GetTileId(startX + relx, startY + rely, false); - int otileId = Map.GetTileId(startX + relx, startY + rely, true); - encodeTileDataAndAddToPacket(packet, tileId, otileId); - } - } - - packet.Add(PACKET_TERMINATOR); - - return packet.ToArray(); - } - // Creates a byte array for a packet to inform the client that the image in a drawing room has changed. - public static byte[] CreateDrawingUpdatePacket(string Drawing) - { - byte[] drawingBytes = Encoding.UTF8.GetBytes(Drawing); - byte[] packet = new byte[(1 * 2) + drawingBytes.Length]; - - packet[0] = PACKET_SWFMODULE; - Array.Copy(drawingBytes, 0, packet, 1, drawingBytes.Length); - packet[packet.Length-1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array for a packet to inform the client that a poetry peice in a brick poet room has moved. - public static byte[] CreateBrickPoetMovePacket(Brickpoet.PoetryPeice peice) - { - string peiceUpdateStr = "|"; - peiceUpdateStr += peice.Id + "|"; - peiceUpdateStr += peice.X + "|"; - peiceUpdateStr += peice.Y + "|"; - peiceUpdateStr += "^"; - - byte[] infoBytes = Encoding.UTF8.GetBytes(peiceUpdateStr); - byte[] packet = new byte[(1 * 3) + infoBytes.Length]; - - packet[0] = PACKET_SWFMODULE; - packet[1] = BRICKPOET_MOVE; - - Array.Copy(infoBytes, 0, packet, 2, infoBytes.Length); - - packet[packet.Length-1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array for a packet to inform the client of all all Poetry Peices in a Brick Poet room - public static byte[] CreateBrickPoetListPacket(Brickpoet.PoetryPeice[] room) - { - string peicesStr = ""; - foreach(Brickpoet.PoetryPeice peice in room) - { - peicesStr += "A"; - peicesStr += "|"; - peicesStr += peice.Id; - peicesStr += "|"; - peicesStr += peice.Word.ToUpper(); - peicesStr += "|"; - peicesStr += peice.X; - peicesStr += "|"; - peicesStr += peice.Y; - peicesStr += "|"; - peicesStr += "^"; - } - byte[] peicesBytes = Encoding.UTF8.GetBytes(peicesStr); - byte[] packet = new byte[(1 * 2) + peicesBytes.Length]; - - packet[0] = PACKET_SWFMODULE; - - Array.Copy(peicesBytes, 0, packet, 1, peicesBytes.Length); - - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet requesting the client to play a sound effect. - public static byte[] CreatePlaysoundPacket(string sound) - { - byte[] soundBytes = Encoding.UTF8.GetBytes(sound); - byte[] packet = new byte[(1 * 2) + soundBytes.Length]; - - packet[0] = PACKET_PLAYSOUND; - - Array.Copy(soundBytes, 0, packet, 1, soundBytes.Length); - - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet informing the client that a given user has left the game - // So they can be removed from the chat list - public static byte[] CreatePlayerLeavePacket(string username) - { - byte[] userBytes = Encoding.UTF8.GetBytes(username); - byte[] packet = new byte[(1 * 3) + userBytes.Length]; - - packet[0] = PACKET_PLAYERINFO; - packet[1] = PLAYERINFO_LEAVE; - - Array.Copy(userBytes, 0, packet, 2, userBytes.Length); - - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet informing the client that a given player has changed position, - // changed direction, or changed character sprites - public static byte[] CreatePlayerInfoUpdateOrCreate(int x, int y, int facing, int charId, string username) - { - byte[] userBytes = Encoding.UTF8.GetBytes(username); - byte[] packet = new byte[(1 * 10) + userBytes.Length]; - - packet[0] = PACKET_PLAYERINFO; - packet[1] = PLAYERINFO_UPDATE_OR_CREATE; - - packet[2] = (byte)(((x - 4) / 64) + 20); - packet[3] = (byte)(((x - 4) % 64) + 20); - - packet[4] = (byte)(((y - 1) / 64) + 20); - packet[5] = (byte)(((y - 1) % 64) + 20); - - packet[6] = (byte)(facing + 20); - - packet[7] = (byte)((charId / 64) + 20); - packet[8] = (byte)((charId % 64) + 20); - - Array.Copy(userBytes, 0, packet, 9, userBytes.Length); - - packet[packet.Length-1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet to inform the client - // if a given Login Attempt was successful or not - public static byte[] CreateLoginPacket(bool Success, string ErrorMessage="") - { - byte[] loginFailMessage = Encoding.UTF8.GetBytes(ErrorMessage); - byte[] packet = new byte[(1 * 3) + loginFailMessage.Length]; - - packet[0] = PACKET_LOGIN; - if (ErrorMessage != "") - packet[1] = LOGIN_CUSTOM_MESSAGE; - else if (Success) - packet[1] = LOGIN_SUCCESS; - else - packet[1] = LOGIN_INVALID_USER_PASS; - - Array.Copy(loginFailMessage, 0, packet, 2, loginFailMessage.Length); - - packet[packet.Length-1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet to inform the client of - // the users current profile page, or "about me" - // This is for the the "Profile" button - public static byte[] CreateProfilePage(string userProfile) - { - byte[] profileBytes = Encoding.UTF8.GetBytes(userProfile); - byte[] packet = new byte[(1 * 2) + profileBytes.Length]; - - packet[0] = PACKET_PLAYER; - Array.Copy(profileBytes, 0, packet, 1, profileBytes.Length); - packet[packet.Length-1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet to inform the client of the players - // new X/Y position, there character id, facing direction, and Tile Data for their position in the map. - public static byte[] CreateMovementPacket(int x, int y, int charId, int facing, int direction, bool walk) + // using the telescope item in game + public static byte[] CreateBirdMap(int X, int Y) + { + // The size is always fixed in this case, but i still have to use a List because + // encodeTileDataAndAddToPacket expects packet as a List. + List packet = new List(); + + // Calculate top left corner of BirdMap viewport + // from given X/Y position. + int startX = X - 24; + int startY = Y - 15; + + packet.Add(PACKET_BIRDMAP); + + for (int rely = 0; rely <= 30; rely++) + { + for (int relx = 0; relx <= 48; relx++) + { + int tileId = Map.GetTileId(startX + relx, startY + rely, false); + int otileId = Map.GetTileId(startX + relx, startY + rely, true); + encodeTileDataAndAddToPacket(packet, tileId, otileId); + } + } + + packet.Add(PACKET_TERMINATOR); + + return packet.ToArray(); + } + // Creates a byte array for a packet to inform the client that the image in a drawing room has changed. + public static byte[] CreateDrawingUpdate(string Drawing) + { + byte[] drawingBytes = Encoding.UTF8.GetBytes(Drawing); + byte[] packet = new byte[(1 * 2) + drawingBytes.Length]; + + packet[0] = PACKET_SWFMODULE; + Array.Copy(drawingBytes, 0, packet, 1, drawingBytes.Length); + packet[packet.Length-1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array for a packet to inform the client that a poetry peice in a brick poet room has moved. + public static byte[] CreateBrickPoetMove(Brickpoet.PoetryPeice peice) + { + string peiceUpdateStr = "|"; + peiceUpdateStr += peice.Id + "|"; + peiceUpdateStr += peice.X + "|"; + peiceUpdateStr += peice.Y + "|"; + peiceUpdateStr += "^"; + + byte[] infoBytes = Encoding.UTF8.GetBytes(peiceUpdateStr); + byte[] packet = new byte[(1 * 3) + infoBytes.Length]; + + packet[0] = PACKET_SWFMODULE; + packet[1] = BRICKPOET_MOVE; + + Array.Copy(infoBytes, 0, packet, 2, infoBytes.Length); + + packet[packet.Length-1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array for a packet to inform the client of all all Poetry Peices in a Brick Poet room + public static byte[] CreateBrickPoetList(Brickpoet.PoetryPeice[] room) + { + string peicesStr = ""; + foreach(Brickpoet.PoetryPeice peice in room) + { + peicesStr += "A"; + peicesStr += "|"; + peicesStr += peice.Id; + peicesStr += "|"; + peicesStr += peice.Word.ToUpper(); + peicesStr += "|"; + peicesStr += peice.X; + peicesStr += "|"; + peicesStr += peice.Y; + peicesStr += "|"; + peicesStr += "^"; + } + byte[] peicesBytes = Encoding.UTF8.GetBytes(peicesStr); + byte[] packet = new byte[(1 * 2) + peicesBytes.Length]; + + packet[0] = PACKET_SWFMODULE; + + Array.Copy(peicesBytes, 0, packet, 1, peicesBytes.Length); + + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet requesting the client to play a sound effect. + public static byte[] CreatePlaySound(string sound) + { + byte[] soundBytes = Encoding.UTF8.GetBytes(sound); + byte[] packet = new byte[(1 * 2) + soundBytes.Length]; + + packet[0] = PACKET_PLAYSOUND; + + Array.Copy(soundBytes, 0, packet, 1, soundBytes.Length); + + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet informing the client that a given user has left the game + // So they can be removed from the chat list + public static byte[] CreatePlayerLeave(string username) + { + byte[] userBytes = Encoding.UTF8.GetBytes(username); + byte[] packet = new byte[(1 * 3) + userBytes.Length]; + + packet[0] = PACKET_PLAYERINFO; + packet[1] = PLAYERINFO_LEAVE; + + Array.Copy(userBytes, 0, packet, 2, userBytes.Length); + + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet informing the client that a given player has changed position, + // changed direction, or changed character sprites + public static byte[] CreatePlayerInfoUpdateOrCreate(int x, int y, int facing, int charId, string username) + { + byte[] userBytes = Encoding.UTF8.GetBytes(username); + byte[] packet = new byte[(1 * 10) + userBytes.Length]; + + packet[0] = PACKET_PLAYERINFO; + packet[1] = PLAYERINFO_UPDATE_OR_CREATE; + + packet[2] = (byte)(((x - 4) / 64) + 20); + packet[3] = (byte)(((x - 4) % 64) + 20); + + packet[4] = (byte)(((y - 1) / 64) + 20); + packet[5] = (byte)(((y - 1) % 64) + 20); + + packet[6] = (byte)(facing + 20); + + packet[7] = (byte)((charId / 64) + 20); + packet[8] = (byte)((charId % 64) + 20); + + Array.Copy(userBytes, 0, packet, 9, userBytes.Length); + + packet[packet.Length-1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet to inform the client + // if a given Login Attempt was successful or not + public static byte[] CreateLogin(bool Success, string ErrorMessage="") + { + byte[] loginFailMessage = Encoding.UTF8.GetBytes(ErrorMessage); + byte[] packet = new byte[(1 * 3) + loginFailMessage.Length]; + + packet[0] = PACKET_LOGIN; + if (ErrorMessage != "") + packet[1] = LOGIN_CUSTOM_MESSAGE; + else if (Success) + packet[1] = LOGIN_SUCCESS; + else + packet[1] = LOGIN_INVALID_USER_PASS; + + Array.Copy(loginFailMessage, 0, packet, 2, loginFailMessage.Length); + + packet[packet.Length-1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet to inform the client of + // the users current profile page, or "about me" + // This is for the the "Profile" button + public static byte[] CreateProfilePage(string userProfile) + { + byte[] profileBytes = Encoding.UTF8.GetBytes(userProfile); + byte[] packet = new byte[(1 * 2) + profileBytes.Length]; + + packet[0] = PACKET_PLAYER; + Array.Copy(profileBytes, 0, packet, 1, profileBytes.Length); + packet[packet.Length-1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet to inform the client of the players + // new X/Y position, there character id, facing direction, and Tile Data for their position in the map. + public static byte[] CreateMovement(int x, int y, int charId, int facing, int direction, bool walk) { /* Packet HEADER */ // Packet size varries too much and so using a dynamically sized list of bytes instead of a byte[] - List packet = new List(); - - packet.Add(PACKET_MOVE); // 0x0 - - packet.Add((byte)(((x-4) / 64) + 20)); //0x1 - packet.Add((byte)(((x-4) % 64) + 20)); //0x2 - - packet.Add((byte)(((y-1) / 64) + 20)); //0x3 - packet.Add((byte)(((y-1) % 64) + 20)); //0x4 - - packet.Add((byte)(facing + 20)); //0x5 - - packet.Add((byte)((charId / 64) + 20)); //0x6 - packet.Add((byte)((charId % 64) + 20)); //0x7 - packet.Add((byte)(direction + 20)); //0x8 - packet.Add((byte)(Convert.ToInt32(walk) + 20)); //0x9 - - /* Packet PAYLOAD */ - bool moveTwo = false; - if(direction >= 20) // is the player riding a horse? - { - direction -= 20; - moveTwo = true; - } - - - // Calculate start of the client's viewport start offset from top-left origin - int startY = y - 4; - int startX = x - 6; - int endX = startX + 12; - int endY = startY + 9; - - // This giant if case logic essentially - // Pulls the missing tile data portion from map file - // And encodes it into packet data - if (direction == DIRECTION_UP) - { - int totalY = 0; - if (moveTwo) - { - startY++; - totalY = 1; - } - - for (int curY = startY; curY >= startY - totalY; curY--) - { - for (int curX = startX; curX <= endX; curX++) - { - int tileId = Map.GetTileId(curX, curY, false); - int otileId = Map.GetTileId(curX, curY, true); - encodeTileDataAndAddToPacket(packet, tileId, otileId); - } - } - } - else if (direction == DIRECTION_LEFT) - { - int totalX = 0; - if (moveTwo) - { - startX++; - totalX = 1; - } - - for (int curX = startX; curX >= startX - totalX; curX--) - { - for (int curY = startY; curY <= endY; curY++) - { - int tileId = Map.GetTileId(curX, curY, false); - int otileId = Map.GetTileId(curX, curY, true); - encodeTileDataAndAddToPacket(packet, tileId, otileId); - } - } - } - else if (direction == DIRECTION_RIGHT) - { - int totalX = 0; - if (moveTwo) - { - endX--; - totalX = 1; - } - - for (int curX = endX; curX <= endX + totalX; curX++) - { - - for (int curY = startY; curY <= endY; curY++) - { - int tileId = Map.GetTileId(curX, curY, false); - int otileId = Map.GetTileId(curX, curY, true); - encodeTileDataAndAddToPacket(packet, tileId, otileId); - - } - } - } - else if (direction == DIRECTION_DOWN) - { - int totalY = 0; - if (moveTwo) - { - endY--; - totalY = 1; - } - - for (int curY = endY; curY <= endY + totalY; curY++) - { - - for (int curX = startX; curX <= endX; curX++) - { - int tileId = Map.GetTileId(curX, curY, false); - int otileId = Map.GetTileId(curX, curY, true); - encodeTileDataAndAddToPacket(packet, tileId, otileId); - } - } - - } - else if (direction == DIRECTION_TELEPORT) - { - for(int rely = 0; rely <= 9; rely++) - { - for (int relx = 0; relx <= 12; relx++) - { - int tileId = Map.GetTileId(startX + relx, startY + rely, false); - int otileId = Map.GetTileId(startX + relx, startY + rely, true); - encodeTileDataAndAddToPacket(packet, tileId, otileId); - } - } - - } - packet.Add(PACKET_TERMINATOR); - - return packet.ToArray(); - } - // Creates a byte array of a packet containing Information about a specific tile - // used when you click on a tile in the client, it gives you some extra info about it. - public static byte[] CreateTileClickInfo(string text) - { - byte[] strBytes = Encoding.UTF8.GetBytes(text); - byte[] packet = new byte[(1 * 2) + strBytes.Length]; - packet[0] = PACKET_CLICK; - Array.Copy(strBytes, 0, packet, 1, strBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - return packet; - } - - // Creates a byte array of a packet containing information to be displayed in the "Meta" window - // (Thats the one on the top-right corner of the screent hat contains buttons and other widgets) - public static byte[] CreateMeta(string formattedText) - { - byte[] formattedBytes = Encoding.UTF8.GetBytes(formattedText); - byte[] packet = new byte[(1 * 2) + formattedBytes.Length]; - - packet[0] = PACKET_META; - Array.Copy(formattedBytes, 0, packet, 1, formattedBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet informing the client to display a chat message - // And which of the two chat windows to include it in. - public static byte[] CreateChat(string formattedText, byte chatWindow) - { - byte[] formattedBytes = Encoding.UTF8.GetBytes(formattedText); - byte[] packet = new byte[(1 * 3) + formattedBytes.Length]; - packet[0] = PACKET_CHAT; - packet[1] = chatWindow; - Array.Copy(formattedBytes, 0, packet, 2, formattedBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - return packet; - } - - // Creates a byte array of a packet informing the client to change the current Weather Effect. - public static byte[] CreateWeatherUpdatePacket(string newWeather) - { - byte[] weatherBytes = Encoding.UTF8.GetBytes(newWeather); - byte[] packet = new byte[(1 * 3) + weatherBytes.Length]; - packet[0] = PACKET_WORLD; - packet[1] = WEATHER_UPDATE; + List packet = new List(); + + packet.Add(PACKET_MOVE); // 0x0 + + packet.Add((byte)(((x-4) / 64) + 20)); //0x1 + packet.Add((byte)(((x-4) % 64) + 20)); //0x2 + + packet.Add((byte)(((y-1) / 64) + 20)); //0x3 + packet.Add((byte)(((y-1) % 64) + 20)); //0x4 + + packet.Add((byte)(facing + 20)); //0x5 + + packet.Add((byte)((charId / 64) + 20)); //0x6 + packet.Add((byte)((charId % 64) + 20)); //0x7 + packet.Add((byte)(direction + 20)); //0x8 + packet.Add((byte)(Convert.ToInt32(walk) + 20)); //0x9 + + /* Packet PAYLOAD */ + bool moveTwo = false; + if(direction >= 20) // is the player riding a horse? + { + direction -= 20; + moveTwo = true; + } + + + // Calculate start of the client's viewport start offset from top-left origin + int startY = y - 4; + int startX = x - 6; + int endX = startX + 12; + int endY = startY + 9; + + // This giant if case logic essentially + // Pulls the missing tile data portion from map file + // And encodes it into packet data + if (direction == DIRECTION_UP) + { + int totalY = 0; + if (moveTwo) + { + startY++; + totalY = 1; + } + + for (int curY = startY; curY >= startY - totalY; curY--) + { + for (int curX = startX; curX <= endX; curX++) + { + int tileId = Map.GetTileId(curX, curY, false); + int otileId = Map.GetTileId(curX, curY, true); + encodeTileDataAndAddToPacket(packet, tileId, otileId); + } + } + } + else if (direction == DIRECTION_LEFT) + { + int totalX = 0; + if (moveTwo) + { + startX++; + totalX = 1; + } + + for (int curX = startX; curX >= startX - totalX; curX--) + { + for (int curY = startY; curY <= endY; curY++) + { + int tileId = Map.GetTileId(curX, curY, false); + int otileId = Map.GetTileId(curX, curY, true); + encodeTileDataAndAddToPacket(packet, tileId, otileId); + } + } + } + else if (direction == DIRECTION_RIGHT) + { + int totalX = 0; + if (moveTwo) + { + endX--; + totalX = 1; + } + + for (int curX = endX; curX <= endX + totalX; curX++) + { + + for (int curY = startY; curY <= endY; curY++) + { + int tileId = Map.GetTileId(curX, curY, false); + int otileId = Map.GetTileId(curX, curY, true); + encodeTileDataAndAddToPacket(packet, tileId, otileId); + + } + } + } + else if (direction == DIRECTION_DOWN) + { + int totalY = 0; + if (moveTwo) + { + endY--; + totalY = 1; + } + + for (int curY = endY; curY <= endY + totalY; curY++) + { + + for (int curX = startX; curX <= endX; curX++) + { + int tileId = Map.GetTileId(curX, curY, false); + int otileId = Map.GetTileId(curX, curY, true); + encodeTileDataAndAddToPacket(packet, tileId, otileId); + } + } + + } + else if (direction == DIRECTION_TELEPORT) + { + for(int rely = 0; rely <= 9; rely++) + { + for (int relx = 0; relx <= 12; relx++) + { + int tileId = Map.GetTileId(startX + relx, startY + rely, false); + int otileId = Map.GetTileId(startX + relx, startY + rely, true); + encodeTileDataAndAddToPacket(packet, tileId, otileId); + } + } + + } + packet.Add(PACKET_TERMINATOR); + + return packet.ToArray(); + } + // Creates a byte array of a packet containing Information about a specific tile + // used when you click on a tile in the client, it gives you some extra info about it. + public static byte[] CreateTileClickInfo(string text) + { + byte[] strBytes = Encoding.UTF8.GetBytes(text); + byte[] packet = new byte[(1 * 2) + strBytes.Length]; + packet[0] = PACKET_CLICK; + Array.Copy(strBytes, 0, packet, 1, strBytes.Length); + packet[packet.Length - 1] = PACKET_TERMINATOR; + return packet; + } + + // Creates a byte array of a packet containing information to be displayed in the "Meta" window + // (Thats the one on the top-right corner of the screent hat contains buttons and other widgets) + public static byte[] CreateMeta(string formattedText) + { + byte[] formattedBytes = Encoding.UTF8.GetBytes(formattedText); + byte[] packet = new byte[(1 * 2) + formattedBytes.Length]; + + packet[0] = PACKET_META; + Array.Copy(formattedBytes, 0, packet, 1, formattedBytes.Length); + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet informing the client to display a chat message + // And which of the two chat windows to include it in. + public static byte[] CreateChat(string formattedText, byte chatWindow) + { + byte[] formattedBytes = Encoding.UTF8.GetBytes(formattedText); + byte[] packet = new byte[(1 * 3) + formattedBytes.Length]; + packet[0] = PACKET_CHAT; + packet[1] = chatWindow; + Array.Copy(formattedBytes, 0, packet, 2, formattedBytes.Length); + packet[packet.Length - 1] = PACKET_TERMINATOR; + return packet; + } + + // Creates a byte array of a packet informing the client to change the current Weather Effect. + public static byte[] CreateWeatherUpdate(string newWeather) + { + byte[] weatherBytes = Encoding.UTF8.GetBytes(newWeather); + byte[] packet = new byte[(1 * 3) + weatherBytes.Length]; + packet[0] = PACKET_WORLD; + packet[1] = WEATHER_UPDATE; Array.Copy(weatherBytes, 0, packet, 2, weatherBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - return packet; - } - // Creates a byte array of a packet informing the client of the current game time, and weather effect. - public static byte[] CreateTimeAndWeatherUpdate(int gameTime, int gameDay, int gameYear, string weather) - { - byte[] weatherBytes = Encoding.UTF8.GetBytes(weather); - - byte[] packet = new byte[(1 * 7) + weatherBytes.Length]; - - packet[0] = PACKET_WORLD; - // Encode current time - packet[1] = (byte)((gameTime / 64) + 20); - packet[2] = (byte)((gameTime % 64) + 20); - // Encode current day - packet[3] = (byte)((gameDay / 64) + 20); - packet[4] = (byte)((gameDay % 64) + 20); - // Encode current year - packet[5] = (byte)((gameYear / 64) + 20); - packet[6] = (byte)((gameYear % 64) + 20); - - // Copy weather information to packet - Array.Copy(weatherBytes, 0, packet, 7, weatherBytes.Length); - - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a "keep alive" packet, to check if the client is still connected - // and to inform the client the server is still here too and has not crashed / disconnected the client. - public static byte[] CreateKeepAlive() - { - byte[] packet = new byte[2]; - packet[0] = PACKET_KEEP_ALIVE; - packet[1] = PACKET_TERMINATOR; - return packet; - } + packet[packet.Length - 1] = PACKET_TERMINATOR; + return packet; + } + // Creates a byte array of a packet informing the client of the current game time, and weather effect. + public static byte[] CreateTimeAndWeatherUpdate(int gameTime, int gameDay, int gameYear, string weather) + { + byte[] weatherBytes = Encoding.UTF8.GetBytes(weather); + + byte[] packet = new byte[(1 * 7) + weatherBytes.Length]; + + packet[0] = PACKET_WORLD; + // Encode current time + packet[1] = (byte)((gameTime / 64) + 20); + packet[2] = (byte)((gameTime % 64) + 20); + // Encode current day + packet[3] = (byte)((gameDay / 64) + 20); + packet[4] = (byte)((gameDay % 64) + 20); + // Encode current year + packet[5] = (byte)((gameYear / 64) + 20); + packet[6] = (byte)((gameYear % 64) + 20); + + // Copy weather information to packet + Array.Copy(weatherBytes, 0, packet, 7, weatherBytes.Length); + + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a "keep alive" packet, to check if the client is still connected + // and to inform the client the server is still here too and has not crashed / disconnected the client. + public static byte[] CreateKeepAlive() + { + byte[] packet = new byte[2]; + packet[0] = PACKET_KEEP_ALIVE; + packet[1] = PACKET_TERMINATOR; + return packet; + } // Creates a byte array of a packet to inform the client of all "Places" that exist in the world - // (as defined by gamedata json) This is used in the map view when you hover over certain areas - public static byte[] CreatePlaceData(World.Isle[] isles, World.Town[] towns, World.Area[] areas) - { - // As this information is defined by gamedata.json file - // the size of it can vary alot, so im using a List instead of a byte[] here. - List packet = new List(); - packet.Add(PACKET_AREA_DEFS); - - // Encode Towns - - foreach (World.Town town in towns) - { - byte[] townBytes = Encoding.UTF8.GetBytes(town.Name); - - packet.Add(AREA_SEPERATOR); - packet.Add(AREA_TOWN); - - packet.Add((byte)(((town.StartX - 4) / 64) + 20)); - packet.Add((byte)(((town.StartX - 4) % 64) + 20)); - - packet.Add((byte)(((town.EndX - 4) / 64) + 20)); - packet.Add((byte)(((town.EndX - 4) % 64) + 20)); - - packet.Add((byte)(((town.StartY - 1) / 64) + 20)); - packet.Add((byte)(((town.StartY - 1) % 64) + 20)); - - packet.Add((byte)(((town.EndY - 1) / 64) + 20)); - packet.Add((byte)(((town.EndY - 1) % 64) + 20)); - - - Helper.ByteArrayToByteList(townBytes, packet); - } - - // Encode Areas - - foreach (World.Area area in areas) - { - byte[] areaBytes = Encoding.UTF8.GetBytes(area.Name); - - packet.Add(AREA_SEPERATOR); - packet.Add(AREA_AREA); - - packet.Add((byte)(((area.StartX - 4) / 64) + 20)); - packet.Add((byte)(((area.StartX - 4) % 64) + 20)); - - packet.Add((byte)(((area.EndX - 4) / 64) + 20)); - packet.Add((byte)(((area.EndX - 4) % 64) + 20)); - - packet.Add((byte)(((area.StartY - 1) / 64) + 20)); - packet.Add((byte)(((area.StartY - 1) % 64) + 20)); - - packet.Add((byte)(((area.EndY - 1) / 64) + 20)); - packet.Add((byte)(((area.EndY - 1) % 64) + 20)); - - - Helper.ByteArrayToByteList(areaBytes, packet); - } - - // Encode Isles - - foreach (World.Isle isle in isles) - { - byte[] isleBytes = Encoding.UTF8.GetBytes(isle.Name); - - packet.Add(AREA_SEPERATOR); - packet.Add(AREA_ISLE); - - packet.Add((byte)(((isle.StartX - 4) / 64) + 20)); - packet.Add((byte)(((isle.StartX - 4) % 64) + 20)); - - packet.Add((byte)(((isle.EndX - 4) / 64) + 20)); - packet.Add((byte)(((isle.EndX - 4) % 64) + 20)); - - packet.Add((byte)(((isle.StartY - 1) / 64) + 20)); - packet.Add((byte)(((isle.StartY - 1) % 64) + 20)); - - packet.Add((byte)(((isle.EndY - 1) / 64) + 20)); - packet.Add((byte)(((isle.EndY - 1) % 64) + 20)); - - packet.Add((byte)isle.Tileset.ToString()[0]); - - Helper.ByteArrayToByteList(isleBytes, packet); - } - packet.Add(PACKET_TERMINATOR); - - return packet.ToArray(); - } - // Creates a byte array of a packet informing the client of the players money, total player count and, - // how many mail messages they have. - public static byte[] CreateMoneyPlayerCountAndMail(int money, int playerCount, int mail) - { - byte[] playerDataBytes = Encoding.UTF8.GetBytes(money.ToString("N0", CultureInfo.InvariantCulture) + "|" + - playerCount.ToString("N0", CultureInfo.InvariantCulture) + "|" + - mail.ToString("N0", CultureInfo.InvariantCulture) + "|"); - - - byte[] packet = new byte[(1*2) + playerDataBytes.Length]; - packet[0] = PACKET_BASE_STATS; - Array.Copy(playerDataBytes, 0, packet, 1, playerDataBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - return packet; - } - // Creates a byte array of a packet informing the client of Tile Overlay flags - // these tell the client what tiles are and are not passable, which ones the player - // should appear ontop of or under, and stuff like that. - public static byte[] CreateTileOverlayFlags(int[] tileDepthFlags) - { - byte[] packet = new byte[(1 * 2) + tileDepthFlags.Length]; - packet[0] = PACKET_TILE_FLAGS; - - for(int i = 0; i < tileDepthFlags.Length; i++) - packet[1 + i] = (byte)(tileDepthFlags[i].ToString()[0]); - - packet[packet.Length - 1] = PACKET_TERMINATOR; - return packet; - } + // (as defined by gamedata json) This is used in the map view when you hover over certain areas + public static byte[] CreatePlaceData(World.Isle[] isles, World.Town[] towns, World.Area[] areas) + { + // As this information is defined by gamedata.json file + // the size of it can vary alot, so im using a List instead of a byte[] here. + List packet = new List(); + packet.Add(PACKET_AREA_DEFS); + + // Encode Towns + + foreach (World.Town town in towns) + { + byte[] townBytes = Encoding.UTF8.GetBytes(town.Name); + + packet.Add(AREA_SEPERATOR); + packet.Add(AREA_TOWN); + + packet.Add((byte)(((town.StartX - 4) / 64) + 20)); + packet.Add((byte)(((town.StartX - 4) % 64) + 20)); + + packet.Add((byte)(((town.EndX - 4) / 64) + 20)); + packet.Add((byte)(((town.EndX - 4) % 64) + 20)); + + packet.Add((byte)(((town.StartY - 1) / 64) + 20)); + packet.Add((byte)(((town.StartY - 1) % 64) + 20)); + + packet.Add((byte)(((town.EndY - 1) / 64) + 20)); + packet.Add((byte)(((town.EndY - 1) % 64) + 20)); + + + Helper.ByteArrayToByteList(townBytes, packet); + } + + // Encode Areas + + foreach (World.Area area in areas) + { + byte[] areaBytes = Encoding.UTF8.GetBytes(area.Name); + + packet.Add(AREA_SEPERATOR); + packet.Add(AREA_AREA); + + packet.Add((byte)(((area.StartX - 4) / 64) + 20)); + packet.Add((byte)(((area.StartX - 4) % 64) + 20)); + + packet.Add((byte)(((area.EndX - 4) / 64) + 20)); + packet.Add((byte)(((area.EndX - 4) % 64) + 20)); + + packet.Add((byte)(((area.StartY - 1) / 64) + 20)); + packet.Add((byte)(((area.StartY - 1) % 64) + 20)); + + packet.Add((byte)(((area.EndY - 1) / 64) + 20)); + packet.Add((byte)(((area.EndY - 1) % 64) + 20)); + + + Helper.ByteArrayToByteList(areaBytes, packet); + } + + // Encode Isles + + foreach (World.Isle isle in isles) + { + byte[] isleBytes = Encoding.UTF8.GetBytes(isle.Name); + + packet.Add(AREA_SEPERATOR); + packet.Add(AREA_ISLE); + + packet.Add((byte)(((isle.StartX - 4) / 64) + 20)); + packet.Add((byte)(((isle.StartX - 4) % 64) + 20)); + + packet.Add((byte)(((isle.EndX - 4) / 64) + 20)); + packet.Add((byte)(((isle.EndX - 4) % 64) + 20)); + + packet.Add((byte)(((isle.StartY - 1) / 64) + 20)); + packet.Add((byte)(((isle.StartY - 1) % 64) + 20)); + + packet.Add((byte)(((isle.EndY - 1) / 64) + 20)); + packet.Add((byte)(((isle.EndY - 1) % 64) + 20)); + + packet.Add((byte)isle.Tileset.ToString()[0]); + + Helper.ByteArrayToByteList(isleBytes, packet); + } + packet.Add(PACKET_TERMINATOR); + + return packet.ToArray(); + } + // Creates a byte array of a packet informing the client of the players money, total player count and, + // how many mail messages they have. + public static byte[] CreateMoneyPlayerCountAndMail(int money, int playerCount, int mail) + { + byte[] playerDataBytes = Encoding.UTF8.GetBytes(money.ToString("N0", CultureInfo.InvariantCulture) + "|" + + playerCount.ToString("N0", CultureInfo.InvariantCulture) + "|" + + mail.ToString("N0", CultureInfo.InvariantCulture) + "|"); + + + byte[] packet = new byte[(1*2) + playerDataBytes.Length]; + packet[0] = PACKET_BASE_STATS; + Array.Copy(playerDataBytes, 0, packet, 1, playerDataBytes.Length); + packet[packet.Length - 1] = PACKET_TERMINATOR; + return packet; + } + // Creates a byte array of a packet informing the client of Tile Overlay flags + // these tell the client what tiles are and are not passable, which ones the player + // should appear ontop of or under, and stuff like that. + public static byte[] CreateTileOverlayFlags(int[] tileDepthFlags) + { + byte[] packet = new byte[(1 * 2) + tileDepthFlags.Length]; + packet[0] = PACKET_TILE_FLAGS; + + for(int i = 0; i < tileDepthFlags.Length; i++) + packet[1 + i] = (byte)(tileDepthFlags[i].ToString()[0]); + + packet[packet.Length - 1] = PACKET_TERMINATOR; + return packet; + } // Creates a byte array of a packet informing the client of its current Sec Code seed and Inc values, - // Some client packets (eg minigame rewards) require this special Message Authentication Code to validate them - // Its not at all secure, you can easily just forge these packets by just implementing sec codes, but i didnt make it -- - public static byte[] CreateSecCode(byte[] SecCodeSeed, int SecCodeInc, bool Admin, bool Moderator) + // Some client packets (eg minigame rewards) require this special Message Authentication Code to validate them + // Its not at all secure, you can easily just forge these packets by just implementing sec codes, but i didnt make it -- + public static byte[] CreateSecCode(byte[] SecCodeSeed, int SecCodeInc, bool Admin, bool Moderator) { - char userType = 'N'; // Normal? - - if (Moderator) - userType = 'M'; // Moderator - - if (Admin) - userType = 'A'; // Admin - - byte[] packet = new byte[7]; - - packet[0] = PACKET_SEC_CODE; - - packet[1] = (byte)(SecCodeSeed[0] + 33); - packet[2] = (byte)(SecCodeSeed[1] + 33); - packet[3] = (byte)(SecCodeSeed[2] + 33); - packet[4] = (byte)(SecCodeInc + 33); - - - packet[5] = (byte)userType; - packet[6] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet to tell the client to please GET + char userType = 'N'; // Normal? + + if (Moderator) + userType = 'M'; // Moderator + + if (Admin) + userType = 'A'; // Admin + + byte[] packet = new byte[7]; + + packet[0] = PACKET_SEC_CODE; + + packet[1] = (byte)(SecCodeSeed[0] + '!'); + packet[2] = (byte)(SecCodeSeed[1] + '!'); + packet[3] = (byte)(SecCodeSeed[2] + '!'); + packet[4] = (byte)(SecCodeInc + '!'); + + + packet[5] = (byte)userType; + packet[6] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet to tell the client to please GET // a certain SWF in the mod/ directory on web, and then load it as a MovieClip - // into the actual game client. - public static byte[] CreateSwfModule(string swf,byte headerByte) - { - byte[] swfBytes = Encoding.UTF8.GetBytes(swf); - byte[] packet = new byte[(1 * 2) + swfBytes.Length]; - - packet[0] = headerByte; + // into the actual game client. + public static byte[] CreateSwfModule(string swf,byte headerByte) + { + byte[] swfBytes = Encoding.UTF8.GetBytes(swf); + byte[] packet = new byte[(1 * 2) + swfBytes.Length]; + + packet[0] = headerByte; Array.Copy(swfBytes, 0, packet, 1, swfBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet to show the client an "Annoucement" message - // This has the exact same effect as CreateChat with CHAT_BOTTOM_RIGHT but for some reason - // the header byte is different, - // This is basically only used for MOTD. - public static byte[] CreateAnnouncement(string announcement) - { - byte[] annouceBytes = Encoding.UTF8.GetBytes(announcement); - byte[] packet = new byte[(1 * 2) + annouceBytes.Length]; - - packet[0] = PACKET_ANNOUNCEMENT; + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet to show the client an "Annoucement" message + // This has the exact same effect as CreateChat with CHAT_BOTTOM_RIGHT but for some reason + // the header byte is different, + // This is basically only used for MOTD. + public static byte[] CreateMotd(string announcement) + { + byte[] annouceBytes = Encoding.UTF8.GetBytes(announcement); + byte[] packet = new byte[(1 * 2) + annouceBytes.Length]; + + packet[0] = PACKET_ANNOUNCEMENT; Array.Copy(annouceBytes, 0, packet, 1, annouceBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - // Creates a byte array of a packet informing the clent that they have been kicked from the server - // and includes a reason for them being kicked, - public static byte[] CreateKickMessage(string reason) - { - byte[] kickMsgBytes = Encoding.UTF8.GetBytes(reason); - byte[] packet = new byte[(1 * 2) + kickMsgBytes.Length]; - - packet[0] = PACKET_KICK; + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + // Creates a byte array of a packet informing the clent that they have been kicked from the server + // and includes a reason for them being kicked, + public static byte[] CreateKickMessage(string reason) + { + byte[] kickMsgBytes = Encoding.UTF8.GetBytes(reason); + byte[] packet = new byte[(1 * 2) + kickMsgBytes.Length]; + + packet[0] = PACKET_KICK; Array.Copy(kickMsgBytes, 0, packet, 1, kickMsgBytes.Length); - packet[packet.Length - 1] = PACKET_TERMINATOR; - - return packet; - } - - } -} + packet[packet.Length - 1] = PACKET_TERMINATOR; + + return packet; + } + + } +} diff --git a/HorseIsleServer/LibHISP/Util/Helper.cs b/HorseIsleServer/LibHISP/Util/Helper.cs index 1c0b0d1..beaf9d6 100644 --- a/HorseIsleServer/LibHISP/Util/Helper.cs +++ b/HorseIsleServer/LibHISP/Util/Helper.cs @@ -1,4 +1,5 @@ -using System; +using HISP.Server; +using System; using System.Collections.Generic; using System.Linq; @@ -36,10 +37,17 @@ namespace HISP.Util char firstChar = char.ToUpper(str[0]); return firstChar + str.Substring(1); } + public static int GetMonthsBetweenTwoDateTimes(DateTime from, DateTime to) + { + if (from > to) return GetMonthsBetweenTwoDateTimes(to, from); + int monthDiff = Math.Abs((to.Year * 12 + (to.Month)) - (from.Year * 12 + (from.Month))); + return monthDiff; + + } public static DateTime UnixTimeStampToDateTime(double unixTimeStamp) { // Unix timestamp is seconds past epoch - System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); + DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); dtDateTime = dtDateTime.AddSeconds(unixTimeStamp).ToUniversalTime(); return dtDateTime; } @@ -47,6 +55,23 @@ namespace HISP.Util public static void ByteArrayToByteList(byte[] byteArray, List byteList) { byteList.AddRange(byteArray.ToList()); + } + public static string RandomString(string allowedCharacters) + { + int length = GameServer.RandomNumberGenerator.Next(7, 16); + string str = ""; + for (int i = 0; i < length; i++) + str += allowedCharacters[GameServer.RandomNumberGenerator.Next(0, allowedCharacters.Length - 1)]; + + return str; + } + public static string ReverseString(string str) + { + char[] charArray = str.ToCharArray(); + Array.Reverse(charArray); + string newStr = new string(charArray); + + return newStr; } } } diff --git a/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs b/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs index 69296ef..d749588 100755 --- a/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs +++ b/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.8.23.0")] -[assembly: AssemblyFileVersion("1.8.23.0")] +[assembly: AssemblyVersion("1.8.30.0")] +[assembly: AssemblyFileVersion("1.8.30.0")] diff --git a/HorseIsleServer/MPN00BS/RegisterWindow.axaml.cs b/HorseIsleServer/MPN00BS/RegisterWindow.axaml.cs index 31ffd04..670f462 100755 --- a/HorseIsleServer/MPN00BS/RegisterWindow.axaml.cs +++ b/HorseIsleServer/MPN00BS/RegisterWindow.axaml.cs @@ -127,20 +127,19 @@ namespace MPN00BS private void CreateAccount(object sender, RoutedEventArgs e) { - int newUserId = Database.GetNextFreeUserId(); - - // Generate random salt - byte[] salt = new byte[64]; - new Random(Guid.NewGuid().GetHashCode()).NextBytes(salt); - - // Hash password - string saltText = BitConverter.ToString(salt).Replace("-", ""); - string hashsalt = BitConverter.ToString(Authentication.HashAndSalt(passwordBox.Text, salt)).Replace("-", ""); - + // GENDer? I hardly knew THEM! string gender = ((ComboBoxItem)genderSelectionBox.SelectedItem).Content.ToString(); + + // Permissions + bool admin = (bool)adminCheckbox.IsChecked; + bool mod = (bool)modCheckbox.IsChecked; + + // Credentials + string password = passwordBox.Text; + string username = usernameBox.Text; - Database.CreateUser(newUserId, usernameBox.Text, hashsalt, saltText, gender, (bool)adminCheckbox.IsChecked, (bool)modCheckbox.IsChecked); + Authentication.CreateAccount(username, password, gender, admin, mod); this.Close(); } diff --git a/HorseIsleServer/MPN00BS/ServerStarter.cs b/HorseIsleServer/MPN00BS/ServerStarter.cs index 12b5b6d..070a6c5 100755 --- a/HorseIsleServer/MPN00BS/ServerStarter.cs +++ b/HorseIsleServer/MPN00BS/ServerStarter.cs @@ -122,11 +122,6 @@ namespace MPN00BS ProgressCallback(); - if (Database.GetUsers().Length <= 0) - { - UserCreationCallback(); - } - // Start HI1 Server ProgressCallback(); @@ -184,6 +179,11 @@ namespace MPN00BS ProgressCallback(); HasServerStarted = true; ServerStartedCallback(); + + + + if (Database.GetUsers().Length <= 0) + UserCreationCallback(); } public static void ModifyConfig(string okey, string value)