Joseph Manley
12ea66e4fc
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
25 lines
768 B
Go
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
|
|
}
|