Package emu.grasscutter.plugin.api
Class ServerHook
java.lang.Object
emu.grasscutter.plugin.api.ServerHook
Hooks into the
GameServer class, adding convenient ways to do certain things.-
Constructor Summary
ConstructorsConstructorDescriptionServerHook(GameServer gameServer, HttpServer httpServer) Hooks into a server. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a router using an instance of a class.voidAdds a router using a class.static ServerHookGets the server hook instance.Gets all online players.voidregisterCommand(CommandHandler handler) Registers a command to theCommandMap.voidsetAuthSystem(AuthenticationSystem authSystem) Sets the server's authentication system.
-
Constructor Details
-
ServerHook
Hooks into a server.- Parameters:
gameServer- The game server to hook into.httpServer- The HTTP server to hook into.
-
-
Method Details
-
getInstance
Gets the server hook instance.- Returns:
- A
ServerHooksingleton.
-
getGameServer
- Returns:
- The game server.
-
getHttpServer
- Returns:
- The HTTP server.
-
getOnlinePlayers
Gets all online players.- Returns:
- Players connected to the server.
-
registerCommand
Registers a command to theCommandMap.- Parameters:
handler- The command handler.
-
addRouter
Adds a router using an instance of a class.- Parameters:
router- A router instance.
-
addRouter
Adds a router using a class.- Parameters:
router- The class of the router.
-
setAuthSystem
Sets the server's authentication system.- Parameters:
authSystem- An instance of the authentication system.
-