-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add functionality to give credits after a period of time #7
Comments
Added in v2.2 |
Are you sure that that is the best way to do it? |
Is the player disconnect event called on map end? I don't think so but I'll recheck. Edit: Yeah it does. I'll add the ConnectTime in database in some time. Thanks! |
After adding the feature to the SQL database and testing it, I realized that there is actually no possible way to implement map overarching connection tracking. So in theory, I just wasted my time. I'm not sure what the point is having the "connectedAt" column in the database but since I've already done it, I've commited it anyway. You can view my commit here: Nachtfrische@60f86c9 Tell me if you want to merge it. The downside is, people would need to modify their table by using one line of SQL if they want to update since there was a column added. |
It could be done in a little complex way by adding time from playerconnected to mapend and storing it somewhere and then adding it to next map but I don't know if it's feasible. |
You should be able to set when the player can recieve the credits in the config file.
For example, you can set a value of 10 minutes in the config file and the player can only get credits, if he played for at least 10 minutes.
One way to do it would be to add a new column "connectedAt" to the database and save a timestamp of the connection there. When the user then types !daily, it gets the difference in minutes of the "connectedAt" timestamp and the current time and then compares that to the value set in the config.
The text was updated successfully, but these errors were encountered: