mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-15 05:44:36 +01:00
Implement dictionaries
This commit is contained in:
@@ -19,6 +19,8 @@ import emu.nebula.game.mail.Mailbox;
|
||||
import emu.nebula.game.story.StoryManager;
|
||||
import emu.nebula.game.tower.StarTowerManager;
|
||||
import emu.nebula.net.GameSession;
|
||||
import emu.nebula.proto.PlayerData.DictionaryEntry;
|
||||
import emu.nebula.proto.PlayerData.DictionaryTab;
|
||||
import emu.nebula.proto.PlayerData.PlayerInfo;
|
||||
import emu.nebula.proto.Public.NewbieInfo;
|
||||
import emu.nebula.proto.Public.QuestType;
|
||||
@@ -333,7 +335,6 @@ public class Player implements GameDatabaseObject {
|
||||
.setCreateTime(this.getCreateTime());
|
||||
|
||||
proto.getMutableWorldClass()
|
||||
.setStage(3)
|
||||
.setCur(this.getLevel())
|
||||
.setLastExp(this.getExp());
|
||||
|
||||
@@ -418,6 +419,22 @@ public class Player implements GameDatabaseObject {
|
||||
for (int boardId : this.getBoards()) {
|
||||
proto.addBoard(boardId);
|
||||
}
|
||||
|
||||
// Add dictionary tabs
|
||||
for (var dictionaryData : GameData.getDictionaryTabDataTable()) {
|
||||
var dictionaryProto = DictionaryTab.newInstance()
|
||||
.setTabId(dictionaryData.getId());
|
||||
|
||||
for (var entry : dictionaryData.getEntries()) {
|
||||
var entryProto = DictionaryEntry.newInstance()
|
||||
.setIndex(entry.getIndex())
|
||||
.setStatus(2); // 2 = complete
|
||||
|
||||
dictionaryProto.addEntries(entryProto);
|
||||
}
|
||||
|
||||
proto.addDictionaries(dictionaryProto);
|
||||
}
|
||||
|
||||
// Server timestamp
|
||||
proto.setServerTs(Nebula.getCurrentTime());
|
||||
|
||||
Reference in New Issue
Block a user