PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
.unloadall
Goto page 1, 2  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    PenUltima Online Forum Index -> Feature Suggestions
Display posts from previous:   

Author Message
MontuZ
Distro Developer


Joined: 10 Feb 2006
Posts: 293
Location: Myrtle Beach, South Carolina

PostPosted: Fri Feb 10, 2006 1:07 pm    Post subject: .unloadall Reply with quote

I know there is a way to script it. But... why not a default cmd?

.unloadall would, unload all loaded scripts, refresh unloaded scripts. And unload all loaded cfg files, including packaged cfg files. for faster unloading and development.

Author Message
Marilla



Joined: 02 Feb 2006
Posts: 329

PostPosted: Fri Feb 10, 2006 6:57 pm    Post subject: Reply with quote

Forgive me, but you seem to want a lot of core functions that duplicate easy-to-write script functions. I don't think this type of thing is good.

I also don't like 'default commands' at all; I want to have as much control over what happens with a command as possible.

Author Message
Adrian



Joined: 04 Feb 2006
Posts: 4
Location: Poland

PostPosted: Sat Feb 11, 2006 2:49 pm    Post subject: Reply with quote

There already is a builtin textcmd .unloadall which unloads all cached scripts. See: http://poldoc.fem.tu-ilmenau.de/builtintextcmds.php

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Mon Feb 13, 2006 1:55 am    Post subject: Reply with quote

ALWAYS be sure to RTFM at poldoc and the core-changes.txt please.

Author Message
FreeSoul



Joined: 04 Feb 2006
Posts: 90
Location: Aman

PostPosted: Fri Feb 24, 2006 1:23 am    Post subject: Reply with quote

MuadDib... make the sticky post with RTFM Smile

Author Message
MontuZ
Distro Developer


Joined: 10 Feb 2006
Posts: 293
Location: Myrtle Beach, South Carolina

PostPosted: Fri Feb 24, 2006 8:17 am    Post subject: Reply with quote

I know there's already .unloadall. I'm asking for a better one. Actually the current one doesn't even seem to do the job right for some reason.

Author Message
Hybrid



Joined: 26 Feb 2006
Posts: 1
Location: Sint-Niklaas, Belgium

PostPosted: Sat Mar 04, 2006 11:25 pm    Post subject: Reply with quote

.unload / .unloadall never failed for me before? If it's an npc script that fails to unload, make sure to delete and recreate it since the NPC uses the cached version of the script, even after .unloadall.

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 517

PostPosted: Sun Mar 05, 2006 12:23 am    Post subject: Reply with quote

As I read it, the original request asks for not only scripts to be unloaded but also cfg files - without having to specify them each by name.

Author Message
Marilla



Joined: 02 Feb 2006
Posts: 329

PostPosted: Sun Mar 05, 2006 12:56 am    Post subject: Reply with quote

Thing is, I don't understand the reason for an "unload all configs" command at all. Unloadall works on all scripts because you could quite possibly update a LOT of scripts all at once - say when you update a single frequently-used Include, and then compile all your scripts.

There is no such equivalent with configs, though; You have to 'manually' change one file to get it to need updating, so why should a command be hard-coded for something that could be scripted for whatever off-the-wall purpose it might ever be needed for; For example, say you go through and edit lots of itemdesc.cfg files; it's trivial to just unload all of those via a quick script.

Author Message
MontuZ
Distro Developer


Joined: 10 Feb 2006
Posts: 293
Location: Myrtle Beach, South Carolina

PostPosted: Sun Mar 05, 2006 2:34 am    Post subject: Reply with quote

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
CWO



Joined: 04 Feb 2006
Posts: 685
Location: Chicago, IL USA

PostPosted: Sun Mar 05, 2006 2:38 am    Post subject: Reply with quote

instead of restarting the server, my server has commands to just RestartScript(NPC) on the NPC.

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Sun Mar 05, 2006 8:21 am    Post subject: Reply with quote

Here is where a lot of people get a bit confused. You have to either restart the script of an npc (for example), or restart the server, becuase their AI(Script) is running, currently, and doesn't "end". That is why it has to be done. It cannot "change" it to the new code because it is still running. Same with Windows, when you do critical updates and have to reboot for them to take affect. They can't, cuz they are locked and running. Same thing here.

Author Message
Marilla



Joined: 02 Feb 2006
Posts: 329

PostPosted: Sun Mar 05, 2006 5:09 pm    Post subject: Reply with quote

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
MontuZ
Distro Developer


Joined: 10 Feb 2006
Posts: 293
Location: Myrtle Beach, South Carolina

PostPosted: Sun Mar 05, 2006 5:49 pm    Post subject: Reply with quote

It would be nice to update a cfg file, type 1 cmd and know that it's unloaded from memory and scripts will use the new data. In some cases .unloadcfg does unload it, but other times I have to restart and it's time consuming.

I understand the thing about npcs. Restart for all your NPCs IS reasonable. But for a Cfg file? every itemdesc i've tried to unload never unloads, even when I recompile all the scripts.

I could use a simple aux script, but I don't want to. Mainly besause I don't know how to yet.

But nevermind, you still don't get my point.

Author Message
Marilla



Joined: 02 Feb 2006
Posts: 329

PostPosted: Sun Mar 05, 2006 6:13 pm    Post subject: Reply with quote

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.

Post new topic   This topic is locked: you cannot edit posts or make replies.    PenUltima Online Forum Index -> Feature Suggestions All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty