-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move players record to lua #4840
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Horrible, having to instantiate a pointer to a lua interface in the Game class just to get a variable from lua.
More code, same functionality, less efficient, harder to maintain.
First of all, it would be easier to have a method that accepts a luaState* L and use it to interact with lua.
Secondly, you can obtain the number of players with the Game.getPlayerCount method.
Thirdly you are not freeing the results table from the database when using storeQuery
@MillhioreBT I agree—if only we had a status server in Lua or something like an Http Client, we wouldn’t need to call Lua in Game.cpp.
I’m not a fan of |
Just keep a running counter of players online that increases with a creaturescript of type |
Wasn't this already a thing back in like 1.2 1.0 and it got removed? |
Pull Request Prelude
Changes Proposed
Test required
ScriptInterface
toGame
, but I am unsure of its limitations. It’s necessary to check whether what I’ve implemented is correct, includingGame::getPlayersRecord()