Jump to content
  • 0

how to read guild info from sql initially


RyanB

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/24/12
  • Last Seen:  

anyway to do it?

Link to comment
Share on other sites

4 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:  

What guild info do you want to read from SQL?

(guilds? guild castles? guild members?)

What do you want to do with this information?

(read it into a script? and then what?)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/24/12
  • Last Seen:  

Actually i need info of guilds, guild castles, guild members, guild alliances.

I'm trying to make a script/atcommand that can check guilds' info.

And check alliance relations by script, using sql is not accurate coz do not update instantly.

Edited by RyanB
Link to comment
Share on other sites


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

I'm trying to make a script/atcommand that can check guilds' info.

And check alliance relations by script, using sql is not accurate coz do not update instantly.

But once this NPC reads the guild info from SQL (when the server starts), how will the NPC be updated when guild info changes?

Maybe you could just reduce autosave_time so guild info is saved to SQL more frequently (it's already set to 60 seconds). trunk/conf/char_athena.conf

// How often should the server save all files? (In seconds)
// Note: Applies to all data files on TXT servers.
// On SQL servers, it applies to guilds (character save interval is defined on the map config)
autosave_time: 60

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/24/12
  • Last Seen:  

int mapif_parse_GuildInfo(int fd,int guild_id)

{

struct guild * g = inter_guild_fromsql(guild_id); //We use this because on start-up the info of castle-owned guilds is requied. [skotlex]

if(g)

{

if (!guild_calcinfo(g)) {

int i;

mapif_guild_info(fd,g);

for(i=0;i<MAX_GUILDALLIANCE;i++) {

struct guild * a = inter_guild_fromsql(g->alliance.guild_id);

if(a) mapif_guild_info(-1,a);

}

}

}

else

mapif_guild_noinfo(fd,guild_id); // Failed to load info

return 0;

}

I did this but i dunno would it crash anything or not

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...