Class MongoDatabase

java.lang.Object
net.chen.legacyLand.database.MongoDatabase
All Implemented Interfaces:
IDatabase

@Deprecated(since="beta2.3", forRemoval=true) public class MongoDatabase extends Object implements IDatabase
Deprecated, for removal: This API element is subject to removal in a future version.
MongoDB 数据库实现
  • Constructor Details

    • MongoDatabase

      public MongoDatabase(LegacyLand plugin)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • connect

      public void connect()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      连接数据库
      Specified by:
      connect in interface IDatabase
    • disconnect

      public void disconnect()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      断开数据库连接
      Specified by:
      disconnect in interface IDatabase
    • createTables

      public void createTables()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      创建表结构
      Specified by:
      createTables in interface IDatabase
    • saveNationGovernment

      public void saveNationGovernment(String nationName, GovernmentType governmentType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      saveNationGovernment in interface IDatabase
    • loadNationGovernment

      public GovernmentType loadNationGovernment(String nationName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadNationGovernment in interface IDatabase
    • saveNationPoliticalSystem

      public void saveNationPoliticalSystem(String nationName, String systemId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      保存国家政治体制(配置驱动)
      Specified by:
      saveNationPoliticalSystem in interface IDatabase
    • loadNationPoliticalSystem

      public String loadNationPoliticalSystem(String nationName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      加载国家政治体制 ID
      Specified by:
      loadNationPoliticalSystem in interface IDatabase
    • savePlayerRole

      public void savePlayerRole(String nationName, UUID playerId, NationRole role)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      savePlayerRole in interface IDatabase
    • loadNationRoles

      public Map<UUID, NationRole> loadNationRoles(String nationName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadNationRoles in interface IDatabase
    • removePlayerRole

      public void removePlayerRole(String nationName, UUID playerId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      removePlayerRole in interface IDatabase
    • deleteNationData

      public void deleteNationData(String nationName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      deleteNationData in interface IDatabase
    • saveDiplomacyRelation

      public void saveDiplomacyRelation(DiplomacyRelation relation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      saveDiplomacyRelation in interface IDatabase
    • loadAllDiplomacyRelations

      public List<DiplomacyRelation> loadAllDiplomacyRelations()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadAllDiplomacyRelations in interface IDatabase
    • deleteDiplomacyRelation

      public void deleteDiplomacyRelation(String nation1, String nation2)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      deleteDiplomacyRelation in interface IDatabase
    • savePlayerData

      public void savePlayerData(PlayerData data)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      savePlayerData in interface IDatabase
    • loadPlayerData

      public PlayerData loadPlayerData(UUID playerId, String playerName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadPlayerData in interface IDatabase
    • saveWar

      public void saveWar(War war)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      saveWar in interface IDatabase
    • saveWarData

      public void saveWarData(String warName, Map<String,Object> warData)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      saveWarData in interface IDatabase
    • loadWarData

      public Map<String,Object> loadWarData(String warName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadWarData in interface IDatabase
    • deleteWarData

      public void deleteWarData(String warName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      deleteWarData in interface IDatabase
    • saveWarParticipant

      public void saveWarParticipant(String warName, UUID playerId, String role)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      saveWarParticipant in interface IDatabase
    • loadWarParticipants

      public Map<UUID,String> loadWarParticipants(String warName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadWarParticipants in interface IDatabase
    • saveSiegeWar

      public void saveSiegeWar(Map<String,Object> siegeData)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      saveSiegeWar in interface IDatabase
    • loadSiegeWar

      public Map<String,Object> loadSiegeWar(String siegeId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadSiegeWar in interface IDatabase
    • savePlayerAchievement

      public void savePlayerAchievement(UUID playerId, String achievementId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      savePlayerAchievement in interface IDatabase
    • loadPlayerAchievements

      public List<String> loadPlayerAchievements(UUID playerId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadPlayerAchievements in interface IDatabase
    • saveSeasonData

      public void saveSeasonData(String currentSeason, int currentDay, int daysPerSubSeason)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      saveSeasonData in interface IDatabase
    • loadSeasonData

      public Map<String,Object> loadSeasonData()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadSeasonData in interface IDatabase
    • saveFlagWar

      public void saveFlagWar(FlagWarData flagWar)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      saveFlagWar in interface IDatabase
    • loadActiveFlagWars

      public List<FlagWarData> loadActiveFlagWars()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      loadActiveFlagWars in interface IDatabase
    • deleteFlagWar

      public void deleteFlagWar(String flagWarId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      deleteFlagWar in interface IDatabase
    • saveMarket

      public void saveMarket(Market market)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      保存市场数据
      Specified by:
      saveMarket in interface IDatabase
    • loadAllMarkets

      public List<Market> loadAllMarkets()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      加载所有市场数据
      Specified by:
      loadAllMarkets in interface IDatabase
    • deleteMarket

      public void deleteMarket(String marketId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      删除市场数据
      Specified by:
      deleteMarket in interface IDatabase
    • saveMarketChest

      public void saveMarketChest(MarketChest chest)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      保存市场箱子数据
      Specified by:
      saveMarketChest in interface IDatabase
    • loadMarketChests

      public List<MarketChest> loadMarketChests(String marketId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      加载指定市场的所有箱子
      Specified by:
      loadMarketChests in interface IDatabase
    • deleteMarketChest

      public void deleteMarketChest(String chestId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      删除市场箱子数据
      Specified by:
      deleteMarketChest in interface IDatabase
    • saveGuaranteeRelation

      public void saveGuaranteeRelation(GuaranteeRelation relation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      保存保卫关系
      Specified by:
      saveGuaranteeRelation in interface IDatabase
    • loadAllGuarantees

      public Map<String, List<GuaranteeRelation>> loadAllGuarantees()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      加载所有保卫关系
      Specified by:
      loadAllGuarantees in interface IDatabase
    • updateGuaranteeRelation

      public void updateGuaranteeRelation(GuaranteeRelation relation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      更新保卫关系
      Specified by:
      updateGuaranteeRelation in interface IDatabase
    • deleteGuaranteeRelation

      public void deleteGuaranteeRelation(String guarantorNation, String protectedNation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      删除保卫关系
      Specified by:
      deleteGuaranteeRelation in interface IDatabase
    • deleteNationGuarantees

      public void deleteNationGuarantees(String nationName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      删除国家的所有保卫关系
      Specified by:
      deleteNationGuarantees in interface IDatabase
    • saveChunkResource

      public void saveChunkResource(ChunkResourceData data)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      保存或更新区块储量数据(upsert)。
      Specified by:
      saveChunkResource in interface IDatabase
    • loadChunkResource

      public ChunkResourceData loadChunkResource(String world, int chunkX, int chunkZ)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      加载单个区块的储量数据,未找到返回 null。
      Specified by:
      loadChunkResource in interface IDatabase
    • loadAllChunkResources

      public List<ChunkResourceData> loadAllChunkResources()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      加载所有已扫描区块(用于全量统计/导出,谨慎在大数据集下调用)。
      Specified by:
      loadAllChunkResources in interface IDatabase
    • decrementChunkResource

      public void decrementChunkResource(String world, int chunkX, int chunkZ, double delta)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IDatabase
      P2 预留:递减 currentValue。当前未被调用。
      Specified by:
      decrementChunkResource in interface IDatabase