-
Notifications
You must be signed in to change notification settings - Fork 173
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
Tracking of currently online accounts #455
Conversation
I have a feeling that this could get really messy. If a server dies completely then all of that worlds flags for who is online, is incorrect. |
I have a method of getting online players through a web API which is in the review process, I was just given a few things to fix up. |
@@ -122,6 +122,12 @@ int main(int argc, char** argv) { | |||
return 0; | |||
} | |||
|
|||
//Backwards compatibiliy, add the is_online column to accounts table if it doesnt already exsist | |||
sql::PreparedStatement* stmt = Database::CreatePreppedStmt("ALTER TABLE accounts ADD if not exists is_online tinyint(1) NOT NULL DEFAULT 0;"); |
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.
This should be done in a migration not on MasterServer startup
Parse activity log and get characters that have not left a world, that will give you online characters |
Should I close this pull request or keep it open incase others want to pull it and implement player tracking before the API merge? |
Well as said by Aaron above, this can be done through the |
This is an unneeded bandaid solution. Wait for #309 to be merged or use activity log. |
Implements #450
Adds
is_online
column toaccounts
table, and updates said column for an account with a1
when they logon, and a0
when they disconnect or log off.Has been tested on my GC server with multiple members.