Rev 28 | Rev 32 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#include "pch.h"
#pragma hdrstop
#include "ClientServices.h"
/****************************************************************************
*
* Client memory addresses
*
***/
#define CLIENTCONNECTION__GETCHARACTERLIST 0x006B14C0;
#define CLIENTSERVICES_REPORT 0x006B22A0;
#define CLIENTSERVICES_SEND 0x00406F40
#define CLIENTSERVICES__SENDONCONNECTION 0x006B0B50
#define CLIENTSERVICES_INITIALIZE 0x005AB1D0
#define CLIENTSERVICES_DESTROY 0x005AB3D0
#define CLIENTSERVICES_SETMESSAGEHANDLER 0x006B0B80
#define CLIENTSERVICES_CLEARMESSAGEHANDLER 0x006B0BC0
/****************************************************************************
*
* Client function pointers
*
***/
void (*ClientConnection__GetCharacterListPtr)(void*) = *(void(*)(void*))CLIENTCONNECTION__GETCHARACTERLIST;
void (*ClientServices_InitializePtr)() = *(void(*)())CLIENTSERVICES_INITIALIZE;
void (*ClientServices_DestroyPtr)() = *(void(*)())CLIENTSERVICES_DESTROY;
BOOL (*ClientServices_ReportPtr)(unsigned int,LPCSTR) = *(BOOL(*)(unsigned int,LPCSTR))CLIENTSERVICES_REPORT;
void (*ClientServices_SendPtr)(CDataStore*) = *(void(*)(CDataStore*))CLIENTSERVICES_SEND;
void (*ClientServices_SendOnConnectionPtr)(CDataStore*) = *(void(*)(CDataStore*))CLIENTSERVICES__SENDONCONNECTION;
void (*ClientServices_SetMessageHandlerPtr)(NETMESSAGE,int (*)(void*,NETMESSAGE,unsigned int,CDataStore*),void*) = *(void(*)(NETMESSAGE,int (*)(void*,NETMESSAGE,unsigned int,CDataStore*),void*))CLIENTSERVICES_SETMESSAGEHANDLER;
void (*ClientServices_ClearMessageHandlerPtr)(NETMESSAGE) = *(void(*)(NETMESSAGE))CLIENTSERVICES_CLEARMESSAGEHANDLER;
/****************************************************************************
*
* Private
*
***/
//===========================================================================
void ClientServices_InternalInitialize () {
ClientServices_InitializePtr();
}
//===========================================================================
void ClientServices_InternalDestroy () {
ClientServices_DestroyPtr();
}
/****************************************************************************
*
* External
*
***/
void ClientConnection::GetCharacterList () {
ClientConnection__GetCharacterListPtr(ClientServices_Connection());
}
//===========================================================================
void ClientServices_Initialize () {
DETOUR_INIT;
DETOUR_ATTACH(ClientServices_InitializePtr,ClientServices_InternalInitialize);
DETOUR_COMMIT;
}
//===========================================================================
void* ClientServices_Connection () {
return (void*)0x00C79CF4; //TODO: ClientConnection::s_currentConnection
}
//===========================================================================
void ClientServices_Destroy () {
DETOUR_INIT;
DETOUR_DETACH(ClientServices_DestroyPtr,ClientServices_InternalDestroy);
DETOUR_COMMIT;
}
//===========================================================================
BOOL ClientServices_Report (unsigned int category, char const* title) {
return ClientServices_ReportPtr(category, title);
}
//===========================================================================
void ClientServices_Send (CDataStore *netMessage) {
ClientServices_SendPtr(netMessage);
}
//===========================================================================
void ClientServices_SendOnConnection(CDataStore* msg) {
ClientServices_SendOnConnectionPtr(msg);
}
//===========================================================================
void ClientServices_SetMessageHandler (NETMESSAGE msgID,
int (*handler)(void*,NETMESSAGE,unsigned int,CDataStore*),
void* param) {
ClientServices_SetMessageHandlerPtr(msgID,handler,param);
}
//===========================================================================
void ClientServices_ClearMessageHandler (NETMESSAGE msgID) {
ClientServices_ClearMessageHandlerPtr(msgID);
}