viewing paste Unknown #1746 | Diff

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
1492a1493,1499
>   // check the number of already existing chars in this account
>   if( char_per_account != 0 ) {
>       if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `account_id` = '%d'", char_db, sd->account_id) )
>           Sql_ShowDebug(sql_handle);
>       if( Sql_NumRows(sql_handle) >= char_per_account )
>           return -2; // character account limit exceeded
>   }
1576,1580c1583,1587
<     char name[NAME_LENGTH];
<     char esc_name[NAME_LENGTH*2+1]; //Name needs be escaped.
<     int account_id, party_id, guild_id, hom_id, base_level, partner_id, father_id, mother_id, elemental_id;
<     char *data;
<     size_t len;
---
>   char name[NAME_LENGTH];
>   char esc_name[NAME_LENGTH*2+1]; //Name needs be escaped.
>   int account_id, party_id, guild_id, hom_id, base_level, partner_id, father_id, mother_id;
>   char* data;
>   size_t len;
1582,1583c1589,1590
<     if (SQL_ERROR == Sql_Query(sql_handle, "SELECT `name`,`account_id`,`party_id`,`guild_id`,`base_level`,`homun_id`,`partner_id`,`father`,`mother`,`elemental_id` FROM `%s` WHERE `char_id`='%d'", char_db, char_id))
<         Sql_ShowDebug(sql_handle);
---
>   if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `name`,`account_id`,`party_id`,`guild_id`,`base_level`,`homun_id`,`partner_id`,`father`,`mother` FROM `%s` WHERE `char_id`='%d'", char_db, char_id) )
>       Sql_ShowDebug(sql_handle);
1601,1602d1607
<     Sql_GetData(sql_handle, 9, &data, NULL);
<     elemental_id = atoi(data);
1655,1658d1659
<         
<     /* remove elemental */
<     if (elemental_id)
<         mapif_elemental_delete(elemental_id);
1690,1701c1691,1698
<     /* delete character registry */
<     if (SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `type`=3 AND `char_id`='%d'", reg_db, char_id))
<         Sql_ShowDebug(sql_handle);
< 
<     /* delete skills */
<     if (SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `char_id`='%d'", skill_db, char_id))
<         Sql_ShowDebug(sql_handle);
<         
<     /* delete mails (only received) */
<     if (SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `dest_id`='%d'", mail_db, char_id))
<         Sql_ShowDebug(sql_handle);
< 
---
>   /* delete character registry */
>   if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `type`=3 AND `char_id`='%d'", reg_db, char_id) )
>       Sql_ShowDebug(sql_handle);
>   
>   /* delete skills */
>   if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `char_id`='%d'", skill_db, char_id) )
>       Sql_ShowDebug(sql_handle);
>
Viewed 1508 times, submitted by lighta.