I tried to reimplement code that loads : guild_eventlog and guild_bank_eventlog tables.
I renamed few variables, therefore patch is big.
Patch is a bit tested. Unexpected behavior wasn't found.
Patch adds new config options Guild.EventLogRecordsCount and Guild.BankEventLogRecordsCount.
[url]http://paste2.org/p/387609[/url]
Real change of this patch isn't big, just i changed the way how events are stored.
Pls if you have time, test it.
SQL scripts needed to run patch:
-- THIS SCRIPT DELETES table `guild_eventlog` - MAKE BACKUP, if you need it.
DROP TABLE IF EXISTS `guild_eventlog`;
CREATE TABLE `guild_eventlog` (
`guildid` int(11) NOT NULL COMMENT 'Guild Identificator',
`LogGuid` int(11) NOT NULL COMMENT 'Log record identificator - auxiliary column',
`EventType` tinyint(1) NOT NULL COMMENT 'Event type',
`PlayerGuid1` int(11) NOT NULL COMMENT 'Player 1',
`PlayerGuid2` int(11) NOT NULL COMMENT 'Player 2',
`NewRank` tinyint(2) NOT NULL COMMENT 'New rank(in case promotion/demotion)',
`TimeStamp` bigint(20) NOT NULL COMMENT 'Event UNIX time',
PRIMARY KEY (`guildid`, `LogGuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT 'Guild Eventlog';
-- The reason i decided for such dramatic change is that old guild_eventlog table hadn't Primary key and
-- used LogGuids from 0 to infinity
-- New system uses LogGuids from 0 to number defined in config.
-- THIS SCRIPT DELETES table `guild_bank_eventlog` - MAKE BACKUP, if you need it.
DROP TABLE IF EXISTS `guild_bank_eventlog`;
CREATE TABLE `guild_bank_eventlog` (
`guildid` int(11) unsigned NOT NULL default '0' COMMENT 'Guild Identificator',
`LogGuid` int(11) unsigned NOT NULL default '0' COMMENT 'Log record identificator - auxiliary column',
`TabId` tinyint(3) unsigned NOT NULL default '0' COMMENT 'Guild bank TabId',
`EventType` tinyint(3) unsigned NOT NULL default '0' COMMENT 'Event type',
`PlayerGuid` int(11) unsigned NOT NULL default '0',
`ItemOrMoney` int(11) unsigned NOT NULL default '0',
`ItemStackCount` tinyint(3) unsigned NOT NULL default '0',
`DestTabId` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Destination Tab Id',
`TimeStamp` bigint(20) unsigned NOT NULL default '0' COMMENT 'Event UNIX time',
PRIMARY KEY (`guildid`,`LogGuid`,`TabId`),
KEY `guildid_key` (`guildid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- The reason i decided for such dramatic change is that old guild_bank_eventlog table used `TabId` = 0 for Money events and
-- used `LogGuid` from 0 to infinity
-- New system uses `LogGuid` from 0 to number defined in config.