Please check out The Fairy Garden MUSH !

Member Discussions

terms



[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]


1. Adding Color To Windows Port of ROM 2.4 Sun Aug 1, 2004 [11:48 PM]
Sekket
chris.parker@knology.net
member since: Aug 1, 2004
Reply
When I recently started work on my MUD (Windows version of ROM 2.4, available here: http://www.gammon.com.au/rom/rom.htm ), I realized it would be best to patch it with functions I know I wanted added before I attempted to edit anything.

I looked for a color patch first, and found Lope's. Reading through it, I realized it wouldnt work on Windows. That wasnt a big surprise, but it didnt include instructions for manually applying the patch.

So I thought Id simply come up with my own. Make a function that gets called right before the text actually gets sent out by the server, and have it convert everything (probably using a similar setup of unescapes as is customary). I tried a simplified version of what I had described, and to my displeasure the client (SimpleMU, in this case) simply displayed  instead of red.

So I have a number of questions, but can best be summed up with - how do I resolve this?

A) What do I need to do to make my custom made function work? Where would I have to call this function?
B) How do I apply Lope's patch manually? How do I read the commands present in it?
C) Are there any other, more suitable patches? (Im more looking for color capability then a full change to all the channels, etc etc - Id prefer to do that by hand) I tried to locate Wreck's, which I saw referenced in a few different places, but was unsuccesful (even using google). Where is that patch?

Thank you for your time.


2. RE: Adding Color To Windows Port of ROM 2.4 Mon Aug 2, 2004 [11:53 PM]
Fire
Email not supplied
member since: Feb 29, 2000
In Reply To
Reply
I can't see how color codes can be different for a Windows server. Any telnet server can send telnet codes, and any telnet client must recieve them. True, a few lower-quality clients will ignore a lot of so-called 'arbitrary' control codes, and a few higher-quality clients will read escape codes that are not part of the original ANSI standard, but for the most part it's not the operating system that determines which codes can be sent. Rather it's the client's job to interpret those sequences properly.
If I am missing something important here, feel free to correct me, but to sum up what I said:
Color codes are not dependent on the operating system, just the client which recieves them.

p.s. Perhaps you should try another server that already has color codes added?
Never use a big word when a diminutive one will suffice.


3. RE: Adding Color To Windows Port of ROM 2.4 Tue Aug 3, 2004 [7:09 AM]
Sekket
chris.parker@knology.net
member since: Aug 1, 2004
In Reply To
Reply
I understand exactly what you mean...

However you should realize that the patch is designed for linux and simply wont run on windows. (unknown file type)

And I am already familiar with ROM and have my changes all planned out... Though I think making some of the changes will involve significant modifications, I believe ROM to be fairly compatible with what I want.


4. RE: Adding Color To Windows Port of ROM 2.4 Tue Aug 3, 2004 [8:24 AM]
Loriel
Email not supplied
member since: Aug 26, 2001
In Reply To
Reply
It appears there are at least 3 options available to you :

1) Apply the patch by hand. Open up the patch file as a text file, and it should contain details of which files to amend, and which line numbers to add/delete in each file. These numbers mnay differ from the numbers in your version, in which case you'll need to identify where to insert/delete - there's usually 2 or 3 lines quoted before/after each change for context.

2) Switch to a *nix system (at least for the purpose of applying the patch)

3) Use a different codebase - eg 1stmud which appears to be a Windows-compatible ROM derivative with various extras (like colour) already included.

Other possibilities you might like to consider :
Use Cygwin (or another *nix emulator) on Windows.
Obtain a Windows port of the "patch" utility (eg here.


5. RE: Adding Color To Windows Port of ROM 2.4 Tue Aug 3, 2004 [9:16 AM]
RuinsOfFey
Email not supplied
member since: Jul 5, 2004
In Reply To
Reply
Hello-

Now im supprised that nobody pointed this out to you as its probabbly the real cause of your problems.

You need to make sure that  is really the escape character. Since your doing this in windows, depending on your editor, what you opened it with, and what you copied it from, this most likely is NOT the escape character just what windows decided was a suitable substitute.

Now im guessing this is the case becuase if your client is displaying  and its supposed to support color you said. So it is either lying about supporting color(most likely not) or the square isnt the escape character cause the rest is right and your client should read strip it out.

How do you fix this you might ask? Find a Suitable source code editor and open the files and copy and paste the  symbol from lopes stuff into your code. Most likely it still containts the true escape character, this is assuming it wasnt opened and saved in windows or otherwise edited.

Just my thoughts on it all, i could be wrong but im thinking im not.

_-Menser-_


6. RE: Adding Color To Windows Port of ROM 2.4 Tue Aug 3, 2004 [10:02 AM]
omagasohe
omagasohe-muds@yahoo.com
member since: Aug 8, 2000
In Reply To
Reply
First off, hand patching isn't that hard patch file looks like this

--- act_comm.c 1997/10/08 11:22:45 1.1
+++ act_comm.c 1997/08/09 14:25:32
@@ -1455,6 +1455,7 @@

save_char_obj( ch );
send_to_char("Saving. Remember that ROM has automatic saving
now.\n\r", ch);
+ WAIT_STATE(ch,4 * PULSE_VIOLENCE);
return;
}

the "--- filename" and "+++ filename" just tell you the file to patch
the "@@ -1455" is close to the line you want to find.
the rest is what the code looks like, find the stuff that has no + sign and add
lines with the + and remove lines with -

line number are almost never correct, thats why there is 3 lines of similar text

i'd check out cygwin it's a linux console on you pc with patch and gcc so you
can use all the linux stuffin windows.


7. RE: Adding Color To Windows Port of ROM 2.4 Tue Aug 3, 2004 [4:13 PM]
Sekket
chris.parker@knology.net
member since: Aug 1, 2004
In Reply To
Reply
I understand exactly what you mean...

However you should realize that the patch is designed for linux and simply wont run on windows. (unknown file type)

And I am already familiar with ROM and have my changes all planned out... Though I think making some of the changes will involve significant modifications, I believe ROM to be fairly compatible with what I want.


8. RE: Adding Color To Windows Port of ROM 2.4 Tue Aug 3, 2004 [5:17 PM]
thyrr
Email not supplied
member since: Nov 21, 1999
In Reply To
Reply
http://gnuwin32.sourceforge.net/

Includes a version of the "patch" utility for Windows that should work like the Linux version. (of course, you'll need to run it from the command line)

But if you want to design your own color system, more power to you.


9. RE: Adding Color To Windows Port of ROM 2.4 Tue Aug 3, 2004 [10:35 PM]
Sekket
Email not supplied
member since: Aug 1, 2004
In Reply To
Reply
Actually, I didnt look through all of Lope's code. I instead set up a program called Ethereal to log all incoming and outgoing packets, and used that to decipher what the escape sequence was for color...

I know that the square simple is what its supposed to be, because I went to asciitable.com and used the appropriate ALT sequence to generate the character. It also proved to be equivalent to the character I logged from the incoming data from a different MUD.

The more I think about it, the more confused I am. Ill probably switch to a different codebase (The Color-Enabled ROM similar one for Windows someone brought up), or try the Windows based Lope's patch...

Niether tonight, other things to do.

All the feedback has been exactly what I needed, thanks.

(Comment added by Sekket on Tue Aug 3 23:37:30 2004)



10. RE: Adding Color To Windows Port of ROM 2.4 Wed Aug 4, 2004 [1:57 PM]
RuinsOfFey
Email not supplied
member since: Jul 5, 2004
In Reply To
Reply
It could still be the wrong code you are sending. Like i said it depends on how that Ethereal program showed it to you and how your source code editor saved it.

I have previously worked with ROM on windows and i know that color can work in it just fine so dont give up hope in it yet.

If you really want to be sure your sending the write code why dont you make a small program to accept a character and give you its ascii value? If you need help with this let me know. another option would be to modify your funciton that replaces the color codes with their characters is to make it instead displays its decimal or hex value or something from which you can easily decern the TRUE characters being sent.

As i said before, windows is a crazy thing, and if your client really does support color(is it on?) and its getting the code you showed. If that is really the escape char it should be doing some color action. Look at it logically and youll see there isnt many places it can go wrong.

What source editor do you use to do your editing?
What Client are you using to connect into the mud as well to?(i think you said in the first post but as im writing a response i cant view it right now.)

_-Menser-_


11. RE: Adding Color To Windows Port of ROM 2.4 Fri Aug 6, 2004 [7:44 PM]
omagasohe
omagasohe-muds@yahoo.com
member since: Aug 8, 2000
In Reply To
Reply
Looking at my code, i realize the '\e' is the square that you want. At least is is
for both Mac OS X and Red Hat. Use it instead of the code. i've use that color
on many platforms. But i hand patch it, since olc changes the same areas of
the code. it's a 10minute job, it'd be done faster than waiting for a solution
you like




[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]