From 9b0260a3df03e1fde9fbd76552bacaa70dbb1899 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 29 May 2021 22:59:19 +0100 Subject: [PATCH] Add GameService Signed-off-by: Graham --- .../main/kotlin/org/openrs2/game/GameModule.kt | 1 + .../main/kotlin/org/openrs2/game/GameService.kt | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 game/src/main/kotlin/org/openrs2/game/GameService.kt diff --git a/game/src/main/kotlin/org/openrs2/game/GameModule.kt b/game/src/main/kotlin/org/openrs2/game/GameModule.kt index 0aade2f6..ac7c0935 100644 --- a/game/src/main/kotlin/org/openrs2/game/GameModule.kt +++ b/game/src/main/kotlin/org/openrs2/game/GameModule.kt @@ -23,6 +23,7 @@ public object GameModule : AbstractModule() { install(NetworkModule) val binder = Multibinder.newSetBinder(binder(), Service::class.java) + binder.addBinding().to(GameService::class.java) binder.addBinding().to(Js5Service::class.java) binder.addBinding().to(NetworkService::class.java) diff --git a/game/src/main/kotlin/org/openrs2/game/GameService.kt b/game/src/main/kotlin/org/openrs2/game/GameService.kt new file mode 100644 index 00000000..de9058d7 --- /dev/null +++ b/game/src/main/kotlin/org/openrs2/game/GameService.kt @@ -0,0 +1,16 @@ +package org.openrs2.game + +import com.google.common.util.concurrent.AbstractScheduledService +import java.util.concurrent.TimeUnit +import javax.inject.Singleton + +@Singleton +public class GameService : AbstractScheduledService() { + override fun runOneIteration() { + // TODO(gpe): implement + } + + override fun scheduler(): Scheduler { + return Scheduler.newFixedRateSchedule(0, 600, TimeUnit.MILLISECONDS) + } +}