mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 13:15:42 +12:00
Add Feature pt2
This commit is contained in:
parent
092534e331
commit
67275262fb
36 changed files with 1555 additions and 296 deletions
|
@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibHISP", "LibHISP\LibHISP.
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HISP", "HISP\HISP.csproj", "{DEAD5CB0-C6B6-4B63-B1FB-A9F649CA1D27}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "N00BS", "N00BS\N00BS.csproj", "{6B45A1E8-0F54-4BF7-AF48-41B9FE676570}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HISP-N00BS", "N00BS\HISP-N00BS.csproj", "{6B45A1E8-0F54-4BF7-AF48-41B9FE676570}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -38,8 +38,8 @@ Global
|
|||
Windows|x86 = Windows|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Debug|Any CPU.ActiveCfg = Debug|AnyCPU
|
||||
{C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Debug|Any CPU.Build.0 = Debug|AnyCPU
|
||||
{C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{C48CBD82-AB30-494A-8FFA-4DE7069B5827}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
|
|
Binary file not shown.
|
@ -16,16 +16,6 @@
|
|||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent Condition="'$(OS)' == 'Windows_NT'">
|
||||
copy "$(SolutionDir)..\HorseIsleData\gamedata.json" "$(TargetDir)gamedata.json" /Y
|
||||
copy "$(SolutionDir)..\HorseIsleData\HI1.MAP" "$(TargetDir)HI1.MAP" /Y
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent Condition="'$(OS)' != 'Windows_NT'">
|
||||
cp -f "$(SolutionDir)../HorseIsleData/gamedata.json" "$(TargetDir)gamedata.json"
|
||||
cp -f "$(SolutionDir)../HorseIsleData/HI1.MAP" "$(TargetDir)HI1.MAP"
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>false</GenerateBindingRedirectsOutputType>
|
||||
|
@ -37,7 +27,7 @@
|
|||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
<StartupObject>HISP.Program</StartupObject>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<DebugType>none</DebugType>
|
||||
<DebugType>embedded</DebugType>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AnalysisLevel>none</AnalysisLevel>
|
||||
<EnableNETAnalyzers>False</EnableNETAnalyzers>
|
||||
|
@ -216,7 +206,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
<Optimize>True</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
|
|
@ -5,12 +5,18 @@ namespace HISP
|
|||
{
|
||||
public static class Program
|
||||
{
|
||||
public static bool ShuttingDown = false;
|
||||
public static void OnShutdown()
|
||||
{
|
||||
ShuttingDown = true;
|
||||
}
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Logger.SetCallback(Console.WriteLine);
|
||||
Start.InitalizeAndStart();
|
||||
Entry.SetShutdownCallback(OnShutdown);
|
||||
Entry.Start();
|
||||
|
||||
while (true) { /* Allow asyncronous operations to happen. */ };
|
||||
while (!ShuttingDown) { /* Allow asyncronous operations to happen. */ };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,34 +34,12 @@ namespace HISP.Game.Chat
|
|||
public static bool Shutdown(string message, string[] args, User user)
|
||||
{
|
||||
if (!user.Administrator)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
foreach(GameClient client in GameClient.ConnectedClients)
|
||||
{
|
||||
|
||||
if (client.LoggedIn)
|
||||
{
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
ItemInstance rubyItem = new ItemInstance(Item.Ruby);
|
||||
client.LoggedinUser.Inventory.AddIgnoringFull(rubyItem);
|
||||
}
|
||||
|
||||
client.LoggedinUser.TrackedItems.GetTrackedItem(Tracking.TrackableItem.GameUpdates).Count++;
|
||||
}
|
||||
|
||||
client.Kick("%SHUTDOWN Command Executed by an Administrator (Probably a server restart)");
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception) { };
|
||||
return false;
|
||||
|
||||
byte[] chatPacket = PacketBuilder.CreateChat(Messages.FormatAdminCommandCompleteMessage(message.Substring(1)), PacketBuilder.CHAT_BOTTOM_LEFT);
|
||||
user.LoggedinClient.SendPacket(chatPacket);
|
||||
Thread.Sleep(1000); // give it a few seconds to shut down, if it doesnt force exit
|
||||
Environment.Exit(0);
|
||||
GameServer.ShutdownServer();
|
||||
|
||||
return true;
|
||||
}
|
||||
public static bool Give(string message, string[] args, User user)
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace HISP.Game.SwfModules
|
||||
{
|
||||
class Drawingroom
|
||||
public class Drawingroom
|
||||
{
|
||||
private static List<Drawingroom> drawingRooms = new List<Drawingroom>();
|
||||
public static Drawingroom[] DrawingRooms
|
||||
|
|
|
@ -13,6 +13,18 @@
|
|||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="..\..\HorseIsleData\gamedata.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>gamedata.json</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="..\..\HorseIsleData\HI1.MAP">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>HI1.MAP</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.2" />
|
||||
<PackageReference Include="MySqlConnector" Version="2.1.8" />
|
||||
|
@ -206,7 +218,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
<Optimize>True</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
using HISP.Game;
|
||||
using HISP.Player;
|
||||
using HISP.Game.Horse;
|
||||
|
@ -11,7 +13,6 @@ using HISP.Game.SwfModules;
|
|||
|
||||
using MySqlConnector;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
|
@ -39,12 +40,18 @@ namespace HISP.Server
|
|||
return new SqliteConnection(ConnectionString);
|
||||
}
|
||||
|
||||
public static void OnShutdown()
|
||||
{
|
||||
MySqlConnection.ClearAllPools();
|
||||
SqliteConnection.ClearAllPools();
|
||||
}
|
||||
|
||||
public static void OpenDatabase()
|
||||
{
|
||||
if (!ConfigReader.SqlLite)
|
||||
ConnectionString = "server=" + ConfigReader.DatabaseIP + ";user=" + ConfigReader.DatabaseUsername + ";password=" + ConfigReader.DatabasePassword + ";database=" + ConfigReader.DatabaseName;
|
||||
ConnectionString = "server=" + ConfigReader.DatabaseIP + ";user=" + ConfigReader.DatabaseUsername + ";password=" + ConfigReader.DatabasePassword + ";database=" + ConfigReader.DatabaseName;
|
||||
else
|
||||
ConnectionString = "Data Source=./" + ConfigReader.DatabaseName + ".db;";
|
||||
ConnectionString = "Data Source=./" + ConfigReader.DatabaseName + ".db;";
|
||||
|
||||
Logger.InfoPrint(ConnectionString);
|
||||
|
||||
|
@ -61,6 +68,8 @@ namespace HISP.Server
|
|||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
string SqlPragma = "PRAGMA journal_mode=WAL;";
|
||||
|
||||
string UserTable = "CREATE TABLE IF NOT EXISTS Users(Id INT, Username TEXT(16), PassHash TEXT(128), Salt TEXT(128), Gender TEXT(16), Admin TEXT(3), Moderator TEXT(3))";
|
||||
string ExtTable = "CREATE TABLE IF NOT EXISTS UserExt(Id INT, X INT, Y INT, LastLogin INT, Money INT, QuestPoints INT, BankBalance DOUBLE, BankInterest DOUBLE, ProfilePage Text(4000),IpAddress TEXT(1028),PrivateNotes Text(65535), CharId INT, ChatViolations INT,Subscriber TEXT(3), SubscribedUntil INT, Experience INT, Tiredness INT, Hunger INT, Thirst INT, FreeMinutes INT, TotalLogins INT)";
|
||||
string MailTable = "CREATE TABLE IF NOT EXISTS Mailbox(RandomId INT, IdTo INT, IdFrom INT, Subject TEXT(100), Message Text(65535), TimeSent INT, BeenRead TEXT(3))";
|
||||
|
@ -99,6 +108,20 @@ namespace HISP.Server
|
|||
string DeleteOnlineUsers = "DROP TABLE OnlineUsers";
|
||||
string OnlineUsers = "CREATE TABLE IF NOT EXISTS OnlineUsers(playerId INT, Admin TEXT(3), Moderator TEXT(3), Subscribed TEXT(3), New TEXT(3))";
|
||||
|
||||
if (ConfigReader.SqlLite)
|
||||
{
|
||||
try
|
||||
{
|
||||
DbCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = SqlPragma;
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.WarnPrint(e.Message);
|
||||
};
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
DbCommand sqlCommand = db.CreateCommand();
|
||||
|
@ -4675,7 +4698,6 @@ namespace HISP.Server
|
|||
|
||||
Int32 count = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
|
||||
|
||||
return count >= 1;
|
||||
}
|
||||
}
|
||||
|
@ -4874,6 +4896,23 @@ namespace HISP.Server
|
|||
}
|
||||
}
|
||||
|
||||
public static int GetNextFreeUserId()
|
||||
{
|
||||
using (DbConnection db = connectDb())
|
||||
{
|
||||
db.Open();
|
||||
DbCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT MAX(Id)+1 FROM Users";
|
||||
sqlCommand.Prepare();
|
||||
|
||||
object res = sqlCommand.ExecuteScalar();
|
||||
if (res == DBNull.Value)
|
||||
return 0;
|
||||
|
||||
return Convert.ToInt32(res);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateUser(int id, string username, string passhash, string salt, string gender, bool admin, bool moderator)
|
||||
{
|
||||
using (DbConnection db = connectDb())
|
||||
|
|
|
@ -5,13 +5,28 @@ using HISP.Game.Services;
|
|||
using HISP.Game.SwfModules;
|
||||
using HISP.Security;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
public static class Start
|
||||
public static class Entry
|
||||
{
|
||||
// "Entry Point"
|
||||
public static void InitalizeAndStart()
|
||||
|
||||
|
||||
private static void defaultOnShutdownCallback()
|
||||
{
|
||||
Process.GetCurrentProcess().Close();
|
||||
}
|
||||
public static Action OnShutdown = defaultOnShutdownCallback;
|
||||
|
||||
|
||||
public static void SetShutdownCallback(Action callback)
|
||||
{
|
||||
OnShutdown = callback;
|
||||
}
|
||||
|
||||
public static void Start()
|
||||
{
|
||||
#if (!DEBUG)
|
||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
|
@ -1,12 +1,13 @@
|
|||
using System;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using HISP.Player;
|
||||
using HISP.Game;
|
||||
using HISP.Game.Horse;
|
||||
using HISP.Game.Events;
|
||||
using HISP.Game.Items;
|
||||
using HISP.Game.Inventory;
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
|
@ -87,6 +88,30 @@ namespace HISP.Server
|
|||
receivePackets(null, evt);
|
||||
}
|
||||
|
||||
public static void OnShutdown()
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (GameClient client in ConnectedClients)
|
||||
{
|
||||
|
||||
if (client.LoggedIn)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
ItemInstance rubyItem = new ItemInstance(Item.Ruby);
|
||||
client.LoggedinUser.Inventory.AddIgnoringFull(rubyItem);
|
||||
}
|
||||
|
||||
client.LoggedinUser.TrackedItems.GetTrackedItem(Tracking.TrackableItem.GameUpdates).Count++;
|
||||
}
|
||||
|
||||
client.Kick("Server shutdown.");
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception) { };
|
||||
}
|
||||
public static void CreateClient(object sender, SocketAsyncEventArgs e)
|
||||
{
|
||||
do
|
||||
|
@ -114,7 +139,7 @@ namespace HISP.Server
|
|||
// Close Socket
|
||||
if (ClientSocket != null)
|
||||
{
|
||||
ClientSocket.Close();
|
||||
ClientSocket.Disconnect(false);
|
||||
ClientSocket.Dispose();
|
||||
ClientSocket = null;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ using HISP.Game.SwfModules;
|
|||
using HISP.Game.Horse;
|
||||
using HISP.Game.Events;
|
||||
using HISP.Game.Items;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
|
@ -8251,6 +8252,20 @@ namespace HISP.Server
|
|||
}
|
||||
return true;
|
||||
}
|
||||
public static void OnShutdown()
|
||||
{
|
||||
ServerSocket.Dispose();
|
||||
gameTimer.Dispose();
|
||||
minuteTimer.Dispose();
|
||||
}
|
||||
public static void ShutdownServer()
|
||||
{
|
||||
GameClient.OnShutdown();
|
||||
GameServer.OnShutdown();
|
||||
Database.OnShutdown();
|
||||
Entry.OnShutdown();
|
||||
}
|
||||
|
||||
public static void StartServer()
|
||||
{
|
||||
ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
|
|
145
HorseIsleServer/N00BS/HISP-N00BS.csproj
Normal file
145
HorseIsleServer/N00BS/HISP-N00BS.csproj
Normal file
|
@ -0,0 +1,145 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>HISP</RootNamespace>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
|
||||
<Platforms>x64;x86;AnyCPU</Platforms>
|
||||
<Configurations>Debug;Windows</Configurations>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LibHISP\LibHISP.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="flash.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="..\..\HorseIsleWeb\game-site\*.swf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>client\%(Filename)%(Extension)</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="..\..\HorseIsleWeb\game-site\map750.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>client\map750.png</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="..\..\HorseIsleWeb\game-site\mod\*.swf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>client\mod\%(Filename)%(Extension)</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="..\..\HorseIsleWeb\game-site\tack\*.swf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>client\tack\%(Filename)%(Extension)</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="..\..\HorseIsleWeb\game-site\breed\*.swf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>client\breed\%(Filename)%(Extension)</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="..\..\HorseIsleWeb\game-site\resource\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>client\resource\%(Filename)%(Extension)</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>false</GenerateBindingRedirectsOutputType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<NoWin32Manifest>true</NoWin32Manifest>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
<StartupObject>HISP.Program</StartupObject>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<DebugType>embedded</DebugType>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AnalysisLevel>none</AnalysisLevel>
|
||||
<EnableNETAnalyzers>False</EnableNETAnalyzers>
|
||||
<Copyright>Public Domain, 2022</Copyright>
|
||||
<PackageProjectUrl>https://islehorse.com</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/islehorse/HISP</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|x86'">
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
<Optimize>true</Optimize>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DefineConstants>OS_WINDOWS;ARCH_X86</DefineConstants>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|x64'">
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<Optimize>true</Optimize>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DefineConstants>OS_WINDOWS;ARCH_X86_64</DefineConstants>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='All|AnyCPU'">
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
|
||||
<Optimize>True</Optimize>
|
||||
<DefineConstants>OS_ALL;ARCH_ANYCPU</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Optimize>False</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE;OS_DEBUG;ARCH_X86_64</DefineConstants>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||
<Optimize>False</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE;OS_DEBUG;ARCH_X86</DefineConstants>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|AnyCPU'">
|
||||
<Optimize>False</Optimize>
|
||||
<DefineConstants>OS_WINDOWS;ARCH_ANYCPU</DefineConstants>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
</Project>
|
15
HorseIsleServer/N00BS/HISP-N00BS.csproj.user
Normal file
15
HorseIsleServer/N00BS/HISP-N00BS.csproj.user
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<ItemGroup>
|
||||
<Compile Update="LoadingForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="RegisterForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="SystemTrayIcon.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,4 +1,7 @@
|
|||
using System.Net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
|
||||
|
@ -31,7 +34,6 @@ namespace HTTP
|
|||
{
|
||||
clientSock = ClientSocket;
|
||||
baseServ = Server;
|
||||
Server.Clients.Add(this);
|
||||
baseServ.WriteDebugOutput("Client Connected @ " + clientSock.RemoteEndPoint.ToString());
|
||||
ProcessRequests();
|
||||
clientSock.Close();
|
||||
|
@ -103,11 +105,10 @@ namespace HTTP
|
|||
return headers;
|
||||
}
|
||||
|
||||
private void RespondGet(string path, Dictionary<string, string> query)
|
||||
private void RespondGet(string name)
|
||||
{
|
||||
baseServ.WriteDebugOutput("GET " + path);
|
||||
string name = path.Remove(0, 1);
|
||||
|
||||
baseServ.WriteDebugOutput("GET " + name);
|
||||
|
||||
if (ContentItemExists(name))
|
||||
{
|
||||
ContentItem ci = GetContentItem(name);
|
||||
|
@ -143,8 +144,8 @@ namespace HTTP
|
|||
}
|
||||
else
|
||||
{
|
||||
string body = GeneratePage(path);
|
||||
string requestStr = GenerateHeaders(path, body.Length);
|
||||
string body = GeneratePage(name);
|
||||
string requestStr = GenerateHeaders(name, body.Length);
|
||||
requestStr += body;
|
||||
|
||||
SendString(requestStr);
|
||||
|
@ -204,12 +205,7 @@ namespace HTTP
|
|||
{
|
||||
if (path == "/")
|
||||
{
|
||||
string body = "Content Downloader Server.<br>Open this url in PSVita's \"Content Downloader\" To view avalible files.";
|
||||
foreach (ContentItem content in baseServ.Contents)
|
||||
{
|
||||
body += "<a href=\"" + content.name + "\"></a>";
|
||||
}
|
||||
|
||||
string body = "Horse Isle Web Server..<br>Fork of SilicaAndPina's \"Content Server\"";
|
||||
return body;
|
||||
}
|
||||
else
|
||||
|
@ -227,23 +223,6 @@ namespace HTTP
|
|||
else
|
||||
return relativeUri;
|
||||
}
|
||||
private Dictionary<string,string> ExtractQuery(string relativeUri)
|
||||
{
|
||||
int questionIndex = relativeUri.IndexOf("?");
|
||||
if (questionIndex != -1)
|
||||
{
|
||||
string[] queryStrList = relativeUri.Substring(questionIndex + 1).Split('&');
|
||||
Dictionary<string,string> queryDict = new Dictionary<string, string>();
|
||||
foreach(string queryStr in queryStrList)
|
||||
{
|
||||
string[] qStr = queryStr.Split('=');
|
||||
queryDict.Add(qStr[0], qStr[1]);
|
||||
}
|
||||
return queryDict;
|
||||
}
|
||||
else
|
||||
return new Dictionary<string, string>();
|
||||
}
|
||||
private string ExtractRelativeUrl(string header)
|
||||
{
|
||||
return header.Split(' ')[1];
|
||||
|
@ -264,8 +243,8 @@ namespace HTTP
|
|||
{
|
||||
string relUrl = ExtractRelativeUrl(line);
|
||||
string path = ExtractPath(relUrl);
|
||||
Dictionary<string,string> query = ExtractQuery(relUrl);
|
||||
RespondGet(path, query);
|
||||
//Dictionary<string,string> query = ExtractQuery(relUrl);
|
||||
RespondGet(path);
|
||||
return;
|
||||
}
|
||||
else if (line.StartsWith("HEAD"))
|
||||
|
@ -282,36 +261,34 @@ namespace HTTP
|
|||
class ContentServer
|
||||
{
|
||||
public List<ContentItem> Contents = new List<ContentItem>();
|
||||
public List<ContentClient> Clients = new List<ContentClient>();
|
||||
|
||||
public Socket ServerSocket;
|
||||
public void WriteDebugOutput(string txt)
|
||||
{
|
||||
Console.WriteLine("[HTTP] "+txt);
|
||||
Console.WriteLine("[HTTP] " + txt);
|
||||
}
|
||||
|
||||
public void CreateClient(object sender, SocketAsyncEventArgs e)
|
||||
{
|
||||
do
|
||||
{
|
||||
Socket eSocket = e.AcceptSocket;
|
||||
if (eSocket != null)
|
||||
new ContentClient(this, eSocket);
|
||||
e.AcceptSocket = null;
|
||||
} while (!ServerSocket.AcceptAsync(e));
|
||||
}
|
||||
public ContentServer()
|
||||
{
|
||||
|
||||
new Thread(() =>
|
||||
{
|
||||
WriteDebugOutput("Listening for connections on port 12515.");
|
||||
IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 12515);
|
||||
Socket newsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
newsock.Bind(localEndPoint);
|
||||
newsock.Listen(20);
|
||||
WriteDebugOutput("Listening for connections on port 80.");
|
||||
IPEndPoint ep = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 80);
|
||||
ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
ServerSocket.Bind(ep);
|
||||
ServerSocket.Listen(0x7fffffff);
|
||||
|
||||
while(true)
|
||||
{
|
||||
Socket clientSock = newsock.Accept();
|
||||
|
||||
new Thread(() =>
|
||||
{
|
||||
ContentClient client = new ContentClient(this, clientSock);
|
||||
Clients.Remove(client);
|
||||
}).Start();
|
||||
}
|
||||
|
||||
}).Start();
|
||||
SocketAsyncEventArgs e = new SocketAsyncEventArgs();
|
||||
e.Completed += CreateClient;
|
||||
CreateClient(this, e);
|
||||
}
|
||||
|
||||
|
||||
|
|
95
HorseIsleServer/N00BS/LoadingForm.Designer.cs
generated
Normal file
95
HorseIsleServer/N00BS/LoadingForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,95 @@
|
|||
namespace HISP
|
||||
{
|
||||
partial class LoadingForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoadingForm));
|
||||
this.StepName = new System.Windows.Forms.Label();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.StartProgress = new System.Windows.Forms.ProgressBar();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// StepName
|
||||
//
|
||||
this.StepName.AutoSize = true;
|
||||
this.StepName.Location = new System.Drawing.Point(79, 22);
|
||||
this.StepName.Name = "StepName";
|
||||
this.StepName.Size = new System.Drawing.Size(92, 15);
|
||||
this.StepName.TabIndex = 0;
|
||||
this.StepName.Text = "Starting Server...";
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||
this.pictureBox1.Location = new System.Drawing.Point(12, 12);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(61, 73);
|
||||
this.pictureBox1.TabIndex = 1;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// StartProgress
|
||||
//
|
||||
this.StartProgress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.StartProgress.Location = new System.Drawing.Point(79, 40);
|
||||
this.StartProgress.Maximum = 18;
|
||||
this.StartProgress.Name = "StartProgress";
|
||||
this.StartProgress.Size = new System.Drawing.Size(618, 23);
|
||||
this.StartProgress.Step = 1;
|
||||
this.StartProgress.TabIndex = 2;
|
||||
//
|
||||
// LoadingForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(709, 101);
|
||||
this.Controls.Add(this.StartProgress);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.StepName);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(725, 140);
|
||||
this.MinimumSize = new System.Drawing.Size(725, 140);
|
||||
this.Name = "LoadingForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Starting Server...";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label StepName;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
public System.Windows.Forms.ProgressBar StartProgress;
|
||||
}
|
||||
}
|
20
HorseIsleServer/N00BS/LoadingForm.cs
Normal file
20
HorseIsleServer/N00BS/LoadingForm.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HISP
|
||||
{
|
||||
public partial class LoadingForm : Form
|
||||
{
|
||||
public LoadingForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
154
HorseIsleServer/N00BS/LoadingForm.resx
Normal file
154
HorseIsleServer/N00BS/LoadingForm.resx
Normal file
|
@ -0,0 +1,154 @@
|
|||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
R0lGODlhOgBEAIYAAAAAAP///0kBPZyEmPsA7tEAxs8AxMoAv8gAv8EAuaEAmp8AmIoAhDIALzAALiUF
|
||||
I7cAtKAAmp4AmJ4AmpcAlJUAkpEAjZAAjYUAgIQAgHkAd1gAVVcAVFUAUlMAUE8ATUkARz0APDUAMzEA
|
||||
MC4ALf8n96gAposAioMAgWsAa0QAQzUANZkAnZUAmI4AkXMAdWEAZF8AYS8AMIgAjn4Ag3s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oYYmqmhRjCrgKJqGRRZBBAssYIABSyLqpA8+LJrDp6GO+mlGAij/9ZJQrIpKqg7VmUok
|
||||
qqrW6moEsMr6kgACcMDBBBMgoCwCAaLqrA811RpgBx0ccACyEkhgbKwTQfYAscYiuyyzOjyLarSgLjBt
|
||||
tddOkO22xELkLbEeeFBBBRZYcMEF+X7wQQYZBMjAwAxggEGA/iaQAAUU1Evsw/KWJBC99uKrL78W+Auw
|
||||
wAQbjPAHCjPs8MMQbyVxEMT6e8IJKLTsMgggELtuvf4SCzMEEKxcM8nxInQSThMLoDLLLrcMs8w6UEvz
|
||||
BzaDgLPOHwxEckI//xQ0sSqo8MILLLCggQZZ92xQ1iaY8LUKBk3tM2RSP5z11l2frYLYBZFtNtgI0W0S
|
||||
21cLwxBCCC64MMMMKaQQgkMhtNBC4YcfpDdbSxWkduCDM4644oUn9PhAP0techAj0EBDDDHg4BAOMMCw
|
||||
AkObC9Q5QWqDLjrpD6Guet7cUh1532LLUEMNI0C0gg02yIB7QzG1HbvvwAtPvOO5O5R87AKRcMMNwTtE
|
||||
OgnHy4sSyp9Xf332DOGw/WPfUx+EA9c3cDrx3Ms0ffjrt/++DfEnpf4IAwwgwun9yx9Q1BeE/v3PIQEs
|
||||
zEFEYLqHjMABCjQIAyHyQJUEBAA7
|
||||
</value>
|
||||
</data>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAGyAAAAEAIAAoDgAAFgAAACgAAAAbAAAAQAAAAAEAIAAAAAAAgA0AAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAPQFJAD0BSQo9AUkpPQFJGj0BSQBJHk0AWzZePT8NQLwyADALOAA3AAAAAAAAAAAAnZCiAMrK
|
||||
0AVCGUSsMAMyVC8CMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAIQEg/Hj0D
|
||||
STw9AUnoPQF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AAAAAAAAAAAAAAAAAAAAAAAAAAGC0YBjcDOYZxAHbxngCm/6EAqf9pAm//OAU71UMH
|
||||
RRxKB00AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAjBSUAXABfAAAAAAWZAaCliQOQ+0gDS7MyBDWiMigzxUBBPzk/QD8AAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAOsf9ADyIPtdoxGp8koATF9NBFAAQUNBHkBBQBBAQEAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKYV
|
||||
qgClFKkjdAh4fVEAVBRXAFoAAAAAAAAAAAAAAAAAAAAAAAAAAADGPH/gBDx/4AQ8d+AAPGPgAD4h4CAe
|
||||
MOAADBjgAAAA4AAAAOCAAAHggAAD4IAAA+DAAAPgwAAD4MAAA+DgAAPg4AAD4OAAA+DwAAPg+MACAP/4
|
||||
AgD/+AAA//wAAP/8AAD//AAA//4AAP/+ACD//gBg//8A4P//gOD//8Tg///H4A==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1,20 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<StartupObject>HISP.Program</StartupObject>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="icon.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LibHISP\LibHISP.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -1,21 +1,31 @@
|
|||
// An HTTP Server, and Horse Isle Server, Flash Player, in a single package
|
||||
// Idea is to just be open and play.
|
||||
|
||||
using HISP.Game;
|
||||
using HISP.Game.Horse;
|
||||
using HISP.Game.Items;
|
||||
using HISP.Game.Services;
|
||||
using HISP.Game.SwfModules;
|
||||
using HISP.Security;
|
||||
using HISP.Server;
|
||||
using HTTP;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HISP
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
private static LoadingForm lfrm;
|
||||
private static string baseDir;
|
||||
private static ContentServer cs;
|
||||
private static void addToList(string path)
|
||||
{
|
||||
string Name = path.Remove(0, Path.Combine(baseDir, "client").Length+1);
|
||||
string Name = path.Remove(0, Path.Combine(baseDir, "client").Length);
|
||||
Name = Name.Replace("\\", "/");
|
||||
|
||||
ContentItem ci = new ContentItem(Name, path);
|
||||
|
@ -23,35 +33,62 @@ namespace HISP
|
|||
|
||||
}
|
||||
|
||||
public static void OnShutdown()
|
||||
{
|
||||
if(!Process.GetCurrentProcess().CloseMainWindow())
|
||||
Process.GetCurrentProcess().Close();
|
||||
}
|
||||
|
||||
public static void StartLRFrm()
|
||||
{
|
||||
if (lfrm.ShowDialog() == DialogResult.Cancel)
|
||||
{
|
||||
GameServer.ShutdownServer();
|
||||
}
|
||||
}
|
||||
|
||||
public static void IncrementProgress()
|
||||
{
|
||||
if (lfrm.InvokeRequired)
|
||||
{
|
||||
lfrm.Invoke(() =>
|
||||
{
|
||||
lfrm.StartProgress.Increment(1);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
lfrm.StartProgress.Increment(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
|
||||
baseDir = Directory.GetCurrentDirectory();
|
||||
|
||||
lfrm = new LoadingForm();
|
||||
Task startForm = new Task(StartLRFrm);
|
||||
startForm.Start();
|
||||
|
||||
ConfigReader.OpenConfig();
|
||||
if (File.Exists(ConfigReader.ConfigurationFileName))
|
||||
File.WriteAllText(ConfigReader.ConfigurationFileName, File.ReadAllText(ConfigReader.ConfigurationFileName).Replace("sql_lite=false", "sql_lite=true"));
|
||||
ConfigReader.SqlLite = true;
|
||||
ConfigReader.LogLevel = 0;
|
||||
|
||||
IncrementProgress();
|
||||
|
||||
|
||||
Database.OpenDatabase();
|
||||
if(Database.GetUsers().Length == 0)
|
||||
IncrementProgress();
|
||||
|
||||
if (Database.GetUsers().Length <= 0)
|
||||
{
|
||||
Console.Write("Username: ");
|
||||
string username = Console.ReadLine();
|
||||
Console.Write("Password: ");
|
||||
string password = Console.ReadLine();
|
||||
Console.Write("Gender: ");
|
||||
string gender = Console.ReadLine();
|
||||
RegisterForm rfrm = new RegisterForm();
|
||||
if (rfrm.ShowDialog() == DialogResult.Cancel)
|
||||
GameServer.ShutdownServer();
|
||||
|
||||
lfrm.Focus();
|
||||
|
||||
Random r = new Random();
|
||||
byte[] salt = new byte[64];
|
||||
|
||||
r.NextBytes(salt);
|
||||
|
||||
string saltText = BitConverter.ToString(salt).Replace("-", "");
|
||||
|
||||
string hashsalt = BitConverter.ToString(Authentication.HashAndSalt(password, salt)).Replace("-", "");
|
||||
|
||||
Database.CreateUser(0, username, hashsalt, saltText, gender, true, true);
|
||||
}
|
||||
|
||||
// Start Web Server
|
||||
|
@ -60,18 +97,62 @@ namespace HISP
|
|||
foreach (string file in fileList)
|
||||
addToList(file);
|
||||
|
||||
IncrementProgress();
|
||||
|
||||
// Start HI1 Server
|
||||
Logger.SetCallback(Console.WriteLine);
|
||||
Start.InitalizeAndStart();
|
||||
IncrementProgress();
|
||||
|
||||
// Start Flash (Windows)
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = Path.Combine(baseDir, "flash.dll");
|
||||
p.StartInfo.Arguments = "http://127.0.0.1:12515/horseisle.swf?SERVER=127.0.0.1&PORT=12321";
|
||||
p.Start();
|
||||
Entry.SetShutdownCallback(OnShutdown);
|
||||
IncrementProgress();
|
||||
|
||||
while (true) { /* Allow asyncronous operations to happen. */ };
|
||||
CrossDomainPolicy.GetPolicy();
|
||||
IncrementProgress();
|
||||
|
||||
GameDataJson.ReadGamedata();
|
||||
IncrementProgress();
|
||||
|
||||
Map.OpenMap();
|
||||
IncrementProgress();
|
||||
|
||||
World.ReadWorldData();
|
||||
IncrementProgress();
|
||||
|
||||
Treasure.Init();
|
||||
IncrementProgress();
|
||||
|
||||
DroppedItems.Init();
|
||||
IncrementProgress();
|
||||
|
||||
WildHorse.Init();
|
||||
IncrementProgress();
|
||||
|
||||
Drawingroom.LoadAllDrawingRooms();
|
||||
IncrementProgress();
|
||||
|
||||
Brickpoet.LoadPoetryRooms();
|
||||
IncrementProgress();
|
||||
|
||||
Multiroom.CreateMultirooms();
|
||||
IncrementProgress();
|
||||
|
||||
Auction.LoadAllAuctionRooms();
|
||||
IncrementProgress();
|
||||
|
||||
Item.DoSpecialCases();
|
||||
IncrementProgress();
|
||||
|
||||
GameServer.StartServer();
|
||||
IncrementProgress();
|
||||
|
||||
lfrm.DialogResult = DialogResult.OK;
|
||||
startForm.Wait();
|
||||
|
||||
SystemTrayIcon stry = new SystemTrayIcon();
|
||||
stry.ShowDialog();
|
||||
|
||||
// Finally, shutdown server
|
||||
GameServer.ShutdownServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration>Linux</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
<PublishDir>bin\x64\Linux\net6.0\linux-x64\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_LINUX;ARCH_X86_64</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration>Linux</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
<PublishDir>bin\ARM\Linux\net6.0\linux-arm\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_LINUX;ARCH_ARM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration>Linux</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
<PublishDir>bin\ARM64\Linux\net6.0\linux-arm64\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_LINUX;ARCH_ARM64</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration>MacOS</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
<PublishDir>bin\x64\MacOS\net6.0\osx-x64\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_MACOS;ARCH_X86_64</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration>MacOS</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
<PublishDir>bin\arm64\MacOS\net6.0\osx-arm64\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_MACOS;ARCH_ARM64</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -2,18 +2,18 @@
|
|||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration>Windows</Configuration>
|
||||
<Platform>x86</Platform>
|
||||
<PublishDir>bin\x86\Windows\net6.0\win-x86\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_WINDOWS;ARCH_X86</DefineConstants>
|
||||
<!-- <PublishTrimmed>True</PublishTrimmed> -->
|
||||
<DefineConstants>OS_WINDOWS;ARCH_X86</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -8,12 +8,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<Platform>x64</Platform>
|
||||
<PublishDir>bin\x64\Windows\net6.0\win-x64\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_WINDOWS;ARCH_X86_64</DefineConstants>
|
||||
<!-- <PublishTrimmed>True</PublishTrimmed> -->
|
||||
<DefineConstants>OS_WINDOWS;ARCH_X86_64</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration>Windows</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
<PublishDir>bin\arm\Windows\net6.0\windows-arm\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>win-arm</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_WINDOWS;ARCH_ARM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration>Windows</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
<PublishDir>bin\arm64\Windows\net6.0\windows-arm64\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
|
||||
<SelfContained>True</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>True</PublishTrimmed>
|
||||
<DefineConstants>OS_WINDOWS;ARCH_ARM64</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"profiles": {
|
||||
"HISP": {
|
||||
"N00BS": {
|
||||
"commandName": "Project"
|
||||
}
|
||||
}
|
||||
|
|
233
HorseIsleServer/N00BS/RegisterForm.Designer.cs
generated
Normal file
233
HorseIsleServer/N00BS/RegisterForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,233 @@
|
|||
namespace HISP
|
||||
{
|
||||
partial class RegisterForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RegisterForm));
|
||||
this.isAdmin = new System.Windows.Forms.CheckBox();
|
||||
this.isMod = new System.Windows.Forms.CheckBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.Username = new System.Windows.Forms.TextBox();
|
||||
this.Password = new System.Windows.Forms.TextBox();
|
||||
this.BoySelecton = new System.Windows.Forms.RadioButton();
|
||||
this.GirlSelection = new System.Windows.Forms.RadioButton();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.CreateAccount = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.UsernameValidationFailReason = new System.Windows.Forms.Label();
|
||||
this.PasswordValidationFailReason = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// isAdmin
|
||||
//
|
||||
this.isAdmin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.isAdmin.AutoSize = true;
|
||||
this.isAdmin.Checked = true;
|
||||
this.isAdmin.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.isAdmin.Location = new System.Drawing.Point(238, 169);
|
||||
this.isAdmin.Name = "isAdmin";
|
||||
this.isAdmin.Size = new System.Drawing.Size(99, 19);
|
||||
this.isAdmin.TabIndex = 6;
|
||||
this.isAdmin.Text = "Administrator";
|
||||
this.isAdmin.UseVisualStyleBackColor = true;
|
||||
this.isAdmin.CheckedChanged += new System.EventHandler(this.isAdmin_CheckedChanged);
|
||||
//
|
||||
// isMod
|
||||
//
|
||||
this.isMod.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.isMod.AutoSize = true;
|
||||
this.isMod.Checked = true;
|
||||
this.isMod.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.isMod.Location = new System.Drawing.Point(238, 145);
|
||||
this.isMod.Name = "isMod";
|
||||
this.isMod.Size = new System.Drawing.Size(82, 19);
|
||||
this.isMod.TabIndex = 5;
|
||||
this.isMod.Text = "Moderator";
|
||||
this.isMod.UseVisualStyleBackColor = true;
|
||||
this.isMod.CheckedChanged += new System.EventHandler(this.isMod_CheckedChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(71, 15);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "User Details:";
|
||||
//
|
||||
// Username
|
||||
//
|
||||
this.Username.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.Username.Location = new System.Drawing.Point(12, 27);
|
||||
this.Username.MaxLength = 16;
|
||||
this.Username.Name = "Username";
|
||||
this.Username.PlaceholderText = "Username";
|
||||
this.Username.Size = new System.Drawing.Size(325, 23);
|
||||
this.Username.TabIndex = 1;
|
||||
this.Username.TextChanged += new System.EventHandler(this.Username_TextChanged);
|
||||
this.Username.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Username_KeyPress);
|
||||
//
|
||||
// Password
|
||||
//
|
||||
this.Password.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.Password.Location = new System.Drawing.Point(12, 56);
|
||||
this.Password.MaxLength = 16;
|
||||
this.Password.Name = "Password";
|
||||
this.Password.PasswordChar = '*';
|
||||
this.Password.PlaceholderText = "Password";
|
||||
this.Password.Size = new System.Drawing.Size(325, 23);
|
||||
this.Password.TabIndex = 2;
|
||||
this.Password.TextChanged += new System.EventHandler(this.Password_TextChanged);
|
||||
this.Password.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Password_KeyPress);
|
||||
//
|
||||
// BoySelecton
|
||||
//
|
||||
this.BoySelecton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.BoySelecton.AutoSize = true;
|
||||
this.BoySelecton.Location = new System.Drawing.Point(17, 168);
|
||||
this.BoySelecton.Name = "BoySelecton";
|
||||
this.BoySelecton.Size = new System.Drawing.Size(45, 19);
|
||||
this.BoySelecton.TabIndex = 4;
|
||||
this.BoySelecton.TabStop = true;
|
||||
this.BoySelecton.Text = "Boy";
|
||||
this.BoySelecton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// GirlSelection
|
||||
//
|
||||
this.GirlSelection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.GirlSelection.AutoSize = true;
|
||||
this.GirlSelection.Checked = true;
|
||||
this.GirlSelection.Location = new System.Drawing.Point(17, 144);
|
||||
this.GirlSelection.Name = "GirlSelection";
|
||||
this.GirlSelection.Size = new System.Drawing.Size(43, 19);
|
||||
this.GirlSelection.TabIndex = 3;
|
||||
this.GirlSelection.TabStop = true;
|
||||
this.GirlSelection.Text = "Girl";
|
||||
this.GirlSelection.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 121);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(48, 15);
|
||||
this.label2.TabIndex = 9;
|
||||
this.label2.Text = "Gender:";
|
||||
//
|
||||
// CreateAccount
|
||||
//
|
||||
this.CreateAccount.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.CreateAccount.Enabled = false;
|
||||
this.CreateAccount.Location = new System.Drawing.Point(12, 201);
|
||||
this.CreateAccount.Name = "CreateAccount";
|
||||
this.CreateAccount.Size = new System.Drawing.Size(325, 29);
|
||||
this.CreateAccount.TabIndex = 7;
|
||||
this.CreateAccount.Text = "Create Account";
|
||||
this.CreateAccount.UseVisualStyleBackColor = true;
|
||||
this.CreateAccount.Click += new System.EventHandler(this.CreateAccount_Click);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(238, 121);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(64, 15);
|
||||
this.label3.TabIndex = 11;
|
||||
this.label3.Text = "Privledges:";
|
||||
//
|
||||
// UsernameValidationFailReason
|
||||
//
|
||||
this.UsernameValidationFailReason.AutoSize = true;
|
||||
this.UsernameValidationFailReason.ForeColor = System.Drawing.Color.Red;
|
||||
this.UsernameValidationFailReason.Location = new System.Drawing.Point(12, 82);
|
||||
this.UsernameValidationFailReason.Name = "UsernameValidationFailReason";
|
||||
this.UsernameValidationFailReason.Size = new System.Drawing.Size(241, 15);
|
||||
this.UsernameValidationFailReason.TabIndex = 12;
|
||||
this.UsernameValidationFailReason.Text = "- Username must be more than 3 characters.";
|
||||
//
|
||||
// PasswordValidationFailReason
|
||||
//
|
||||
this.PasswordValidationFailReason.AutoSize = true;
|
||||
this.PasswordValidationFailReason.ForeColor = System.Drawing.Color.Red;
|
||||
this.PasswordValidationFailReason.Location = new System.Drawing.Point(12, 97);
|
||||
this.PasswordValidationFailReason.Name = "PasswordValidationFailReason";
|
||||
this.PasswordValidationFailReason.Size = new System.Drawing.Size(238, 15);
|
||||
this.PasswordValidationFailReason.TabIndex = 13;
|
||||
this.PasswordValidationFailReason.Text = "- Password must be more than 6 characters.";
|
||||
//
|
||||
// RegisterForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(349, 241);
|
||||
this.Controls.Add(this.PasswordValidationFailReason);
|
||||
this.Controls.Add(this.UsernameValidationFailReason);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.CreateAccount);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.GirlSelection);
|
||||
this.Controls.Add(this.BoySelecton);
|
||||
this.Controls.Add(this.Password);
|
||||
this.Controls.Add(this.Username);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.isMod);
|
||||
this.Controls.Add(this.isAdmin);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(365, 280);
|
||||
this.Name = "RegisterForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Create Account";
|
||||
this.Load += new System.EventHandler(this.RegisterForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.CheckBox isAdmin;
|
||||
private System.Windows.Forms.CheckBox isMod;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox Username;
|
||||
private System.Windows.Forms.TextBox Password;
|
||||
private System.Windows.Forms.RadioButton BoySelecton;
|
||||
private System.Windows.Forms.RadioButton GirlSelection;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button CreateAccount;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label UsernameValidationFailReason;
|
||||
private System.Windows.Forms.Label PasswordValidationFailReason;
|
||||
}
|
||||
}
|
169
HorseIsleServer/N00BS/RegisterForm.cs
Normal file
169
HorseIsleServer/N00BS/RegisterForm.cs
Normal file
|
@ -0,0 +1,169 @@
|
|||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using HISP.Security;
|
||||
using HISP.Server;
|
||||
|
||||
namespace HISP
|
||||
{
|
||||
public partial class RegisterForm : Form
|
||||
{
|
||||
public RegisterForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void RegisterForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
ValidateInput();
|
||||
}
|
||||
|
||||
private void ValidateInput()
|
||||
{
|
||||
if(ValidateUsername() && ValidatePassword())
|
||||
CreateAccount.Enabled = true;
|
||||
else
|
||||
CreateAccount.Enabled = false;
|
||||
}
|
||||
|
||||
private bool ValidatePassword()
|
||||
{
|
||||
int selStart = Password.SelectionStart;
|
||||
int selLen = Password.SelectionLength;
|
||||
Password.Text = Regex.Replace(Password.Text, "[^A-Za-z0-9]", "");
|
||||
Password.SelectionStart = selStart;
|
||||
Password.SelectionLength = selLen;
|
||||
|
||||
if (Password.Text.Length < 6)
|
||||
{
|
||||
PasswordValidationFailReason.Text = "- Password must be more than 6 characters.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Password.Text.Length >= 16)
|
||||
{
|
||||
PasswordValidationFailReason.Text = "- Password must be less than 16 characters.";
|
||||
return false;
|
||||
}
|
||||
|
||||
PasswordValidationFailReason.Text = "";
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ValidateUsername()
|
||||
{
|
||||
int selStart = Username.SelectionStart;
|
||||
int selLen = Username.SelectionLength;
|
||||
Username.Text = Regex.Replace(Username.Text, "[^A-Za-z]", "");
|
||||
Username.SelectionStart = selStart;
|
||||
Username.SelectionLength = selLen;
|
||||
|
||||
if (Username.Text.Length < 3)
|
||||
{
|
||||
UsernameValidationFailReason.Text = "- Username must be more than 3 characters.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Username.Text.Length >= 16)
|
||||
{
|
||||
UsernameValidationFailReason.Text = "- Username must be less than 16 characters.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Regex.IsMatch(Username.Text, "[A-Z]{2,}"))
|
||||
{
|
||||
UsernameValidationFailReason.Text = "- Username have the first letter of each word capitalized.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Username.Text.ToUpper()[0] != Username.Text[0])
|
||||
{
|
||||
UsernameValidationFailReason.Text = "- Username have the first letter of each word capitalized.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Database.CheckUserExist(Username.Text))
|
||||
{
|
||||
UsernameValidationFailReason.Text = "- Username is already in use.";
|
||||
return false;
|
||||
}
|
||||
|
||||
UsernameValidationFailReason.Text = "";
|
||||
return true;
|
||||
}
|
||||
|
||||
private void Username_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ValidateInput();
|
||||
}
|
||||
|
||||
private void Password_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ValidateInput();
|
||||
}
|
||||
|
||||
private void CreateAccount_Click(object sender, EventArgs 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(Password.Text, salt)).Replace("-", "");
|
||||
|
||||
// Insert LGBT Patch here.
|
||||
string gender = "";
|
||||
if (BoySelecton.Checked)
|
||||
gender = "MALE";
|
||||
|
||||
if (GirlSelection.Checked)
|
||||
gender = "FEMALE";
|
||||
|
||||
Database.CreateUser(newUserId, Username.Text, hashsalt, saltText, gender, isAdmin.Checked, isMod.Checked);
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void isAdmin_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (isAdmin.Checked)
|
||||
isMod.Checked = true;
|
||||
}
|
||||
|
||||
private void isMod_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!isMod.Checked)
|
||||
isAdmin.Checked = false;
|
||||
}
|
||||
|
||||
private void Password_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if(e.KeyChar == (char)Keys.Return)
|
||||
{
|
||||
if (CreateAccount.Enabled)
|
||||
{
|
||||
e.Handled = true;
|
||||
CreateAccount_Click(null, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Username_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (e.KeyChar == (char)Keys.Return)
|
||||
{
|
||||
if (CreateAccount.Enabled)
|
||||
{
|
||||
e.Handled = true;
|
||||
CreateAccount_Click(null, null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
126
HorseIsleServer/N00BS/RegisterForm.resx
Normal file
126
HorseIsleServer/N00BS/RegisterForm.resx
Normal file
|
@ -0,0 +1,126 @@
|
|||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAGyAAAAEAIAAoDgAAFgAAACgAA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AGCASgBMEFEAVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACMzoIBKxksgTIENfFuAHL/rwC3/8cA
|
||||
0v+fAKf/cQB2/V8AYoJKAEwRUQBTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGC0YBjcDOYZxAHbxngCm/6EAqf9pAm//OAU71UMH
|
||||
RRxKB00AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAjBSUAXABfAAAAAAWZAaCliQOQ+0gDS7MyBDWiMigzxUBBPzk/QD8AAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAOsf9ADyIPtdoxGp8koATF9NBFAAQUNBHkBBQBBAQEAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKYV
|
||||
qgClFKkjdAh4fVEAVBRXAFoAAAAAAAAAAAAAAAAAAAAAAAAAAADGPH/gBDx/4AQ8d+AAPGPgAD4h4CAe
|
||||
MOAADBjgAAAA4AAAAOCAAAHggAAD4IAAA+DAAAPgwAAD4MAAA+DgAAPg4AAD4OAAA+DwAAPg+MACAP/4
|
||||
AgD/+AAA//wAAP/8AAD//AAA//4AAP/+ACD//gBg//8A4P//gOD//8Tg///H4A==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
117
HorseIsleServer/N00BS/SystemTrayIcon.Designer.cs
generated
Normal file
117
HorseIsleServer/N00BS/SystemTrayIcon.Designer.cs
generated
Normal file
|
@ -0,0 +1,117 @@
|
|||
namespace HISP
|
||||
{
|
||||
partial class SystemTrayIcon
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SystemTrayIcon));
|
||||
this.HispNotifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.HispContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.usersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.serverToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.closeServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.createNewUserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.HispContextMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// HispNotifyIcon
|
||||
//
|
||||
this.HispNotifyIcon.ContextMenuStrip = this.HispContextMenuStrip;
|
||||
this.HispNotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("HispNotifyIcon.Icon")));
|
||||
this.HispNotifyIcon.Text = "Horse Isle";
|
||||
this.HispNotifyIcon.Visible = true;
|
||||
//
|
||||
// HispContextMenuStrip
|
||||
//
|
||||
this.HispContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.usersToolStripMenuItem,
|
||||
this.serverToolStripMenuItem});
|
||||
this.HispContextMenuStrip.Name = "HispContextMenuStrip";
|
||||
this.HispContextMenuStrip.Size = new System.Drawing.Size(107, 48);
|
||||
//
|
||||
// usersToolStripMenuItem
|
||||
//
|
||||
this.usersToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.createNewUserToolStripMenuItem});
|
||||
this.usersToolStripMenuItem.Name = "usersToolStripMenuItem";
|
||||
this.usersToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.usersToolStripMenuItem.Text = "Users";
|
||||
//
|
||||
// serverToolStripMenuItem
|
||||
//
|
||||
this.serverToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.closeServerToolStripMenuItem});
|
||||
this.serverToolStripMenuItem.Name = "serverToolStripMenuItem";
|
||||
this.serverToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.serverToolStripMenuItem.Text = "Server";
|
||||
//
|
||||
// closeServerToolStripMenuItem
|
||||
//
|
||||
this.closeServerToolStripMenuItem.Name = "closeServerToolStripMenuItem";
|
||||
this.closeServerToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.closeServerToolStripMenuItem.Text = "Close Server";
|
||||
this.closeServerToolStripMenuItem.Click += new System.EventHandler(this.closeServerToolStripMenuItem_Click);
|
||||
//
|
||||
// createNewUserToolStripMenuItem
|
||||
//
|
||||
this.createNewUserToolStripMenuItem.Name = "createNewUserToolStripMenuItem";
|
||||
this.createNewUserToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.createNewUserToolStripMenuItem.Text = "Create New User";
|
||||
this.createNewUserToolStripMenuItem.Click += new System.EventHandler(this.createNewUserToolStripMenuItem_Click);
|
||||
//
|
||||
// SystemTrayIcon
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(90, 92);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "SystemTrayIcon";
|
||||
this.Opacity = 0D;
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "SystemTrayIcon";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SystemTrayIcon_FormClosing);
|
||||
this.Load += new System.EventHandler(this.SystemTrayIcon_Load);
|
||||
this.HispContextMenuStrip.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.NotifyIcon HispNotifyIcon;
|
||||
private System.Windows.Forms.ContextMenuStrip HispContextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem usersToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem createNewUserToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem serverToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem closeServerToolStripMenuItem;
|
||||
}
|
||||
}
|
65
HorseIsleServer/N00BS/SystemTrayIcon.cs
Normal file
65
HorseIsleServer/N00BS/SystemTrayIcon.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
using HISP.Server;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HISP
|
||||
{
|
||||
public partial class SystemTrayIcon : Form
|
||||
{
|
||||
Process clientProcess = new Process();
|
||||
|
||||
public SystemTrayIcon()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void createNewUserToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
RegisterForm frm = new RegisterForm();
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
private void closeServerToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void SystemTrayIcon_Load(object sender, EventArgs e)
|
||||
{
|
||||
clientProcess.StartInfo.FileName = "flash.dll";
|
||||
clientProcess.StartInfo.Arguments = "http://127.0.0.1/horseisle.swf?SERVER=127.0.0.1&PORT=12321";
|
||||
|
||||
clientProcess.StartInfo.RedirectStandardOutput = true;
|
||||
clientProcess.StartInfo.RedirectStandardError = true;
|
||||
|
||||
clientProcess.EnableRaisingEvents = true;
|
||||
clientProcess.Exited += clientExited;
|
||||
clientProcess.Start();
|
||||
|
||||
}
|
||||
|
||||
private void clientExited(object sender, EventArgs e)
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(() =>
|
||||
{
|
||||
this.Close();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void SystemTrayIcon_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
HispNotifyIcon.Visible = false;
|
||||
clientProcess.Kill();
|
||||
}
|
||||
}
|
||||
}
|
135
HorseIsleServer/N00BS/SystemTrayIcon.resx
Normal file
135
HorseIsleServer/N00BS/SystemTrayIcon.resx
Normal file
|
@ -0,0 +1,135 @@
|
|||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="HispNotifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="HispContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>150, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="HispNotifyIcon.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAGyAAAAEAIAAoDgAAFgAAACgAAAAbAAAAQAAAAAEAIAAAAAAAgA0AAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAPQFJAD0BSQo9AUkpPQFJGj0BSQBJHk0AWzZePT8NQLwyADALOAA3AAAAAAAAAAAAnZCiAMrK
|
||||
0AVCGUSsMAMyVC8CMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAIQEg/Hj0D
|
||||
STw9AUnoPQFJljYAPQAZABsQcEpyul0yX8sLAA0KMwA1AAAAAAAAAAAAgl2EAF8vX2JvSXH0Nws4UTMH
|
||||
NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAtQEFArT0LSEs9AUn9PQFJpDQA
|
||||
OQAoACofSwVK6UcER8wYAB4KLwAyAAAAAAAAAAAAWwdZAEcDRZBUBlL/MgEzUDABMQA9AUkAPQFJAD0B
|
||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||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAOsf9ADyIPtdoxGp8koATF9NBFAAQUNBHkBBQBBAQEAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKYV
|
||||
qgClFKkjdAh4fVEAVBRXAFoAAAAAAAAAAAAAAAAAAAAAAAAAAADGPH/gBDx/4AQ8d+AAPGPgAD4h4CAe
|
||||
MOAADBjgAAAA4AAAAOCAAAHggAAD4IAAA+DAAAPgwAAD4MAAA+DgAAPg4AAD4OAAA+DwAAPg+MACAP/4
|
||||
AgD/+AAA//wAAP/8AAD//AAA//4AAP/+ACD//gBg//8A4P//gOD//8Tg///H4A==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>79</value>
|
||||
</metadata>
|
||||
</root>
|
BIN
HorseIsleServer/N00BS/flash.dll
Normal file
BIN
HorseIsleServer/N00BS/flash.dll
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue