|
||
|
|
#1 (permalink) |
|
Join Date: Jul 2006
Age: 26
Posts: 1
|
Hi there,
I've been searching the net for way to long now to try and find a way to get various data from UO. About a year ago I was developing a new auction/shop web site for UO (that would hopefully support non-OSI servers) but I had to abandon the project due to time constraints, most of my time was consumed with manual data entry, meaning entering every type of craftable etc into a database, as you can imagine, this was a tad mind numbing. So what I want really is to be able to export this information directly from the game. I need things like all types of armor,weapon,shield,jewlery (including data like str req,medable etc), and more or less anything that you can sell. Also things like all possible item properties(spell effects,stats,etc. etc.) and their value ranges,type of buildings and sizes (althought I already have most of this data for OSI servers), and...well you get the idea. Obviously this information is stored somewhere, but where I don't know, and as for accessing it well, maybe if I had the lives of a cat. Also when I say export items, I dont mean like every item on the server (i.e. player made) just the different types (chainmail tunic,platemail tunic etc.) So I thought I'd come to the one place where I thought I might get an answer to try and put an end to the misery. If this is possible and can be made to be straight forward it would be possible to have support for non-OSI servers with a simple "export" of their item database. The reason for such complexity (compared to something like uo-auction2) is because the main basis of the site is to be able to find EXACTLY what you want. And if I manage to get that far, I was also thinking about being able to export item data directly from the game, i.e. items in your backpack and their properties (pref without using euo) Anyway I've babbled enough, I just want closure Thanks in advance to all advice Sorry if it doesn't seem appropriate to the forum, couldn't think what else to try. This is going to be developed with ASP.NET(VB.NET). Cheers D |
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
|
Code:
static Hashtable m_Classes = new Hashtable( new CaseInsensitiveHashCodeProvider( ), new CaseInsensitiveComparer( ) );
public static void Configure( )
{
//Get ALL Constructors for Type "Item"
Type[] types = Assembly.GetAssembly( typeof( Item ) ).GetTypes( );
foreach( Type type in types )
{
//Double-Check the Constructors and add Valid Items to Hashtable
if( type.IsSubclassOf( typeof( Item ) ) && !type.IsAbstract )
{
m_Classes.Add( type.FullName, type.GetConstructor( new Type[0] ).Invoke( new object[0] ) );
}
}
foreach( Item item in m_Classes.Values )
{
if( item != null && !item.Deleted )
{
Console.WriteLine("Found Item Class: "+item.GetType().FullName.ToString());
}
}
}
WARNING! This code WILL create one instance of every item on your server, if you have 10,000 scripts that derive Item, you're gonna get 10,000 new items created outta no-where. You can just use this to gather and store Type Names instead of creating an instance of the item... Creating the instances of Item has advantages because you can access it like you would normally, being able to gather a wealth of information on each Item. You can do tests for special items too!
__________________
![]() WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard Last edited by Vorspire; 05-19-2008 at 01:38 AM. |
|
|
|
|
|
#6 (permalink) | |
|
Forum Expert
Join Date: Oct 2002
Age: 45
Posts: 4,372
|
Quote:
![]() Thanks for the code example. |
|
|
|
|
|
|
#7 (permalink) |
|
Forum Expert
|
No problem.
There are many great uses for this, i have used it to register donation items, armor "sets" and a special Ability system, it's very neat code and can be VERY helpful. With this code, i am able to get instances of classes, like all Items, invoke them and get all of their ItemID's... which i can store for a special system or gump or export to a file or database... you can even use this to save and load in serializes, you can simply save the Type Name as a string... since there are never two Type Names that are the same, it can be good to use them for indexing other things, or even encrypting them to get a new serial #, which will always be unique.
__________________
![]() WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|