Skip to content

Commit 99ffbf0

Browse files
authored
Migrate to Buf tool for Protobuf code generation. (#62)
1 parent fa44f5e commit 99ffbf0

File tree

5 files changed

+51
-25
lines changed

5 files changed

+51
-25
lines changed

README.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ Hiro
55
66
[Hiro](https://heroiclabs.com/hiro/) is a client and server framework built on top of [Nakama server](https://heroiclabs.com/nakama/) to rapidly build high performance, flexible, and composable gameplay systems like Achievements, Energies, Event Leaderboards, and much more.
77

8-
The code is divided into a Go package of interfaces and a C# DLL which is packaged with utilities (such as UnityPurchasing, Unity Mobile Notifications, etc) for Unity Engine.
8+
The code is divided into a Go package of interfaces and a client package for one of these supported languages and game engines:
99

10-
This repository maintains the public interfaces which make it easy to use the library from inside a Nakama game server project to extend and build additional gameplay systems.
10+
- A C# DLL which is packaged with utilities (such as UnityPurchasing, Unity Mobile Notifications, etc) for Unity Engine,
11+
- An Unreal plugin, as well as CPP support for other engines,
12+
- TypeScript-based JavaScript package for web games,
13+
- And a Godot asset written in GDScript.
1114

12-
To learn more about Hiro and integrate it into your Unity game project, have a look at these resources:
15+
This repository maintains the public interfaces which make it easy to use the library from inside a Nakama game server project to extend and build additional gameplay systems. You can explore the features with an [API client](https://www.usebruno.com/) when you import the "hiro-openapi.yml" collection.
16+
17+
To learn more about Hiro and integrate it into your game project, have a look at these resources:
1318

1419
- [heroiclabs.com/hiro](https://heroiclabs.com/hiro/)
1520
- [heroiclabs.com/docs/hiro](https://heroiclabs.com/docs/hiro/)
@@ -35,8 +40,17 @@ Reach out to [Heroic Labs](mailto:[email protected]) for more information abo
3540
The game framework initializes and returns the configured gameplay systems with `Init`:
3641

3742
```go
43+
package main
44+
45+
import (
46+
"context"
47+
"database/sql"
48+
"github.com/heroiclabs/hiro"
49+
"github.com/heroiclabs/nakama-common/runtime"
50+
)
51+
3852
func InitModule(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, initializer runtime.Initializer) error {
39-
systems, err := hiro.Init(ctx, logger, nk, initializer, "hiro.bin", "LicenseKey"
53+
systems, err := hiro.Init(ctx, logger, nk, initializer, "hiro.bin", "LicenseKey",
4054
hiro.WithEconomySystem("economy.json", true),
4155
hiro.WithEnergySystem("energy.json", true),
4256
hiro.WithInventorySystem("inventory.json", true))

buf.gen.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: v2
2+
managed:
3+
enabled: true
4+
plugins:
5+
- remote: buf.build/protocolbuffers/go:v1.34.2
6+
out: .
7+
opt:
8+
- paths=source_relative

buf.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: v2
2+
breaking:
3+
use:
4+
- FILE
5+
lint:
6+
use:
7+
- STANDARD
8+
except:
9+
- PACKAGE_DIRECTORY_MATCH
10+
- PACKAGE_VERSION_SUFFIX
11+
modules:
12+
- path: .
13+
name: buf.build/heroiclabs/hiro
14+
excludes:
15+
- vendor
16+
- node_modules

build.go

-17
This file was deleted.

hiro.pb.go

+9-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)