Added the capability for custom encryption's to be added to EHC.

This commit is contained in:
2024-10-06 22:54:29 -07:00
parent 1feff0a25c
commit 8b01ee3c46
15 changed files with 392 additions and 182 deletions

View File

@@ -1,12 +1,12 @@
#pragma once
#include "Utils.h"
#include "Fragments.h"
#include "NetUtils.h"
#include "NetFrags.h"
#include <ehs/Str.h>
#include <ehs/Vector.h>
#include <ehs/Serializer.h>
#include <ehs/io/socket/Socket.h>
#include "ehs/Str.h"
#include "ehs/Vector.h"
#include "ehs/Serializer.h"
#include "ehs/io/socket/Socket.h"
namespace ehs
{
@@ -27,7 +27,7 @@ namespace ehs
UInt_64 nextSendId;
Vector<Insurance> sent;
UInt_64 nextRecvId;
Vector<Fragments> received;
Vector<NetFrags> received;
AddrType type;
Str_8 address;
UInt_16 port;
@@ -68,21 +68,21 @@ namespace ehs
/// Sends data to the remote endpoint.
/// @param [in] deltaLocked Whether or not to match the remote endpoint's delta time to prevent overloading the client. This will drop data if delta time does not match.
/// @param [in] encrypted Whether or not to encrypt this data before sending to the remote endpoint.
/// @param [in] encHashId The hash id of the encryption to use. Can be zero for none.
/// @param [in] ensure Whether or not to ensure the data was received by the remote endpoint.
/// @param [in] sys The system hash id to execute an operation from.
/// @param [in] op The operation hash id in the system to execute.
/// @param [in] payload Additional parameters and data to send to the remote endpoint.
void Send(bool deltaLocked, bool encrypted, bool ensure, UInt_64 sys, UInt_64 op, const Serializer<UInt_64>& payload);
void Send(bool deltaLocked, UInt_64 encHashId, bool ensure, UInt_64 sys, UInt_64 op, const Serializer<UInt_64>& payload);
/// Sends data to the remote endpoint.
/// @param [in] deltaLocked Whether or not to match the remote endpoint's delta time to prevent overloading the client. This will drop data if delta time does not match.
/// @param [in] encrypted Whether or not to encrypt this data before sending to the remote endpoint.
/// @param [in] encId The id of the encryption to use. Can be empty for none.
/// @param [in] ensure Whether or not to ensure the data was received by the remote endpoint.
/// @param [in] sys The system string id to execute an operation from.
/// @param [in] op The operation string id in the system to execute.
/// @param [in] payload Additional parameters and data to send to the remote endpoint.
void Send(bool deltaLocked, bool encrypted, bool ensure, const Str_8& sys, const Str_8& op, const Serializer<UInt_64>& payload);
void Send(bool deltaLocked, const Str_8 &encID, bool ensure, const Str_8& sys, const Str_8& op, const Serializer<UInt_64>& payload);
UInt_64 GetNextRecvId() const;
@@ -113,7 +113,7 @@ namespace ehs
void AddReceived(const Header& header, const Serializer<>& payload);
Vector<Fragments>* GetReceived();
Vector<NetFrags>* GetReceived();
void Ping(float delta);
@@ -123,7 +123,7 @@ namespace ehs
void SetQueueSlot(UInt_64 slot);
Fragments FragmentData(const Header& header, const Serializer<>& data);
NetFrags FragmentData(const Header& header, const Serializer<>& data);
void Send(const Header& header, const Serializer<>& payload);