Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jumbo
@JumpWu
And some logic can use lua, when server is running,can we hot update lua file do not restart server.
Mo Firouz
@mofirouz
@JumpWu there is no trial as Nakama is open source and there is no API difference between open source and Enterprise
Also Lua code is not hot reloadable and requires a server restart
Chris Molozian
@novabyte
@JumpWu The Managed Cloud does have integration with GitHub as a source control system
You can enable auto-sync as well if you want to have code pushes made to a specific branch synced to the live servers (with a fast rolling reboot)
Zeke Foppa
@bfops
do I have to worry about multithreading at all if I'm writing nakama lua modules? Is it possible for e.g. one RPC to run while another one is in the middle of its own block of code?
Chris Molozian
@novabyte
@bfops Yes it’s possible to have concurrent RPC functions run over the same dataset. This includes interact with the same user records. But the way the server APIs work it protects data access through transactions
What sort of multi threaded code do you have you plan to write?
Zeke Foppa
@bfops
Hey Chris! Thanks for the quick reply :). I'm actually just debugging some of my lua code and I'm trying to rule out race conditions. Is this the kind of the thing where I might be cutting myself on sharp edges if I don't know anything about it?
none of our code was written to be multithreaded and it assumes that e.g. RPCs don't interrupt each other to run
Chris Molozian
@novabyte
@bfops I think it’s hugely unlikely for you to have this kind of racey code
Zeke Foppa
@bfops
mkay great, so RPCs etc. all grab some global lock by default?
Chris Molozian
@novabyte
Is there a particular interaction sequence between client and server you thin is problematic?
No we don’t implement any global locks, that would be extremely slow for the scale of games which use our tech
Zeke Foppa
@bfops
yes, one of our RPCs is doing an existence check in DB followed by an insertion and it's complaining about duplicate entries in that DB. There's a lot of code in between and it could totally be something else.
Chris Molozian
@novabyte
What we do is have a pool of Lua VMs which are checked out from when an RPC function is run and then checked back into the pool afterwards
This limits memory usage and creates back pressure in the system to prevent clients overloading the server(s)
Zeke Foppa
@bfops
do those VMs share DB access or are they doing some kind of rollback/merge thing?
Chris Molozian
@novabyte
You can of course adjust the pool size and the min/max VMs retained between RPC calls. Those VMs always have their state wiped before another RPC function can use them
@bfops do you have custom DB tables? What sort of existence check do you run?
Zeke Foppa
@bfops
we do have custom tables! but does that mean that even for nk.storage_read and nk.storage_write there's race conditions for e.g. an RPC that does read, increment, then write?
like if we had an RPC to issue lottery tickets to clients that all used the same entry in the storage table, and the RPC just read the counter, incremented, and wrote it back and returned it, could lots of clients running that RPC at the same time get the same ticket issued to them?
Chris Molozian
@novabyte
I don’t think so because it’s still be done in a database transaction but I’d have to see your code
I think let’s follow up on a forum thread to work it out
Zeke Foppa
@bfops
sure! are there any docs on how nakama does database transactions so I can get the easy questions out of the way ahead of time? :)
Mo Firouz
@mofirouz
@bfops a gentle reminder that we now have a forum (https://forum.heroiclabs.com) - Your original question would have been an amazing additional to the forum as a source of permanent knoweldge base - Gitter is really terrible when it comes to searching for previous questions :)
HashtagGo
@HashtagGo
We've developed our game using go modules on windows, using docker method (through the use of pluginbuilder). The modules are compiled into a directory, and this directory is then passed to the docker run command (the windows disk/data path is bound in yml). We are now trying to deploy this in production (Linux). The recommended method is to use the binary install method. How do we pass the information about our go modules to the nakama binary using this method?
Mo Firouz
@mofirouz
@HashtagGo Good question for the forum - please post it here: https://forum.heroiclabs.com
HashtagGo
@HashtagGo
Done !
Zeke Foppa
@bfops
ah thanks @mofirouz - I had no idea the gitter was deprecated!
Alim Jaffer
@AlimJaffer
@bfops it's not deprecated, we're focusing on building up a quality knowledge base in the forums as Gitter simply isn't searchable.
The forums make it a lot easier for those new to Nakama to come across common questions :)
Iliyan Georgiev
@SumoIGeorgiev

Heya, I'v been trying to set up nakama to run from source / binary on Windows following the steps on this page: https://heroiclabs.com/docs/install-start-server/

Let me know if you want me to put this in the forums instead. :) I'm hoping theres some detail I'm missing since part of this process works.

I've set up cockroach db, I've ran migrate up and it completed successfully. And I can see the nakama titled database in the cockroach db webui.
But when I try and start nakama itself it comes out with the following error / crash.

{
"level":"fatal","ts":"2019-08-28T16:13:16.982+0100","msg":"Error pinging database","error":"context deadline exceeded","stacktrace":"main.dbConnect
C:/Users/xxxx/Documents/repos/git_nakama/nakama/main.go:244\nmain.main
C:/Users/xxxx/Documents/repos/git_nakama/nakama/main.go:109\nruntime.main
c:/go/src/runtime/proc.go:200"
}

I've been googling around and looking through forums for the past couple of hours but there does not appear to be anything close to what I am seeing.
I am using version 19.1.4 of cockroach as I did not spot any requirement for an older version.
And I am using the latest commit to master of nakama as well.
go version go1.12.9 windows/amd64

Mo Firouz
@mofirouz
@igeorgievsd Hi. Yes putting this on the forum would be useful for the next soul that might encounter this. Thanks
Iliyan Georgiev
@SumoIGeorgiev
@mofirouz Alrighty will do now :)
Nick Gerakines
@ngerakines
I'm getting an unexpected error when trying to run through some basic curl commands to auth against a local server: {"error":"invalid character '\\'' looking for beginning of value","message":"invalid character '\\'' looking for beginning of value","code":3}
The command isn't anything special: curl "http://127.0.0.1:7350/v2/account/authenticate/custom?create=true&username=mycustomusername" --user 'defaultkey:' --data '{"id":"some-custom-id"}'
Chris Molozian
@novabyte
That's odd
@ngerakines I'll run the command as well
Nick Gerakines
@ngerakines
:+1:
Chris Molozian
@novabyte
I ran that command and get back:
{"created":true,"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTgxMTc2NTAsInVpZCI6IjZjODk5YWJiLTdmNzYtNGVlZC1hNjgwLWQ4YWFmMDZkOTJkMSIsInVzbiI6Im15Y3VzdG9tdXNlcm5hbWUifQ.phas6SQBwPWrUazrlU5RT3RjAvn4hfURB4L7xJlJySg"}
I wonder if it's the & character in the terminal you're using (even though the inputs are escaped)
Nick Gerakines
@ngerakines
hmm
Chris Molozian
@novabyte
what happens if you use the short form:
curl "http://127.0.0.1:7350/v2/account/authenticate/custom" --user 'defaultkey:' --data '{"id":"some-custom-id"}'
Nick Gerakines
@ngerakines
Same: curl "http://127.0.0.1:7350/v2/account/authenticate/custom" --user 'defaultkey:' --data '{"id":"some-custom-id"}' {"error":"invalid character '\\'' looking for beginning of value","message":"invalid character '\\'' looking for beginning of value","code":3}
Chris Molozian
@novabyte
I wonder if the quote characters are wrong after they've been copied?
Nick Gerakines
@ngerakines
I thought that too and have tried stripping them out / replacing them.