Page 1 of 1
Suggestion...
Posted: Mon Jan 15, 2018 6:09 am
by Gangrenous
I suggest adding these to commands.cpp
Code: Select all
case COMMAND_RELOAD_RULES: {
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Reloading Rules...");
world.ReloadRules();
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Done!");
break;
}
case COMMAND_RELOAD_RECIPES: {
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Reloading Recipes...");
master_recipe_list.ClearRecipes();
database.LoadRecipes();
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Done!");
break;
Code: Select all
#define COMMAND_RELOAD_RULES 315
#define COMMAND_RELOAD_RECIPES 316
In World.cpp
Code: Select all
void World::ReloadRules() {
LogWrite(RULESYS__DEBUG, 1, "Rules", "-ReLoading Rule Sets...");
rule_manager.ClearRuleSets();
database.LoadRuleSets();
LogWrite(RULESYS__DEBUG, 1, "Rules", "-ReLoad Rule Sets complete!");
}
Of course the rules need to be added in the database commands table.
There may be some things like a supporting function missing, but it should be self explanatory.
Re: Suggestion...
Posted: Mon Jan 15, 2018 6:14 am
by Gangrenous
Also to note, new recipes do not show up until the character logs in and out. We could also reload player recipes, or would that be dangerous? Having them log is not that big of a deal.
Re: Suggestion...
Posted: Wed Jan 17, 2018 10:19 am
by Ememjr
we should not require a player to log out to add new recipe unless its a new to the world recipe
Re: Suggestion...
Posted: Wed Jan 17, 2018 4:23 pm
by Jabantiz
If I remember right the recipe book is kind of special and there is really no way to clear it, I believe every packet sent for it appends its data to what the client was already sent. So when you scribe a new book only those recipes are sent in the packet and it gets added on to what you already had.
Re: Suggestion...
Posted: Wed Jan 17, 2018 5:05 pm
by Gangrenous
master_recipe_list.ClearRecipes();
Re: Suggestion...
Posted: Wed Jan 17, 2018 6:00 pm
by Jabantiz
I am talking about the client, once sent I don't think it is possible to clear the list on the client from the server.
Re: Suggestion...
Posted: Wed Jan 17, 2018 6:03 pm
by xinux
It has been a very long time but I thought there was a opcode to remove a recipe or I could have my games mixed up but if there is you would need to cycle through the players current list removing them all from the client then resend them.
Re: Suggestion...
Posted: Wed Jan 17, 2018 6:58 pm
by Jabantiz
xinux wrote: Wed Jan 17, 2018 6:03 pm
It has been a very long time but I thought there was a opcode to remove a recipe or I could have my games mixed up but if there is you would need to cycle through the players current list removing them all from the client then resend them.
Now that you mention it I do seem to remember recipes you could only craft a certain number of times before they vanished, don't know if we ever got a collect of that or if live still does that. Figuring out that opcode is probably the only way to clear the clients list, not fond of sending that packet for each recipe though as that could be thousands of packets for a single player, unless that opcode allows an array of recipes. Something to look into at least, thanks Xinux.
Re: Suggestion...
Posted: Thu Jan 18, 2018 7:03 am
by Ememjr
Jabantiz wrote: Wed Jan 17, 2018 6:58 pm
xinux wrote: Wed Jan 17, 2018 6:03 pm
It has been a very long time but I thought there was a opcode to remove a recipe or I could have my games mixed up but if there is you would need to cycle through the players current list removing them all from the client then resend them.
Now that you mention it I do seem to remember recipes you could only craft a certain number of times before they vanished, don't know if we ever got a collect of that or if live still does that. Figuring out that opcode is probably the only way to clear the clients list, not fond of sending that packet for each recipe though as that could be thousands of packets for a single player, unless that opcode allows an array of recipes. Something to look into at least, thanks Xinux.
yes live still has limited use recipes, i have seen single use and 3x use ones in my ventures
Re: Suggestion...
Posted: Thu Jan 18, 2018 8:55 am
by Gangrenous
What would you say the cause is? All of my recipes are custom, can you think of anything that would cause this?