note 1: this code is for an injected dll, you cannot use this in a exe, the reason is the packet encryption and session id
note 2: you need the CNetworkMessage Class from engine.dll source code (i will not give you this, don't ask me, ask google)
note 3: this code is outdated and will not work on current EP2 server (Gamigo, Aeria, Destiny, ... )
types.h:
Code:
typedef signed __int64 SQUAD;
typedef signed long int SLONG;
typedef signed short int SWORD;
typedef signed char SBYTE;
typedef signed int SINT;
typedef unsigned __int64 UQUAD;
typedef unsigned long int ULONG;
typedef unsigned short int UWORD;
typedef unsigned char UBYTE;
typedef unsigned int UINT;
typedef int BOOL; // this is for TRUE/FALSE
typedef long int RESULT; // for error codes
typedef long int INDEX; // for indexed values and quantities
typedef SLONG PIX; // pixel coordinates
typedef SLONG TEX; // texel coordinates
typedef SLONG MEX; // texels in mip-level 0
typedef float FLOAT;
typedef double DOUBLE;
typedef float ANGLE;
typedef float TIME;
typedef FLOAT RANGE;
typedef ULONG COLOR; // color is always in 32 bit true-color format
class CNetworkMessage;
class CTString;
network.h:
Code:
typedef void (__stdcall* funcSendToServerNew)(const CNetworkMessage&, BOOL);
void SendToServerNew(const CNetworkMessage &nmMessage, BOOL bLogin = false);
network.cpp:
Code:
void SendToServerNew(const CNetworkMessage &nmMessage, BOOL bLogin)
{
funcSendToServerNew function = (funcSendToServerNew)GetProcAddress(GetModuleHandle("Engine.dll"), "?SendToServerNew@CMessageDispatcher@@QAEXABVCNetworkMessage@@H@Z");
function(nmMessage, bLogin);
}
to use this: (example: delete item)
Code:
void SendItemDelete(SBYTE iTab, SBYTE iRow, SBYTE iCol, INDEX UniIndex, SQUAD count)
{
CNetworkMessage nmItem(MSG_ITEM);
nmItem << (SBYTE)MSG_ITEM_DELETE << iTab << iRow << iCol << UniIndex << count;
SendToServerNew(nmItem);
}