diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/guild.cpp | 7 | ||||
-rw-r--r-- | src/guild.h | 2 | ||||
-rw-r--r-- | src/net/guildhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/protocol.h | 2 | ||||
-rw-r--r-- | src/player.cpp | 4 | ||||
-rw-r--r-- | src/player.h | 2 |
8 files changed, 23 insertions, 14 deletions
@@ -1,3 +1,9 @@ +2008-07-22 David Athay <ko2fan@gmail.com> + + * src/game.cpp, src/guild.cpp, src/player.cpp, src/guild.h, src/player.h, + src/net/guildhandler.cpp, src/net/protocol.h: Add permissions to guild + members. Alt-Gr fix for Rotonen. + 2008-07-17 David Athay <ko2fan@gmail.com> * src/gui/partywindow.cpp: Fixed crash bug with accepting diff --git a/src/game.cpp b/src/game.cpp index f0209b73..afd4cba4 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -652,7 +652,7 @@ void Game::handleInput() // Keys pressed together with Alt/Meta // Emotions and some internal gui windows #ifndef __APPLE__ - if (event.key.keysym.mod & KMOD_ALT) + if (event.key.keysym.mod & KMOD_ALT && event.key.keysym.mod ^ KMOD_LCTRL) #else if (event.key.keysym.mod & KMOD_LMETA) #endif diff --git a/src/guild.cpp b/src/guild.cpp index 4f28d8b5..c02af865 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -23,10 +23,13 @@ #include "guild.h" -Guild::Guild(short id, bool inviteRights): +Guild::Guild(short id, short rights): mId(id), - mCanInviteUsers(inviteRights) + mCanInviteUsers(false) { + // to invite, rights must be greater than 0 + if (rights > 0) + mCanInviteUsers = true; } void Guild::addMember(const std::string &name) diff --git a/src/guild.h b/src/guild.h index 969b146e..e262d3df 100644 --- a/src/guild.h +++ b/src/guild.h @@ -35,7 +35,7 @@ public: /** * Constructor with guild id passed to it */ - Guild(short id, bool inviteRights); + Guild(short id, short rights); /** * Set the guild's name diff --git a/src/net/guildhandler.cpp b/src/net/guildhandler.cpp index 151abe03..51393168 100644 --- a/src/net/guildhandler.cpp +++ b/src/net/guildhandler.cpp @@ -137,19 +137,19 @@ void GuildHandler::handleMessage(MessageIn &msg) guild->addMember(guildMember); guildWindow->setOnline(guild->getName(), guildMember, true); break; - + case GUILD_EVENT_LEAVING_PLAYER: guild->removeMember(guildMember); break; - + case GUILD_EVENT_ONLINE_PLAYER: guildWindow->setOnline(guild->getName(), guildMember, true); break; - + case GUILD_EVENT_OFFLINE_PLAYER: guildWindow->setOnline(guild->getName(), guildMember, false); break; - + default: logger->log("Invalid guild event"); } @@ -201,12 +201,12 @@ void GuildHandler::joinedGuild(MessageIn &msg) { std::string guildName = msg.readString(); short guildId = msg.readInt16(); - bool leader = msg.readInt8(); + short permissions = msg.readInt16(); short channelId = msg.readInt16(); std::string announcement = msg.readString(); // Add guild to player and create new guild tab - Guild *guild = player_node->addGuild(guildId, leader); + Guild *guild = player_node->addGuild(guildId, permissions); guild->setName(guildName); guildWindow->newGuildTab(guildName); guildWindow->requestMemberList(guildId); diff --git a/src/net/protocol.h b/src/net/protocol.h index 89713591..52db350b 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -143,7 +143,7 @@ enum { CPMSG_GUILD_QUIT_RESPONSE = 0x0361, // B error CPMSG_GUILD_INVITED = 0x0370, // S char name, S guild name, W id - CPMSG_GUILD_REJOIN = 0x0371, // S name, W guild, B rights, W channel + CPMSG_GUILD_REJOIN = 0x0371, // S name, W guild, W rights, W channel, S announce // Party PCMSG_PARTY_INVITE = 0x03A0, // S name diff --git a/src/player.cpp b/src/player.cpp index 61730724..49f0221d 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -153,9 +153,9 @@ void Player::setSprite(int slot, int id, const std::string &color) Being::setSprite(slot, id, color); } -Guild* Player::addGuild(short guildId, bool inviteRights) +Guild* Player::addGuild(short guildId, short rights) { - Guild *guild = new Guild(guildId, inviteRights); + Guild *guild = new Guild(guildId, rights); mGuilds.insert(std::pair<int, Guild*>(guildId, guild)); return guild; } diff --git a/src/player.h b/src/player.h index 89cc1207..7e86b1e1 100644 --- a/src/player.h +++ b/src/player.h @@ -93,7 +93,7 @@ class Player : public Being /** * Adds a guild to the player. */ - Guild* addGuild(short guildId, bool inviteRights); + Guild* addGuild(short guildId, short rights); /** * Removers a guild from the player. |