ProtoProxy: Added the tab completion packet parsing
This commit is contained in:
parent
e8a907d89e
commit
0b166ee784
@ -193,6 +193,7 @@ enum
|
|||||||
PACKET_PLAYER_LIST_ITEM = 0xc9,
|
PACKET_PLAYER_LIST_ITEM = 0xc9,
|
||||||
PACKET_PLAYER_ABILITIES = 0xca,
|
PACKET_PLAYER_ABILITIES = 0xca,
|
||||||
PACKET_INCREMENT_STATISTIC = 0xc8,
|
PACKET_INCREMENT_STATISTIC = 0xc8,
|
||||||
|
PACKET_TAB_COMPLETION = 0xcb,
|
||||||
PACKET_LOCALE_AND_VIEW = 0xcc,
|
PACKET_LOCALE_AND_VIEW = 0xcc,
|
||||||
PACKET_CLIENT_STATUSES = 0xcd,
|
PACKET_CLIENT_STATUSES = 0xcd,
|
||||||
PACKET_PLUGIN_MESSAGE = 0xfa,
|
PACKET_PLUGIN_MESSAGE = 0xfa,
|
||||||
@ -579,6 +580,7 @@ bool cConnection::DecodeClientsPackets(const char * a_Data, int a_Size)
|
|||||||
case PACKET_PLAYER_POSITION_LOOK: HANDLE_CLIENT_READ(HandleClientPlayerPositionLook); break;
|
case PACKET_PLAYER_POSITION_LOOK: HANDLE_CLIENT_READ(HandleClientPlayerPositionLook); break;
|
||||||
case PACKET_PLUGIN_MESSAGE: HANDLE_CLIENT_READ(HandleClientPluginMessage); break;
|
case PACKET_PLUGIN_MESSAGE: HANDLE_CLIENT_READ(HandleClientPluginMessage); break;
|
||||||
case PACKET_SLOT_SELECT: HANDLE_CLIENT_READ(HandleClientSlotSelect); break;
|
case PACKET_SLOT_SELECT: HANDLE_CLIENT_READ(HandleClientSlotSelect); break;
|
||||||
|
case PACKET_TAB_COMPLETION: HANDLE_CLIENT_READ(HandleClientTabCompletion); break;
|
||||||
case PACKET_UPDATE_SIGN: HANDLE_CLIENT_READ(HandleClientUpdateSign); break;
|
case PACKET_UPDATE_SIGN: HANDLE_CLIENT_READ(HandleClientUpdateSign); break;
|
||||||
case PACKET_USE_ENTITY: HANDLE_CLIENT_READ(HandleClientUseEntity); break;
|
case PACKET_USE_ENTITY: HANDLE_CLIENT_READ(HandleClientUseEntity); break;
|
||||||
case PACKET_WINDOW_CLICK: HANDLE_CLIENT_READ(HandleClientWindowClick); break;
|
case PACKET_WINDOW_CLICK: HANDLE_CLIENT_READ(HandleClientWindowClick); break;
|
||||||
@ -687,6 +689,7 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size)
|
|||||||
case PACKET_SPAWN_OBJECT_VEHICLE: HANDLE_SERVER_READ(HandleServerSpawnObjectVehicle); break;
|
case PACKET_SPAWN_OBJECT_VEHICLE: HANDLE_SERVER_READ(HandleServerSpawnObjectVehicle); break;
|
||||||
case PACKET_SPAWN_PAINTING: HANDLE_SERVER_READ(HandleServerSpawnPainting); break;
|
case PACKET_SPAWN_PAINTING: HANDLE_SERVER_READ(HandleServerSpawnPainting); break;
|
||||||
case PACKET_SPAWN_PICKUP: HANDLE_SERVER_READ(HandleServerSpawnPickup); break;
|
case PACKET_SPAWN_PICKUP: HANDLE_SERVER_READ(HandleServerSpawnPickup); break;
|
||||||
|
case PACKET_TAB_COMPLETION: HANDLE_SERVER_READ(HandleServerTabCompletion); break;
|
||||||
case PACKET_TIME_UPDATE: HANDLE_SERVER_READ(HandleServerTimeUpdate); break;
|
case PACKET_TIME_UPDATE: HANDLE_SERVER_READ(HandleServerTimeUpdate); break;
|
||||||
case PACKET_UPDATE_HEALTH: HANDLE_SERVER_READ(HandleServerUpdateHealth); break;
|
case PACKET_UPDATE_HEALTH: HANDLE_SERVER_READ(HandleServerUpdateHealth); break;
|
||||||
case PACKET_UPDATE_SIGN: HANDLE_SERVER_READ(HandleServerUpdateSign); break;
|
case PACKET_UPDATE_SIGN: HANDLE_SERVER_READ(HandleServerUpdateSign); break;
|
||||||
@ -1072,6 +1075,19 @@ bool cConnection::HandleClientSlotSelect(void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool cConnection::HandleClientTabCompletion(void)
|
||||||
|
{
|
||||||
|
HANDLE_CLIENT_PACKET_READ(ReadBEUTF16String16, AString, Query);
|
||||||
|
Log("Received a PACKET_TAB_COMPLETION query from the client");
|
||||||
|
Log(" Query = \"%s\"", Query.c_str());
|
||||||
|
COPY_TO_SERVER();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool cConnection::HandleClientUpdateSign(void)
|
bool cConnection::HandleClientUpdateSign(void)
|
||||||
{
|
{
|
||||||
HANDLE_CLIENT_PACKET_READ(ReadBEInt, int, BlockX);
|
HANDLE_CLIENT_PACKET_READ(ReadBEInt, int, BlockX);
|
||||||
@ -2103,6 +2119,30 @@ bool cConnection::HandleServerSpawnPickup(void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool cConnection::HandleServerTabCompletion(void)
|
||||||
|
{
|
||||||
|
HANDLE_SERVER_PACKET_READ(ReadBEUTF16String16, AString, Results);
|
||||||
|
Log("Received a PACKET_TAB_COMPLETION from the server, results given:");
|
||||||
|
|
||||||
|
// Parse the zero-terminated list of results:
|
||||||
|
size_t len = Results.size();
|
||||||
|
size_t last = 0;
|
||||||
|
for (size_t i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
if (Results[i] == 0)
|
||||||
|
{
|
||||||
|
Log(" \"%s\"", Results.substr(last, i - last).c_str());
|
||||||
|
last = i + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
COPY_TO_CLIENT();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool cConnection::HandleServerTimeUpdate(void)
|
bool cConnection::HandleServerTimeUpdate(void)
|
||||||
{
|
{
|
||||||
HANDLE_SERVER_PACKET_READ(ReadBEInt64, Int64, WorldAge);
|
HANDLE_SERVER_PACKET_READ(ReadBEInt64, Int64, WorldAge);
|
||||||
|
@ -128,6 +128,7 @@ protected:
|
|||||||
bool HandleClientPlayerPositionLook(void);
|
bool HandleClientPlayerPositionLook(void);
|
||||||
bool HandleClientPluginMessage(void);
|
bool HandleClientPluginMessage(void);
|
||||||
bool HandleClientSlotSelect(void);
|
bool HandleClientSlotSelect(void);
|
||||||
|
bool HandleClientTabCompletion(void);
|
||||||
bool HandleClientUpdateSign(void);
|
bool HandleClientUpdateSign(void);
|
||||||
bool HandleClientUseEntity(void);
|
bool HandleClientUseEntity(void);
|
||||||
bool HandleClientWindowClick(void);
|
bool HandleClientWindowClick(void);
|
||||||
@ -177,6 +178,7 @@ protected:
|
|||||||
bool HandleServerSpawnObjectVehicle(void);
|
bool HandleServerSpawnObjectVehicle(void);
|
||||||
bool HandleServerSpawnPainting(void);
|
bool HandleServerSpawnPainting(void);
|
||||||
bool HandleServerSpawnPickup(void);
|
bool HandleServerSpawnPickup(void);
|
||||||
|
bool HandleServerTabCompletion(void);
|
||||||
bool HandleServerTimeUpdate(void);
|
bool HandleServerTimeUpdate(void);
|
||||||
bool HandleServerUpdateHealth(void);
|
bool HandleServerUpdateHealth(void);
|
||||||
bool HandleServerUpdateSign(void);
|
bool HandleServerUpdateSign(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user