diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/messagein.cpp | 3 | ||||
-rw-r--r-- | src/net/net.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/adminhandler.cpp | 11 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 7 | ||||
-rw-r--r-- | src/net/tmwa/gui/partytab.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/guildhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/network.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 3 | ||||
-rw-r--r-- | src/net/tmwa/protocol.h | 1 |
9 files changed, 30 insertions, 7 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 6a5adbe1..3c3e9edf 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -97,6 +97,9 @@ void MessageIn::readCoordinates(Uint16 &x, Uint16 &y, Uint8 &direction) case 7: direction = 9; break; + case 8: + direction = 8; + break; default: // OOPSIE! Impossible or unknown direction = 0; diff --git a/src/net/net.cpp b/src/net/net.cpp index 7e7395a6..25dcd981 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -134,12 +134,16 @@ void connectToServer(ServerInfo &server) // TODO: Query the server about itself and choose the netcode based on // that +#ifndef MANASERV_SUPPORT + server.type = ServerInfo::TMWATHENA; +#else if (server.port == 6901) server.type = ServerInfo::TMWATHENA; else if (server.port == 9601) server.type = ServerInfo::MANASERV; else logger->error(_("Unknown Server Type! Exiting.")); +#endif } if (networkType == server.type && getGeneralHandler() != NULL) diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index b72c2a13..2795df8a 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -43,8 +43,10 @@ namespace TmwAthena { AdminHandler::AdminHandler() { - static const Uint16 _messages[] = { + static const Uint16 _messages[] = + { SMSG_ADMIN_KICK_ACK, + SMSG_ADMIN_IP, 0 }; handledMessages = _messages; @@ -63,6 +65,13 @@ void AdminHandler::handleMessage(Net::MessageIn &msg) else SERVER_NOTICE(_("Kick succeeded!")) break; + case SMSG_ADMIN_IP: + id = msg.readInt32(); + int ip = msg.readInt32(); + Being *player = actorSpriteManager->findBeing(id); + player->setIp(ip); + player->updateName(); + break; } } diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 332ac548..d6ba816b 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -44,7 +44,8 @@ const int EMOTION_TIME = 150; /**< Duration of emotion icon */ BeingHandler::BeingHandler(bool enableSync): mSync(enableSync) { - static const Uint16 _messages[] = { + static const Uint16 _messages[] = + { SMSG_BEING_VISIBLE, SMSG_BEING_MOVE, SMSG_BEING_SPAWN, @@ -354,7 +355,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) } break; - case SMSG_BEING_SELFEFFECT: { + case SMSG_BEING_SELFEFFECT: + { id = (Uint32)msg.readInt32(); Being* being = actorSpriteManager->findBeing(id); if (!being) @@ -562,7 +564,6 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) msg.readCoordinatePair(srcX, srcY, dstX, dstY); dstBeing->setTileCoords(srcX, srcY); dstBeing->setDestination(dstX, dstY); - } else { diff --git a/src/net/tmwa/gui/partytab.cpp b/src/net/tmwa/gui/partytab.cpp index d5781971..6833831c 100644 --- a/src/net/tmwa/gui/partytab.cpp +++ b/src/net/tmwa/gui/partytab.cpp @@ -42,7 +42,7 @@ namespace TmwAthena { PartyTab::PartyTab() : ChatTab(_("Party")) { - setTabColor(&Theme::getThemeColor(Theme::PARTY)); + setTabColor(&Theme::getThemeColor(Theme::PARTY_CHAT_TAB)); } PartyTab::~PartyTab() diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 39d49bc7..1ff2f22a 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -44,6 +44,7 @@ Guild *taGuild; GuildHandler::GuildHandler() { static const Uint16 _messages[] = { +/* SMSG_GUILD_CREATE_RESPONSE, SMSG_GUILD_POSITION_INFO, SMSG_GUILD_MEMBER_LOGIN, @@ -70,6 +71,7 @@ GuildHandler::GuildHandler() SMSG_GUILD_DEL_ALLIANCE, SMSG_GUILD_OPPOSITION_ACK, SMSG_GUILD_BROKEN, +*/ 0 }; handledMessages = _messages; diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index aff19b11..4d2073a0 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -77,8 +77,8 @@ short packet_lengths[] = { 8, 14, 10, 35, 6, 8, 4, 11, 54, 53, 60, 2, -1, 47, 33, 6, 30, 8, 34, 14, 2, 6, 26, 2, 28, 81, 6, 10, 26, 2, -1, -1, -1, -1, 20, 10, 32, 9, 34, 14, 2, 6, 48, 56, -1, 4, 5, 10, -// #0x2000 - 26, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, +// #0x0200 + 26, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index ca42a5c9..970d1ecd 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -159,6 +159,9 @@ PlayerHandler::PlayerHandler() void PlayerHandler::handleMessage(Net::MessageIn &msg) { + if (!player_node) + return; + switch (msg.getId()) { case SMSG_WALK_RESPONSE: diff --git a/src/net/tmwa/protocol.h b/src/net/tmwa/protocol.h index 21d562bc..0a768d5d 100644 --- a/src/net/tmwa/protocol.h +++ b/src/net/tmwa/protocol.h @@ -181,6 +181,7 @@ static const int STORAGE_OFFSET = 1; #define SMSG_PLAYER_STORAGE_CLOSE 0x00f8 /**< Storage access closed */ #define SMSG_ADMIN_KICK_ACK 0x00cd +#define SMSG_ADMIN_IP 0x020c #define SMSG_GUILD_CREATE_RESPONSE 0x0167 #define SMSG_GUILD_POSITION_INFO 0x016c |