1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-06 10:47:45 +00:00

added a short form oodle2net.h

Custom short version of oodle2net.h that only sets up the functions we need here. Still need oo2net_9_win64.dll and oo2net_9_win64.lib which won't be added here
This commit is contained in:
Moydow 2022-06-14 04:28:42 +01:00 committed by Maple
parent 064851ff2e
commit 432cdc0de8
2 changed files with 35 additions and 3 deletions

32
deps/Oodle/oodle2net.h vendored Normal file
View file

@ -0,0 +1,32 @@
#ifndef __OODLE2NET_H__
#define __OODLE2NET_H__
extern "C" intptr_t __stdcall OodleNetwork1_Shared_Size( int32_t htbits );
extern "C" intptr_t __stdcall OodleNetwork1UDP_State_Size();
extern "C" void __stdcall OodleNetwork1_Shared_SetWindow(
void* shared,
int32_t htbits,
const void* window,
int32_t windowSize
);
extern "C" void __stdcall OodleNetwork1UDP_Train(
void* state,
const void* shared,
const void** trainingPacketPointers,
const int32_t* trainingPacketSizes,
int32_t numTrainingPackets
);
extern "C" bool __stdcall OodleNetwork1UDP_Decode(
void* state,
const void* shared,
const void* enc,
intptr_t encSize,
void* dec,
intptr_t decSize
);
#endif

View file

@ -17,11 +17,11 @@ Network::Oodle::Oodle() :
void Network::Oodle::oodleInit()
{
OodleNetwork1_Shared_SetWindow( (OodleNetwork1_Shared*) &m_shared[0], m_htbits, &m_window[0], (int) m_window.size() );
OodleNetwork1UDP_Train( (OodleNetwork1UDP_State*) &m_state[0], (OodleNetwork1_Shared*) &m_shared[0], nullptr, nullptr, 0 );
OodleNetwork1_Shared_SetWindow( &m_shared[0], m_htbits, &m_window[0], (int) m_window.size() );
OodleNetwork1UDP_Train( &m_state[0], &m_shared[0], nullptr, nullptr, 0 );
}
bool Network::Oodle::oodleDecode( const std::vector< uint8_t > &enc, uint32_t encSize, std::vector< uint8_t > &dec, uint32_t decSize )
{
return OodleNetwork1UDP_Decode( (OodleNetwork1UDP_State*) &m_state[0], (OodleNetwork1_Shared*) &m_shared[0], &enc[0], encSize, &dec[0], decSize );
return OodleNetwork1UDP_Decode( &m_state[0], &m_shared[0], &enc[0], encSize, &dec[0], decSize );
}