Initial MSVC 2008 projects workspace
This commit is contained in:
63
l2packets/game/client/L2Game_Action.cpp
Normal file
63
l2packets/game/client/L2Game_Action.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_Action.h"
|
||||
|
||||
/* L2J:
|
||||
private int _objectId;
|
||||
@SuppressWarnings("unused")
|
||||
private int _originX;
|
||||
@SuppressWarnings("unused")
|
||||
private int _originY;
|
||||
@SuppressWarnings("unused")
|
||||
private int _originZ;
|
||||
private int _actionId;
|
||||
|
||||
@Override
|
||||
protected void readImpl()
|
||||
{
|
||||
_objectId = readD(); // Target object Identifier
|
||||
_originX = readD();
|
||||
_originY = readD();
|
||||
_originZ = readD();
|
||||
_actionId = readC(); // Action identifier : 0-Simple click, 1-Shift click
|
||||
}
|
||||
*/
|
||||
|
||||
L2Game_Action::L2Game_Action()
|
||||
{
|
||||
this->_initNull();
|
||||
}
|
||||
|
||||
L2Game_Action::L2Game_Action( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
this->_initNull();
|
||||
this->setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_Action::create( unsigned int objectID,
|
||||
unsigned int originX,
|
||||
unsigned int originY,
|
||||
unsigned int originZ,
|
||||
unsigned char bUseShift )
|
||||
{
|
||||
this->writeReset();
|
||||
this->writeUChar( 0x1f ); // packet type - Action
|
||||
this->writeUInt( objectID );
|
||||
this->writeUInt( originX );
|
||||
this->writeUInt( originY );
|
||||
this->writeUInt( originZ );
|
||||
this->writeUChar( bUseShift );
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int L2Game_Action::read_objectID()
|
||||
{
|
||||
if( !(this->canReadBytes(5)) ) return 0;
|
||||
this->readReset();
|
||||
this->readUChar(); // pcode
|
||||
return this->readUInt();
|
||||
}
|
||||
|
||||
int L2Game_Action::read_originX() { return this->readInt(); }
|
||||
int L2Game_Action::read_originY() { return this->readInt(); }
|
||||
int L2Game_Action::read_originZ() { return this->readInt(); }
|
||||
char L2Game_Action::read_useShift() { return this->readChar(); }
|
24
l2packets/game/client/L2Game_Action.h
Normal file
24
l2packets/game/client/L2Game_Action.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef L2GAME_ACTION_H_
|
||||
#define L2GAME_ACTION_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_Action : public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_Action();
|
||||
L2Game_Action( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( unsigned int objectID,
|
||||
unsigned int originX,
|
||||
unsigned int originY,
|
||||
unsigned int originZ,
|
||||
unsigned char bUseShift );
|
||||
unsigned int read_objectID();
|
||||
int read_originX();
|
||||
int read_originY();
|
||||
int read_originZ();
|
||||
char read_useShift();
|
||||
};
|
||||
|
||||
#endif /*L2GAME_CHARACTERSELECT_H_*/
|
96
l2packets/game/client/L2Game_AuthLogin.cpp
Normal file
96
l2packets/game/client/L2Game_AuthLogin.cpp
Normal file
@@ -0,0 +1,96 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_AuthLogin.h"
|
||||
|
||||
/* interlude pcode is 08
|
||||
hellbound pcode is 2b
|
||||
L2J:
|
||||
protected void readImpl()
|
||||
{
|
||||
_loginName = readS().toLowerCase();
|
||||
_playKey2 = readD();
|
||||
_playKey1 = readD();
|
||||
_loginKey1 = readD();
|
||||
_loginKey2 = readD();
|
||||
}
|
||||
*/
|
||||
|
||||
L2Game_AuthLogin::L2Game_AuthLogin()
|
||||
{
|
||||
this->_initNull();
|
||||
}
|
||||
|
||||
L2Game_AuthLogin::L2Game_AuthLogin( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
this->_initNull();
|
||||
this->setBytes( bytes, length );
|
||||
}
|
||||
|
||||
// session keys must point to 8-byte arrays
|
||||
bool L2Game_AuthLogin::create( char *loginName,
|
||||
unsigned char *sessionKey1,
|
||||
unsigned char *sessionKey2 )
|
||||
{
|
||||
if( !loginName || !sessionKey1 || !sessionKey2 ) return false;
|
||||
wchar_t loginU[32];
|
||||
memset( loginU, 0, sizeof(loginU) );
|
||||
#ifdef L2PACKETS_WINDOWS
|
||||
_snwprintf( loginU, 32, L"%S", loginName );
|
||||
#endif
|
||||
#ifdef L2PACKETS_LINUX
|
||||
swprintf( loginU, 32, L"%ls", loginName );
|
||||
#endif
|
||||
loginU[31] = 0;
|
||||
return this->create( loginU, sessionKey1, sessionKey2 );
|
||||
}
|
||||
|
||||
bool L2Game_AuthLogin::create( wchar_t *loginName,
|
||||
unsigned char *sessionKey1,
|
||||
unsigned char *sessionKey2 )
|
||||
{
|
||||
if( !loginName || !sessionKey1 || !sessionKey2 ) return false;
|
||||
this->writeReset();
|
||||
// write packet code
|
||||
//this->writeUChar( 0x08 ); // interlude
|
||||
this->writeUChar( 0x2b ); // hellbound
|
||||
this->writeUnicodeString( loginName );
|
||||
this->writeBytes( sessionKey2+4, 4 );
|
||||
this->writeBytes( sessionKey2, 4 );
|
||||
this->writeBytes( sessionKey1, 8 );
|
||||
this->writeUInt( 1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_AuthLogin::read_login( wchar_t *loginOut )
|
||||
{
|
||||
if( !loginOut ) return false;
|
||||
this->readReset();
|
||||
this->readUChar();
|
||||
loginOut[0] = 0;
|
||||
wchar_t *login = this->readUnicodeString();
|
||||
if( !login ) return false;
|
||||
wcscpy( loginOut, login );
|
||||
free( login );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_AuthLogin::read_login( char *loginOut )
|
||||
{
|
||||
if( !loginOut ) return false;
|
||||
loginOut[0] = 0;
|
||||
wchar_t loginU[32] = {0};
|
||||
if( this->read_login(loginU) )
|
||||
{
|
||||
if( loginU[0] == 0 ) return true;
|
||||
#ifdef L2PACKETS_WINDOWS
|
||||
sprintf( loginOut, "%S", loginU );
|
||||
#else
|
||||
#ifdef L2PACKETS_LINUX
|
||||
sprintf( loginOut, "%ls", loginU );
|
||||
#else
|
||||
#error Unknown OS? O_o
|
||||
#endif
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
27
l2packets/game/client/L2Game_AuthLogin.h
Normal file
27
l2packets/game/client/L2Game_AuthLogin.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef L2GAME_AUTHLOGIN_H_
|
||||
#define L2GAME_AUTHLOGIN_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_AuthLogin : public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_AuthLogin();
|
||||
L2Game_AuthLogin( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
// session keys must point to 8-byte arrays
|
||||
bool create( char *loginName,
|
||||
unsigned char *sessionKey1,
|
||||
unsigned char *sessionKey2 );
|
||||
// unicode version of upper function
|
||||
// session keys must point to 8-byte arrays
|
||||
bool create( wchar_t *loginName,
|
||||
unsigned char *sessionKey1,
|
||||
unsigned char *sessionKey2 );
|
||||
public:
|
||||
bool read_login( char *loginOut );
|
||||
bool read_login( wchar_t *loginOut );
|
||||
//bool read_session_keys( unsigned char *skey1, unsigned char *skey2 );
|
||||
};
|
||||
|
||||
#endif /*L2GAME_AUTHLOGIN_H_*/
|
53
l2packets/game/client/L2Game_CharacterCreate.cpp
Normal file
53
l2packets/game/client/L2Game_CharacterCreate.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_CharacterCreate.h"
|
||||
|
||||
/*
|
||||
Client: Len 63 [CharacterCreate]
|
||||
3F 00
|
||||
0C // opcode
|
||||
41 00 65 00 72 00 69 00 6E 00 00 00 // name
|
||||
01 00 00 00 // race
|
||||
01 00 00 00 // sex
|
||||
19 00 00 00 // class id
|
||||
1C 00 00 00 // INT
|
||||
27 00 00 00 // STR
|
||||
1E 00 00 00 // CON
|
||||
1B 00 00 00 // MEN
|
||||
23 00 00 00 // DEX
|
||||
0B 00 00 00 // WIT
|
||||
00 00 00 00 // hair style
|
||||
00 00 00 00 // hair color
|
||||
00 00 00 00 // face
|
||||
*/
|
||||
|
||||
L2Game_CharacterCreate::L2Game_CharacterCreate()
|
||||
{
|
||||
_initNull();
|
||||
}
|
||||
|
||||
L2Game_CharacterCreate::L2Game_CharacterCreate( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
_initNull();
|
||||
setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_CharacterCreate::create( const L2Game_NewCharacterTemplate *tmpl, const wchar_t *name,
|
||||
int hairStyle, int hairColor, int face, int gender )
|
||||
{
|
||||
if( !tmpl ) return false;
|
||||
setPacketType( 0x0C ); // CharacterCreate
|
||||
writeS( name );
|
||||
writeD( tmpl->race );
|
||||
writeD( gender );
|
||||
writeD( tmpl->classID );
|
||||
writeD( tmpl->base_INT );
|
||||
writeD( tmpl->base_STR );
|
||||
writeD( tmpl->base_CON );
|
||||
writeD( tmpl->base_MEN );
|
||||
writeD( tmpl->base_DEX );
|
||||
writeD( tmpl->base_WIT );
|
||||
writeD( hairStyle );
|
||||
writeD( hairColor );
|
||||
writeD( face );
|
||||
return true;
|
||||
}
|
17
l2packets/game/client/L2Game_CharacterCreate.h
Normal file
17
l2packets/game/client/L2Game_CharacterCreate.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef H_L2GAME_CHARACTERCREATE
|
||||
#define H_L2GAME_CHARACTERCREATE
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
#include "../server/L2Game_NewCharacterSuccess.h"
|
||||
|
||||
class L2Game_CharacterCreate: public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_CharacterCreate();
|
||||
L2Game_CharacterCreate( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( const L2Game_NewCharacterTemplate *tmpl, const wchar_t *name,
|
||||
int hairStyle, int hairColor, int face, int gender );
|
||||
};
|
||||
|
||||
#endif
|
29
l2packets/game/client/L2Game_CharacterDelete.cpp
Normal file
29
l2packets/game/client/L2Game_CharacterDelete.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_CharacterDelete.h"
|
||||
|
||||
L2Game_CharacterDelete::L2Game_CharacterDelete()
|
||||
{
|
||||
_initNull();
|
||||
}
|
||||
|
||||
L2Game_CharacterDelete::L2Game_CharacterDelete( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
_initNull();
|
||||
setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_CharacterDelete::create( L2_VERSION ver )
|
||||
{
|
||||
ver = L2_VERSION_T1;
|
||||
setPacketType( 0x0D ); // CharacterDelete
|
||||
writeD( p_charSlot );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_CharacterDelete::parse( L2_VERSION ver )
|
||||
{
|
||||
ver = L2_VERSION_T1;
|
||||
if( getPacketType() != 0x0D ) return false;
|
||||
p_charSlot = readD();
|
||||
return true;
|
||||
}
|
18
l2packets/game/client/L2Game_CharacterDelete.h
Normal file
18
l2packets/game/client/L2Game_CharacterDelete.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef H_L2GAME_CHARACTERDELETE
|
||||
#define H_L2GAME_CHARACTERDELETE
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_CharacterDelete: public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_CharacterDelete();
|
||||
L2Game_CharacterDelete( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( L2_VERSION ver = L2_VERSION_T1 );
|
||||
bool parse( L2_VERSION ver = L2_VERSION_T1 );
|
||||
public:
|
||||
int p_charSlot;
|
||||
};
|
||||
|
||||
#endif
|
30
l2packets/game/client/L2Game_CharacterRestore.cpp
Normal file
30
l2packets/game/client/L2Game_CharacterRestore.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_CharacterRestore.h"
|
||||
|
||||
L2Game_CharacterRestore::L2Game_CharacterRestore()
|
||||
{
|
||||
_initNull();
|
||||
}
|
||||
|
||||
L2Game_CharacterRestore::L2Game_CharacterRestore( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
_initNull();
|
||||
setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_CharacterRestore::create( L2_VERSION ver )
|
||||
{
|
||||
ver = L2_VERSION_T1;
|
||||
setPacketType( 0x7B ); // CharacterDelete
|
||||
writeD( p_charSlot );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_CharacterRestore::parse( L2_VERSION ver )
|
||||
{
|
||||
ver = L2_VERSION_T1;
|
||||
if( getPacketType() != 0x7B ) return false;
|
||||
p_charSlot = readD();
|
||||
return true;
|
||||
}
|
||||
|
18
l2packets/game/client/L2Game_CharacterRestore.h
Normal file
18
l2packets/game/client/L2Game_CharacterRestore.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef H_L2GAME_CHARACTERRESTORE
|
||||
#define H_L2GAME_CHARACTERRESTORE
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_CharacterRestore: public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_CharacterRestore();
|
||||
L2Game_CharacterRestore( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( L2_VERSION ver = L2_VERSION_T1 );
|
||||
bool parse( L2_VERSION ver = L2_VERSION_T1 );
|
||||
public:
|
||||
int p_charSlot;
|
||||
};
|
||||
|
||||
#endif
|
46
l2packets/game/client/L2Game_CharacterSelect.cpp
Normal file
46
l2packets/game/client/L2Game_CharacterSelect.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_CharacterSelect.h"
|
||||
|
||||
/* L2J:
|
||||
protected void readImpl()
|
||||
{
|
||||
_charSlot = readD();
|
||||
_unk1 = readH();
|
||||
_unk2 = readD();
|
||||
_unk3 = readD();
|
||||
_unk4 = readD();
|
||||
}
|
||||
*/
|
||||
|
||||
L2Game_CharacterSelect::L2Game_CharacterSelect()
|
||||
{
|
||||
this->_initNull();
|
||||
}
|
||||
|
||||
L2Game_CharacterSelect::L2Game_CharacterSelect( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
this->_initNull();
|
||||
this->setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_CharacterSelect::create( unsigned int charSlot )
|
||||
{
|
||||
this->writeReset();
|
||||
this->writeUChar( 0x12 ); // packet type
|
||||
this->writeUInt( charSlot );
|
||||
this->writeUShort( 0x0000 );
|
||||
this->writeUInt( 0x00000000 );
|
||||
this->writeUInt( 0x00000000 );
|
||||
this->writeUInt( 0x00000000 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_CharacterSelect::read_charSlot( unsigned int *charSlot )
|
||||
{
|
||||
if( !charSlot || !(this->canReadBytes(5)) ) return false;
|
||||
(*charSlot) = 0;
|
||||
this->readReset();
|
||||
this->readUChar(); // pcode
|
||||
(*charSlot) = this->readUInt();
|
||||
return true;
|
||||
}
|
16
l2packets/game/client/L2Game_CharacterSelect.h
Normal file
16
l2packets/game/client/L2Game_CharacterSelect.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef L2GAME_CHARACTERSELECT_H_
|
||||
#define L2GAME_CHARACTERSELECT_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_CharacterSelect : public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_CharacterSelect();
|
||||
L2Game_CharacterSelect( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( unsigned int charSlot );
|
||||
bool read_charSlot( unsigned int *charSlot );
|
||||
};
|
||||
|
||||
#endif /*L2GAME_CHARACTERSELECT_H_*/
|
54
l2packets/game/client/L2Game_EnterWorld.cpp
Normal file
54
l2packets/game/client/L2Game_EnterWorld.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_EnterWorld.h"
|
||||
|
||||
/*
|
||||
Client: Len 107
|
||||
6B 00
|
||||
11
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
C9 BC F2 A7 66 5A 0B 98 36 A5 BD 89 ED 7F E4 D7
|
||||
6B 49 E2 9F EF 76 EB CE A3 FA F4 BF 0C 64 A3 B4
|
||||
A4 CE DC C6 08 3E 6E EA 45 CA D3 FE 88 13 87 B8
|
||||
06 2C 96 F0 9B 1E 8E BC C6 9B 98 C8 63 16 CF D0
|
||||
29 00 00 00 0A E1 74 17 0A 08 00 08 5C 32 BD E1
|
||||
5C 32 BE 22 5E 19 03 41
|
||||
|
||||
last 2 D's are different, depend on char
|
||||
|
||||
unsigned char array = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xC9, 0xBC, 0xF2, 0xA7, 0x66, 0x5A, 0x0B, 0x98, 0x36, 0xA5, 0xBD, 0x89, 0xED, 0x7F, 0xE4, 0xD7,
|
||||
0x6B, 0x49, 0xE2, 0x9F, 0xEF, 0x76, 0xEB, 0xCE, 0xA3, 0xFA, 0xF4, 0xBF, 0x0C, 0x64, 0xA3, 0xB4,
|
||||
0xA4, 0xCE, 0xDC, 0xC6, 0x08, 0x3E, 0x6E, 0xEA, 0x45, 0xCA, 0xD3, 0xFE, 0x88, 0x13, 0x87, 0xB8,
|
||||
0x06, 0x2C, 0x96, 0xF0, 0x9B, 0x1E, 0x8E, 0xBC, 0xC6, 0x9B, 0x98, 0xC8, 0x63, 0x16, 0xCF, 0xD0,
|
||||
0x29, 0x00, 0x00, 0x00, 0x0A, 0xE1, 0x74, 0x17, 0x0A, 0x08, 0x00, 0x08, 0x5C, 0x32, 0xBD, 0xE1,
|
||||
0x5C, 0x32, 0xBE, 0x22, 0x5E, 0x19, 0x03, 0x41, };
|
||||
*/
|
||||
|
||||
L2Game_EnterWorld::L2Game_EnterWorld()
|
||||
{
|
||||
_initNull();
|
||||
}
|
||||
|
||||
L2Game_EnterWorld::L2Game_EnterWorld( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
_initNull();
|
||||
setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_EnterWorld::create( L2_VERSION ver /*= L2_VERSION_T1*/ )
|
||||
{
|
||||
UNREFERENCED_PARAMETER(ver);
|
||||
unsigned char ew_array[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xC9, 0xBC, 0xF2, 0xA7, 0x66, 0x5A, 0x0B, 0x98, 0x36, 0xA5, 0xBD, 0x89, 0xED, 0x7F, 0xE4, 0xD7,
|
||||
0x6B, 0x49, 0xE2, 0x9F, 0xEF, 0x76, 0xEB, 0xCE, 0xA3, 0xFA, 0xF4, 0xBF, 0x0C, 0x64, 0xA3, 0xB4,
|
||||
0xA4, 0xCE, 0xDC, 0xC6, 0x08, 0x3E, 0x6E, 0xEA, 0x45, 0xCA, 0xD3, 0xFE, 0x88, 0x13, 0x87, 0xB8,
|
||||
0x06, 0x2C, 0x96, 0xF0, 0x9B, 0x1E, 0x8E, 0xBC, 0xC6, 0x9B, 0x98, 0xC8, 0x63, 0x16, 0xCF, 0xD0,
|
||||
0x29, 0x00, 0x00, 0x00, 0x0A, 0xE1, 0x74, 0x17, 0x0A, 0x08, 0x00, 0x08, 0x5C, 0x32, 0xBD, 0xE1,
|
||||
0x5C, 0x32, 0xBE, 0x22, 0x5E, 0x19, 0x03, 0x41 };
|
||||
this->writeReset();
|
||||
this->writeUChar( 0x11 ); // EnterWorld
|
||||
this->writeBytes( ew_array, sizeof(ew_array) );
|
||||
return true;
|
||||
}
|
16
l2packets/game/client/L2Game_EnterWorld.h
Normal file
16
l2packets/game/client/L2Game_EnterWorld.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef L2GAME_ENTERWORLD_H_
|
||||
#define L2GAME_ENTERWORLD_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_EnterWorld : public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_EnterWorld();
|
||||
L2Game_EnterWorld( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
virtual bool create( L2_VERSION ver = L2_VERSION_T1 );
|
||||
//void read() {} // L2J Server ignores its contents, parsing is unknown :)
|
||||
};
|
||||
|
||||
#endif
|
33
l2packets/game/client/L2Game_NewCharacter.cpp
Normal file
33
l2packets/game/client/L2Game_NewCharacter.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_NewCharacter.h"
|
||||
|
||||
/**
|
||||
Client: Len 3 [NewCharacter]
|
||||
03 00
|
||||
13 // opcode
|
||||
*/
|
||||
|
||||
L2Game_NewCharacter::L2Game_NewCharacter()
|
||||
{
|
||||
_initNull();
|
||||
}
|
||||
|
||||
L2Game_NewCharacter::L2Game_NewCharacter( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
_initNull();
|
||||
setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_NewCharacter::create( L2_VERSION ver )
|
||||
{
|
||||
ver = L2_VERSION_T1;
|
||||
setPacketType( 0x13 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_NewCharacter::parse( L2_VERSION ver )
|
||||
{
|
||||
ver = L2_VERSION_T1;
|
||||
// just trugger
|
||||
return true;
|
||||
}
|
16
l2packets/game/client/L2Game_NewCharacter.h
Normal file
16
l2packets/game/client/L2Game_NewCharacter.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef H_L2GAME_NEWCHARACTER
|
||||
#define H_L2GAME_NEWCHARACTER
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_NewCharacter: public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_NewCharacter();
|
||||
L2Game_NewCharacter( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( L2_VERSION ver = L2_VERSION_T1 );
|
||||
bool parse( L2_VERSION ver = L2_VERSION_T1 );
|
||||
};
|
||||
|
||||
#endif
|
274
l2packets/game/client/L2Game_ProtocolVersion.cpp
Normal file
274
l2packets/game/client/L2Game_ProtocolVersion.cpp
Normal file
@@ -0,0 +1,274 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_ProtocolVersion.h"
|
||||
|
||||
/* L2J:
|
||||
// "[C] 00 ProtocolVersion";
|
||||
* pcode 0c00 is in interlude
|
||||
* pcode 0x0e is in hellbound
|
||||
protected void readImpl()
|
||||
{
|
||||
_version = readD();
|
||||
}
|
||||
*/
|
||||
|
||||
L2Game_ProtocolVersion::L2Game_ProtocolVersion()
|
||||
{
|
||||
this->_initNull();
|
||||
}
|
||||
|
||||
L2Game_ProtocolVersion::L2Game_ProtocolVersion( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
this->_initNull();
|
||||
this->setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_ProtocolVersion::create( L2_VERSION ver )
|
||||
{
|
||||
switch( ver )
|
||||
{
|
||||
case L2_VERSION_T1: this->createDefaultKamael(); break;
|
||||
case L2_VERSION_T15: this->createDefaultHellbound(); break;
|
||||
case L2_VERSION_T2: this->createDefaultGracia1(); break;
|
||||
case L2_VERSION_T22: this->createDefaultGracia2(); break;
|
||||
case L2_VERSION_T23: this->createDefaultGracia3(); break;
|
||||
case L2_VERSION_T24: this->createDefaultGracia4(); break;
|
||||
default: return false; break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Kamael
|
||||
C->S
|
||||
0B 01 // len
|
||||
0E // p.code ProtocolVersion
|
||||
3C 03 00 00 // protocol - 828
|
||||
09 07 54 56 03 09 0B 01 07 02 54 54 56 07 00 02
|
||||
55 56 00 51 00 53 57 04 07 55 08 54 01 07 01 53
|
||||
00 56 55 56 01 06 05 04 51 03 08 51 08 51 56 04
|
||||
54 06 55 08 02 09 51 56 01 53 06 55 04 53 00 56
|
||||
56 53 01 09 02 09 01 51 54 51 09 55 56 09 03 04
|
||||
07 05 55 04 06 55 04 06 09 04 51 01 08 08 06 05
|
||||
52 06 04 01 07 54 03 06 52 55 06 55 55 51 01 02
|
||||
04 54 03 55 54 01 57 51 55 05 52 05 54 07 51 51
|
||||
55 07 02 53 53 00 52 05 52 07 01 54 00 03 05 05
|
||||
08 06 05 05 06 03 00 0D 08 01 07 09 03 51 03 07
|
||||
53 09 51 06 07 54 0A 50 56 02 52 04 05 55 51 02
|
||||
53 00 08 54 04 52 56 06 02 09 00 08 03 53 56 01
|
||||
05 00 55 06 08 56 04 0D 06 07 52 06 07 04 0A 06
|
||||
01 04 54 04 00 05 02 04 54 00 09 52 53 05 04 01
|
||||
04 05 05 01 52 51 52 0D 06 51 08 09 54 53 00 0D
|
||||
01 02 03 54 53 01 05 03 08 56 54 07 02 54 0B 06
|
||||
8D 71 5F 08
|
||||
*/
|
||||
|
||||
bool L2Game_ProtocolVersion::createDefaultKamael( unsigned int gameProtoVer /*= 828*/ )
|
||||
{
|
||||
this->writeReset();
|
||||
// packet code 0x00 was in Interlude!!!!
|
||||
// this->writeUChar( 0x00 ); // packet type - ProtocolVersion
|
||||
// in Hellbound this code is 0x0e
|
||||
this->writeUChar( 0x0e ); // packet type - ProtocolVersion
|
||||
this->writeUInt( gameProtoVer );
|
||||
unsigned char pv_array[] = {
|
||||
0x09, 0x07, 0x54, 0x56, 0x03, 0x09, 0x0B, 0x01, 0x07, 0x02, 0x54, 0x54, 0x56, 0x07, 0x00, 0x02,
|
||||
0x55, 0x56, 0x00, 0x51, 0x00, 0x53, 0x57, 0x04, 0x07, 0x55, 0x08, 0x54, 0x01, 0x07, 0x01, 0x53,
|
||||
0x00, 0x56, 0x55, 0x56, 0x01, 0x06, 0x05, 0x04, 0x51, 0x03, 0x08, 0x51, 0x08, 0x51, 0x56, 0x04,
|
||||
0x54, 0x06, 0x55, 0x08, 0x02, 0x09, 0x51, 0x56, 0x01, 0x53, 0x06, 0x55, 0x04, 0x53, 0x00, 0x56,
|
||||
0x56, 0x53, 0x01, 0x09, 0x02, 0x09, 0x01, 0x51, 0x54, 0x51, 0x09, 0x55, 0x56, 0x09, 0x03, 0x04,
|
||||
0x07, 0x05, 0x55, 0x04, 0x06, 0x55, 0x04, 0x06, 0x09, 0x04, 0x51, 0x01, 0x08, 0x08, 0x06, 0x05,
|
||||
0x52, 0x06, 0x04, 0x01, 0x07, 0x54, 0x03, 0x06, 0x52, 0x55, 0x06, 0x55, 0x55, 0x51, 0x01, 0x02,
|
||||
0x04, 0x54, 0x03, 0x55, 0x54, 0x01, 0x57, 0x51, 0x55, 0x05, 0x52, 0x05, 0x54, 0x07, 0x51, 0x51,
|
||||
0x55, 0x07, 0x02, 0x53, 0x53, 0x00, 0x52, 0x05, 0x52, 0x07, 0x01, 0x54, 0x00, 0x03, 0x05, 0x05,
|
||||
0x08, 0x06, 0x05, 0x05, 0x06, 0x03, 0x00, 0x0D, 0x08, 0x01, 0x07, 0x09, 0x03, 0x51, 0x03, 0x07,
|
||||
0x53, 0x09, 0x51, 0x06, 0x07, 0x54, 0x0A, 0x50, 0x56, 0x02, 0x52, 0x04, 0x05, 0x55, 0x51, 0x02,
|
||||
0x53, 0x00, 0x08, 0x54, 0x04, 0x52, 0x56, 0x06, 0x02, 0x09, 0x00, 0x08, 0x03, 0x53, 0x56, 0x01,
|
||||
0x05, 0x00, 0x55, 0x06, 0x08, 0x56, 0x04, 0x0D, 0x06, 0x07, 0x52, 0x06, 0x07, 0x04, 0x0A, 0x06,
|
||||
0x01, 0x04, 0x54, 0x04, 0x00, 0x05, 0x02, 0x04, 0x54, 0x00, 0x09, 0x52, 0x53, 0x05, 0x04, 0x01,
|
||||
0x04, 0x05, 0x05, 0x01, 0x52, 0x51, 0x52, 0x0D, 0x06, 0x51, 0x08, 0x09, 0x54, 0x53, 0x00, 0x0D,
|
||||
0x01, 0x02, 0x03, 0x54, 0x53, 0x01, 0x05, 0x03, 0x08, 0x56, 0x54, 0x07, 0x02, 0x54, 0x0B, 0x06,
|
||||
0x8D, 0x71, 0x5F, 0x08 };
|
||||
writeBytes( pv_array, sizeof(pv_array) );
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Hellbound
|
||||
C->S Len 267
|
||||
0B 01 // len
|
||||
0E // p. code
|
||||
3F 03 00 00 // protocol - 831 (Hellbound?)
|
||||
09 07 54 56 03 09 0B 01 07 02 54 54 56 07 00 02
|
||||
55 56 00 51 00 53 57 04 07 55 08 54 01 07 01 53
|
||||
00 56 55 56 01 06 05 04 51 03 08 51 08 51 56 04
|
||||
54 06 55 08 02 09 51 56 01 53 06 55 04 53 00 56
|
||||
56 53 01 09 02 09 01 51 54 51 09 55 56 09 03 04
|
||||
07 05 55 04 06 55 04 06 09 04 51 01 08 08 06 05
|
||||
52 06 04 01 07 54 03 06 52 55 06 55 55 51 01 02
|
||||
04 54 03 55 54 01 57 51 55 05 52 05 54 07 51 51
|
||||
55 07 02 53 53 00 52 05 52 07 01 54 00 03 05 05
|
||||
08 06 05 05 06 03 00 0D 08 01 07 09 03 51 03 07
|
||||
53 09 51 06 07 54 0A 50 56 02 52 04 05 55 51 02
|
||||
53 00 08 54 04 52 56 06 02 09 00 08 03 53 56 01
|
||||
05 00 55 06 08 56 04 0D 06 07 52 06 07 04 0A 06
|
||||
01 04 54 04 00 05 02 04 54 00 09 52 53 05 04 01
|
||||
04 05 05 01 52 51 52 0D 06 51 08 09 54 53 00 0D
|
||||
01 02 03 54 53 01 05 03 08 56 54 07 02 54 0B 06
|
||||
FB 87 B9 4A
|
||||
*/
|
||||
|
||||
bool L2Game_ProtocolVersion::createDefaultHellbound( unsigned int gameProtoVer /*= 851*/ )
|
||||
{
|
||||
this->writeReset();
|
||||
// packet code 0x00 was in Interlude!!!!
|
||||
// this->writeUChar( 0x00 ); // packet type - ProtocolVersion
|
||||
// in Hellbound this code is 0x0e
|
||||
this->writeUChar( 0x0e ); // packet type - ProtocolVersion
|
||||
this->writeUInt( gameProtoVer );
|
||||
unsigned char pv_array[] = {
|
||||
0x09, 0x07, 0x54, 0x56, 0x03, 0x09, 0x0B, 0x01, 0x07, 0x02, 0x54, 0x54, 0x56, 0x07, 0x00, 0x02,
|
||||
0x55, 0x56, 0x00, 0x51, 0x00, 0x53, 0x57, 0x04, 0x07, 0x55, 0x08, 0x54, 0x01, 0x07, 0x01, 0x53,
|
||||
0x00, 0x56, 0x55, 0x56, 0x01, 0x06, 0x05, 0x04, 0x51, 0x03, 0x08, 0x51, 0x08, 0x51, 0x56, 0x04,
|
||||
0x54, 0x06, 0x55, 0x08, 0x02, 0x09, 0x51, 0x56, 0x01, 0x53, 0x06, 0x55, 0x04, 0x53, 0x00, 0x56,
|
||||
0x56, 0x53, 0x01, 0x09, 0x02, 0x09, 0x01, 0x51, 0x54, 0x51, 0x09, 0x55, 0x56, 0x09, 0x03, 0x04,
|
||||
0x07, 0x05, 0x55, 0x04, 0x06, 0x55, 0x04, 0x06, 0x09, 0x04, 0x51, 0x01, 0x08, 0x08, 0x06, 0x05,
|
||||
0x52, 0x06, 0x04, 0x01, 0x07, 0x54, 0x03, 0x06, 0x52, 0x55, 0x06, 0x55, 0x55, 0x51, 0x01, 0x02,
|
||||
0x04, 0x54, 0x03, 0x55, 0x54, 0x01, 0x57, 0x51, 0x55, 0x05, 0x52, 0x05, 0x54, 0x07, 0x51, 0x51,
|
||||
0x55, 0x07, 0x02, 0x53, 0x53, 0x00, 0x52, 0x05, 0x52, 0x07, 0x01, 0x54, 0x00, 0x03, 0x05, 0x05,
|
||||
0x08, 0x06, 0x05, 0x05, 0x06, 0x03, 0x00, 0x0D, 0x08, 0x01, 0x07, 0x09, 0x03, 0x51, 0x03, 0x07,
|
||||
0x53, 0x09, 0x51, 0x06, 0x07, 0x54, 0x0A, 0x50, 0x56, 0x02, 0x52, 0x04, 0x05, 0x55, 0x51, 0x02,
|
||||
0x53, 0x00, 0x08, 0x54, 0x04, 0x52, 0x56, 0x06, 0x02, 0x09, 0x00, 0x08, 0x03, 0x53, 0x56, 0x01,
|
||||
0x05, 0x00, 0x55, 0x06, 0x08, 0x56, 0x04, 0x0D, 0x06, 0x07, 0x52, 0x06, 0x07, 0x04, 0x0A, 0x06,
|
||||
0x01, 0x04, 0x54, 0x04, 0x00, 0x05, 0x02, 0x04, 0x54, 0x00, 0x09, 0x52, 0x53, 0x05, 0x04, 0x01,
|
||||
0x04, 0x05, 0x05, 0x01, 0x52, 0x51, 0x52, 0x0D, 0x06, 0x51, 0x08, 0x09, 0x54, 0x53, 0x00, 0x0D,
|
||||
0x01, 0x02, 0x03, 0x54, 0x53, 0x01, 0x05, 0x03, 0x08, 0x56, 0x54, 0x07, 0x02, 0x54, 0x0B, 0x06,
|
||||
0xFB, 0x87, 0xB9, 0x4A };
|
||||
writeBytes( pv_array, sizeof(pv_array) );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_ProtocolVersion::createDefaultGracia1( unsigned int gameProtoVer /*= 12*/ )
|
||||
{
|
||||
this->writeReset();
|
||||
// packet code 0x00 was in Interlude!!!!
|
||||
// this->writeUChar( 0x00 ); // packet type - ProtocolVersion
|
||||
// in Hellbound this code is 0x0e
|
||||
this->writeUChar( 0x0e ); // packet type - ProtocolVersion
|
||||
this->writeUInt( gameProtoVer );
|
||||
unsigned char pv_array[] = {
|
||||
0x09, 0x07, 0x54, 0x56, 0x03, 0x09, 0x0b, 0x01, 0x07, 0x02, 0x54, 0x54, 0x56, 0x07, 0x00, 0x02,
|
||||
0x55, 0x56, 0x00, 0x51, 0x00, 0x53, 0x57, 0x04, 0x07, 0x55, 0x08, 0x54, 0x01, 0x07, 0x01, 0x53,
|
||||
0x00, 0x56, 0x55, 0x56, 0x01, 0x06, 0x05, 0x04, 0x51, 0x03, 0x08, 0x51, 0x08, 0x51, 0x56, 0x04,
|
||||
0x54, 0x06, 0x55, 0x08, 0x02, 0x09, 0x51, 0x56, 0x01, 0x53, 0x06, 0x55, 0x04, 0x53, 0x00, 0x56,
|
||||
0x56, 0x53, 0x01, 0x09, 0x02, 0x09, 0x01, 0x51, 0x54, 0x51, 0x09, 0x55, 0x56, 0x09, 0x03, 0x04,
|
||||
0x07, 0x05, 0x55, 0x04, 0x06, 0x55, 0x04, 0x06, 0x09, 0x04, 0x51, 0x01, 0x08, 0x08, 0x06, 0x05,
|
||||
0x52, 0x06, 0x04, 0x01, 0x07, 0x54, 0x03, 0x06, 0x52, 0x55, 0x06, 0x55, 0x55, 0x51, 0x01, 0x02,
|
||||
0x04, 0x54, 0x03, 0x55, 0x54, 0x01, 0x57, 0x51, 0x55, 0x05, 0x52, 0x05, 0x54, 0x07, 0x51, 0x51,
|
||||
0x55, 0x07, 0x02, 0x53, 0x53, 0x00, 0x52, 0x05, 0x52, 0x07, 0x01, 0x54, 0x00, 0x03, 0x05, 0x05,
|
||||
0x08, 0x06, 0x05, 0x05, 0x06, 0x03, 0x00, 0x0d, 0x08, 0x01, 0x07, 0x09, 0x03, 0x51, 0x03, 0x07,
|
||||
0x53, 0x09, 0x51, 0x06, 0x07, 0x54, 0x0a, 0x50, 0x56, 0x02, 0x52, 0x04, 0x05, 0x55, 0x51, 0x02,
|
||||
0x53, 0x00, 0x08, 0x54, 0x04, 0x52, 0x56, 0x06, 0x02, 0x09, 0x00, 0x08, 0x03, 0x53, 0x56, 0x01,
|
||||
0x05, 0x00, 0x55, 0x06, 0x08, 0x56, 0x04, 0x0d, 0x06, 0x07, 0x52, 0x06, 0x07, 0x04, 0x0a, 0x06,
|
||||
0x01, 0x04, 0x54, 0x04, 0x00, 0x05, 0x02, 0x04, 0x54, 0x00, 0x09, 0x52, 0x53, 0x05, 0x04, 0x01,
|
||||
0x04, 0x05, 0x05, 0x01, 0x52, 0x51, 0x52, 0x0d, 0x06, 0x51, 0x08, 0x09, 0x54, 0x53, 0x00, 0x0d,
|
||||
0x01, 0x02, 0x03, 0x54, 0x53, 0x01, 0x05, 0x03, 0x08, 0x56, 0x54, 0x07, 0x02, 0x54, 0x0b, 0x06,
|
||||
0xdf, 0xb8, 0x3b, 0x54 };
|
||||
writeBytes( pv_array, sizeof(pv_array) );
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: validate
|
||||
bool L2Game_ProtocolVersion::createDefaultGracia2( unsigned int gameProtoVer /*= 17*/ )
|
||||
{
|
||||
this->writeReset();
|
||||
// packet code 0x00 was in Interlude!!!!
|
||||
// this->writeUChar( 0x00 ); // packet type - ProtocolVersion
|
||||
// in Hellbound this code is 0x0e
|
||||
this->writeUChar( 0x0e ); // packet type - ProtocolVersion
|
||||
this->writeUInt( gameProtoVer );
|
||||
unsigned char pv_array[] = {
|
||||
0x09, 0x07, 0x54, 0x56, 0x03, 0x09, 0x0B, 0x01, 0x07, 0x02, 0x54, 0x54, 0x56, 0x07, 0x00, 0x02,
|
||||
0x55, 0x56, 0x00, 0x51, 0x00, 0x53, 0x57, 0x04, 0x07, 0x55, 0x08, 0x54, 0x01, 0x07, 0x01, 0x53,
|
||||
0x00, 0x56, 0x55, 0x56, 0x01, 0x06, 0x05, 0x04, 0x51, 0x03, 0x08, 0x51, 0x08, 0x51, 0x56, 0x04,
|
||||
0x54, 0x06, 0x55, 0x08, 0x02, 0x09, 0x51, 0x56, 0x01, 0x53, 0x06, 0x55, 0x04, 0x53, 0x00, 0x56,
|
||||
0x56, 0x53, 0x01, 0x09, 0x02, 0x09, 0x01, 0x51, 0x54, 0x51, 0x09, 0x55, 0x56, 0x09, 0x03, 0x04,
|
||||
0x07, 0x05, 0x55, 0x04, 0x06, 0x55, 0x04, 0x06, 0x09, 0x04, 0x51, 0x01, 0x08, 0x08, 0x06, 0x05,
|
||||
0x52, 0x06, 0x04, 0x01, 0x07, 0x54, 0x03, 0x06, 0x52, 0x55, 0x06, 0x55, 0x55, 0x51, 0x01, 0x02,
|
||||
0x04, 0x54, 0x03, 0x55, 0x54, 0x01, 0x57, 0x51, 0x55, 0x05, 0x52, 0x05, 0x54, 0x07, 0x51, 0x51,
|
||||
0x55, 0x07, 0x02, 0x53, 0x53, 0x00, 0x52, 0x05, 0x52, 0x07, 0x01, 0x54, 0x00, 0x03, 0x05, 0x05,
|
||||
0x08, 0x06, 0x05, 0x05, 0x06, 0x03, 0x00, 0x0D, 0x08, 0x01, 0x07, 0x09, 0x03, 0x51, 0x03, 0x07,
|
||||
0x53, 0x09, 0x51, 0x06, 0x07, 0x54, 0x0A, 0x50, 0x56, 0x02, 0x52, 0x04, 0x05, 0x55, 0x51, 0x02,
|
||||
0x53, 0x00, 0x08, 0x54, 0x04, 0x52, 0x56, 0x06, 0x02, 0x09, 0x00, 0x08, 0x03, 0x53, 0x56, 0x01,
|
||||
0x05, 0x00, 0x55, 0x06, 0x08, 0x56, 0x04, 0x0D, 0x06, 0x07, 0x52, 0x06, 0x07, 0x04, 0x0A, 0x06,
|
||||
0x01, 0x04, 0x54, 0x04, 0x00, 0x05, 0x02, 0x04, 0x54, 0x00, 0x09, 0x52, 0x53, 0x05, 0x04, 0x01,
|
||||
0x04, 0x05, 0x05, 0x01, 0x52, 0x51, 0x52, 0x0D, 0x06, 0x51, 0x08, 0x09, 0x54, 0x53, 0x00, 0x0D,
|
||||
0x01, 0x02, 0x03, 0x54, 0x53, 0x01, 0x05, 0x03, 0x08, 0x56, 0x54, 0x07, 0x02, 0x54, 0x0B, 0x06,
|
||||
0xEB, 0xEF, 0x3D, 0xE6 };
|
||||
writeBytes( pv_array, sizeof(pv_array) );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_ProtocolVersion::createDefaultGracia3( unsigned int gameProtoVer /*= 83*/ )
|
||||
{
|
||||
this->writeReset();
|
||||
// packet code 0x00 was in Interlude!!!!
|
||||
// this->writeUChar( 0x00 ); // packet type - ProtocolVersion
|
||||
// in Hellbound this code is 0x0e
|
||||
this->writeUChar( 0x0e ); // packet type - ProtocolVersion
|
||||
this->writeUInt( gameProtoVer );
|
||||
unsigned char pv_array[] = {
|
||||
0x09, 0x07, 0x54, 0x56, 0x03, 0x09, 0x0B, 0x01, 0x07, 0x02, 0x54, 0x54, 0x56, 0x07, 0x00, 0x02,
|
||||
0x55, 0x56, 0x00, 0x51, 0x00, 0x53, 0x57, 0x04, 0x07, 0x55, 0x08, 0x54, 0x01, 0x07, 0x01, 0x53,
|
||||
0x00, 0x56, 0x55, 0x56, 0x01, 0x06, 0x05, 0x04, 0x51, 0x03, 0x08, 0x51, 0x08, 0x51, 0x56, 0x04,
|
||||
0x54, 0x06, 0x55, 0x08, 0x02, 0x09, 0x51, 0x56, 0x01, 0x53, 0x06, 0x55, 0x04, 0x53, 0x00, 0x56,
|
||||
0x56, 0x53, 0x01, 0x09, 0x02, 0x09, 0x01, 0x51, 0x54, 0x51, 0x09, 0x55, 0x56, 0x09, 0x03, 0x04,
|
||||
0x07, 0x05, 0x55, 0x04, 0x06, 0x55, 0x04, 0x06, 0x09, 0x04, 0x51, 0x01, 0x08, 0x08, 0x06, 0x05,
|
||||
0x52, 0x06, 0x04, 0x01, 0x07, 0x54, 0x03, 0x06, 0x52, 0x55, 0x06, 0x55, 0x55, 0x51, 0x01, 0x02,
|
||||
0x04, 0x54, 0x03, 0x55, 0x54, 0x01, 0x57, 0x51, 0x55, 0x05, 0x52, 0x05, 0x54, 0x07, 0x51, 0x51,
|
||||
0x55, 0x07, 0x02, 0x53, 0x53, 0x00, 0x52, 0x05, 0x52, 0x07, 0x01, 0x54, 0x00, 0x03, 0x05, 0x05,
|
||||
0x08, 0x06, 0x05, 0x05, 0x06, 0x03, 0x00, 0x0D, 0x08, 0x01, 0x07, 0x09, 0x03, 0x51, 0x03, 0x07,
|
||||
0x53, 0x09, 0x51, 0x06, 0x07, 0x54, 0x0A, 0x50, 0x56, 0x02, 0x52, 0x04, 0x05, 0x55, 0x51, 0x02,
|
||||
0x53, 0x00, 0x08, 0x54, 0x04, 0x52, 0x56, 0x06, 0x02, 0x09, 0x00, 0x08, 0x03, 0x53, 0x56, 0x01,
|
||||
0x05, 0x00, 0x55, 0x06, 0x08, 0x56, 0x04, 0x0D, 0x06, 0x07, 0x52, 0x06, 0x07, 0x04, 0x0A, 0x06,
|
||||
0x01, 0x04, 0x54, 0x04, 0x00, 0x05, 0x02, 0x04, 0x54, 0x00, 0x09, 0x52, 0x53, 0x05, 0x04, 0x01,
|
||||
0x04, 0x05, 0x05, 0x01, 0x52, 0x51, 0x52, 0x0D, 0x06, 0x51, 0x08, 0x09, 0x54, 0x53, 0x00, 0x0D,
|
||||
0x01, 0x02, 0x03, 0x54, 0x53, 0x01, 0x05, 0x03, 0x08, 0x56, 0x54, 0x07, 0x02, 0x54, 0x0B, 0x06,
|
||||
0x11, 0x5D, 0x1F, 0x60 }; // these last 4 bytes always differ :)
|
||||
writeBytes( pv_array, sizeof(pv_array) );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_ProtocolVersion::createDefaultGracia4( unsigned int gameProtoVer /*= 146*/ )
|
||||
{
|
||||
this->writeReset();
|
||||
this->writeUChar( 0x0e ); // packet type - ProtocolVersion
|
||||
this->writeUInt( gameProtoVer );
|
||||
unsigned char pv_array[] = {
|
||||
0x09, 0x07, 0x54, 0x56, 0x03, 0x09, 0x0B, 0x01, 0x07, 0x02, 0x54, 0x54, 0x56, 0x07, 0x00, 0x02,
|
||||
0x55, 0x56, 0x00, 0x51, 0x00, 0x53, 0x57, 0x04, 0x07, 0x55, 0x08, 0x54, 0x01, 0x07, 0x01, 0x53,
|
||||
0x00, 0x56, 0x55, 0x56, 0x01, 0x06, 0x05, 0x04, 0x51, 0x03, 0x08, 0x51, 0x08, 0x51, 0x56, 0x04,
|
||||
0x54, 0x06, 0x55, 0x08, 0x02, 0x09, 0x51, 0x56, 0x01, 0x53, 0x06, 0x55, 0x04, 0x53, 0x00, 0x56,
|
||||
0x56, 0x53, 0x01, 0x09, 0x02, 0x09, 0x01, 0x51, 0x54, 0x51, 0x09, 0x55, 0x56, 0x09, 0x03, 0x04,
|
||||
0x07, 0x05, 0x55, 0x04, 0x06, 0x55, 0x04, 0x06, 0x09, 0x04, 0x51, 0x01, 0x08, 0x08, 0x06, 0x05,
|
||||
0x52, 0x06, 0x04, 0x01, 0x07, 0x54, 0x03, 0x06, 0x52, 0x55, 0x06, 0x55, 0x55, 0x51, 0x01, 0x02,
|
||||
0x04, 0x54, 0x03, 0x55, 0x54, 0x01, 0x57, 0x51, 0x55, 0x05, 0x52, 0x05, 0x54, 0x07, 0x51, 0x51,
|
||||
0x55, 0x07, 0x02, 0x53, 0x53, 0x00, 0x52, 0x05, 0x52, 0x07, 0x01, 0x54, 0x00, 0x03, 0x05, 0x05,
|
||||
0x08, 0x06, 0x05, 0x05, 0x06, 0x03, 0x00, 0x0D, 0x08, 0x01, 0x07, 0x09, 0x03, 0x51, 0x03, 0x07,
|
||||
0x53, 0x09, 0x51, 0x06, 0x07, 0x54, 0x0A, 0x50, 0x56, 0x02, 0x52, 0x04, 0x05, 0x55, 0x51, 0x02,
|
||||
0x53, 0x00, 0x08, 0x54, 0x04, 0x52, 0x56, 0x06, 0x02, 0x09, 0x00, 0x08, 0x03, 0x53, 0x56, 0x01,
|
||||
0x05, 0x00, 0x55, 0x06, 0x08, 0x56, 0x04, 0x0D, 0x06, 0x07, 0x52, 0x06, 0x07, 0x04, 0x0A, 0x06,
|
||||
0x01, 0x04, 0x54, 0x04, 0x00, 0x05, 0x02, 0x04, 0x54, 0x00, 0x09, 0x52, 0x53, 0x05, 0x04, 0x01,
|
||||
0x04, 0x05, 0x05, 0x01, 0x52, 0x51, 0x52, 0x0D, 0x06, 0x51, 0x08, 0x09, 0x54, 0x53, 0x00, 0x0D,
|
||||
0x01, 0x02, 0x03, 0x54, 0x53, 0x01, 0x05, 0x03, 0x08, 0x56, 0x54, 0x07, 0x02, 0x54, 0x0B, 0x06,
|
||||
0xA6, 0x23, 0xF4, 0xFE }; // these last 4 bytes always differ :)
|
||||
writeBytes( pv_array, sizeof(pv_array) );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_ProtocolVersion::read_protoVer( unsigned int *pver )
|
||||
{
|
||||
if( !pver || !(this->canReadBytes(5)) ) return false;
|
||||
(*pver) = 0;
|
||||
this->readReset();
|
||||
this->readUChar();
|
||||
(*pver) = this->readUInt();
|
||||
return true;
|
||||
}
|
22
l2packets/game/client/L2Game_ProtocolVersion.h
Normal file
22
l2packets/game/client/L2Game_ProtocolVersion.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef L2GAME_PROTOCOLVERSION_H_
|
||||
#define L2GAME_PROTOCOLVERSION_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_ProtocolVersion : public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_ProtocolVersion();
|
||||
L2Game_ProtocolVersion( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( L2_VERSION ver = L2_VERSION_T1 );
|
||||
bool createDefaultKamael( unsigned int gameProtoVer = 828 );
|
||||
bool createDefaultHellbound( unsigned int gameProtoVer = 851 );
|
||||
bool createDefaultGracia1( unsigned int gameProtoVer = 12 );
|
||||
bool createDefaultGracia2( unsigned int gameProtoVer = 17 );
|
||||
bool createDefaultGracia3( unsigned int gameProtoVer = 83 );
|
||||
bool createDefaultGracia4( unsigned int gameProtoVer = 146 );
|
||||
bool read_protoVer( unsigned int *pver );
|
||||
};
|
||||
|
||||
#endif /*L2GAME_PROTOCOLVERSION_H_*/
|
30
l2packets/game/client/L2Game_RequestGotoLobby.cpp
Normal file
30
l2packets/game/client/L2Game_RequestGotoLobby.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_RequestGotoLobby.h"
|
||||
|
||||
L2Game_RequestGotoLobby::L2Game_RequestGotoLobby()
|
||||
{
|
||||
this->_initNull();
|
||||
}
|
||||
|
||||
L2Game_RequestGotoLobby::L2Game_RequestGotoLobby( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
this->_initNull();
|
||||
this->setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_RequestGotoLobby::create( L2_VERSION ver )
|
||||
{
|
||||
if( ver <= L2_VERSION_T22 ) setPacketType2( 0xD0, 0x0039 );
|
||||
if( ver >= L2_VERSION_T23 ) setPacketType2( 0xD0, 0x0036 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_RequestGotoLobby::parse( L2_VERSION ver )
|
||||
{
|
||||
if( getPacketType() != 0xD0 ) return false;
|
||||
if( ver <= L2_VERSION_T22 )
|
||||
if( readUShort() != 0x0039 ) return false;
|
||||
if( ver >= L2_VERSION_T23 )
|
||||
if( readUShort() != 0x0036 ) return false;
|
||||
return true;
|
||||
}
|
16
l2packets/game/client/L2Game_RequestGotoLobby.h
Normal file
16
l2packets/game/client/L2Game_RequestGotoLobby.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef L2GAME_REQEUSTGOTOLOBBY_H_
|
||||
#define L2GAME_REQUESTGOTOLOBBY_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_RequestGotoLobby : public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_RequestGotoLobby();
|
||||
L2Game_RequestGotoLobby( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( L2_VERSION ver = L2_VERSION_T1 );
|
||||
bool parse( L2_VERSION ver = L2_VERSION_T1 );
|
||||
};
|
||||
|
||||
#endif /*L2GAME_CHARACTERSELECT_H_*/
|
44
l2packets/game/client/L2Game_RequestJoinParty.cpp
Normal file
44
l2packets/game/client/L2Game_RequestJoinParty.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_RequestJoinParty.h"
|
||||
|
||||
/* L2J:
|
||||
Client: Len 15
|
||||
0F 00
|
||||
42
|
||||
6C 00 6F 00 6C 00 00 00 // target char name
|
||||
00 00 00 00 // loot type, item distribution
|
||||
*/
|
||||
|
||||
L2Game_RequestJoinParty::L2Game_RequestJoinParty()
|
||||
{
|
||||
this->_initNull();
|
||||
}
|
||||
|
||||
L2Game_RequestJoinParty::L2Game_RequestJoinParty( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
this->_initNull();
|
||||
this->setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_RequestJoinParty::create( const wchar_t *invitePlayer, unsigned int lootRule )
|
||||
{
|
||||
if( !invitePlayer ) return false;
|
||||
writeReset();
|
||||
writeUChar( 0x42 );
|
||||
writeUnicodeString( invitePlayer );
|
||||
writeUInt( lootRule );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool L2Game_RequestJoinParty::read_invitePlayer( wchar_t *out )
|
||||
{
|
||||
if( !out ) return false;
|
||||
readReset();
|
||||
wcscpy( out, readUnicodeStringPtr() );
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int L2Game_RequestJoinParty::read_lootRule()
|
||||
{
|
||||
return readUInt();
|
||||
}
|
30
l2packets/game/client/L2Game_RequestJoinParty.h
Normal file
30
l2packets/game/client/L2Game_RequestJoinParty.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef L2GAME_REQUESTJOINPARY_H_
|
||||
#define L2GAME_REQUESTJOINPARY_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
#define L2_PARTY_LOOT_ITEM_LOOTER 0
|
||||
#define L2_PARTY_LOOT_ITEM_RANDOM 1
|
||||
#define L2_PARTY_LOOT_ITEM_RANDOM_SPOIL 2
|
||||
#define L2_PARTY_LOOT_ITEM_ORDER 3
|
||||
#define L2_PARTY_LOOT_ITEM_ORDER_SPOIL 4
|
||||
|
||||
class L2Game_RequestJoinParty: public L2GamePacket
|
||||
{
|
||||
public:
|
||||
static const unsigned int ITEM_LOOTER = 0;
|
||||
static const unsigned int ITEM_RANDOM = 1;
|
||||
static const unsigned int ITEM_RANDOM_SPOIL = 2;
|
||||
static const unsigned int ITEM_ORDER = 3;
|
||||
static const unsigned int ITEM_ORDER_SPOIL = 4;
|
||||
public:
|
||||
L2Game_RequestJoinParty();
|
||||
L2Game_RequestJoinParty( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( const wchar_t *invitePlayer, unsigned int lootRule );
|
||||
public:
|
||||
bool read_invitePlayer( wchar_t *out );
|
||||
unsigned int read_lootRule();
|
||||
};
|
||||
|
||||
#endif
|
56
l2packets/game/client/L2Game_RequestUserCommand.cpp
Normal file
56
l2packets/game/client/L2Game_RequestUserCommand.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_RequestUserCommand.h"
|
||||
|
||||
/* L2J:
|
||||
Client Len 7 [ RequestUserCommand]
|
||||
07 00
|
||||
B3
|
||||
00 00 00 00 // command ID
|
||||
|
||||
================================
|
||||
|
||||
Decimal command numbers:
|
||||
|
||||
0 - /loc
|
||||
52 - /unstuck (Escape)
|
||||
61 - /Mount
|
||||
62 - /DisMount
|
||||
77 - /time
|
||||
81 - /partyinfo
|
||||
88 - /AttackList
|
||||
89 - /underattacklist
|
||||
90 - /warlist
|
||||
93 - /ChannelDelete
|
||||
96 - /ChannelLeave
|
||||
97 - /ChannelListUpdate
|
||||
100 - /ClanPenalty
|
||||
109 - /OlympiadStat
|
||||
114 - /InstanceZone
|
||||
*/
|
||||
|
||||
L2Game_RequestUserCommand::L2Game_RequestUserCommand()
|
||||
{
|
||||
this->_initNull();
|
||||
}
|
||||
|
||||
L2Game_RequestUserCommand::L2Game_RequestUserCommand( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
this->_initNull();
|
||||
this->setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_RequestUserCommand::create( unsigned int commandID )
|
||||
{
|
||||
writeReset();
|
||||
writeUChar( 0xB3 );
|
||||
writeUInt( commandID );
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int L2Game_RequestUserCommand::read_commandID()
|
||||
{
|
||||
readReset();
|
||||
getPacketType();
|
||||
return readUInt();
|
||||
}
|
||||
|
33
l2packets/game/client/L2Game_RequestUserCommand.h
Normal file
33
l2packets/game/client/L2Game_RequestUserCommand.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef L2GAME_REQUESTUSERCOMMAND_H_
|
||||
#define L2GAME_REQUESTUSERCOMMAND_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_RequestUserCommand: public L2GamePacket
|
||||
{
|
||||
public:
|
||||
static const unsigned int CMD_LOC = 0;
|
||||
static const unsigned int CMD_UNSTUCK = 52;
|
||||
static const unsigned int CMD_MOUNT = 61;
|
||||
static const unsigned int CMD_DISMOUNT = 62;
|
||||
static const unsigned int CMD_TIME = 77;
|
||||
static const unsigned int CMD_PARTYINFO = 81;
|
||||
static const unsigned int CMD_ATTACKLIST = 88;
|
||||
static const unsigned int CMD_UNDERATTACKLIST = 89;
|
||||
static const unsigned int CMD_WARLIST = 90;
|
||||
static const unsigned int CMD_CHANNELDELETE = 93;
|
||||
static const unsigned int CMD_CHANNELLEAVE = 96;
|
||||
static const unsigned int CMD_CHANNELLISTUPDATE = 97;
|
||||
static const unsigned int CMD_CLANPENALTY = 100;
|
||||
static const unsigned int CMD_OLYMPIADSTAT = 109;
|
||||
static const unsigned int CMD_INSTANCEZONE = 114;
|
||||
public:
|
||||
L2Game_RequestUserCommand();
|
||||
L2Game_RequestUserCommand( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( unsigned int commandID );
|
||||
public:
|
||||
unsigned int read_commandID();
|
||||
};
|
||||
|
||||
#endif
|
37
l2packets/game/client/L2Game_UseItem.cpp
Normal file
37
l2packets/game/client/L2Game_UseItem.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "stdafx.h"
|
||||
#include "L2Game_UseItem.h"
|
||||
|
||||
/*
|
||||
0B 00 // len 11
|
||||
19 // ptype - UseItem
|
||||
57 EA 03 10 // objectID? 268692055
|
||||
00 00 00 00 // wtf nulls?
|
||||
*/
|
||||
|
||||
L2Game_UseItem::L2Game_UseItem()
|
||||
{
|
||||
this->_initNull();
|
||||
}
|
||||
|
||||
L2Game_UseItem::L2Game_UseItem( const unsigned char *bytes, unsigned int length )
|
||||
{
|
||||
this->_initNull();
|
||||
this->setBytes( bytes, length );
|
||||
}
|
||||
|
||||
bool L2Game_UseItem::create( unsigned int oid )
|
||||
{
|
||||
this->writeReset();
|
||||
this->writeUChar( 0x19 ); // packet type - UseItem
|
||||
this->writeUInt( oid );
|
||||
this->writeUInt( 0x00000000 );
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int L2Game_UseItem::read_objectID()
|
||||
{
|
||||
if( !(this->canReadBytes(5)) ) return 0;
|
||||
this->readReset();
|
||||
this->readUChar(); // pcode
|
||||
return this->readUInt();
|
||||
}
|
17
l2packets/game/client/L2Game_UseItem.h
Normal file
17
l2packets/game/client/L2Game_UseItem.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef L2GAME_USEITEM_H_
|
||||
#define L2GAME_USEITEM_H_
|
||||
|
||||
#include "../L2GamePacket.h"
|
||||
|
||||
class L2Game_UseItem: public L2GamePacket
|
||||
{
|
||||
public:
|
||||
L2Game_UseItem();
|
||||
L2Game_UseItem( const unsigned char *bytes, unsigned int length );
|
||||
public:
|
||||
bool create( unsigned int oid );
|
||||
public:
|
||||
unsigned int read_objectID();
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user