`_.,-'~'-,._.,-'~'-,._.,-'~'-,._.,-'~'-,._.,-'~'-,._.,-'~'-,._.,-'~'-,._' ANSI Color Query Upon Log-in Copyright 1996, by Daniel Koepke `_.,-'~'-,._.,-'~'-,._.,-'~'-,._.,-'~'-,._.,-'~'-,._.,-'~'-,._.,-'~'-,._' I. Introduction =============== This is another little patch by me. This one asks is for asking whether the loginning in person wants ANSI support on. It then overrides any pre-set flags. This kind of makes the PRF_COLOR_x flags a waste of space [why should they be saved if they are being overriden anyway?] but I didn't want to change anything more (to keep it largely compatible for highly modified MUDs). If you want to free up the two PRF_x positions used (wasted) by PRF_COLOR_x then I would suggest making a temporary flag bitvector in char_specials. Something like: #define TMP_FLAGS(ch) ((ch)->char_specials.tmp_flags) #define TMP_FLAGGED(ch, f) (IS_SET(TMP_FLAGS(ch), f)) #define TMP_COLOR_1 (1 << 0) #define TMP_COLOR_2 (1 << 1) // any other temporary flags for players can go here Then go about in your code changing all calls to PRF_COLOR_x to use the TMP_COLOR_x, etc. It's not hard to do, just a bit time consuming. This is particularly useful for those of you with inline (on-the-fly) color, like the easy_color patch. It permits you, then, to put color inside your character creation sequence, title screen, etc. but it still has it's uses for other people (sending a seperate title screen, menu, etc.). It's also helpful for players whom login from multiple sites with different term types. If they login from one that supports color, and thus turn on ANSI color support, then they later login from a terminal without ANSI color support, they'd normally have to wait until they got into the game before they could turn off color. This would make things hard to read or their terminal could mis-interpret the codes and react badly, etc. Now they can turn off or on color before logging in. II. Standard (Keep-me-from-court) Disclaimer ============================================ Use this at your own risks. There is (like pretty much all code) some bugs. That is to be expected. I am giving you this, so I expect that, in return, you will send me improvements you add, or report any bugs you encounter. My e-mail address is dkoepke@california.com. You do not need to give me credit for this. I ask, though, that you do not take credit for it. I appreciate any credit you give me. Of course, you have to follow the CircleMUD license... but that goes without saying and you are *obviously* already doing that [pssst, read doc/license.doc if you haven't, yet]. I believe this patch, because of it's size, to be entirely bug free. But if you find any bugs, don't hesistate to prove me wrong. III. Installing =============== Okay, now on to how to install this thing... Move the query_ansi.diff file to the src/ directory. Go into the src/ directory and type: % patch < query_ansi.diff If you get any failures/rejects, look at the .rej files and manually install from that (key: '+' is add, '-' is remove, '!' is change). If the entire thing fails, manually patch from the query_ansi.diff file (same key). IV. For the Coders ================== Here's some basics about how the query ANSI patch works: CON STATE: CON_QANSI, CON_x (16) The connected state for players whom we haven't got the term type for, yet. CASE: CON_QANSI, nanny()/interpreter.c The case statement for the CON_QANSI state, checks if input is either NULL (they pressed input without typing anything) or 'y' for turning on color, or 'n' for turning off color; then we send GREETINGS out. You could send a different greeting screen depending upon the response by moving the "SEND_TO_Q(GREETINGS, d);" up inside the if-block when the arg is 'n' and putting a different SEND_TO_Q() call inside the block when the arg is 'y'. V. Other Patches By Me ====================== The below are availible at the CircleMUD anonymous ftp site (see below for the address): Filename: new.do_who.diff.gz, /pub/CircleMUD/contrib/code Usage : A replacement for do_who(), it splits apart immortals and mortals, gives immortals a "who title" ("Immortal" instead of "31 War"), keeps a count of highest players on per boot, and a little bit more. Filename: mount.diff.gz, /pub/CircleMUD/contrib/code Usage : A small, basic mount system with a TAME skill, your mount taking the move point cost, and a little more. Filename: obj_mail.diff.gz, /pub/CircleMUD/contrib/code Usage : Permits attaching of objects to mail Filename: new_prompt.diff.gz, /pub/CircleMUD/contrib/code Usage : Enhanced prompt code that interprets a character's prompt. Beware: THIS WILL CHANGE YOUR PFILE! Filename: multi_hit.diff.gz, /pub/CircleMUD/contrib/code Usage : Adds multiple attacks per round and the connected skills. VI. Popular CircleMUD Sites =========================== Anonymous ftp : [ftp.circlemud.org] Homepage : [http://www.circlemud.org/] Code snippets : [http://cspo.queensu.ca/~fletcher/Circle/Snippet/] Have fun and godspeed, -- Daniel Koepke dkoepke@california.com Forgive me father, for I am sin.