View Full Version : Login System

07-03-2011, 11:21 PM
How would i implement a login system. how would i link my site's database to my novashell game so the game can check if the login is correct? and if this is not possible is there any other way to protect my game so it cant be leaked or spread?

07-04-2011, 12:49 AM
Novashell has no built-in support for authentication or anti-piracy protection, but because you have the source code it's fairly easy to apply any method you want.

Personally, I've removed all my complex authentication based protection from my software last year, didn't find it worth the hassle.

PS: If you're concerned with beta versions in the wild, you can set them up to "expire" after a certain date is reached.

07-04-2011, 02:46 AM
how would i make betas expire and do you have any suggestions or recommendations for authentication methods? i was planning on selling my game once it was finished and would need an authentication method, thanks!

07-04-2011, 03:07 AM
Well, you'd have to get into the source code and code 'er up. If you do, this may be helpful to you (for Win anyway..):

#include <ctime>

//month is 1-12 btw
int GetDaysSinceDate(int month,int day, int year)
time_t ltime;
time( &ltime );

tm expire = { 0, 0, 0, day, month-1, year-1900, 0 }; //Month is 0-11 btw
tm today = *localtime( &ltime );

long time_now = (long)today.tm_mday + (long)today.tm_mon * 30 + today.tm_year*365;
long time_exp = (long)expire.tm_mday +(long)expire.tm_mon * 30 + expire.tm_year * 365;
long time_passed = time_now - time_exp;

//now let's convert it back to days
if (time_passed == 0) return 0; //avoid divide by 0
return time_passed;

07-04-2011, 09:03 AM
thanks and do you have any idea how i can do an authentication system? i was thinking cd keys but im not sure how i would get lua to check for it, i was also thinking HWID protection but agian im not sure how i would get lua to check for it.