RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Guild Chat using \

tejster24

Sorceror
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!
 

Irian

Page
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*
 

Greystar

Wanderer
Irian said:
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...
 

Irian

Page
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? :)
 

Greystar

Wanderer
Irian said:
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.
 

Irian

Page
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 :)
 

tejster24

Sorceror
Personally, I can't see this interfering with anything else, but just in case, I'll add a notice to the first post.
 

brodock

Sorceror
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.
 

Greystar

Wanderer
brodockbr said:
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.
 

jaynigs

Wanderer
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.....
 

Ravatar

Knight
jaynigs said:
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.
 

tejster24

Sorceror
Ravatar said:
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.
 

daat99

Moderator
Staff member
Irian said:
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.
 

kmekc

Wanderer
Hey you could limit the impact on the Core Modification when you place your Code from DoSpeech in PlayerMobile.cs. Cause there is no need to handle the guild speech in the core.
 

Kamron

Knight
because its a special Message Type, it is handled in the core. This has already been implimented in RunUO 2.0, so if you keep your core up to date, you should have the code.
 
Top