From ffc3096a0d107bc2cb2ec88bb35ded289efc3398 Mon Sep 17 00:00:00 2001 From: Mini Date: Fri, 12 Jan 2007 16:43:37 +0000 Subject: [PATCH] Fixed: .namego summon on mangos servers works now with PseuW@W, but still a animation bug to fix. Fixed: The logfile now properly gets closed upon exit. --- src/Client/PseuWoW.cpp | 1 + src/Client/World/WorldSession.cpp | 22 ++++++++++++++++++++++ src/Client/World/WorldSession.h | 2 ++ src/Client/log.cpp | 5 +++++ src/Client/log.h | 1 + 5 files changed, 31 insertions(+) diff --git a/src/Client/PseuWoW.cpp b/src/Client/PseuWoW.cpp index 4984729..026d9fb 100644 --- a/src/Client/PseuWoW.cpp +++ b/src/Client/PseuWoW.cpp @@ -64,6 +64,7 @@ PseuInstance::~PseuInstance() delete _conf; //delete _rsession; // deleted by SocketHandler!!!!! delete _wsession; + log_close(); } diff --git a/src/Client/World/WorldSession.cpp b/src/Client/World/WorldSession.cpp index f69dd53..94c02e7 100644 --- a/src/Client/World/WorldSession.cpp +++ b/src/Client/World/WorldSession.cpp @@ -153,6 +153,8 @@ OpcodeHandler *WorldSession::_GetOpcodeHandlerTable() const {MSG_MOVE_HEARTBEAT, &WorldSession::_HandleMovementOpcode}, {MSG_MOVE_FALL_LAND, &WorldSession::_HandleMovementOpcode}, + {MSG_MOVE_TELEPORT_ACK, &WorldSession::_HandleTelePortAckOpcode}, + // table termination { 0, NULL } }; @@ -492,4 +494,24 @@ void WorldSession::_HandleMovementOpcode(WorldPacket& recvPacket) // SendWorldPacket(opcode,&bb); //} // more to come +} + +void WorldSession::_HandleTelePortAckOpcode(WorldPacket& recvPacket) +{ + uint8 unk; + uint16 unk1, unk2; + uint32 unk3, unk4; + uint64 guid; + + float x, y, z, o, ang; + + recvPacket >> unk >> guid >> unk3 >> unk1 >> unk2 >> o >> x >> y >> z >> ang >> unk4; + + //printf("DEBUG: Got teleport, data: x: %f, y: %f, z: %f, o: %f, guid: %d\n", x, y, z, o, guid); + + // TODO: Still bugs with animation + WorldPacket response; + response.SetOpcode(MSG_MOVE_FALL_LAND); + response << uint32(0) << uint32(0) << x << y << z << o << uint32(0); + SendWorldPacket(response); } \ No newline at end of file diff --git a/src/Client/World/WorldSession.h b/src/Client/World/WorldSession.h index 9378379..2e6aeb1 100644 --- a/src/Client/World/WorldSession.h +++ b/src/Client/World/WorldSession.h @@ -76,6 +76,8 @@ private: void _HandleTradeStatusOpcode(WorldPacket& recvPacket); void _HandleGroupInviteOpcode(WorldPacket& recvPacket); + void _HandleTelePortAckOpcode(WorldPacket& recvPacket); + PseuInstance *_instance; WorldSocket *_socket; diff --git a/src/Client/log.cpp b/src/Client/log.cpp index 1dad83b..55d2e06 100644 --- a/src/Client/log.cpp +++ b/src/Client/log.cpp @@ -81,4 +81,9 @@ void logdebug(const char *str, ...) } fflush(stdout); } + +void log_close() +{ + fclose(logfile); +} \ No newline at end of file diff --git a/src/Client/log.h b/src/Client/log.h index 7354fca..cce155c 100644 --- a/src/Client/log.h +++ b/src/Client/log.h @@ -7,6 +7,7 @@ void log_prepare(char *fn, PseuInstance* p); void log(const char *str, ...); void logdetail(const char *str, ...); void logdebug(const char *str, ...); +void log_close(); #endif \ No newline at end of file