Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

HailStorm32
Copy link
Contributor

Implements #450

Adds is_online column to accounts table, and updates said column for an account with a 1 when they logon, and a 0 when they disconnect or log off.

Has been tested on my GC server with multiple members.

@Jettford
Copy link
Collaborator

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.

@Jettford
Copy link
Collaborator

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;");
Copy link
Collaborator

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

@aronwk-aaron
Copy link
Member

Implements #450

Adds is_online column to accounts table, and updates said column for an account with a 1 when they logon, and a 0 when they disconnect or log off.

Has been tested on my GC server with multiple members.

Parse activity log and get characters that have not left a world, that will give you online characters

@HailStorm32
Copy link
Contributor Author

Should I close this pull request or keep it open incase others want to pull it and implement player tracking before the API merge?

@Jettford
Copy link
Collaborator

Well as said by Aaron above, this can be done through the activity_log table

@codeshaunted
Copy link
Member

This is an unneeded bandaid solution. Wait for #309 to be merged or use activity log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants