This repository has been archived on 2023-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
family-lineage/server/plugin/family_plugin.go
Joseph Manley 12ea66e4fc Create custom match plugin
Rename world_control

Fix package name

Attempt with main package

Go world_control debug

Go world_control debug

Added get world RPC method

Remove '_' from module

Nakama plugin testing

Nakama plugin testing

Nakama plugin testing

Try updated pipeline

Nakama plugin testing

Update pipeline

Rework plugin dir

Fix path

Fix imports

Fix imports

Load match

Load match work

Server changes

Server changes

Server changes

Changes basic upon helpful suggestions

Client side get match
2020-08-16 03:34:15 -04:00

25 lines
768 B
Go

package main
import (
"context"
"database/sql"
"github.com/heroiclabs/nakama-common/runtime"
"github.com/josephbmanley/family/server/plugin/control"
"github.com/josephbmanley/family/server/plugin/rpc"
)
func InitModule(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, initializer runtime.Initializer) error {
logger.Info("Loaded family plugin!")
if err := initializer.RegisterMatch("control", func(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule) (runtime.Match, error) {
return &control.Match{}, nil
}); err != nil {
return err
}
if err := initializer.RegisterRpc("get_world_id", rpc.GetWorldId); err != nil {
logger.Error("Unable to register: %v", err)
return err
}
return nil
}