|
||
|
|
#1 (permalink) |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
Summary:
World Spy allows to view, navigate and edit the RunUO world file. Supports mobiles, items, accounts and guilds and allows the user to edit any of these objects' properties. Description: This script is actually somewhere in between a script and a standalone program. While it is started by running RunUO, it creates a classical windows program rather than adding functionality to the server. Once you install the script, you can start RunUO using a -WorldSpy switch ( in other words "Server.exe -WorldSpy" ). When this switch is used, the WorldSpy script will be run and will lock down the server to prevent players from logging in. Then it will run the actual program window. The current version (1.0 Beta) can view items, mobiles, accounts and guilds and can perform various searches for types, accounts, guilds or item/mobile/player names. Once you find an object you wish to edit, you can select it and all its properties will be displayed in a property browser. You can then edit any properties that allow editing. Once an object is selected, you can also view a hierarchical representation of its relationships. For example, if you choose a PlayerMobile you will see a tree node with the player's name, and under this node you will see all the items the player is carrying, its bankbox, the guild, account and so on. You can then open the bankbox node to see the items inside the player's bank. You can delete any object from the world (even accounts, players and guilds, so be careful and always backup your worldfile!). Deleting can be done by either using the small Delete button (which deletes the object currently selected and displayed in the properties viewer) or the wider 'Delete selected items" button which deletes all the objects selected in the list view in the lower portion of the screen. The current release should be considered a beta because it hasn't been tested much. ALWAYS BACKUP YOUR WORLD FILE BEFORE USING WORLD SPY! Please don't come crying to me if you delete something you didn't want to, I warned you to backup! Please report any bugs and suggestions either in this thread, or at http://arya.runuo.com/ Installation: 1. Copy the following files anywhere inside your RunUO\Scripts folder: WorldSpy.cs WorldSpyForm.cs 2. Browse to ..\RunUO\Data and open the file Assemblies.cfg in notepad. Add the following lines at the end: System.Windows.Forms.dll System.Drawing.dll * There's a small chance you already might have those entries in Assemblies.cfg. If so, ignore this step. 3. Run RunUO from the command line using the following syntax: Server.exe -WorldSpy Updates Version 1.0 Beta Revision 1 (March 16, 2004) - Fixed a potential crash for items whose Map property is set to null - Added a check for changes when closing the program using the windows X icon. Version 1.0 Beta Revision 2 (April 9, 2004) - Compatibility update for RunUO 1.0 RC0. Get WorlsSpyRC0.zip for RunUO 1.0, use WorldSpy.zip for Beta 36.
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
#2 (permalink) |
|
Connection Reset by Peer
Join Date: Jan 2003
Posts: 676
|
When I run RunUO with the -WorldSpy switch, I get: (this is copied from a dialog box, and is all the error I recieve)
Code:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at TheBox.WorldSpy.WorldSpyForm.DisplayEntities(ArrayList list)
at TheBox.WorldSpy.WorldSpyForm.WorldSpyForm_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
Server
Assembly Version: 1.0.1425.4527
Win32 Version: 1.0.1425.4527
CodeBase: file:///D:/Program%20Files/RunUO/Server.exe
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
Scripts.CS
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///D:/Program%20Files/RunUO/Scripts/Output/Scripts.CS.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
TemplateIntefaces
Assembly Version: 1.0.1163.26561
Win32 Version: 1.0.1163.26561
CodeBase: file:///D:/Program%20Files/RunUO/TemplateIntefaces.DLL
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/winnt/assembly/gac/system.runtime.remoting/1.0.5000.0__b77a5c561934e089/system.runtime.remoting.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///d:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
|
|
|
|
|
|
#4 (permalink) |
|
Connection Reset by Peer
Join Date: Jan 2003
Posts: 676
|
Code:
************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at TheBox.WorldSpy.WorldSpyForm.DisplayEntities(ArrayList list) in d:\Program Files\RunUO\Scripts\Custom\WorldSpy\WorldSpyForm.cs:line 871 at TheBox.WorldSpy.WorldSpyForm.WorldSpyForm_Load(Object sender, EventArgs e) in d:\Program Files\RunUO\Scripts\Custom\WorldSpy\WorldSpyForm.cs:line 604 at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Code:
foreach( IEntity entity in list )
{
string[] subItems = new string[ 5 ];
subItems[ 0 ] = entity.Serial.ToString();
subItems[ 1 ] = entity.GetType().Name;
Item item = entity as Item;
Mobile m = entity as Mobile;
if ( item != null && !item.Deleted )
{
if ( item.Name != null )
{
subItems[ 2 ] = item.Name;
}
else
{
subItems[ 2 ] = item.ItemData.Name;
}
}
else if ( m != null && !m.Deleted )
{
subItems[ 2 ] = m.Name;
}
subItems[ 3 ] = entity.Location.ToString();
subItems[ 4 ] = entity.Map.Name; // line 871
lstMaster.Items.Add( new ListViewItem( subItems ) );
}
Is it that some entities do not have a map assigned? |
|
|
|
|
|
#5 (permalink) |
|
Account Terminated
|
Arya
Can you run Server.exe with the -debug line or is that a line to run your application in debug mode. Its sad I am not familar csc addiational command ![]() I have to say. Your the first person including myself that has had runuo launch a program that references it. Wondering how you did it actually :-) I cannot for the life of me understand how you got the form to be able to read anything from runuo. Can you pm explaining the process, I have many things I could do if I understand, plus its interesting :-) |
|
|
|
|
|
#6 (permalink) |
|
Account Terminated
|
I am starting to understand what you did.
Strange the simplest code explains it. Code:
World.Save( false ); Clearly since RunUO launches the "form" and runuo is running, you access everything just as it was. Ayra you just gave me a killer idea :-) You mind if I use "your method" for a program I am working on? Its much better then trying to use xml ![]() |
|
|
|
|
|
#7 (permalink) |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
tejster24, the reason for this exception is a mobile or item on your server with the map value set to null which is something I didn't think was possible. Later on I'll post an update version, in the meantime you can workaround it at line 871:
Change: subItems[ 4 ] = entity.Map.Name; to: if ( entity.Map != null ) { subItems[ 4 ] = entity.Map.Name; }
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
#8 (permalink) | |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
Quote:
It's quite easy to display the form actually. The form class is written just like a normal application (except it misses a Main method), and the script that launches it just creates the form and shows it:Code:
WorldSpyForm form = new WorldSpyForm(); form.ShowDialog(); The downside of this method is that it can create the form only on the machine the server is running on, but then again is this desirable for my script. If you still need any help with it let me know and I'll gladly try ![]() PS: Don't you really know the -debug switch? It's the most useful switch ever, and I'm sure it's RunUO specific. It runs the server and compiles the scripts with debug symbols which means that crashlogs have line numbers (see above) and you also can attach a debugger and debug your scripts just like you would do with a classical program Priceless ![]()
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
|
#9 (permalink) |
|
Account Terminated
|
Krrios talked about it oh 5 -6 months never said how
I am thinking about a spawn "system" that can use the default spawners but organize certain aspects. Spawners would have groups, would display the group, the monsters, location, map, ect. You could export and import your spawners and submit the xml. I was original going to try to read the xml to make the list. But this is much better :-) Locking the server would actually I believe be good for this process. Would be "spawner" program. Different to the Area Spawner orb plans, but still useful. Would allow packages to be done, using the default, custom default spawners ( spawners with fixed creaure lists ). You could of course convert custom spawners -> default spawners via a different export command. |
|
|
|
|
|
#10 (permalink) |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
That's a good idea, but if you do it like I did it can only be run on the machine hosting the server, while spawning is often delegated to gamemasters or seers. You could consider doing it through .NET remoting (using the same system UOArchitect is using).
You could also make it spawner indipendent, using a filter class that converts a shard's spawner into a format recognized by your program. This is what I'm doing for the next version of Pandora's Box: you create a spawn group in my own format, send it to the .NET remoting object that converts it to a spawner appropriate for the server (I'll be providing filters for the default spawner and the xmlspawner, but it's easy to write a custom one). When it comes to Xml, it's very easy to use if your classes are Xml serializable and you don't have to write and read each node manually. It takes 4 lines of code to read or write an Xml file. Here are the generic methods I'm using: Code:
public static object LoadXml( Type type, string filename )
{
try
{
FileStream stream = new FileStream( filename, FileMode.Open, FileAccess.Read, FileShare.Read );
XmlSerializer serializer = new XmlSerializer( type );
object obj = serializer.Deserialize( stream );
stream.Close();
return obj;
}
catch
{
return null;
}
}
public static bool SaveXml( object obj, string filename )
{
try
{
FileStream stream = new FileStream( filename, FileMode.Create, FileAccess.Write, FileShare.Read );
XmlSerializer serializer = new XmlSerializer( obj.GetType() );
serializer.Serialize( stream, obj );
stream.Close();
return true;
}
catch
{
return false;
}
}
Also if you only deal with spawners you won't probably need to lockdown, you can add code to check if a spawn is used by testing if any players are fighting the spawn creatures. Well I'm just throwing ideas Good luck with your project! ![]()
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
#11 (permalink) |
|
Join Date: Nov 2002
Posts: 636
|
Well, i am using a windows form just like this to edit account information. Just a reminder for people who want to use this, if you are using some custom scripts (Cats Jail as an example, i guess most people use this one), you will have problem unless you do the necessasy changes for the those scripts as well..
i havent looked the script but overall it sounds very nice :) |
|
|
|
|
|
#12 (permalink) | |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
Quote:
If you know of specific issues that can occur, can you let me know so I can try and address them in my code? Thanks! ![]()
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
|
#13 (permalink) |
|
Forum Expert
Join Date: Jan 2004
Posts: 1,377
|
Although my knowledge isn't enough to fully understand this script, I can tell it's great
![]() I have only used it for deleting a few items i couldn't get to with the client so far but it works without any flaws. Thank you very much!
__________________
Dracarys retired - consider me dead to these boards |
|
|
|
|
|
#14 (permalink) |
|
Account Terminated
|
Well
The tool I want to make is sort of an "Admin" tool. Would be used to load up a donated xml spawner file. Then the admin could change the spawner(s). I would have to look into how to doing something like UOArchitect if I wanted to make the remote version of the tool. I am not sure what I want to do :-) Outkast wants to do a similar program, I might work with him perhaps we can make something really good that way. I hate making a program that is already done in another program. Problem with map making today, so many programs that never get updated. Orb is solving that though with their tools. Either tool I speak of would be different then Area Spawner program, that they are working on. I am not sure ![]() |
|
|
|
|
|
#15 (permalink) |
|
bow before me.. or perish
|
I am very impressed, Arya. I love it! Loaded my test world file fine. Very nice.
__________________
http://www.dominusexuro.com/ |
|
|
|
|
|
#16 (permalink) |
|
Join Date: Oct 2002
Age: 23
Posts: 4,689
|
I havent tested the power of this program yet, although I was wondering if -
1) would it be possible to add batch commands that you could do on items/mobiles 2) would it be possible to change the derived class that an object comes from? In essence changing the parent class Item to BaseItem (and using batch commands to do it to every item)? |
|
|
|
|
|
#17 (permalink) | |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
Quote:
2. This is somewhat complicated, and really out of scope for world spy. Changing the parent class must be done in the script, so say you have a MyItem derived from Item. You would need to create a second class MyItem2 derived from BaseItem and then perform the conversion from MyItem to MyItem2 ad hoc, specifying which properties are converted and how. As far as I know there's no way to change the base type of a class dynamically. Or maybe I didn't fully understand what you want to do ![]()
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
|
#21 (permalink) |
|
Account Terminated
|
Guys lose the god damn color words, its so anyoing.
This program allows you to edit the world and delete/edit items in the world. Read the first post and follow the directions. If you want help you will have to explain your question in more detail and do not use color, if you do, I won't help you. |
|
|
|
|
|
#22 (permalink) | |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
Quote:
If you can't understand what the script does from the description, you probably shouldn't use it or you just risk loosking your shard.
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
|
#24 (permalink) |
|
Join Date: Oct 2002
Age: 23
Posts: 4,689
|
Arya, I meant this.. You have lets say BaseArmor which derives from Item. If you change it IN SCRIPT to BaseArmor derives from BaseItem which derives from Item. Would it be possible, to prevent RunUO from loading the world (so you dont ruin the world trying to load it) with your script, and actually change the derivation of all items which use BaseArmor.
So instead of like PlateHelm -> BaseArmor -> Item you change it (in the world) to PlateHelm -> BaseArmor -> BaseItem -> Item granted these changes were already made in the code? Also, I do know that if BaseItem was a blank class, you could do that, but that does not help 90% of the people, becuase you cannot change it without corrupting the world regardless. If this is definately outside of the scope of your script, then I apologize, it was just a false hope then ![]() |
|
|
|