Jump to content
  • 0
Sign in to follow this  
Zirius

Reducing guild capacity and removing alliance => how to fix/ready DB

Question

Hello! I successfully reduced the max guild capacity and also planning to remove guild alliance feature.

I tried in local dev, but seems like existing guilds are giving console error since in DB they have max guild capacity greater than what the source allows.

 

How can I:

Make the max guild capacity applies then

Kick all players from their guild IF NOT guild master

Then also remove the alliance the guild has

 

I don't wanna truncate all guild database :(

 

Thanks!

Edited by Zirius

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Oh, sorry, I understood you just wanted to remove alliances.

 

I couldn't understand you what you mean with makint the max guild capacity apply, so please elaborate a bit on that. In any case, please remember that if you edit the max guild capacity (I think that's a source edit) you should recompile to make it effective.

 

To kick every guild member from the guilds except the guild master, you could issue the following SQL query (remember to try on a backup first, I haven't tested it):

 

DELETE FROM `guild_member` WHERE `char_id` NOT IN (SELECT `char_id` FROM `guild`)

Share this post


Link to post
Share on other sites
  • 0

If you want to remove any existing guild alliances, please check out the guild_alliance table on your SQL side. Maybe you'll want to truncate the table (remove all data on it).

 

Please do test on a server backup and while the server is shut down if you don't want to find out unexpected behavior, since I haven't tested but that should do.

Share this post


Link to post
Share on other sites
  • 0

If you want to remove any existing guild alliances, please check out the guild_alliance table on your SQL side. Maybe you'll want to truncate the table (remove all data on it).

 

Please do test on a server backup and while the server is shut down if you don't want to find out unexpected behavior, since I haven't tested but that should do.

 

Yes removing alliance is easy how about this bro? :

 

 

Make the max guild capacity applies then

Kick all players from their guild IF NOT guild master

Share this post


Link to post
Share on other sites
  • 0

Oh, sorry, I understood you just wanted to remove alliances.

 

I couldn't understand you what you mean with makint the max guild capacity apply, so please elaborate a bit on that. In any case, please remember that if you edit the max guild capacity (I think that's a source edit) you should recompile to make it effective.

 

To kick every guild member from the guilds except the guild master, you could issue the following SQL query (remember to try on a backup first, I haven't tested it):

 

 

DELETE FROM `guild_member` WHERE `char_id` NOT IN (SELECT `char_id` FROM `guild`)

 

 

Thanks!

I am referring to updating the sql database with the new guild capacity as based on new src edit.

 

If the old max guild capacity is 36. 16 initial, and 2 per Guild extension level.

A guild which capped their guild extension will have at SQL table guild capacity of 36.

And this number won't get updated and keep on showing as warning on console because of this:

 

if (g->max_member > MAX_GUILD) {

// Fix reduction of MAX_GUILD [PoW]

ShowWarning("Guild %d:%s specifies higher capacity (%d) than MAX_GUILD (%d)n", guild_id, g->name, g->max_member, MAX_GUILD);

g->max_member = MAX_GUILD;

}

Is there a way Herc would run on all guilds on server, update the `max_member` table based on src edit?

 

Thanks.

Share this post


Link to post
Share on other sites
  • 0

You can do it manually, but I think Guild Extension would need an edit to avoid other guilds get over the limit.

 

UPDATE `guild` SET `max_member` = yourmaxvalue WHERE `max_member` > yourmaxvalue

Share this post


Link to post
Share on other sites
  • 0

You can do it manually, but I think Guild Extension would need an edit to avoid other guilds get over the limit.

 

UPDATE `guild` SET `max_member` = yourmaxvalue WHERE `max_member` > yourmaxvalue

you mean at

 

src/char/int_guild.c

g->max_member = 6 + inter_guild->checkskill(g, GD_EXTENSION) * 6;

and

 

src/common/mmo.h

#define MAX_GUILD (6+10*6)

right?

 

it was already done. anything else I should note bro?

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.