Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is how classic Battle.net calculates if your account is expired or not.
- // Pretend that the functions that this function calls actually return real data about that account.
- // You could do this in a multitude of ways, such as providing the necessary data in the function parameters instead.
- // The end result is the same -- see the return line.
- void isExpired(int databaseId)
- {
- FILETIME today = getToday(); // today's date and time in a FILETIME struct
- FILETIME accountCreated = getAccountCreated(databaseId); // profile key: System/Account Created
- FILETIME lastLogon = getLastLogon(databaseId); // profile key: System/Last Logon
- int timeLogged = getTimeLogged(datebaseId); // profile key: System/Time Logged
- // Note that the FILETIME structure is based on 100-nanosecond intervals.
- int oneSecond = (10000000);
- int twoHours = (oneSecond * 60 * 60 * 2);
- int twoDays = (oneSecond * 60 * 60 * 24 * 2);
- int threeMonths = (oneSecond * 60 * 60 * 24 * 90);
- // Note that I am not paying attention whether I can add int to FILETIME, that is up to how you code this yourself.
- // This is only a concept demonstration of how the code could look like.
- return (accountCreated + twoHours < today && (timeLogged < twoDays || lastLogon + threeMonths < today));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement