You've already forked CC-Framework.BriskGameServer
44 lines
1019 B
Markdown
44 lines
1019 B
Markdown
# Quick Start
|
|
|
|
## Initialize
|
|
|
|
```csharp
|
|
await Brisk.InitializeAsync(new BriskOptions
|
|
{
|
|
BaseUrl = "https://brisk.lightyears.ltd",
|
|
GameKey = "demo-game",
|
|
ClientVersion = Application.version,
|
|
DeviceId = SystemInfo.deviceUniqueIdentifier
|
|
});
|
|
```
|
|
|
|
## Login
|
|
|
|
```csharp
|
|
await Brisk.Auth.LoginWithUserIdAsync("tap", "tap_user_10001");
|
|
```
|
|
|
|
## Common calls
|
|
|
|
```csharp
|
|
var me = await Brisk.Player.GetMeAsync();
|
|
var config = await Brisk.Config.GetCurrentAsync();
|
|
var top = await Brisk.Leaderboard.GetTopAsync("season-score", 20);
|
|
await Brisk.Leaderboard.SubmitScoreAsync("season-score", 128);
|
|
```
|
|
|
|
## Sample
|
|
|
|
For the current source project, open directly:
|
|
|
|
- `Assets/BriskSdk/Samples/QuickStart/BriskQuickStartSample.cs`
|
|
- `Assets/Scenes/BriskQuickStartScene.unity`
|
|
|
|
The sample scene uses an IMGUI debug panel and can directly test:
|
|
|
|
- initialize and restore
|
|
- login by `login_user_id`
|
|
- login by `code`
|
|
- player, config, announcement, leaderboard, archive, and space flows
|
|
- global event logs and request results
|