Jump to content

[8464] Guild ranks - Bug


Recommended Posts

Posted

Hi

rev 8426

When server crash or restart, the rank with id 1 is in guild twice. And rank with hightest id is deleted. I muss changed privilegia and names of guild ranks every restart mangos.

Posted

You should check your database for

CREATE TABLE `guild_rank` (
 `guildid` int(6) unsigned NOT NULL default '0',
 `rid` int(11) unsigned NOT NULL,
 `rname` varchar(255) NOT NULL default '',
 `rights` int(3) unsigned NOT NULL default '0',
 `BankMoneyPerDay` int(11) unsigned NOT NULL default '0',
 PRIMARY KEY  (`guildid`,`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Guild System';

There is no way to have 2 ranks with same rank_ids (`rid`) for one guild.

Or you use some old patch, that breaks function of guild ranks.

If you delete that table, all guilds will be disbanned, so you have to update its structure!

Posted

Confirmed.

added: I thing problem here:

Patch fix it

diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index 41e9adb..52b38f0 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -680,7 +680,7 @@ void Guild::SetRankName(uint32 rankId, std::string name_)

    // name now can be used for encoding to DB
    CharacterDatabase.escape_string(name_);
-    CharacterDatabase.PExecute("UPDATE guild_rank SET rname='%s' WHERE rid='%u' AND guildid='%u'", name_.c_str(), (rankId+1), m_Id);
+    CharacterDatabase.PExecute("UPDATE guild_rank SET rname='%s' WHERE rid='%u' AND guildid='%u'", name_.c_str(), (rankId), m_Id);
}

void Guild::SetRankRights(uint32 rankId, uint32 rights)
@@ -690,7 +690,7 @@ void Guild::SetRankRights(uint32 rankId, uint32 rights)

    m_Ranks[rankId].rights = rights;

-    CharacterDatabase.PExecute("UPDATE guild_rank SET rights='%u' WHERE rid='%u' AND guildid='%u'", rights, (rankId+1), m_Id);
+    CharacterDatabase.PExecute("UPDATE guild_rank SET rights='%u' WHERE rid='%u' AND guildid='%u'", rights, (rankId), m_Id);
}

int32 Guild::GetRank(uint32 LowGuid)
@@ -1402,7 +1402,7 @@ void Guild::SetBankMoneyPerDay(uint32 rankId, uint32 money)
        if (itr->second.RankId == rankId)
            itr->second.BankResetTimeMoney = 0;

-    CharacterDatabase.PExecute("UPDATE guild_rank SET BankMoneyPerDay='%u' WHERE rid='%u' AND guildid='%u'", money, (rankId+1), m_Id);
+    CharacterDatabase.PExecute("UPDATE guild_rank SET BankMoneyPerDay='%u' WHERE rid='%u' AND guildid='%u'", money, (rankId), m_Id);
    CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeMoney='0' WHERE guildid='%u' AND rank='%u'", m_Id, rankId);
}

I'll test it.

Added:

Now working fine ))

Posted

core: 8456

all confirmed

Guild bank total buggy ( system )

now new feature all members from a guild can stolen all money and items without ranks etc. ( 5 seconsds had u time 4 this action )

Posted

patch commited in [8464]. Thx to Wowka321.

Sorry that was my mistake, i didn't check that code when i coded guild loading optimization.

Guild Leaders have to change their rank names and rights again , and it will work correctly.

Topic moved to applied section.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use