-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Old legions had tens of thousands of history entries, all permanently loaded into memory. Limited legion warehouse and reward logs to one year to remove most of the entries. As these two views only show the month and day but not the year, they shouldn't hold several years of data anyway. Also reduced the memory footprint of history entries by optimizing fields/types and interning common strings.
- Loading branch information
Showing
18 changed files
with
258 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/* | ||
* DB changes since 249c4e14 (10.08.2024) | ||
* DB changes since 9556a4b (30.11.2024) | ||
*/ | ||
|
||
-- remove old event items | ||
DELETE FROM inventory WHERE item_id IN (182006999, 185000128, 188052166, 188600199); | ||
ALTER TABLE `legion_history` DROP COLUMN `tab_id`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
game-server/src/com/aionemu/gameserver/model/team/legion/LegionHistory.java
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
game-server/src/com/aionemu/gameserver/model/team/legion/LegionHistoryAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.aionemu.gameserver.model.team.legion; | ||
|
||
/** | ||
* @author Simple | ||
*/ | ||
public enum LegionHistoryAction { | ||
|
||
CREATE(0, Type.LEGION), // No parameters | ||
JOIN(1, Type.LEGION), // Parameter: name | ||
KICK(2, Type.LEGION), // Parameter: name | ||
LEVEL_UP(3, Type.LEGION), // Parameter: legion level | ||
APPOINTED(4, Type.LEGION), // Parameter: legion level | ||
EMBLEM_REGISTER(5, Type.LEGION), // No parameters | ||
EMBLEM_MODIFIED(6, Type.LEGION), // No parameters | ||
// 7 to 10 are not used anymore or never implemented | ||
DEFENSE(11, Type.REWARD), // Parameter: name = kinah amount, description = fortress id | ||
OCCUPATION(12, Type.REWARD), // Parameter: name = kinah amount, description = fortress id | ||
LEGION_RENAME(13, Type.LEGION), // Parameter: old name, new name | ||
CHARACTER_RENAME(14, Type.LEGION), // Parameter: old name, new name | ||
ITEM_DEPOSIT(15, Type.WAREHOUSE), // Parameter: name | ||
ITEM_WITHDRAW(16, Type.WAREHOUSE), // Parameter: name | ||
KINAH_DEPOSIT(17, Type.WAREHOUSE), // Parameter: name | ||
KINAH_WITHDRAW(18, Type.WAREHOUSE); // Parameter: name | ||
|
||
private final byte id; | ||
private final Type type; | ||
|
||
LegionHistoryAction(int id, Type type) { | ||
this.id = (byte) id; | ||
this.type = type; | ||
} | ||
|
||
public byte getId() { | ||
return id; | ||
} | ||
|
||
public Type getType() { | ||
return type; | ||
} | ||
|
||
public enum Type { LEGION, REWARD, WAREHOUSE } | ||
} |
15 changes: 15 additions & 0 deletions
15
game-server/src/com/aionemu/gameserver/model/team/legion/LegionHistoryEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.aionemu.gameserver.model.team.legion; | ||
|
||
/** | ||
* @author Simple, xTz | ||
*/ | ||
public record LegionHistoryEntry(int id, int epochSeconds, LegionHistoryAction action, String name, String description) { | ||
|
||
public LegionHistoryEntry(int id, int epochSeconds, LegionHistoryAction action, String name, String description) { | ||
this.id = id; | ||
this.epochSeconds = epochSeconds; | ||
this.action = action; | ||
this.name = name.intern(); | ||
this.description = description.intern(); | ||
} | ||
} |
39 changes: 0 additions & 39 deletions
39
game-server/src/com/aionemu/gameserver/model/team/legion/LegionHistoryType.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.