-
Notifications
You must be signed in to change notification settings - Fork 5
Characters images
Jav edited this page Dec 31, 2022
·
10 revisions
In your Neuz project on the Source files folder:
- Right click -> new element and select header file (rename it httplib.h)
- Copy the code from https://raw.githubusercontent.com/yhirose/cpp-httplib/master/httplib.h and paste it in your project.
Put this in your common defines
#define __AZURIOM_IMAGES
#define AZURIOM_WEBSITE "my-website.com" // for more info look at https://github.com/yhirose/cpp-httplib#client-1
#define AZURIOM_WEBSITE_PORT 80
Now follow the steps :
Step #1
Go to WndFiled.h and look for
BOOL m_bVBHPGauge;
BOOL m_bVBMPGauge;
BOOL m_bVBFPGauge;
BOOL m_bVBEXPGauge;
Add right after :
#ifdef __AZURIOM_IMAGES
BOOL m_Azuriom_SaveAvatar;
#endif
Step #2
Go to WndFiled.cpp
Look for :
#if __VER >= 15 // __GUILD_HOUSE
#include "GuildHouse.h"
#endif
Add right after :
#ifdef __AZURIOM_IMAGES
#include "httplib.h"
#endif
Look for:
m_bHPVisible = TRUE;
m_bExpVisible = TRUE;
Add right after :
#ifdef __AZURIOM_IMAGES
m_Azuriom_SaveAvatar = TRUE;
#endif
Look for:
::SetLight( FALSE );
::SetFog( FALSE );
SetDiffuse( 1.0f, 1.0f, 1.0f );
SetAmbient( 1.0f, 1.0f, 1.0f );
g_pBipedMesh->Render(pd3dDevice,&matWorld);
Add right after :
#ifdef __AZURIOM_IMAGES
if (m_Azuriom_SaveAvatar) {
LPCSTR token = g_dpCertified.GetAzuriomAccessToken();
IDirect3DSurface9* pDestTarget;
CRect rectCtrl;
rectCtrl.top = this->m_rectClient.top + lpFace->rect.top;
rectCtrl.bottom = this->m_rectClient.top + lpFace->rect.bottom;
rectCtrl.left = this->m_rectClient.left + lpFace->rect.left;
rectCtrl.right = this->m_rectClient.left + lpFace->rect.right;
pd3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_FORCE_DWORD, &pDestTarget);
LPD3DXBUFFER buffer;
D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_PNG, pDestTarget, NULL, &rectCtrl);
httplib::Client cli(AZURIOM_WEBSITE, AZURIOM_WEBSITE_PORT);
httplib::Headers headers = {
{ "Content-Type", "multipart/form-data"},
{ "Accept", "application/json"}
};
httplib::MultipartFormDataItems items = {
{ "access_token", token},
{ "avatar", std::string((char*)buffer->GetBufferPointer(), buffer->GetBufferSize()), pMover->GetName(), "image/png" },
{ "playerName", pMover->GetName()}
};
auto res = cli.Post("/api/flyff/upload_avatar", headers, items);
buffer->Release();
m_Azuriom_SaveAvatar = FALSE;
}
#endif
Step #3
Go to DPCertified.h and look for
DWORD m_dwSizeofServerset;
SERVER_DESC m_aServerset[128];
Add right after :
#ifdef __AZURIOM_IMAGES
char m_Azuriom_access_token[192];
#endif
look for
BOOL CheckNofityDisconnected();
void SendCertify();
Add right after :
#ifdef __AZURIOM_IMAGES
LPCTSTR GetAzuriomAccessToken() { return m_Azuriom_access_token; }
#endif
Go to DPCertified.cpp look for
for( int i = 0; i < (int)( m_dwSizeofServerset ); i++ )
{
pServer = m_aServerset + i;
ar >> pServer->dwParent;
ar >> pServer->dwID;
ar.ReadString( pServer->lpName, 36 );
ar.ReadString( pServer->lpAddr, 16 );
// ���� ��Ʈ �������� ���� �����̰� ip�� ���Ե� ���� �������,
if( bPrivate && pServer->lpAddr[0] != '\0' )
lstrcpy( pServer->lpAddr, g_Neuz.m_lpCertifierAddr );
ar >> pServer->b18;
ar >> pServer->lCount;
ar >> pServer->lEnable;
ar >> pServer->lMax;
}
Add right after :
#ifdef __AZURIOM_IMAGES
ar.ReadString(m_Azuriom_access_token, 191);
#endif
Step #4
Go to DPCertifier.cpp and look for
for( DWORD i = 0; i < m_dwSizeofServerset; i++ )
{
LPSERVER_DESC pServer = m_aServerset + i;
ar << pServer->dwParent;
ar << pServer->dwID;
ar.WriteString( pServer->lpName );
ar.WriteString( pServer->lpAddr );
ar << pServer->b18;
ar << pServer->lCount;
ar << pServer->lEnable;
ar << pServer->lMax;
}
Add right after :
#ifdef __AZURIOM_IMAGES
CQuery query;
query.Connect(3, "login", "account", g_DbManager.m_szLoginPWD);
char szQuery[200] = { 0, };
sprintf(szQuery, "SELECT TOP 1 [account], [Azuriom_user_access_token] FROM [ACCOUNT_DBF].[dbo].[ACCOUNT_TBL] WHERE [account] = '%s'", szBak);
if (query.Exec(szQuery) == FALSE)
{
Error("[ERROR] Exec SendServerList. %s", szBak);
query.Clear();
}
char token[192] = { 0, };
while (query.Fetch()) {
query.GetStr("Azuriom_user_access_token", token, _countof(token));
}
query.Clear();
ar.WriteString(token);
#endif // __AZURIOM_IMAGES