| Author |
Message |
Adrian
Joined: 04 Feb 2006 Posts: 4 Location: Poland
|
|
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
MontuZ Distro Developer
Joined: 10 Feb 2006 Posts: 293 Location: Myrtle Beach, South Carolina
|
Posted: Sun Mar 05, 2006 2:34 am Post subject: |
|
|
Well if you update killpcs script you have to restart the server, you aren't going to .kill all 3000 npcs are you?
ANYWAY.
| Code: |
Use cfgfile;
Use polsys;
Use os;
Program textcmd_mount( Who )
Var CONFIG_FILES := {
":*:animxlate",
":*:armrdesc",
":*:armrzone",
":*:bannedips",
":*:boats",
":*:bowcraft",
":*:circles",
":*:cloth",
":*:cmds",
":*:combat",
":*:console",
":*:corpses",
":*:days",
":*:dyeitems",
":*:equip",
":*:food",
":*:golocs",
":*:guardedareas",
":*:incognito",
":*:innlocation",
":*:itemdesc",
":*:menus",
":*:movecost",
":*:mrcspawn",
":*:multis",
":*:names",
":*:nlootgroup",
":*:npcdesc",
":*:RankingList",
":*:repsys",
":*:servers",
":*:servspecopt",
":*:sets",
":*:skills",
":*:songs",
":*:speechgroup",
":*:spells",
":*:starteqp",
":*:startloc",
":*:teleporters",
":*:traveling",
":*:use_stuff",
":*:watch",
":*:wepndesc",
":*:xlate",
":aspoxitems:itemdesc",
":botanik:itemdesc",
":botanik:tree",
":chests:itemdesc",
":chests:lockpicking",
":commcrystals:itemdesc",
":decorations:itemdesc",
":delayfixes:itemdesc",
":doors:itemdesc",
":doors:door",
":dundee:itemdesc",
":dundee:dragonspeak",
":dundee:codex",
":dyteitems:itemdesc",
":dyteitems:dyeitems",
":guildstone:itemdesc",
":lighting:itemdesc",
":lockboxes:itemdesc",
":omnibind:itemdesc",
":omnibind:binding",
":races:itemdesc",
":runebook:itemdesc",
":shilitems:itemdesc",
":shilitems:usescriptdesc",
":training:itemdesc",
":treasuremap:itemdesc",
":treasuremap:guardians",
":treasuremap:treasure",
":ulitems:itemdesc",
":traps:itemdesc",
":zulugames:itemdesc",
":artificier:itemdesc",
":artificier:rituals",
":earth:shapeshift",
":holybook:itemdesc",
":necro:itemdesc",
":songbook:itemdesc",
":zulumagic:itemdesc",
":alchemy:itemdesc",
":alchemy:alchemy",
":alchemyplus:itemdesc",
":alchemyplus:alchemyplus",
":blacksmithy:itemdesc",
":blacksmithy:blacksmithy",
":camping:itemdesc",
":carpentry:itemdesc",
":carpentry:carpentry",
":cartography:itemdesc",
":cooking:cooking",
":cooking:itemdesc",
":cooking:grinding",
":fishing:itemdesc",
":fishing:sosarea",
":healing:healing",
":healing:itemdesc",
":herding:itemdesc",
":inscription:inscription",
":lumberjacking:itemdesc",
":mining:itemdesc",
":musicianship:itemdesc",
":snooping:itemdesc",
":snooping:stealme",
":stealing:itemdesc",
":tailoring:tailoring",
":tailoring:itemdesc",
":tinkering:itemdesc",
":tinkering:tinker",
":tracking:tracking",
":areas:itemdesc",
":areas:areas",
":auction:itemdesc",
":boat:itemdesc",
":combat:itemdesc",
":combat:enchantableitems",
":combat:hitscriptdesc",
":combat:modenchantdesc",
":combat:onhitscriptdesc",
":donators:itemdesc",
":donators:npcdesc",
":farming:itemdesc",
":farming:plants",
":hooks:attributes",
":hooks:checkskill",
":hooks:skillsdef",
":hooks:syshook",
":hooks:uoclient",
":hooks:uoskills",
":hooks:vitals",
":housing:itemdesc",
":loot:itemdesc",
":spawnpoint:itemdesc",
":spawnregion:spawngroups"
};
Foreach Effing_CFG in CONFIG_FILES
UnloadConfigFile( Effing_CFG );
Endforeach
Unload_Scripts();
ReloadConfiguration();
Foreach thing in ListObjectsInBox( 0, 0, -128, 6142, 4094, 128 )
If( thing.npctemplate )
RestartScript( thing );
Endif
SleepMS( 10 );
Endforeach
Endprogram
|
Got the idea yet?
Last edited by MontuZ on Sun Mar 05, 2006 2:54 am; edited 1 time in total |
|
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
Marilla
Joined: 02 Feb 2006 Posts: 329
|
Posted: Sun Mar 05, 2006 5:09 pm Post subject: |
|
|
As was noted above, you must restart any running control/AI script for it to take the new version. For NPC AI, that often means that a shard restart IS, in fact, necessary. There is nothing that the POL core itself should be doing to help here; a running program must be stopped before it can run the new version of itself.
BTW; if you want to restart all your NPCs, as was noted above as well, restarting all of the NPCs is a much better idea than killing them. (though restarting the shard itself is probably much easier. It is for things like this, though, that I have a regular, automatic 'daily maintenance' period on my shard)
As for your config file thing, two notes:
First; most of your listing of config files is redundant. You use wildcard entries at the top (the ones like :*:itemdesc), but then you ALSO list your itemdesc packaged files separately below. Perhaps you aren't aware that the :*: entries are wildcard entries? Below, you only need to list the specific packaged configs that you don't have the wildcard entries for above.
But second, and most important, Why? This is what I don't understand: Why do you need a way to unload ALL of your shard's config files at one time? Do you have some programmatic process that is going through updating massive numbers of your config files or something? If so, why don't you have that same process also connect to POL through a simple AUX script and send commands to unload only the exact configs that are being changed?
I just don't see any reason to force thrashing of ALL config data unless you really need to.
Scripts are a different matter here; The ability to unload all scripts IS needed frequently because changing a single include file can cause dozens of scripts to change and need to be unloaded. There are no "config includes", however. |
|
 |
|
|
 |
 |
|
 |
 |
| Author |
Message |
Marilla
Joined: 02 Feb 2006 Posts: 329
|
Posted: Sun Mar 05, 2006 6:13 pm Post subject: |
|
|
And you aren't getting our points; there are either reasons things work as they do, or there are much easier ways to do what you are trying to do.
What you are wanting is basically the equivalent of editing a Word document on your computer, saving it, and then forcing all your programs to reload everything from memory - even though only programs that have that specific Word document loaded need to just reload that one file. You don't need to close and re-open all your Excel files, Outlook E-Mails, Access Databases and Power Point presentations; Just that one Word document.
And if something you do to close and re-open that one Word document isn't working properly, you don't throw up your hands and just close everything; you figure out maybe why what you are doing isn't working. For instance, if you use Word to edit a startup file that Windows uses on booting up, you should expect to need to reboot Windows for it to take effect. Unloading ALL Office documents won't help.
And finally, I'll note this: To my knowledge, itemdesc is one of the configs that I don't believe you can really unload at all by the normal means. Recompiling scripts also has nothing to do with configs being loaded/unloaded. You also cannot add a new itemdesc.cfg somewhere and expect POL to know it's there, until you restart. Similarly, files like servers.cfg might be able to be 'reloaded' without causing an error - but it's not relevant, and won't take effect until a shard restart.
So again, it seems like you may just need to get a bit more comfortable with how the system is meant to work here. |
|
 |
|
|
|