Added support for 64bit ticks (#3768)

Fixes #3017

Thanks to Hercules for the idea and their implementation of it.

This deprecates Windows XP support. If you want to use it to run your server on it, you have to forcefully enable it now.
Since 64bit ticks do not exist on XP, you might encounter some issues that are already fixed on other OS.
This commit is contained in:
Lemongrass3110
2018-12-21 00:02:19 +01:00
committed by GitHub
parent 0d816975f7
commit 01f61cfa4f
46 changed files with 495 additions and 424 deletions

View File

@@ -21,7 +21,7 @@ bool mapif_elemental_save(struct s_elemental* ele) {
if( ele->elemental_id == 0 ) { // Create new DB entry
if( SQL_ERROR == Sql_Query(sql_handle,
"INSERT INTO `%s` (`char_id`,`class`,`mode`,`hp`,`sp`,`max_hp`,`max_sp`,`atk1`,`atk2`,`matk`,`aspd`,`def`,`mdef`,`flee`,`hit`,`life_time`)"
"VALUES ('%d','%d','%d','%u','%u','%u','%u','%d','%d','%d','%d','%d','%d','%d','%d','%u')",
"VALUES ('%d','%d','%d','%u','%u','%u','%u','%d','%d','%d','%d','%d','%d','%d','%d','%" PRtf "')",
schema_config.elemental_db, ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->atk, ele->atk2, ele->matk, ele->amotion, ele->def, ele->mdef, ele->flee, ele->hit, ele->life_time) )
{
Sql_ShowDebug(sql_handle);
@@ -32,7 +32,7 @@ bool mapif_elemental_save(struct s_elemental* ele) {
} else if( SQL_ERROR == Sql_Query(sql_handle,
"UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `mode` = '%d', `hp` = '%u', `sp` = '%u',"
"`max_hp` = '%u', `max_sp` = '%u', `atk1` = '%d', `atk2` = '%d', `matk` = '%d', `aspd` = '%d', `def` = '%d',"
"`mdef` = '%d', `flee` = '%d', `hit` = '%d', `life_time` = '%u' WHERE `ele_id` = '%d'", schema_config.elemental_db,
"`mdef` = '%d', `flee` = '%d', `hit` = '%d', `life_time` = '%" PRtf "' WHERE `ele_id` = '%d'", schema_config.elemental_db,
ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->atk, ele->atk2,
ele->matk, ele->amotion, ele->def, ele->mdef, ele->flee, ele->hit, ele->life_time, ele->elemental_id) )
{ // Update DB entry
@@ -75,7 +75,7 @@ bool mapif_elemental_load(int ele_id, uint32 char_id, struct s_elemental *ele) {
Sql_GetData(sql_handle, 11, &data, NULL); ele->mdef = atoi(data);
Sql_GetData(sql_handle, 12, &data, NULL); ele->flee = atoi(data);
Sql_GetData(sql_handle, 13, &data, NULL); ele->hit = atoi(data);
Sql_GetData(sql_handle, 14, &data, NULL); ele->life_time = atoi(data);
Sql_GetData(sql_handle, 14, &data, NULL); ele->life_time = strtoll( data, nullptr, 10 );
Sql_FreeResult(sql_handle);
if( charserv_config.save_log )
ShowInfo("Elemental loaded (ID: %d / Class: %d / CID: %d).\n", ele->elemental_id, ele->class_, ele->char_id);