summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-11-07 11:47:24 -0700
committerJared Adams <jaxad0127@gmail.com>2009-11-07 11:47:24 -0700
commit99be9859a30e84e758ee3bfe7dcc3de33dfa2391 (patch)
tree49354012582a4c9e9218ebafad429b07b19b2539 /src/net/ea
parent9c1cc1e46fd21ec48809fbb8f64853fcecef2439 (diff)
downloadmana-client-99be9859a30e84e758ee3bfe7dcc3de33dfa2391.tar.gz
mana-client-99be9859a30e84e758ee3bfe7dcc3de33dfa2391.tar.bz2
mana-client-99be9859a30e84e758ee3bfe7dcc3de33dfa2391.tar.xz
mana-client-99be9859a30e84e758ee3bfe7dcc3de33dfa2391.zip
More eAthena guild stuff
Also some related chenges elsewhere
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/guildhandler.cpp29
-rw-r--r--src/net/ea/guildhandler.h8
-rw-r--r--src/net/ea/inventoryhandler.cpp22
-rw-r--r--src/net/ea/inventoryhandler.h8
-rw-r--r--src/net/ea/protocol.h39
5 files changed, 79 insertions, 27 deletions
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp
index f4cfc038..0cccd8f4 100644
--- a/src/net/ea/guildhandler.cpp
+++ b/src/net/ea/guildhandler.cpp
@@ -25,6 +25,7 @@
#include "net/ea/protocol.h"
#include "localplayer.h"
+#include "log.h"
Net::GuildHandler *guildHandler;
@@ -102,6 +103,20 @@ void GuildHandler::handleMessage(Net::MessageIn &msg)
// TODO
}
break;
+
+ case SMSG_GUILD_POSITION_INFO:
+ {
+ int guildId = msg.readInt32();
+ int emblem = msg.readInt32();
+ int posMode = msg.readInt32();
+ msg.readInt32(); // Unused
+ msg.readInt8(); // Unused
+ std::string guildName = msg.readString(24);
+
+ logger->log("Guild position info: %d %d %d %s\n", guildId,
+ emblem, posMode, guildName.c_str());
+ }
+ break;
}
}
@@ -143,14 +158,20 @@ void GuildHandler::leave(int guildId)
msg.writeString("", 30); // Message
}
-void GuildHandler::kick(int guildId, int playerId)
+void GuildHandler::kick(GuildMember member)
{
- // TODO
+ MessageOut msg(CMSG_GUILD_EXPULSION);
+ msg.writeInt32(member.getGuild()->getId());
+ msg.writeInt32(member.getID()); // Account ID
+ msg.writeInt32(0); // Char ID
+ msg.writeString("", 40); // Message
}
void GuildHandler::chat(int guildId, const std::string &text)
{
- // TODO
+ MessageOut msg(CMSG_GUILD_MESSAGE);
+ msg.writeInt16(text.size() + 4);
+ msg.writeString(text);
}
void GuildHandler::memberList(int guildId)
@@ -158,7 +179,7 @@ void GuildHandler::memberList(int guildId)
// TODO
}
-void GuildHandler::changeMemberPostion(int guildId, int playerId, int level)
+void GuildHandler::changeMemberPostion(GuildMember member, int level)
{
// TODO
}
diff --git a/src/net/ea/guildhandler.h b/src/net/ea/guildhandler.h
index e80e4818..f04a56bb 100644
--- a/src/net/ea/guildhandler.h
+++ b/src/net/ea/guildhandler.h
@@ -45,13 +45,13 @@ class GuildHandler : public Net::GuildHandler, public MessageHandler
void leave(int guildId);
- void kick(int guildId, int playerId);
+ void kick(GuildMember member);
void chat(int guildId, const std::string &text);
void memberList(int guildId);
- void changeMemberPostion(int guildId, int playerId, int level);
+ void changeMemberPostion(GuildMember member, int level);
void requestAlliance(int guildId, int otherGuildId);
@@ -59,6 +59,10 @@ class GuildHandler : public Net::GuildHandler, public MessageHandler
bool response);
void endAlliance(int guildId, int otherGuildId);
+
+ private:
+ // eAthena only supports one guild per player
+ Guild *mGuild;
};
}
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 8f2b4453..94118ae2 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -347,12 +347,12 @@ void InventoryHandler::moveItem(int oldIndex, int newIndex)
// Not implemented for eAthena (possible?)
}
-void InventoryHandler::openStorage()
+void InventoryHandler::openStorage(StorageType type)
{
// Doesn't apply to eAthena, since opening happens through NPCs?
}
-void InventoryHandler::closeStorage()
+void InventoryHandler::closeStorage(StorageType type)
{
MessageOut outMsg(CMSG_CLOSE_STORAGE);
}
@@ -374,14 +374,20 @@ void InventoryHandler::moveItem(StorageType source, int slot, int amount,
}
}
-size_t InventoryHandler::getInventorySize() const
+size_t InventoryHandler::getSize(StorageType type) const
{
- return 100;
-}
+ switch (type)
+ {
+ case INVENTORY:
+ return 100;
+ case STORAGE:
+ return 300;
+ case GUILD_STORAGE:
+ return 1000;
+ case CART:
+ return 0;
+ }
-size_t InventoryHandler::getStorageSize() const
-{
- return 300;
}
} // namespace EAthena
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index e61ee14b..83a2b440 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -50,16 +50,14 @@ class InventoryHandler : public MessageHandler, public Net::InventoryHandler
void moveItem(int oldIndex, int newIndex);
- void openStorage();
+ void openStorage(StorageType type);
- void closeStorage();
+ void closeStorage(StorageType type);
void moveItem(StorageType source, int slot, int amount,
StorageType destination);
- size_t getInventorySize() const;
-
- size_t getStorageSize() const;
+ size_t getSize(StorageType type) const;
};
} // namespace EAthena
diff --git a/src/net/ea/protocol.h b/src/net/ea/protocol.h
index e6a417aa..75d0d30e 100644
--- a/src/net/ea/protocol.h
+++ b/src/net/ea/protocol.h
@@ -163,8 +163,31 @@ static const int STORAGE_OFFSET = 1;
#define SMSG_ADMIN_KICK_ACK 0x00cd
#define SMSG_GUILD_CREATE_RESPONSE 0x0167
+#define SMSG_GUILD_POSITION_INFO 0x016c
+#define SMSG_GUILD_MEMBER_LOGIN 0x016d
+#define SMSG_GUILD_MASTER_OR_MEMBER 0x014e
+#define SMSG_GUILD_BASIC_INFO 0x01b6
+#define SMSG_GUILD_ALIANCE_INFO 0x014c
+#define SMSG_GUILD_MEMBER_LIST 0x0154
+#define SMSG_GUILD_POS_NAME_LIST 0x0166
+#define SMSG_GUILD_POS_INFO_LIST 0x0160
+#define SMSG_GUILD_POSITION_CHANGED 0x0174
+#define SMSG_GUILD_MEMBER_POS_CHANGE 0x0156
+#define SMSG_GUILD_EMBLEM 0x0152
+#define SMSG_GUILD_SKILL_INFO 0x0162
+#define SMSG_GUILD_NOTICE 0x016f
+#define SMSG_GUILD_INVITE 0x016a
#define SMSG_GUILD_INVITE_ACK 0x0169
-#define SMSG_GUILD_INVITE 0x016A
+#define SMSG_GUILD_LEAVE 0x015a
+#define SMSG_GUILD_EXPULSION 0x015c
+#define SMSG_GUILD_EXPULSION_LIST 0x0163
+#define SMSG_GUILD_MESSAGE 0x017f
+#define SMSG_GUILD_SKILL_UP 0x010e
+#define SMSG_GUILD_REQ_ALLIANCE 0x0171
+#define SMSG_GUILD_REQ_ALLIANCE_ACK 0x0173
+#define SMSG_GUILD_DEL_ALLIANCE 0x0184
+#define SMSG_GUILD_OPPOSITION_ACK 0x0181
+#define SMSG_GUILD_BROKEN 0x015e
#define SMSG_MVP 0x010c
@@ -246,22 +269,22 @@ static const int STORAGE_OFFSET = 1;
#define CMSG_ADMIN_KICK 0x00CC
#define CMSG_ADMIN_MUTE 0x0149
-#define CMSG_GUILD_CHECK_MASTER 0x014D
-#define CMSG_GUILD_REQUEST_INFO 0x014F
+#define CMSG_GUILD_CHECK_MASTER 0x014d
+#define CMSG_GUILD_REQUEST_INFO 0x014f
#define CMSG_GUILD_REQUEST_EMBLEM 0x0151
#define CMSG_GUILD_CHANGE_EMBLEM 0x0153
#define CMSG_GUILD_CHANGE_MEMBER_POS 0x0155
#define CMSG_GUILD_LEAVE 0x0159
-#define CMSG_GUILD_EXPULSION 0x015B
-#define CMSG_GUILD_BREAK 0x015D
+#define CMSG_GUILD_EXPULSION 0x015b
+#define CMSG_GUILD_BREAK 0x015d
#define CMSG_GUILD_CHANGE_POS_INFO 0x0161
#define CMSG_GUILD_CREATE 0x0165
#define CMSG_GUILD_INVITE 0x0168
-#define CMSG_GUILD_INVITE_REPLY 0x016B
-#define CMSG_GUILD_CHANGE_NOTICE 0x016E
+#define CMSG_GUILD_INVITE_REPLY 0x016b
+#define CMSG_GUILD_CHANGE_NOTICE 0x016e
#define CMSG_GUILD_ALLIANCE_REQUEST 0x0170
#define CMSG_GUILD_ALLIANCE_REPLY 0x0172
-#define CMSG_GUILD_MESSAGE 0x017E
+#define CMSG_GUILD_MESSAGE 0x017e
#define CMSG_GUILD_OPPOSITION 0x0180
#define CMSG_GUILD_ALLIANCE_DELETE 0x0183