Go Back   RunUO - Ultima Online Emulation > RunUO > Core Modifications > Network Modifications

Network Modifications This forum is for modifications to the networking code of RunUO

Reply
 
Thread Tools Display Modes
Old 02-10-2006, 03:36 PM   #1 (permalink)
Connection Reset by Peer
 
Join Date: Jan 2003
Posts: 676
Default Guild Chat using \

I've programmed guild chat using \ for my personal shard, and thought it might be a good idea to share.
The code really does need cleaning up, and I'm planning to do that in a day or two. I have not implemented Alliance chat. At the moment, this is just changed to Guild chat, as the functions necessary for checking alliances are not in the core (as far as I can see, if anyone knows otherwise, please tell me).

There are two files to modify.

File 1: Network\PacketHandlers.cs
Find:
Code:
	public enum MessageType
	{
		Regular = 0x00,
		System = 0x01,
		Emote = 0x02,
		Label = 0x06,
		Focus = 0x07,
		Whisper = 0x08,
		Yell = 0x09,
		Spell = 0x0A,
		Encoded = 0xC0
	}
Replace with:
Code:
	public enum MessageType
	{
		Regular = 0x00,
		System = 0x01,
		Emote = 0x02,
		Label = 0x06,
		Focus = 0x07,
		Whisper = 0x08,
		Yell = 0x09,
		Spell = 0x0A,
		Guild = 0x0D,
		Alliance = 0x0E,
		Encoded = 0xC0
	}
File 2: Network\Mobile.cs
Find:
Code:
			switch ( type )
			{
				case MessageType.Regular: m_SpeechHue = hue; break;
				case MessageType.Emote: m_EmoteHue = hue; break;
				case MessageType.Whisper: m_WhisperHue = hue; range = 1; break;
				case MessageType.Yell: m_YellHue = hue; range = 18; break;
				default: type = MessageType.Regular; break;
			}
Replace with:
Code:
			switch ( type )
			{
				case MessageType.Regular: m_SpeechHue = hue; break;
				case MessageType.Emote: m_EmoteHue = hue; break;
				case MessageType.Whisper: m_WhisperHue = hue; range = 1; break;
				case MessageType.Yell: m_YellHue = hue; range = 18; break;
				case MessageType.Guild: break;
				case MessageType.Alliance: type = MessageType.Guild; break;
				default: type = MessageType.Regular; break;
			}
Find:
Code:
			SpeechEventArgs regArgs = new SpeechEventArgs( this, text, type, hue, keywords );

			EventSink.InvokeSpeech( regArgs );
			m_Region.OnSpeech( regArgs );
			OnSaid( regArgs );
Replace with:
Code:
			SpeechEventArgs regArgs = new SpeechEventArgs( this, text, type, hue, keywords );

			if ( type == MessageType.Guild )
			{
				if ( this.Guild != null )
				{
					BaseGuild guild = this.Guild;
					foreach ( Mobile m in World.Mobiles.Values )
					{
						if ( m.Player )
						{
							if ( m.Guild == guild )
							{
								m.OnSpeech( regArgs );

								NetState ns = m.NetState;

								Packet regp = null;

								if ( ns != null )
								{
									if ( regp == null )
										regp = new UnicodeMessage( m_Serial, Body, type, hue, 3, m_Language, Name, text );

									ns.Send( regp );
								}

							}
						}
					}
				}

				return;
			}

			EventSink.InvokeSpeech( regArgs );
			m_Region.OnSpeech( regArgs );
			OnSaid( regArgs );
This should provide working guild chat. It has been rigously tested on my server, but I make no guarantees that it won't eat your world save, or something (even though it doesn't touch it ).

If you find any bugs or have any ideas for improvements, please inform me.

Remember that using a modified core means that you may not recieve script support!

Last edited by tejster24; 02-11-2006 at 08:09 PM.
tejster24 is offline   Reply With Quote
Old 02-10-2006, 05:29 PM   #2 (permalink)
 
Join Date: Feb 2006
Location: Québec
Age: 20
Posts: 1
Default

This is very usefull! Thanks to share with us.
SchopenHauer is offline   Reply With Quote
Old 02-10-2006, 08:41 PM   #3 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
Default

although since this IS a core mod it would cause loss of all future script support.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline   Reply With Quote
Old 02-11-2006, 04:39 AM   #4 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

This is the core mod forum, hopefully you don't post that to any core modification here :-)

Personally I didn't even know that guild and alliance chat was there... Good to know *g*

Last edited by Irian; 02-11-2006 at 04:44 AM.
Irian is offline   Reply With Quote
Old 02-11-2006, 07:29 AM   #5 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
Default

Quote:
Originally Posted by Irian
This is the core mod forum, hopefully you don't post that to any core modification here :-)

Personally I didn't even know that guild and alliance chat was there... Good to know *g*
Huh. I was just letting the person know that IF they do the core mod then they probably won't get help on their custom scripts if they have problems in the future. I did know the guild chat existed, but since the current guild system is disabled by default it doesn't really matter, unless you go through several locations and re-enable it, then you would probably want to be able to use this, or an ALTERNATIVE that does NOT require a core mod, just use Knives Chat that has or can have a guild chat option...
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline   Reply With Quote
Old 02-11-2006, 02:05 PM   #6 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

I think the God of OffTopics will punish me for that, but...

How do we know, who uses a modified core? Does someone make a list, everytime somebody posts here? How does this person know if the person actually uses the core mod? How do I get this list, to know who I may answer to? :-)
Irian is offline   Reply With Quote
Old 02-11-2006, 06:18 PM   #7 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
Default

Quote:
Originally Posted by Irian
I think the God of OffTopics will punish me for that, but...

How do we know, who uses a modified core? Does someone make a list, everytime somebody posts here? How does this person know if the person actually uses the core mod? How do I get this list, to know who I may answer to? :-)
We know this cause when they compile it it changes the version number of runuo from the one the exe shows when they post their crash logs.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline   Reply With Quote
Old 02-11-2006, 07:39 PM   #8 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

Ok, it's an argument, but hopefully most of the custom scripts won't crash the server, so it will be hard to determinate if it's a modified core :-)
Irian is offline   Reply With Quote
Old 02-11-2006, 08:08 PM   #9 (permalink)
Connection Reset by Peer
 
Join Date: Jan 2003
Posts: 676
Default

Personally, I can't see this interfering with anything else, but just in case, I'll add a notice to the first post.
tejster24 is offline   Reply With Quote
Old 03-01-2006, 11:09 PM   #10 (permalink)
Forum Expert
 
Join Date: Jan 2003
Posts: 564
Default

i think people say that you are going to loose support if you use a modified core thinking in the worst possibility (for example, you came here with a completelly "new" core for runuo totally diferent from the current one and want support for something that isn't working well)...

i consider this type of modification as a "patched core" not a "modified core".

small well coded "patches" have no chance to make things don't work.
__________________
UO Central: O Mistério do Oculto
(Free Shard Brasileiro)

brodock is offline   Reply With Quote
Old 03-01-2006, 11:32 PM   #11 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
Default

Quote:
Originally Posted by brodockbr
i think people say that you are going to loose support if you use a modified core thinking in the worst possibility (for example, you came here with a completelly "new" core for runuo totally diferent from the current one and want support for something that isn't working well)...

i consider this type of modification as a "patched core" not a "modified core".

small well coded "patches" have no chance to make things don't work.
This is a CORE MODIFICATION, a patch would be released OR approved by a developer. Modified (or patched as you call it) cores are not supported cause it COULD be because of how you compiled the core OR something you did in the core that made the script have errors. So that is why they are not supported.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline   Reply With Quote
Old 03-02-2006, 06:36 AM   #12 (permalink)
Forum Expert
 
jaynigs's Avatar
 
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
Default

Hmm there is a sticky at the very top of the core modifications subforum, is there any need to reiterate it inside threads? i mean this is the core modifications forum and the sticky posted by quantos should be enough of a reminder.

My personal opinion is that the non support of slightly modified cores is an unhelpful gesture to what is meant to be an open source project, and its quite obvious to anyone who knows what they are looking for that a problem has occured from a core modification usually from the server crashlog. with or without the build number.

We all should be helping each really, some bugfixes need to be fixed by a shard owners and sometimes waiting for an official fix isn't an option when you are trying to proffesionally run a shard.

But, thus, i dont make the rules.....
jaynigs is offline   Reply With Quote
Old 03-16-2006, 02:51 PM   #13 (permalink)
Forum Expert
 
Join Date: Sep 2002
Age: 23
Posts: 1,472
Default

Quote:
Originally Posted by jaynigs
Hmm there is a sticky at the very top of the core modifications subforum, is there any need to reiterate it inside threads? i mean this is the core modifications forum and the sticky posted by quantos should be enough of a reminder.

My personal opinion is that the non support of slightly modified cores is an unhelpful gesture to what is meant to be an open source project, and its quite obvious to anyone who knows what they are looking for that a problem has occured from a core modification usually from the server crashlog. with or without the build number.

We all should be helping each really, some bugfixes need to be fixed by a shard owners and sometimes waiting for an official fix isn't an option when you are trying to proffesionally run a shard.

But, thus, i dont make the rules.....
I agree, if this stigma regarding core modifications continues, people will never bother modifying or improving the core components of RunUO.
Ravatar is offline   Reply With Quote
Old 03-16-2006, 05:23 PM   #14 (permalink)
Connection Reset by Peer
 
Join Date: Jan 2003
Posts: 676
Default

Quote:
Originally Posted by Ravatar
I agree, if this stigma regarding core modifications continues, people will never bother modifying or improving the core components of RunUO.
I also agree - it's little wonder that there are so few threads in the Core Modifications section.
tejster24 is offline   Reply With Quote
Old 03-16-2006, 06:51 PM   #15 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by Irian
Ok, it's an argument, but hopefully most of the custom scripts won't crash the server, so it will be hard to determinate if it's a modified core :-)
That's exactly the point, in any case lets stop arguing about this.
It's very clear that modified core does not get supported in the script support forum.
If a user will post a thread with modified core it'll either get locked or deleted, that's the end of this discussion.

Now let the thread owner take control over his own thread and stop arguing about something you can't change.
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Reply

Bookmarks


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5