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

25 lines
768 B
Go
Raw Normal View History

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
}