game

package
v0.0.0-...-eba1a7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 2 Imported by: 0

README

Module game

Extension

How to write a extension

If your are using the snail built-in game module. then:

  1. Define a extension(struct), embedding GameExtensionSupport and implement IGameExtension.
  2. You can call the function SetRequestHandler, SetRequestHandlerBinary, SetRequestHandlerJson or SetRequestHandlerObject to associate a protocol response logic.
  3. Finish the protocol response logic said above.
  4. Implement other interfaces if your need: IGoroutineExtension、IBeforeRequestExtension、IAfterRequestExtension and so on.
  5. Here is a demo.
How to add extension to the game module

Call the function "RegisterExtension" in the package "github.com/xuzhuoxi/snail/module/internal/game/ifc" to register your extension go game module. Maybe like that:

ifc.RegisterExtension(func() ifc.IGameExtension {
	return NewDemoExtension("Demo")
})
Note

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Created by xuzhuoxi on 2019-02-18.
Created by xuzhuoxi on 2019-02-18.
demo
Created by xuzhuoxi on 2019-02-19.
Created by xuzhuoxi on 2019-02-19.
user
Created by xuzhuoxi on 2019-03-03.
Created by xuzhuoxi on 2019-03-03.
Created by xuzhuoxi on 2019-03-23.
Created by xuzhuoxi on 2019-03-23.
Created by xuzhuoxi on 2019-02-18.
Created by xuzhuoxi on 2019-02-18.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL