14 Dec, 2012, Rarva.Riendf wrote in the 41st comment:
Votes: 0
MCCP also helps to send more text at once to the client without having him disconnected.
When I added mxp, it added a LOT of text to send, because I started to use it in lot of places, and even had to change most of the buffer size to handle it.
(another reason your mud may crash btw, if you are not careful with it, especially if you use external method to add the tags like addRoomMxp(exitBuffer), that can add more to the exitBuffer than its size can handle)
So MCCP really helps. Depends on your mud average text output off course.

For version I don't remember which I used, I think I ended up tweaking one. I did not upload it as I am far from being confident I did a good job out of it.

I can copy paste the code for the class, it is short enough. Instruction in how to plug it should be the same than the one I downloaded. (look the comments at start)
Kavir snippet makes it then very easy to plug (only other modification are in comm.c I think) and I added two commands for player (to toggle it) and imp to check if everything 'seems' ok

/***************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Dystopia Mud improvements copyright (C) 2000, 2001 by Brian Graversen *
* *
* Much time and thought has gone into this software and you are *
* benefitting. We hope that you share your changes too. What goes *
* around, comes around. *
***************************************************************************/

/*
* mccp.c - support functions for mccp (the Mud Client Compression Protocol)
*
* see http://homepages.ihug.co.nz/~icecube/com... and README.Rom24-mccp
*
* Copyright © 1999, Oliver Jowett <icecube@ihug.co.nz>.
*
* This code may be freely distributed and used if this copyright notice is
* retained intact.
*
* Modified for Merc 2.2 by Celestian (celestian1@gmail.com)
*/

#include <stdio.h>
#include <stdlib.h>
#include <zlib.h>

#include "an.h"
#include "telnet.h"

int mccp_mem_usage = 0;
int mccp_mem_freed = 0;

/*
* Memory management - zlib uses these hooks to allocate and free memory
* it needs
*/

void *zlib_alloc(void *opaque, unsigned int items, unsigned int size) {
/* memory tracking */
mccp_mem_usage ++;
/* return memory pointer */
return calloc(items, size);
}

void zlib_free(void *opaque, void *address) {
mccp_mem_freed ++;
/* free the cell */
free(address);
}

/*
* Memory management.
* Increase MAX_STRING if you have too.
* Tune the others only if you understand what you're doing.
*/
#define MAX_PERM_BLOCK 131072
#define MAX_MEM_LIST 11

extern bool_t write_to_descriptor(DESCRIPTOR_DATA *desc, char *txt, int length);

bool_t process_compressed(DESCRIPTOR_DATA *desc) {
if ( !desc->mccp)
return TRUE;
int len = COMPRESS_BUF_SIZE - desc->mccp->avail_out;
if (len <= 0)
return TRUE;

return write(desc->descriptor, mccp_buf, len) < 1 ? FALSE : TRUE;
}

bool_t compressStart(DESCRIPTOR_DATA *desc) {
if ( !desc || !desc->character)
return FALSE;

if ( !desc->pProtocol->bMCCP) {
REMOVE_BIT(desc->character->config, CONF_MCCP);
return FALSE;
}

if (desc->mccp)
return TRUE;

char start_mccp[] =
{IAC, SB, TELOPT_MCCP, IAC, SE, 0};

z_stream *stream = calloc(1, sizeof(z_stream));

stream->next_in = NULL;
stream->avail_in = 0;

stream->next_out = mccp_buf;
stream->avail_out = COMPRESS_BUF_SIZE;

stream->data_type = Z_ASCII;
stream->zalloc = zlib_alloc;
stream->zfree = zlib_free;
stream->opaque = Z_NULL;

// 12, 5 = 32K of memory, more than enough
if (deflateInit2(stream, Z_BEST_COMPRESSION, Z_DEFLATED, 12, 5, Z_DEFAULT_STRATEGY) != Z_OK) {
free(stream);
return FALSE;
}

write_to_descriptor(desc, start_mccp, 0);
// The above call must send all pending output to the descriptor, since from now on we'll be compressing.
desc->mccp = stream;

return TRUE;
}

bool_t compressEnd(DESCRIPTOR_DATA *desc) {
if ( !desc)
return FALSE;

if ( !desc->mccp)
return TRUE;

desc->mccp->next_in = NULL;
desc->mccp->avail_in = 0;

desc->mccp->next_out = mccp_buf;
desc->mccp->avail_out = COMPRESS_BUF_SIZE;

if (deflate(desc->mccp, Z_FINISH) != Z_STREAM_END)
return FALSE;

if ( !process_compressed(desc))
return FALSE;

if (deflateEnd(desc->mccp) != Z_OK)
return FALSE;

free(desc->mccp);
desc->mccp = NULL;
return TRUE;
}

bool_t write_compressed(DESCRIPTOR_DATA *d) {
d->mccp->next_in = (unsigned char *)d->outbuf;
d->mccp->avail_in = d->outtop;

d->mccp->next_out = (unsigned char *)mccp_buf;
d->mccp->avail_out = COMPRESS_BUF_SIZE;

d->outtop = 0;

if (deflate(d->mccp, Z_SYNC_FLUSH) != Z_OK)
return FALSE;

return process_compressed(d);
}

/* User-level compression toggle */
bool_t do_mccp(CHAR_DATA *ch, char *argument) {
if ( !ch->desc) {
send_to_char("What descriptor?!\n\r", ch);
return FALSE;
}

if ( !ch->desc->mccp || !IS_SET(ch->config, CONF_MCCP)) {
if ( !compressStart(ch->desc)) {
send_to_char("Failed.\n\r", ch);
return FALSE;
}
SET_BIT(ch->config, CONF_MCCP);
send_to_char("Ok, compression enabled.\n\r", ch);
return TRUE;
}
if ( !compressEnd(ch->desc)) {
send_to_char("Failed.\n", ch);
return FALSE;
}
REMOVE_BIT(ch->config, CONF_MCCP);
send_to_char("Ok, compression disabled.\n\r", ch);
return TRUE;
}

void do_showmccp(CHAR_DATA *ch, char *argument) {
DESCRIPTOR_DATA *d;
CHAR_DATA *gch;
int count1 = 0, count2 = 0;

for (d = descriptor_list;d;d = d->next) {
if (d->connected != CON_PLAYING || !d->character)
continue;
gch = d->character;
count1 += gch->desc->mccp ? 1 : 0;
count2 += gch->desc->mccp ? 0 : 1;
chprintf(ch, "%-15s %s mccp\n\r", gch->charname, gch->desc->mccp ? "uses" : "does not use");
}
chprintf(ch, "%d out of %d players uses mccp\n\r", count1, count2 + count1);
count2 = mccp_mem_usage - mccp_mem_freed - (count1 * 5); //*5 cause for each player it goes 5 time sin the aloc method
chprintf(ch, "mccp memory that should be cleared:%s %d\n\r&0", count2 > 0 ? "&1" : "&2", count2);
}
14 Dec, 2012, Davion wrote in the 42nd comment:
Votes: 0
Ya, all your MSDP is functioning correctly. Only thing that's off is the room EXITS stuff. It's not the standard!

MSDP Spec said:
"EXITS" Nested abbreviated exit directions and corresponding destination VNUMs.


Here's an altered version of the one from msdp_update. May not seem like much buuut cool stuff can be done when you stick to a spec :).
/* Only update room stuff if they've changed room */
if ( pRoom && pRoom->vnum != d->pProtocol->pVariables[eMSDP_ROOM_VNUM]->ValueInt )
{
int i; /* Loop counter */
buf[0] = '\0';

for ( i = DIR_NORTH; i < MAX_DIR; ++i )
{
if ( pRoom->exit[i] != NULL ) // restrict exits from being shown here.
{
const char MsdpVar = (char)MSDP_VAR;
const char MsdpVal = (char)MSDP_VAL;
extern char *const dir_name[];
char buf2[MSL];

sprintf(buf2, "%c%s%c%d",MsdpVar, dir_name[i], MsdpVal, pRoom->exit[i]->u1.to_room->vnum);
strcat(buf,buf2);
}
}

if ( pRoom->area != NULL )
MSDPSetString( d, eMSDP_AREA_NAME, pRoom->area->name );

MSDPSetString( d, eMSDP_ROOM_NAME, pRoom->name );
MSDPSetTable( d, eMSDP_ROOM_EXITS, buf );
MSDPSetNumber( d, eMSDP_ROOM_VNUM, pRoom->vnum );
}
14 Dec, 2012, KaVir wrote in the 43rd comment:
Votes: 0
Davion said:
Ya, all your MSDP is functioning correctly. Only thing that's off is the room EXITS stuff. It's not the standard!

The variables aren't part of the standard, those mentioned in the specification "are mere suggestions for MUDs wanting to implement MSDP".
15 Dec, 2012, Hades_Kane wrote in the 44th comment:
Votes: 0
Ok, putting MXPSendTag in CON_READ_MOTD worked. Thanks for the help everyone!

I wish it would engage -before- the player has a chance to see a room description, but I'm not going to nitpick at that, I'm just happy it's working now :p

Davion, I'd be willing to bet that's where the msdp_update was crashing before, I'm looking at that now to see if I can figure out exactly what I need to change.

We've modified our code so much… it's difficult sometimes to add stuff like this in because there's a lot of little things that are different.
15 Dec, 2012, Hades_Kane wrote in the 45th comment:
Votes: 0
Oh, and thanks Rarva! I'm gonna look at getting that installed too :)

I feel like EoT is a step closer to moving into the 21st Century of MUDing :p
15 Dec, 2012, KaVir wrote in the 46th comment:
Votes: 0
Hades_Kane said:
And speaking of MCCP, I'm not very familiar with it… Aside from the server side benefit of reduced bandwidth, what are the advantages for the player? I did a little bit of googling and it said a faster connection, so the player side should see quicker response time, less lag, stuff like that?

Most players won't notice a difference. However it will typically reduce bandwidth usage to around 20%, which is very nice if you're playing via your smartphone and have a monthly download limit, and even better for the mud owner if their hosting costs are based on bandwidth usage.
15 Dec, 2012, Runter wrote in the 47th comment:
Votes: 0
Hades_Kane said:
And speaking of MCCP, I'm not very familiar with it… Aside from the server side benefit of reduced bandwidth, what are the advantages for the player? I did a little bit of googling and it said a faster connection, so the player side should see quicker response time, less lag, stuff like that?

I guess I'm not sure what the point is. Also, is there a particular version or uploader I should be searching for to get the most up-to-date version?


The benefit for both the server and the client is less bandwidth used. It won't make their lag any better, since that's latency related, and you don't get less latency based on the size of the data received. On extremely slow connections it should help, as they have extremely low bandwidth. Text is very good for compression, it could reduce the cost of ala carte internet tremendously.
17 Dec, 2012, Hades_Kane wrote in the 48th comment:
Votes: 0
Just wanna say, I have KaVir's snippet fully installed, and even managed to completely swap out the entire colour system over to this, including the additions of the beep, newline, underline, etc. and have it tweaked/customized to my liking, and to make it completely seamless for the players.

I don't know if I really have a way to make sure the MSSP stuff is working or being read by sites (I'll check mudstats tomorrow morning and see if that looks any different), but thanks a ton KaVir!

And thanks everyone who helped me navigate getting this going :D
17 Dec, 2012, Rarva.Riendf wrote in the 49th comment:
Votes: 0
Hades_Kane said:
(I'll check mudstats tomorrow morning and see if that looks any different)


Well, if you are included right away, tell me :) Have no idea what made mine actually included even after multiple request over time. (and it took weeks (or months) after my last request, I actually lost hope it ever will at that time). And I onlly know it is in because you talked about it and I checked…
17 Dec, 2012, KaVir wrote in the 50th comment:
Votes: 0
Hades_Kane said:
Just wanna say, I have KaVir's snippet fully installed, and even managed to completely swap out the entire colour system over to this, including the additions of the beep, newline, underline, etc. and have it tweaked/customized to my liking, and to make it completely seamless for the players.

Congratulations, and welcome to the club ;)

Hades_Kane said:
I don't know if I really have a way to make sure the MSSP stuff is working or being read by sites

You can easily view it with TinTin++ in debug mode:

#config {debug} on
#CONFIG {DEBUG TELNET} HAS BEEN SET TO {ON}.
#ses blah eotmud.com 4000
#TRYING TO CONNECT 'blah' TO 'eotmud.com' PORT '4000'.
#SESSION 'blah' CONNECTED TO 'eotmud.com' PORT '4000'
RCVD IAC DO TTYPE
SENT IAC WILL TTYPE

Do you wish to see End of Time in color? (Y/n)
RCVD IAC SB TTYPE
SENT IAC SB TTYPE TINTIN++
RCVD IAC DO NAWS
SENT IAC WILL NAWS
SENT IAC SB NAWS 0 80 0 25
RCVD IAC DO CHARSET
SENT IAC WONT CHARSET
RCVD IAC WILL MSDP
SENT IAC DONT MSDP
RCVD IAC WILL MSSP
SENT IAC DO MSSP
RCVD IAC DO 200
SENT IAC WONT 200
RCVD IAC WILL MSP
SENT IAC DONT MSP
RCVD IAC DO MXP
SENT IAC WONT MXP
RCVD IAC SB TTYPE
SENT IAC SB TTYPE xterm-256color
RCVD IAC SB MSSP
MSSP VAR NAME VAL End of Time
MSSP VAR PLAYERS VAL 5
MSSP VAR UPTIME VAL 1355717657
MSSP VAR CRAWL DELAY VAL -1
MSSP VAR HOSTNAME VAL eotmud.com
MSSP VAR PORT VAL 23
MSSP VAR CODEBASE VAL Rom (EoT Custom)
MSSP VAR CREATED VAL 2005
MSSP VAR IP VAL 69.12.216.33
MSSP VAR LANGUAGE VAL English
MSSP VAR LOCATION VAL USA
MSSP VAR MINIMUM AGE VAL 0
MSSP VAR WEBSITE VAL http://www.eotmud.com
MSSP VAR FAMILY VAL DikuMUD
MSSP VAR GENRE VAL Final Fantasy, Chrono Trigger, Chrono Cross
MSSP VAR GAMEPLAY VAL Adventure, Hack and Slash, Player versus
Player, Player versus Environment, Roleplaying, Social
MSSP VAR STATUS VAL Live
MSSP VAR GAMESYSTEM VAL None
MSSP VAR INTERMUD VAL
MSSP VAR SUBGENRE VAL None
MSSP VAR AREAS VAL 122
MSSP VAR HELPFILES VAL 1064
MSSP VAR MOBILES VAL 2677
MSSP VAR OBJECTS VAL 4526
MSSP VAR ROOMS VAL 28591
MSSP VAR CLASSES VAL 36
MSSP VAR LEVELS VAL 100
MSSP VAR RACES VAL 9
MSSP VAR ANSI VAL 1
MSSP VAR GMCP VAL 0
MSSP VAR MCCP VAL 0
MSSP VAR MCP VAL 0
MSSP VAR MSDP VAL 1
MSSP VAR MSP VAL 1
MSSP VAR MXP VAL 1
MSSP VAR PUEBLO VAL 0
MSSP VAR UTF-8 VAL 1
MSSP VAR VT100 VAL 0
MSSP VAR XTERM 256 COLORS VAL 1
MSSP VAR PAY TO PLAY VAL 0
MSSP VAR PAY FOR PERKS VAL 0
MSSP VAR HIRING BUILDERS VAL 1
MSSP VAR HIRING CODERS VAL 0
MSSP VAR EXITS VAL 92890
MSSP VAR EXTRA DESCRIPTIONS VAL 949
MSSP VAR RESETS VAL 8415
MSSP VAR ADULT MATERIAL VAL 0
MSSP VAR MULTICLASSING VAL 0
MSSP VAR NEWBIE FRIENDLY VAL 1
MSSP VAR PLAYER CITIES VAL 0
MSSP VAR PLAYER CLANS VAL 1
MSSP VAR PLAYER CRAFTING VAL 1
MSSP VAR PLAYER GUILDS VAL 0
MSSP VAR EQUIPMENT SYSTEM VAL Both
MSSP VAR MULTIPLAYING VAL None
MSSP VAR PLAYERKILLING VAL Restricted
MSSP VAR QUEST SYSTEM VAL Immortal Run, Integrated
MSSP VAR ROLEPLAYING VAL Encouraged
MSSP VAR TRAINING SYSTEM VAL Both
MSSP VAR WORLD ORIGINALITY VAL All Original
MSSP VAR ATCP VAL 1
MSSP VAR SSL VAL 0
MSSP VAR ZMP VAL 0
IAC SB MSSP IAC SE
RCVD IAC WILL MXP
RCVD IAC SB TTYPE
SENT IAC SB TTYPE MTTS 11
RCVD IAC SB TTYPE
SENT IAC SB TTYPE MTTS 11
Do you wish to see End of Time in color? (Y/n)
17 Dec, 2012, Hades_Kane wrote in the 51st comment:
Votes: 0
Rarva, someone else associated with the game (a player or a builder, not sure) submitted the game to the site and it popped up, as far as I can tell, within a week. So far today, it doesn't appear to be pulling any MSSP data. I hope it pulls connected stuff more often than once every few days as it appears to have been doing before. I did a "submit" on a change that we are now using MSSP, hopefully they'll get it changed over. If nothing seems different in a month, I'll try an email I guess.

KaVir, thanks, TinTin++ keeps sounding like a handy thing to keep around :)
18 Dec, 2012, Hades_Kane wrote in the 52nd comment:
Votes: 0
I know my discussion about this stuff has been all over the place… but particularly in the places that report objects, rooms, exits, etc.

I have a "memory" command in the game that reports this, for example:

Affects  2553
Areas 158
ExDes 951
Exits 92902
Helps 1064
Socials 308
Mobs 2679(2679 new format)
(in use) 3299
Objs 4538(4538 new format)
Resets 8430
Rooms 28600
Shops 229
Strings 39303 strings of 7387298 bytes (max 11304960).
Perms 183017 blocks of 19266744 bytes.


I'm assuming it's feasible to set something up for the MSSP value to pull directly from something like that, so it will update itself automatically and always be accurate?
18 Dec, 2012, arholly wrote in the 53rd comment:
Votes: 0
That's what I was thinking too Hades. Gotta be something relatively easy to setup like that.
18 Dec, 2012, Rarva.Riendf wrote in the 54th comment:
Votes: 0
Quote
I'm assuming it's feasible to set something up for the MSSP value to pull directly from something like that, so it will update itself automatically and always be accurate?


Not only feasible, but http://tintin.sourceforge.net/mssp/mudli... will go look for these kind of values as well.
Just look in SendMSSP method in protocol.c
19 Dec, 2012, arholly wrote in the 55th comment:
Votes: 0
This is what I started to do and it seems to be working, but I'm hopeful someone will correct me if I'm wrong. I know that my top_area variable which is used in do_memory has the total number of areas (for example). So, this is what I did. It seems to be working and was planning on extending it out unless someone tells me a better way.

In protocol.c I added this under the MSSP file-scope variables:
extern int    top_area;

Then under local MSSP functions, I added:
static const char *GetMSSP_Area()
{
static char Buffer[32];
sprintf( Buffer, "%d", top_area );
return Buffer;
}

Then just called it as:
{ "AREAS",              FUNCTION_CALL( GetMSSP_Area ) },
20 Dec, 2012, Hades_Kane wrote in the 56th comment:
Votes: 0
How does one get added to the MUD Bytes MSSP crawler?
21 Dec, 2012, Rarva.Riendf wrote in the 57th comment:
Votes: 0
http://www.mudbytes.net/index.php?a=mudl...

I think since you have a banner, you are already added, just need an update to have it appear.
21 Dec, 2012, arholly wrote in the 58th comment:
Votes: 0
It doesn't seem to be updating. I know I updated my MSSP information and it's not showing.
21 Dec, 2012, Scandum wrote in the 59th comment:
Votes: 0
The MudBytes crawler probably isn't running.
26 Dec, 2012, Tijer wrote in the 60th comment:
Votes: 0
when i asked about this i got the answer that the mud needed to be listed here before it went on the mudbytes crawler….
40.0/67