Jump to content
  • 0

"[SQL] DB Error" svn17101 - MAX_GUARDIANS vs guild_castle fields


Cydh

Question


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

hi everyone..

I just downloaded the latest svn for rAthena, 17101. Clean install, also clean import .sql file from svn/repository

of course the main.sql file from https://rathena.svn....files/main.sql.

Here the error

post-5421-0-75185500-1358513550_thumb.jpg

and tada~ I just realize how I got this error.

for guild_castle table, only provides 8 guardians. visibleG0~visibleG7 fields

but, let check on this line (src/char/int_guild.c line 537)

for (i = 0; i < MAX_GUARDIANS; ++i)

it can provide until x guardian that decided on mmo.h (line 100)

#define MAX_GUARDIANS 8 //Local max per castle. [skotlex]

how If I decided the MAX_GUARDIANS is 12 but the table only supports until it 8 guardians?

well, I can add the fields manually.

How if 100 MAX_GUARDIANS? hahaha

Thank's

Edited by cydh
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Correct, trunk/sql-files/main.sql creates a `guild_castle` for the default 8 guardians (visibleG0 - visibleG7).

For 12 guardians, you should modify your SQL table to this:

DROP TABLE IF EXISTS `guild_castle`;
CREATE TABLE IF NOT EXISTS `guild_castle` (
 `castle_id` int(11) unsigned NOT NULL default '0',
 `guild_id` int(11) unsigned NOT NULL default '0',
 `economy` int(11) unsigned NOT NULL default '0',
 `defense` int(11) unsigned NOT NULL default '0',
 `triggerE` int(11) unsigned NOT NULL default '0',
 `triggerD` int(11) unsigned NOT NULL default '0',
 `nextTime` int(11) unsigned NOT NULL default '0',
 `payTime` int(11) unsigned NOT NULL default '0',
 `createTime` int(11) unsigned NOT NULL default '0',
 `visibleC` int(11) unsigned NOT NULL default '0',
 `visibleG0` int(11) unsigned NOT NULL default '0',
 `visibleG1` int(11) unsigned NOT NULL default '0',
 `visibleG2` int(11) unsigned NOT NULL default '0',
 `visibleG3` int(11) unsigned NOT NULL default '0',
 `visibleG4` int(11) unsigned NOT NULL default '0',
 `visibleG5` int(11) unsigned NOT NULL default '0',
 `visibleG6` int(11) unsigned NOT NULL default '0',
 `visibleG7` int(11) unsigned NOT NULL default '0',
 `visibleG8` int(11) unsigned NOT NULL default '0',
 `visibleG9` int(11) unsigned NOT NULL default '0',
 `visibleG10` int(11) unsigned NOT NULL default '0',
 `visibleG11` int(11) unsigned NOT NULL default '0',
 PRIMARY KEY  (`castle_id`),
 KEY `guild_id` (`guild_id`)
) ENGINE=MyISAM;

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Correct, trunk/sql-files/main.sql creates a `guild_castle` for the default 8 guardians (visibleG0 - visibleG7).

For 12 guardians, you should modify your SQL table to this:

DROP TABLE IF EXISTS `guild_castle`;
CREATE TABLE IF NOT EXISTS `guild_castle` (
 `castle_id` int(11) unsigned NOT NULL default '0',
 `guild_id` int(11) unsigned NOT NULL default '0',
 `economy` int(11) unsigned NOT NULL default '0',
 `defense` int(11) unsigned NOT NULL default '0',
 `triggerE` int(11) unsigned NOT NULL default '0',
 `triggerD` int(11) unsigned NOT NULL default '0',
 `nextTime` int(11) unsigned NOT NULL default '0',
 `payTime` int(11) unsigned NOT NULL default '0',
 `createTime` int(11) unsigned NOT NULL default '0',
 `visibleC` int(11) unsigned NOT NULL default '0',
 `visibleG0` int(11) unsigned NOT NULL default '0',
 `visibleG1` int(11) unsigned NOT NULL default '0',
 `visibleG2` int(11) unsigned NOT NULL default '0',
 `visibleG3` int(11) unsigned NOT NULL default '0',
 `visibleG4` int(11) unsigned NOT NULL default '0',
 `visibleG5` int(11) unsigned NOT NULL default '0',
 `visibleG6` int(11) unsigned NOT NULL default '0',
 `visibleG7` int(11) unsigned NOT NULL default '0',
 `visibleG8` int(11) unsigned NOT NULL default '0',
 `visibleG9` int(11) unsigned NOT NULL default '0',
 `visibleG10` int(11) unsigned NOT NULL default '0',
 `visibleG11` int(11) unsigned NOT NULL default '0',
 PRIMARY KEY  (`castle_id`),
 KEY `guild_id` (`guild_id`)
) ENGINE=MyISAM;

I did, just wondering that everyone knows this issue or not.

Thank's :D

And, is the MySQL query always be executed for the first time when the server is running meanwhile there's no record there?

How if make table `castle_guardian` that contains `castle_id`, `visible_guardian`, and `guardian_id` and call it use INNER JOIN, so the MAX_GUARDIANS can be LIMIT clause when executing the query.

Edited by cydh
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...