This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local nk = require("nakama") | |
local function setup_user(context, _) | |
local value = { | |
coins = 100 | |
level = 1 | |
} | |
local record = { | |
Bucket = "mygame", | |
Collection = "saves", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local nk = require("nakama") | |
--[[ | |
Send a push notification to a segment of users via One Signal. | |
]]-- | |
local function send_push_notification(context, payload) | |
local auth = "YOUR ONE SIGNAL REST API KEY" | |
local url = "https://onesignal.com/api/v1/notifications" | |
local method = "POST" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Copyright 2017 The Nakama Authors | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"skills": [ | |
{ | |
"context": {"bucket": "b", "collection": "skills", "record": "fireball"}, | |
"value": { | |
"name": "Fireball", | |
"element": 0, | |
"base_damage": 20 | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class UUID | |
{ | |
public static byte[] FromString(string uuid) | |
{ | |
var guid = new Guid(uuid).ToByteArray(); | |
Array.Reverse(guid, 6, 2); | |
Array.Reverse(guid, 4, 2); | |
Array.Reverse(guid, 0, 4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2017 The Nakama Authors | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2017 The Nakama Authors | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local nk = require("nakama") | |
-- use any string as an ID | |
local id = "8c79b85e-d5a1-11e7-87cc-7bd5871ea4a4" | |
local reset = nil -- no reset | |
local metadata = { | |
} | |
nk.leaderboard_create(id, "desc", reset, metadata, false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
cockroachdb: | |
image: cockroachdb/cockroach:v2.0.1 | |
command: start --insecure --store=attrs=ssd,path=/var/lib/cockroach/ | |
restart: always | |
volumes: | |
- data:/var/lib/cockroach | |
expose: | |
- "8080" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Copyright 2018 The Nakama Authors | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
OlderNewer