|
16 | 16 | import io.luna.game.model.mob.bot.BotManager; |
17 | 17 | import io.luna.game.model.mob.bot.BotRepository; |
18 | 18 | import io.luna.game.model.object.GameObjectList; |
19 | | -import io.luna.game.persistence.GameSerializerManager; |
20 | | -import io.luna.game.persistence.PersistenceService; |
| 19 | +import io.luna.game.persistence.*; |
21 | 20 | import io.luna.game.task.Task; |
22 | 21 | import io.luna.game.task.TaskManager; |
23 | 22 | import io.luna.net.msg.out.NpcUpdateMessageWriter; |
@@ -270,14 +269,18 @@ public World(LunaContext context) { |
270 | 269 | botManager = new BotManager(); |
271 | 270 |
|
272 | 271 | // Initialize the connection pool. |
273 | | - try { |
274 | | - connectionPool = new SqlConnectionPool.Builder() |
275 | | - .poolName("LunaSqlPool") |
276 | | - .database("luna_players") |
277 | | - .build(); |
278 | | - } catch (Exception e) { |
279 | | - logger.fatal("Fatal error creating SQL pool!", e); |
280 | | - throw new RuntimeException(e); |
| 272 | + if (getSerializerManager().getSerializer() instanceof SqlGameSerializer) { |
| 273 | + try { |
| 274 | + connectionPool = new SqlConnectionPool.Builder() |
| 275 | + .poolName("LunaSqlPool") |
| 276 | + .database("luna_players") |
| 277 | + .build(); |
| 278 | + } catch (Exception e) { |
| 279 | + logger.fatal("Fatal error creating SQL pool!", e); |
| 280 | + throw new RuntimeException(e); |
| 281 | + } |
| 282 | + } else { |
| 283 | + connectionPool = null; |
281 | 284 | } |
282 | 285 |
|
283 | 286 | // Initialize synchronization thread pool. |
|
0 commit comments