Documentation
¶
Overview ¶
Package rhine provides a modular framework to interact with the game traffic of Arknights.
Modules can only be registered at compile time with imports. Each module should register itself by calling proxy.RegisterMod at program start up, either in the init() function or otherwise. The initFunc provided will be called when a user authenticates with the game server to set up an instance of the module for that user. While the ShutdownCb return value allows a module to clean up after itself when shutting down gracefully. Here's an example:
package yourmodule import ( "github.com/elazarl/goproxy" "github.com/kyoukaya/rhine/proxy" ) const modName = "yourModule" type modState struct{} func (modState) handle(op string, data []byte, pktCtx *goproxy.ProxyCtx) []byte { return data } func (modState) cleanUp(shuttingDown bool) {} func initFunc(d *proxy.Dispatch) ([]*proxy.PacketHook, proxy.ShutdownCb) { mod := modState{} return []*proxy.PacketHook{ proxy.NewPacketHook(modName, "S/quest/battleStart", 0, mod.handle), }, mod.cleanUp } func init() { proxy.RegisterMod(modName, initFunc) }
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
example
Example is a binary that loads the droplogger and packetlogger for testing and development of Rhine and or mods for it.
|
Example is a binary that loads the droplogger and packetlogger for testing and development of Rhine and or mods for it. |
Package log provides a simple levelled logger outputing to stdout and a file.
|
Package log provides a simple levelled logger outputing to stdout and a file. |
mods
|
|
droplogger
Package droplogger logs all map drops by appending them into a log file at "logs/Drop Logger/{region}_{UID}.log" and prints them to the attached logger.
|
Package droplogger logs all map drops by appending them into a log file at "logs/Drop Logger/{region}_{UID}.log" and prints them to the attached logger. |
packetlogger
Package packetlogger logs all packets into a log file at "logs/Packet Logger/{region}_{UID}/{TIMESTAMP}.log".
|
Package packetlogger logs all packets into a log file at "logs/Packet Logger/{region}_{UID}/{TIMESTAMP}.log". |
filters
Package filters provides the default host filter list for Rhine and a small utility function to generate a regexp expression from a slice of strings.
|
Package filters provides the default host filter list for Rhine and a small utility function to generate a regexp expression from a slice of strings. |
gamestate
Package gamestate currently only marshals and stores the initial data sync, planned to mirror the client's state perfectly and enable other mods to hook onto it to query data or receive updates if values have changed.
|
Package gamestate currently only marshals and stores the initial data sync, planned to mirror the client's state perfectly and enable other mods to hook onto it to query data or receive updates if values have changed. |
Package utils provides miscellaneous utilities and cert generation routines for Rhine.
|
Package utils provides miscellaneous utilities and cert generation routines for Rhine. |
gamedata
Package gamedata provides Arknights gamedata lookup datastructures parsed from https://github.com/Kengxxiao/ArknightsGameData.
|
Package gamedata provides Arknights gamedata lookup datastructures parsed from https://github.com/Kengxxiao/ArknightsGameData. |
Click to show internal directories.
Click to hide internal directories.