Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Ultima SDK

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 05-10-2008, 01:01 AM   #1 (permalink)
Master of the Internet
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,231
Lightbulb Ultima SDK 2.1

Some of you may have noticed that, if you try to use the StringList (Clilocs) with the SDK 2.0, you'll experience a nasty crash.

Thankfully, Zippy provided a fix for this issue, so I was able to integrate the fix into the SDK.

This 2.1 version is for use with RunUO 2.0 (.Net 2.0); I've uploaded the DLL and the source.

Admins: this thread could use a sticky.

Enjoy!
Attached Files
File Type: zip Ultima SDK 2.1.zip (21.2 KB, 232 views)
File Type: zip Ultima SDK 2.1 Source.zip (30.1 KB, 179 views)
Joeku is offline   Reply With Quote
Old 05-10-2008, 04:49 AM   #2 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,335
Default

I'd like to see an official RunUO SVN put up for the Ultima SDK. There have been a lot of fixes posted, but the lack of a central repository is resulting in lots of different versions of the SDK floating around. It would be good to have a place to submit bug fixes and improvements to so we could have one version with all the fixes in it.
__________________
HellRazor is online now   Reply With Quote
Old 05-10-2008, 11:06 AM   #3 (permalink)
Master of the Internet
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,231
Default

That would be very nice.

Here's an example of how to use the new StringList methods:
Code:
using System;
using Server;
using Ultima;

namespace Joeku.Test
{
	public class Test_Main
	{
		public static StringList StringList = new StringList( "ENU" ); // Initialize an instance of the StringList.

		public static void Initialize()
		{
			// If you want to simply convert a cliloc into a string...
			Console.WriteLine( StringList.Table[1076267] ); // Boiling Cauldron
				// Boiling Cauldron

			// If you want to format a cliloc with args...
			Console.WriteLine( StringList.Format( 1070749, "John", "Amy" ) ); // ~1_val~ has joined ~2_val~.
				// John has joined Amy.

			// If you want to format a cliloc with a single arg string that is separated by tabs...
			string args = "Jim\tKelly"; // "\t" is the Tab character
			Console.WriteLine( StringList.SplitFormat( 1070749, args ) ); // ~1_val~ has joined ~2_val~.
				// Jim has joined Kelly.
		}
	}
}
Fully compiled and functional with RunUO 2.0 RC2.
Joeku is offline   Reply With Quote
Old 05-23-2008, 08:34 AM   #4 (permalink)
Newbie
 
i_am_neo's Avatar
 
Join Date: Jan 2008
Location: Warsaw, Poland
Age: 21
Posts: 97
Send a message via MSN to i_am_neo
Default

Umm... Is it supposed to work with RunUo 2.0 RC1?? Cause for me it doesn't seem to work (fatal errors)
__________________
|Heavenly Item System|Neo's Level System|
If anyone knows, how to put links here, please msg me.
i_am_neo is offline   Reply With Quote
Old 05-27-2008, 01:38 PM   #5 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,763
Default

Quote:
Originally Posted by i_am_neo View Post
Umm... Is it supposed to work with RunUo 2.0 RC1?? Cause for me it doesn't seem to work (fatal errors)
it has nothing to do with runuo. its for making 3rd party applications like pandora's box
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 05-27-2008, 03:04 PM   #6 (permalink)
Master of the Internet
 
Join Date: Mar 2006
Location: Germany
Age: 17
Posts: 14,280
Send a message via AIM to Suil Ban Send a message via MSN to Suil Ban
Default

...though parts of it, such as StringList, are useful when combined with RunUO.
__________________
the runuo community has lost sight
Suil Ban is offline   Reply With Quote
Old 05-27-2008, 04:05 PM   #7 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,335
Default

Don't .NET DLL's and the programs they are used with need to be compiled with the same version of .NET?

Just wondering because I know I tried to use ultima.dll compiled under .NET 2.0 with a 1.3 compiled version of Pandora's Box and it wouldn't work, Pandora would just crash.
__________________
HellRazor is online now   Reply With Quote
Old 05-27-2008, 04:20 PM   #8 (permalink)
Master of the Internet
 
Join Date: Mar 2006
Location: Germany
Age: 17
Posts: 14,280
Send a message via AIM to Suil Ban Send a message via MSN to Suil Ban
Default

Use the csc.exe from the framework you wish to target.
__________________
the runuo community has lost sight
Suil Ban is offline   Reply With Quote
Old 08-15-2008, 05:08 AM   #9 (permalink)
Forum Novice
 
Varchild's Avatar
 
Join Date: Jan 2004
Location: Gorizia - Italy
Age: 27
Posts: 186
Send a message via ICQ to Varchild Send a message via MSN to Varchild
Default

A simple question.

Why not use a Dictionary instead of a Hastable in StringList?
__________________
Dies Irę, dies illa
solvet sęclum in favilla

Developer only on
Midgard Shard
Varchild is offline   Reply With Quote
Old 08-24-2008, 01:54 PM   #10 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,335
Default

(Edit - Found some problems with this, will re-post it once I have the kinks worked out!)

ULTIMA SDK 2.2
--------------------

1. New Feature: You can now specify the UO directory path for use with the SDK by using the MyPath property. Here's an example:

Ultima.FileIndex.MyPath = "C:/My UO Directory";

If MyPath is null or empty, the SDK will continue to use the system registry for the UO install path as before.

2. Bug Fix: Fixed a problem with the SDK being sometimes unable to read the UO install data from the system registry of Windows 64 Bit operating systems (due to Wow6432Node being inserted into the registry path under those OS').

Compiled under .NET Framework 2.0.

Hope you find the updates useful!
__________________

Last edited by HellRazor; 08-24-2008 at 05:55 PM.
HellRazor is online now   Reply With Quote
Old 08-25-2008, 04:49 PM   #11 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,763
Default

Quote:
Originally Posted by Varchild View Post
A simple question.

Why not use a Dictionary instead of a Hastable in StringList?
Dictionary is slow.
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 08-25-2008, 07:28 PM   #12 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hic sunt leones ...
Age: 21
Posts: 1,279
Send a message via MSN to arul
Default

Quote:
Originally Posted by Jeff View Post
Dictionary is slow.
In what parallel universe do you live in?
__________________
Angels are falling the very last time, down they're burning in hate and decline, unfaithful and violent we're breaking the spell, we're god, we're scissor, in heaven and hell!
arul is offline   Reply With Quote
Old 08-25-2008, 07:33 PM   #13 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,763
Default

Quote:
Originally Posted by arul View Post
In what parallel universe do you live in?
I'm pretty sure I've read that in a MS article for XNA, perhaps I'm wrong, however, come to think of it, i guess its faster since you don't have to box and unbox, so disregard my comment. One thing i do wish Dictionary didnt do was through a KeyNotFoundExcetion, just return null for damn sake....
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 08-25-2008, 07:40 PM   #14 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hic sunt leones ...
Age: 21
Posts: 1,279
Send a message via MSN to arul
Default

SomeObj val;
dictionary.TryGetValue(key, out val);

Yeah but I agree that with those constructions the code looks a little ugly.
__________________
Angels are falling the very last time, down they're burning in hate and decline, unfaithful and violent we're breaking the spell, we're god, we're scissor, in heaven and hell!
arul is offline   Reply With Quote
Old 08-25-2008, 10:22 PM   #15 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,763
Default

Quote:
Originally Posted by arul View Post
SomeObj val;
dictionary.TryGetValue(key, out val);

Yeah but I agree that with those constructions the code looks a little ugly.
Point is, its not a straight replacement, especially with this SDK, i believe I tried to juts replace it once and got issues with the NoKeyFoundException, got lazy and stopped
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 08-26-2008, 11:32 AM   #16 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,335
Default

Hey Jeff (or anyone else who can help):

I am attempting to modify the DLL to allow the the path to the UO directory to be changed programically from the calling application.

I've tried using a public static variable to hold the file path, which is then used in FileIndex.cs. The problem I am running into is that once the path to the UO client has been set the first time, the DLL always uses that path, even when the static public variable has changed.

Can anyone give me an idea as to why this happens and what I can do to work around it?

Thanks!
__________________
HellRazor is online now   Reply With Quote
Old 08-26-2008, 12:04 PM   #17 (permalink)
Newbie
 
Lord Mashadow's Avatar
 
Join Date: Apr 2008
Location: Turkey
Posts: 27
Send a message via MSN to Lord Mashadow Send a message via Skype™ to Lord Mashadow
Default

My idea is to use InvalidateProperties() in the "set" constructor. Since it reads the path once, probably we need to trigger it again to get the current value, I hope... :/

Last edited by Lord Mashadow; 08-26-2008 at 12:07 PM.
Lord Mashadow is offline   Reply With Quote
Old 08-26-2008, 02:24 PM   #18 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,763
Default

Quote:
Originally Posted by HellRazor View Post
Hey Jeff (or anyone else who can help):

I am attempting to modify the DLL to allow the the path to the UO directory to be changed programically from the calling application.

I've tried using a public static variable to hold the file path, which is then used in FileIndex.cs. The problem I am running into is that once the path to the UO client has been set the first time, the DLL always uses that path, even when the static public variable has changed.

Can anyone give me an idea as to why this happens and what I can do to work around it?

Thanks!
Ya you would have to re-initialize the FileIndexes when the path is changed, kind of a pain in the ass, but doable.
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 08-26-2008, 03:05 PM   #19 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,335
Default

Quote:
Originally Posted by Jeff View Post
Ya you would have to re-initialize the FileIndexes when the path is changed, kind of a pain in the ass, but doable.
I thought it might be something like that. How should I go about doing it? I'm a little lost on how to proceed. Something like Lord Mashadow suggested?
__________________
HellRazor is online now   Reply With Quote
Old 08-26-2008, 08:46 PM   #20 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,763
Default

Well for instance Animations.cs you would do this

Code:
        private static FileIndex m_FileIndex = new FileIndex( "Anim.idx", "Anim.mul", 0x40000, 6 );
        public static FileIndex FileIndex{ get{ return m_FileIndex; } }

        private static FileIndex m_FileIndex2 = new FileIndex( "Anim2.idx", "Anim2.mul", 0x10000, -1 );
        public static FileIndex FileIndex2{ get{ return m_FileIndex; } }

        private static FileIndex m_FileIndex3 = new FileIndex( "Anim3.idx", "Anim3.mul", 0x20000, -1 );
        public static FileIndex FileIndex3{ get{ return m_FileIndex; } }

        static Animations()
        {
            Initialize();
        }

        public static void Initialize()
        {
            Utility.EnsureClose(m_FileIndex);
            Utility.EnsureClose(m_FileIndex2);
            Utility.EnsureClose(m_FileIndex3);

            m_FileIndex = new FileIndex("Anim.idx", "Anim.mul", 0x40000, 6);
            m_FileIndex2 = new FileIndex("Anim2.idx", "Anim2.mul", 0x10000, -1);
            m_FileIndex3 = new FileIndex("Anim3.idx", "Anim3.mul", 0x20000, -1);
        }
Then make a Utility function EnsureClose
Code:
        public static void EnsureClose(FileIndex fileIndex)
        {
            if (fileIndex != null && fileIndex.Stream != null)
            {
                fileIndex.Stream.Close();
            }
        }

Be sure you inlude your custom paths, and whenenver the custom path changes call Animations.Initilize();, just do this for each class that has a FileIndex in it.
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 08-27-2008, 12:59 AM   #21 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,335
Default

Thanks for the help Jeff, I really appreciate it!
__________________
HellRazor is online now   Reply With Quote
Old 08-29-2008, 03:25 PM   #22 (permalink)
Forum Expert
 
Join Date: Dec 2006
Location: uosecondage.com
Age: 36
Posts: 391
Default

Thanks very much for making this available, however there's something up with the source.zip. I can't open with WinRAR or Windows Explorer. Wrong filetype?
ErikDivinityT2A is offline   Reply With Quote
Old 08-29-2008, 03:27 PM   #23 (permalink)
Forum Expert
 
Join Date: Dec 2006
Location: uosecondage.com
Age: 36
Posts: 391
Default

Quote:
Originally Posted by ErikDivinityT2A View Post
Thanks very much for making this available, however there's something up with the source.zip. I can't open with WinRAR or Windows Explorer. Wrong filetype?
Figured it out. This is a gzipped tar. Rename to .tgz and WinRAR will open.
ErikDivinityT2A is offline   Reply With Quote
Old 08-29-2008, 06:36 PM   #24 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,763
Default

Quote:
Originally Posted by ErikDivinityT2A View Post
Figured it out. This is a gzipped tar. Rename to .tgz and WinRAR will open.
thats not the zip its a problem with the forums...
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes
Linear Mode Lin