Skip to content

Commit

Permalink
Delete old db and file manipulation functions, more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazrius committed Nov 15, 2023
1 parent 2de146b commit aa1f339
Show file tree
Hide file tree
Showing 38 changed files with 245 additions and 880 deletions.
2 changes: 2 additions & 0 deletions include/API/InternalApi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ class InternalApi
static Action<void, Error> FMsgEncodeXml(std::wstring_view xml, char* buffer, uint size, uint& ret);
static void FMsgSendChat(ClientId client, char* buffer, uint size);
static Action<void, Error> SendMessage(ClientId to, std::wstring_view message, ClientId from = ClientId(), std::wstring_view = L"");

static uint CreateID(const std::wstring& nickname);
};
8 changes: 5 additions & 3 deletions include/API/Types/SystemId.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ class SystemId

Action<std::wstring_view, Error> GetName() const;
Action<std::wstring, Error> GetNickName() const;
Action<std::vector<Universe::IZone*>, Error> GetZones() const;
Action<std::vector<Universe::IZone *>, Error> GetZones() const;
Action<std::wstring, Error> PositionToSectorCoord(const Vector &pos) const;
Action<std::vector<SystemId>, Error> GetNeighboringSystems() const; // TODO: Look into Freelancer System Enumerator.
Action<std::vector<CSolar*>, Error> GetSolars(bool onlyDockables = false);
Action<std::vector<CSolar *>, Error> GetSolars(bool onlyDockables = false);
Action<std::vector<ClientId>, Error> GetPlayersInSystem(bool includeDocked = false) const;

Action<void, Error> Message(std::wstring_view msg, MessageColor color = MessageColor::Default, MessageFormat format = MessageFormat::Normal);
Action<void, Error> PlaySoundOrMusic(std::wstring trackNickNameSound, bool isMusic = false, std::optional<std::pair<Vector, float>> sphere = {});
Action<void, Error> PlaySoundOrMusic(const std::wstring &trackNickNameSound, bool isMusic = false,
const std::optional<std::pair<Vector, float>> &sphere = {});
Action<uint, Error> KillAllPlayers() const;
};
1 change: 1 addition & 0 deletions include/API/Utils/Serializer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "Core/FLHook.hpp"
#include "Core/Logger.hpp"

namespace nlohmann
{
Expand Down
1 change: 1 addition & 0 deletions include/Core/ClientServerInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class IServerImplHook
static void __stdcall LocationExit(uint locationId, ClientId client);
static void __stdcall LocationEnter(uint locationId, ClientId client);

static bool LoginInnerAfter(const SLoginInfo& li, ClientId client);
static void __stdcall Login(const SLoginInfo& li, ClientId client);
static void __stdcall SetManeuver(ClientId client, const XSetManeuver& sm);
static void __stdcall MineAsteroid(uint systemId, const Vector& pos, uint crateId, uint lootId, uint count, ClientId client);
Expand Down
8 changes: 6 additions & 2 deletions include/Core/FLHook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ClientList;
class InfocardManager;
class Logger;
class TempBanManager;
class FlPacket;

class FLHook final
{
Expand All @@ -17,6 +18,7 @@ class FLHook final
friend InternalApi;
friend ClientId;
friend ShipId;
friend FlPacket;

// Static things

Expand Down Expand Up @@ -80,7 +82,6 @@ class FLHook final

static void LoadSettings();
static void ClearClientInfo(ClientId client);
void LoadUserSettings(uint client);
static void ProcessPendingCommands();

// Timers
Expand All @@ -102,9 +103,12 @@ class FLHook final

bool OnServerStart();
void InitHookExports();
void PatchClientImpl();
static void PatchClientImpl();
void UnloadHookExports();

void LoadUserSettings(ClientId client);
bool LoadBaseMarket();

uint damageToClientId;
uint damageToSpaceId;

Expand Down
1 change: 1 addition & 0 deletions include/Core/IpResolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class FLHook;
class IpResolver
{
friend FLHook;
friend IServerImplHook;

struct ResolvedIp
{
Expand Down
1 change: 1 addition & 0 deletions include/PCH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Dummy file to force build!

#include "API/FLHook/ClientList.hpp"
#include "Exceptions/InvalidParameterException.hpp"

// Template specializations for arg transformations
Expand Down
10 changes: 0 additions & 10 deletions project/FLHook.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@
<ClCompile Include="..\source\API\InternalApi.cpp" />
<ClCompile Include="..\Source\API\FLHook\ClientList.cpp" />
<ClCompile Include="..\source\API\FLHook\InfocardManager.cpp" />
<ClCompile Include="..\Source\API\FLHook\Mail.cpp" />
<ClCompile Include="..\Source\API\FLHook\MessageHandler.cpp" />
<ClCompile Include="..\Source\API\FLServer\Admin.cpp" />
<ClCompile Include="..\Source\API\FLServer\Math.cpp" />
<ClCompile Include="..\Source\API\FLServer\PilotPersonalities.cpp" />
<ClCompile Include="..\Source\API\FLServer\Player.cpp" />
<ClCompile Include="..\Source\API\FLServer\Solar.cpp" />
<ClCompile Include="..\source\API\Types\AccountId.cpp" />
<ClCompile Include="..\source\API\Types\BaseId.cpp" />
<ClCompile Include="..\Source\API\Types\ClientId.cpp" />
Expand All @@ -35,9 +29,6 @@
<ClCompile Include="..\source\API\Types\RepId.cpp" />
<ClCompile Include="..\source\API\Types\ShipId.cpp" />
<ClCompile Include="..\source\API\Types\SystemId.cpp" />
<ClCompile Include="..\source\API\Utils\FileUtils.cpp" />
<ClCompile Include="..\Source\API\Utils\IniUtils.cpp" />
<ClCompile Include="..\Source\Core\ApiInternal.cpp" />
<ClCompile Include="..\Source\Core\Commands\AdminCommandProcessor.cpp" />
<ClCompile Include="..\Source\Core\Commands\CommandLineParser.cpp" />
<ClCompile Include="..\Source\Core\Commands\ExternalCommandProcessor.cpp" />
Expand Down Expand Up @@ -84,7 +75,6 @@
<ClCompile Include="..\Source\Hooks\ClientServerInterface\Trade.cpp" />
<ClCompile Include="..\Source\Hooks\ClientServerInterface\Hooks.cpp" />
<ClCompile Include="..\Source\Hooks\ClientServerInterface\UserInterface.cpp" />
<ClCompile Include="..\Source\Hooks\HkDataBaseMarket.cpp" />
<ClCompile Include="..\Source\Hooks\HkIChatServer.cpp" />
<ClCompile Include="..\Source\Hooks\IEngineHook.cpp" />
<ClCompile Include="..\Source\Hooks\HkIEngineDamage.cpp" />
Expand Down
33 changes: 0 additions & 33 deletions project/FLHook.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
<Filter Include="Source\API\FLHook">
<UniqueIdentifier>{876be2ae-78a1-4080-970d-c0ea7773b25c}</UniqueIdentifier>
</Filter>
<Filter Include="Source\API\FLServer">
<UniqueIdentifier>{3ec9ac72-9554-4f7f-83ef-85c47f948d0e}</UniqueIdentifier>
</Filter>
<Filter Include="Include\API">
<UniqueIdentifier>{a18e4208-124a-4ccd-9fda-632fa9238c6d}</UniqueIdentifier>
</Filter>
Expand Down Expand Up @@ -114,9 +111,6 @@
<ClCompile Include="..\Source\Core\Commands\UserCommandProcessor.cpp">
<Filter>Source\Core\Commands</Filter>
</ClCompile>
<ClCompile Include="..\Source\Hooks\HkDataBaseMarket.cpp">
<Filter>Source\Hooks</Filter>
</ClCompile>
<ClCompile Include="..\Source\Hooks\HkIChatServer.cpp">
<Filter>Source\Hooks</Filter>
</ClCompile>
Expand All @@ -138,27 +132,9 @@
<ClCompile Include="..\Source\Hooks\SendComm.cpp">
<Filter>Source\Hooks</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\FLHook\Mail.cpp">
<Filter>Source\API\FLHook</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\FLHook\MessageHandler.cpp">
<Filter>Source\API\FLHook</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\FLServer\Admin.cpp">
<Filter>Source\API\FLServer</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\FLServer\Math.cpp">
<Filter>Source\API\FLServer</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\FLServer\PilotPersonalities.cpp">
<Filter>Source\API\FLServer</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\FLServer\Player.cpp">
<Filter>Source\API\FLServer</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\FLServer\Solar.cpp">
<Filter>Source\API\FLServer</Filter>
</ClCompile>
<ClCompile Include="..\Include\PCH.cpp" />
<ClCompile Include="..\Source\Hooks\ClientServerInterface\Hooks.cpp">
<Filter>Source\Hooks\ClientServerInterface</Filter>
Expand Down Expand Up @@ -250,12 +226,6 @@
<ClCompile Include="..\Source\Core\Commands\ExternalCommandProcessor.cpp">
<Filter>Source\Core\Commands</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\Utils\IniUtils.cpp">
<Filter>Source\API\Utils</Filter>
</ClCompile>
<ClCompile Include="..\source\API\Utils\FileUtils.cpp">
<Filter>Source\API\Utils</Filter>
</ClCompile>
<ClCompile Include="..\source\Core\IpResolver.cpp">
<Filter>Source\Core</Filter>
</ClCompile>
Expand All @@ -265,9 +235,6 @@
<ClCompile Include="..\source\API\InternalApi.cpp">
<Filter>Source\API</Filter>
</ClCompile>
<ClCompile Include="..\Source\Core\ApiInternal.cpp">
<Filter>Source\Core</Filter>
</ClCompile>
<ClCompile Include="..\Source\API\Types\ClientId.cpp">
<Filter>Source\API\Types</Filter>
</ClCompile>
Expand Down
182 changes: 0 additions & 182 deletions source/API/FLHook/Mail.cpp

This file was deleted.

Loading

0 comments on commit aa1f339

Please sign in to comment.