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

Other Cant find a category above, use this one! Core mods not listed above go here!

Reply
 
Thread Tools Display Modes
Old 06-16-2005, 11:52 PM   #1 (permalink)
The noob formerly known as Jakob
 
Serp's Avatar
 
Join Date: Jan 2005
Posts: 316
Default Work-around to make RunUO accept commands from the GM: prompt

I don't want to call this "fix" as the GM: prompt might show up to be something else than a thing for us to enter commands with.

Core
Network/PacketHandlers.cs
Add the line in red to the MessageType enum:
Code:
public enum MessageType
{
	Regular = 0x00,
	System = 0x01,
	Emote = 0x02,
	Label = 0x06,
	Focus = 0x07,
	Whisper = 0x08,
	Yell = 0x09,
	Spell = 0x0A,
	Encoded = 0xC0,
	GM = 0x0F,
}
Scripts
PlayerMobile.cs

Add the lines in red to the PlayerMobile class:
Code:
public class PlayerMobile : Mobile
{
	public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
	{
		if ( type == MessageType.GM ) // If the message is of type GM
			text = String.Format( "{0}{1}", Commands.CommandPrefix, text ); // then add the prefix to it
		base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
	}
Serp is offline   Reply With Quote
Old 06-18-2005, 12:53 AM   #2 (permalink)
Forum Novice
 
Rothhear's Avatar
 
Join Date: Mar 2005
Location: ohio
Age: 21
Posts: 201
Send a message via AIM to Rothhear Send a message via Yahoo to Rothhear Send a message via Skype™ to Rothhear
Default ?

Remodevd.......................................... ......

Last edited by Rothhear; 12-10-2006 at 08:12 PM.
Rothhear is offline   Reply With Quote
Old 06-18-2005, 01:14 AM   #3 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
Default

Quote:
Originally Posted by Rothhear
ok i cant find PacketHandlers.cs i found it inRunUO 1.0\Scripts\Engines\RemoteAdmin but it dont look like tat help ?

Nope, this is a CORE mod
__________________
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 06-18-2005, 01:14 AM   #4 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
Default

Quote:
Originally Posted by Jakob
I don't want to call this "fix" as the GM: prompt might show up to be something else than a thing for us to enter commands with.

Core
Network/PacketHandlers.cs
Add the line in red to the MessageType enum:
Code:
public enum MessageType
{
	Regular = 0x00,
	System = 0x01,
	Emote = 0x02,
	Label = 0x06,
	Focus = 0x07,
	Whisper = 0x08,
	Yell = 0x09,
	Spell = 0x0A,
	Encoded = 0xC0,
	GM = 0x0F,
}
Scripts
PlayerMobile.cs

Add the lines in red to the PlayerMobile class:
Code:
public class PlayerMobile : Mobile
{
	public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
	{
		if ( type == MessageType.GM ) // If the message is of type GM
			text = String.Format( "{0}{1}", Commands.CommandPrefix, text ); // then add the prefix to it
		base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
	}

BTW thanks
__________________
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 06-18-2005, 02:15 AM   #5 (permalink)
Forum Novice
 
Rothhear's Avatar
 
Join Date: Mar 2005
Location: ohio
Age: 21
Posts: 201
Send a message via AIM to Rothhear Send a message via Yahoo to Rothhear Send a message via Skype™ to Rothhear
Default

Removed......................................

Last edited by Rothhear; 12-10-2006 at 08:12 PM.
Rothhear is offline   Reply With Quote
Old 06-18-2005, 03:02 AM   #6 (permalink)
Forum Expert
 
Tannis's Avatar
 
Join Date: Feb 2004
Age: 27
Posts: 2,047
Default

If you're not completely sure on what you're doing, don't modify your core. You could really mess something up if it goes bad. Also, Run UO doesn't support modified cores, so if you did mess something up, you wouldn't get help putting it right again.
Tannis is offline   Reply With Quote
Old 06-18-2005, 07:35 AM   #7 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

I would say this is the only modification, if you make any to the core, that you should do.

This is the only one, I would still help after finding out about.
Phantom is offline   Reply With Quote
Old 06-18-2005, 05:55 PM   #8 (permalink)
RunUO Developer/Demise Person
 
ASayre's Avatar
 
Join Date: Mar 2003
Location: California
Age: 20
Posts: 1,700
Default

Quote:
Originally Posted by Phantom
I would say this is the only modification, if you make any to the core, that you should do.

This is the only one, I would still help after finding out about.
You technically don't even need to mod the core, if you jsut want a quick patcherup fix to let it use [

(different way than above ofcourse)
__________________
Andre Sayre, Core Developer
The RunUO Software Team

The day we are born is the day Death inches ever closer...
E-mail: ASayre ( AT ) RunUO ( Dot ) c o m
I'm as graceful as a gazelle galloping over glistening green grass with it's head on fire.
ASayre is offline   Reply With Quote
Old 06-18-2005, 06:50 PM   #9 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by ASayre8
You technically don't even need to mod the core, if you jsut want a quick patcherup fix to let it use [

(different way than above ofcourse)
I cannot think of another way, since the argument is a MessageType, would be better if it was type :-)
Phantom is offline   Reply With Quote
Old 06-19-2005, 06:09 PM   #10 (permalink)
An Army of One
 
soldierfortune's Avatar
 
Join Date: Jul 2004
Location: Florida
Age: 41
Posts: 203
Send a message via ICQ to soldierfortune
Default

Unless I'm missing something here I have no idea why someone would want to modify the core for this. All you have to do is go into Handlers.cs in the Commands directory and change this line:

Server.Commands.CommandPrefix = "[";

All you have to do is change the default "[" to whatever u want the new comand to be. I just changed it to "{" and all is working just fine.

Dan
__________________
Proud to serve in the US Army
1988-1992
101st Airborne Desert Shield/Desert Storm
soldierfortune is offline   Reply With Quote
Old 06-19-2005, 06:21 PM   #11 (permalink)
The noob formerly known as Jakob
 
Serp's Avatar
 
Join Date: Jan 2005
Posts: 316
Default

Quote:
Originally Posted by soldierfortune
Unless I'm missing something here I have no idea why someone would want to modify the core for this. All you have to do is go into Handlers.cs in the Commands directory and change this line:

Server.Commands.CommandPrefix = "[";

All you have to do is change the default "[" to whatever u want the new comand to be. I just changed it to "{" and all is working just fine.

Dan
A lot of people have been asking about this and I'm posting a solution. If you don't like it, don't use it. I believe in giving people options and letting them decide what suits them best.
Serp is offline   Reply With Quote
Old 06-19-2005, 07:00 PM   #12 (permalink)
Administrator
 
Zippy's Avatar
 
Join Date: Aug 2002
Location: Baltimore, MD
Age: 25
Posts: 4,845
Default

Here is a code snippet like the one above that does not require you to modify the core:

Scripts
PlayerMobile.cs

Add the lines in red to the PlayerMobile class:
Code:
public class PlayerMobile : Mobile
{
	public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
	{
		if ( (int)type == 0x0F ) // If the message is of type GM
			text = String.Format( "{0}{1}", Commands.CommandPrefix, text ); // then add the prefix to it
		base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
	}
__________________
Zippy, Razor Creator and RunUO Core Developer
The RunUO Software Team

"Intuition, like a flash of lightning, lasts only for a second. It generally comes when one is tormented by a difficult decipherment and when one reviews in his mind the fruitless experiments already tried. Suddenly the light breaks through and one finds after a few minutes what previous days of labor were unable to reveal."
~The Cryptonomicon

Zippy is offline   Reply With Quote
Old 06-19-2005, 07:18 PM   #13 (permalink)
The noob formerly known as Jakob
 
Serp's Avatar
 
Join Date: Jan 2005
Posts: 316
Default

Quote:
Originally Posted by Zippy
Here is a code snippet like the one above that does not require you to modify the core:

Scripts
PlayerMobile.cs

Add the lines in red to the PlayerMobile class:
Code:
public class PlayerMobile : Mobile
{
	public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
	{
		if ( (int)type == 0x0F ) // If the message is of type GM
			text = String.Format( "{0}{1}", Commands.CommandPrefix, text ); // then add the prefix to it
		base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
	}
That's the one I posted first but I removed it as there is code in the core preventing it from working:
Code:
if ( !Enum.IsDefined( typeof( MessageType ), type ) )
	type = MessageType.Regular;
Serp is offline   Reply With Quote
Old 06-19-2005, 08:13 PM   #14 (permalink)
Forum Expert
 
Join Date: Sep 2002
Age: 23
Posts: 1,472
Default

That code has nothing to do with what Zippy does above, his clip converts a GM messagetype to a CommandPrefix at the beginning of the line of text, for Commands.Handle to work with.
Ravatar is offline   Reply With Quote
Old 06-19-2005, 08:23 PM   #15 (permalink)
The noob formerly known as Jakob
 
Serp's Avatar
 
Join Date: Jan 2005
Posts: 316
Default

Quote:
Originally Posted by Ravatar
That code has nothing to do with what Zippy does above, his clip converts a GM messagetype to a CommandPrefix at the beginning of the line of text, for Commands.Handle to work with.
Zippy wrote:
Code:
if ( (int)type == 0x0F ) // If the message is of type GM
The variable type can never be 0x0F. If the client sends a message with the type 0x0F (this is done when you use the GM: prompt) this code
Code:
if ( !Enum.IsDefined( typeof( MessageType ), type ) )
	type = MessageType.Regular;
detects that there is no value in the MessageType enum that is equal to 0x0F, so it sets the type to MessageType.Regular;

Thus, when it arrives to PlayerMobile.DoSpeech the type is 0x00 (RegularSpeech) instead of 0x0F. You need to add the line I wrote into the core to prevent the core from changing type from 0x0F to 0x00.
Serp is offline   Reply With Quote
Old 06-19-2005, 09:57 PM   #16 (permalink)
Forum Expert
 
Join Date: Mar 2004
Location: New York City
Age: 32
Posts: 287
Send a message via AIM to Gandy897
Default

Quote:
Originally Posted by Jakob
Zippy wrote:
Code:
if ( (int)type == 0x0F ) // If the message is of type GM
The variable type can never be 0x0F. If the client sends a message with the type 0x0F (this is done when you use the GM: prompt) this code
Code:
if ( !Enum.IsDefined( typeof( MessageType ), type ) )
	type = MessageType.Regular;
detects that there is no value in the MessageType enum that is equal to 0x0F, so it sets the type to MessageType.Regular;

Thus, when it arrives to PlayerMobile.DoSpeech the type is 0x00 (RegularSpeech) instead of 0x0F. You need to add the line I wrote into the core to prevent the core from changing type from 0x0F to 0x00.

Umm dude.. Zippy is a core developer .. why not just say thanks zippy for the assist and let it be.. sheesh
__________________
Do what you want with the women, but let me go :)
Gandy897 is offline   Reply With Quote
Old 06-19-2005, 10:29 PM   #17 (permalink)
An Army of One
 
soldierfortune's Avatar
 
Join Date: Jul 2004
Location: Florida
Age: 41
Posts: 203
Send a message via ICQ to soldierfortune
Default

Quote:
Originally Posted by Jakob
A lot of people have been asking about this and I'm posting a solution. If you don't like it, don't use it. I believe in giving people options and letting them decide what suits them best.
I never said I didnt like your idea and all I was doing was offering an easier way to do this. Your way requires CORE modifications which most people cannot do and also CORE mods are not supported by RunUO.

Dan
__________________
Proud to serve in the US Army
1988-1992
101st Airborne Desert Shield/Desert Storm
soldierfortune is offline   Reply With Quote
Old 06-19-2005, 11:19 PM   #18 (permalink)
The noob formerly known as Jakob
 
Serp's Avatar
 
Join Date: Jan 2005
Posts: 316
Default

Quote:
Originally Posted by soldierfortune
Your way requires CORE modifications which most people cannot do and also CORE mods are not supported by RunUO.
I see what you're saying, but I personally like to use the [ prefix and after all, this thread is posted under Core Modifications.
Serp is offline   Reply With Quote
Old 06-20-2005, 12:20 AM   #19 (permalink)
Forum Expert
 
Join Date: Sep 2002
Age: 23
Posts: 1,472
Default

PlayerMobile OnSpeech overrides Mobile OnSpeech, therefore it'll hit Zippy's code first, then travel down to

Code:
base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
Ravatar is offline   Reply With Quote
Old 06-20-2005, 12:23 AM   #20 (permalink)
The noob formerly known as Jakob
 
Serp's Avatar
 
Join Date: Jan 2005
Posts: 316
Default

Quote:
Originally Posted by Ravatar
PlayerMobile OnSpeech overrides Mobile OnSpeech, therefore it'll hit Zippy's code first, then travel down to

Code:
base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
type will still be changed to 0x00 (RegularMessage) before it even gets to the DoSpeech method.

This is how it looks in the core:
Code:
if ( !Enum.IsDefined( typeof( MessageType ), type ) )
	type = MessageType.Regular;

from.Language = lang;
from.DoSpeech( text, keywords, type, Utility.ClipDyedHue( hue ) );
Serp is offline   Reply With Quote
Old 06-20-2005, 12:40 AM   #21 (permalink)
Forum Expert
 
Join Date: Sep 2002
Age: 23
Posts: 1,472
Default

Ahh I thought the script you posted at first was Mobile.cs
Ravatar is offline   Reply With Quote
Old 06-20-2005, 01:12 AM   #22 (permalink)
 
Join Date: Oct 2002
Age: 22
Posts: 4,689
Default

Jakob is right, and Zippy was most likley not paying attention to the code he wrote (since he wanted to shut all of you up).

If you look at the core, the message type handling is done before the DoSpeech is called, therefore Zippy's code would not work.
XxSP1DERxX is offline   Reply With Quote
Old 06-20-2005, 05:24 PM   #23 (permalink)
An Army of One
 
soldierfortune's Avatar
 
Join Date: Jul 2004
Location: Florida
Age: 41
Posts: 203
Send a message via ICQ to soldierfortune
Default

Quote:
Originally Posted by Jakob
I see what you're saying, but I personally like to use the [ prefix and after all, this thread is posted under Core Modifications.
LOL now I feel Dumb, I just noticed it was under core mods
Dan
__________________
Proud to serve in the US Army
1988-1992
101st Airborne Desert Shield/Desert Storm
soldierfortune is offline   Reply With Quote
Old 06-27-2005, 12:55 PM   #24 (permalink)
Vilanne
Guest
 
Posts: n/a
Default

Some of my players went to OSI and got the latest patch, then couldn't use the [chat command (Thank you Knives, we love your system)... and staff that patched wasn't able to pull up either, because the GM thing came up, too.

One of the players came up with an immediate work around. Type a space before you hit the [ and it'll recognize without issue.

We haven't had to modify anything more than our typing.
  Reply With Quote
Old 06-28-2005, 03:28 AM   #25 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
Default

Quote:
Originally Posted by Vilanne
Some of my players went to OSI and got the latest patch, then couldn't use the [chat command (Thank you Knives, we love your system)... and staff that patched wasn't able to pull up either, because the GM thing came up, too.

One of the players came up with an immediate work around. Type a space before you hit the [ and it'll recognize without issue.

We haven't had to modify anything more than our typing.

yah but this was posted cause some people didnt like havint to have to add a " " ie Space before the [. Personally I did this mod, but for the most part I dont ask for much help. If I cant fix it right away Ill come up with it eventually, but I also use more then one prefix so fixing it didnt really matter to me. I just dont like when things get broke when its not my fault
__________________
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
Reply