-
Notifications
You must be signed in to change notification settings - Fork 2
/
INSTALL_GMCP.txt
646 lines (527 loc) · 21.9 KB
/
INSTALL_GMCP.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
/******************************************************************************
Protocol snippet by KaVir. Released into the Public Domain in February 2011.
GMCP addition by Greg. Released into the Public Domain in April 2020.
JSMN parser/tokenizer.
https://github.com/zserge/jsmn
******************************************************************************/
In protocol.h: Update MUD_NAME and descriptor_t for your mud.
In protocol.c: Update the fields in the SendMSSP() function.
/***************************************************************************
* File: Makefile
*
* Add protocol.o to the list of object files.
***************************************************************************/
/***************************************************************************
* File: merc.h
*
* Include protocol.h directly after the copyright notice/s.
*
* Or better yet put it in each c file that uses the protocol snippet.
***************************************************************************/
#include "protocol.h"
/***************************************************************************
* File: merc.h
*
* Add the protocol pointer to the end of the descriptor_data structure.
***************************************************************************/
struct descriptor_data
{
DESCRIPTOR_DATA * next;
DESCRIPTOR_DATA * snoop_by;
CHAR_DATA * character;
CHAR_DATA * original;
bool valid;
char * host;
sh_int descriptor;
sh_int connected;
bool fcommand;
char inbuf [4 * MAX_INPUT_LENGTH];
char incomm [MAX_INPUT_LENGTH];
char inlast [MAX_INPUT_LENGTH];
int repeat;
char * outbuf;
int outsize;
int outtop;
char * showstr_head;
char * showstr_point;
protocol_t * pProtocol; /* <--- Add this line */
};
/***************************************************************************
* File: update.c
*
* Add msdp_update() to the list of local functions near the top of the file.
* Add gmcp_update() to the list of local functions near the top of the file.
***************************************************************************/
int hit_gain args( ( CHAR_DATA *ch ) );
int mana_gain args( ( CHAR_DATA *ch ) );
int move_gain args( ( CHAR_DATA *ch ) );
void mobile_update args( ( void ) );
void weather_update args( ( void ) );
void char_update args( ( void ) );
void obj_update args( ( void ) );
void aggr_update args( ( void ) );
void msdp_update args( ( void ) ); /* <--- Add this line */
void gmcp_update args( ( void ) ); /* <--- Add this line */
/***************************************************************************
* File: update.c
*
* Add a new msdp_update() function.
***************************************************************************/
void msdp_update( void )
{
DESCRIPTOR_DATA *d;
int PlayerCount = 0;
for ( d = descriptor_list; d != NULL; d = d->next )
{
if ( d->character && d->connected == CON_PLAYING && !IS_NPC(d->character) )
{
char buf[MAX_STRING_LENGTH];
CHAR_DATA *pOpponent = d->character->fighting;
ROOM_INDEX_DATA *pRoom = d->character->in_room;
AFFECT_DATA *paf;
++PlayerCount;
MSDPSetString( d, eMSDP_CHARACTER_NAME, d->character->name );
MSDPSetNumber( d, eMSDP_ALIGNMENT, d->character->alignment );
MSDPSetNumber( d, eMSDP_EXPERIENCE, d->character->exp );
MSDPSetNumber( d, eMSDP_EXPERIENCE_MAX, exp_per_level(d->character,
d->character->pcdata->points) );
MSDPSetNumber( d, eMSDP_EXPERIENCE_TNL, ((d->character->level + 1) *
exp_per_level(d->character, d->character->pcdata->points) -
d->character->exp ) );
MSDPSetNumber( d, eMSDP_HEALTH, d->character->hit );
MSDPSetNumber( d, eMSDP_HEALTH_MAX, d->character->max_hit );
MSDPSetNumber( d, eMSDP_LEVEL, d->character->level );
/*
MSDPSetNumber( d, eMSDP_RACE, TBD );
MSDPSetNumber( d, eMSDP_CLASS, TBD );
*/
MSDPSetNumber( d, eMSDP_MANA, d->character->mana );
MSDPSetNumber( d, eMSDP_MANA_MAX, d->character->max_mana );
MSDPSetNumber( d, eMSDP_WIMPY, d->character->wimpy );
MSDPSetNumber( d, eMSDP_PRACTICE, d->character->practice );
MSDPSetNumber( d, eMSDP_MONEY, d->character->gold );
MSDPSetNumber( d, eMSDP_MOVEMENT, d->character->move );
MSDPSetNumber( d, eMSDP_MOVEMENT_MAX, d->character->max_move );
MSDPSetNumber( d, eMSDP_HITROLL, GET_HITROLL(d->character) );
MSDPSetNumber( d, eMSDP_DAMROLL, GET_DAMROLL(d->character) );
MSDPSetNumber( d, eMSDP_AC, GET_AC(d->character) );
MSDPSetNumber( d, eMSDP_STR, get_curr_str(d->character) );
MSDPSetNumber( d, eMSDP_INT, get_curr_int(d->character) );
MSDPSetNumber( d, eMSDP_WIS, get_curr_wis(d->character) );
MSDPSetNumber( d, eMSDP_DEX, get_curr_dex(d->character) );
MSDPSetNumber( d, eMSDP_CON, get_curr_con(d->character) );
MSDPSetNumber( d, eMSDP_STR_PERM, d->character->pcdata->perm_str );
MSDPSetNumber( d, eMSDP_INT_PERM, d->character->pcdata->perm_int );
MSDPSetNumber( d, eMSDP_WIS_PERM, d->character->pcdata->perm_wis );
MSDPSetNumber( d, eMSDP_DEX_PERM, d->character->pcdata->perm_dex );
MSDPSetNumber( d, eMSDP_CON_PERM, d->character->pcdata->perm_con );
/* This would be better moved elsewhere */
if ( pOpponent != NULL )
{
int hit_points = (pOpponent->hit * 100) / pOpponent->max_hit;
MSDPSetNumber( d, eMSDP_OPPONENT_HEALTH, hit_points );
MSDPSetNumber( d, eMSDP_OPPONENT_HEALTH_MAX, 100 );
MSDPSetNumber( d, eMSDP_OPPONENT_LEVEL, pOpponent->level );
MSDPSetString( d, eMSDP_OPPONENT_NAME, pOpponent->name );
}
else /* Clear the values */
{
MSDPSetNumber( d, eMSDP_OPPONENT_HEALTH, 0 );
MSDPSetNumber( d, eMSDP_OPPONENT_LEVEL, 0 );
MSDPSetString( d, eMSDP_OPPONENT_NAME, "" );
}
/* 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 )
{
const char MsdpVar[] = { (char)MSDP_VAR, '\0' };
const char MsdpVal[] = { (char)MSDP_VAL, '\0' };
extern char *const dir_name[];
strcat( buf, MsdpVar );
strcat( buf, dir_name[i] );
strcat( buf, MsdpVal );
if ( IS_SET(pRoom->exit[i]->exit_info, EX_CLOSED) )
strcat( buf, "C" );
else /* The exit is open */
strcat( buf, "O" );
}
}
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 );
}
/*
MSDPSetNumber( d, eMSDP_WORLD_TIME, d->character-> );
*/
buf[0] = '\0';
for ( paf = d->character->affected; paf; paf = paf->next )
{
char skill_buf[MAX_STRING_LENGTH];
sprintf( skill_buf, "%c%s%c%d",
(char)MSDP_VAR, skill_table[paf->type].name,
(char)MSDP_VAL, paf->duration );
strcat( buf, skill_buf );
}
MSDPSetTable( d, eMSDP_AFFECTS, buf );
MSDPUpdate( d );
}
}
/* Ideally this should be called once at startup, and again whenever
* someone leaves or joins the mud. But this works, and it keeps the
* snippet simple. Optimise as you see fit.
*/
MSSPSetPlayers( PlayerCount );
}
/***************************************************************************
* GMCP ADDON
* File: update.c
*
* Add a new gmcp_update() function.
***************************************************************************/
void gmcp_update( void )
{
DESCRIPTOR_DATA *d;
for ( d = descriptor_list; d != NULL; d = d->next )
{
if ( d->character && d->connected == CON_PLAYING && !IS_NPC(d->character) )
{
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
ROOM_INDEX_DATA *room = d->character->in_room;
CHAR_DATA *enemy = d->character->fighting;
AFFECT_DATA *paf;
UpdateGMCPString( d, GMCP_NAME, d->character->name );
UpdateGMCPString( d, GMCP_RACE, pc_race_table[d->character->race].name );
UpdateGMCPString( d, GMCP_CLASS, class_table[d->character->class].name );
UpdateGMCPNumber( d, GMCP_HP, d->character->hit );
UpdateGMCPNumber( d, GMCP_MANA, d->character->mana );
UpdateGMCPNumber( d, GMCP_MOVE, d->character->move );
UpdateGMCPNumber( d, GMCP_MAX_HP, d->character->max_hit );
UpdateGMCPNumber( d, GMCP_MAX_MANA, d->character->max_mana );
UpdateGMCPNumber( d, GMCP_MAX_MOVE, d->character->max_move );
UpdateGMCPNumber( d, GMCP_STR, get_curr_stat( d->character, STAT_STR ) );
UpdateGMCPNumber( d, GMCP_INT, get_curr_stat( d->character, STAT_INT ) );
UpdateGMCPNumber( d, GMCP_WIS, get_curr_stat( d->character, STAT_WIS ) );
UpdateGMCPNumber( d, GMCP_DEX, get_curr_stat( d->character, STAT_DEX ) );
UpdateGMCPNumber( d, GMCP_CON, get_curr_stat( d->character, STAT_CON ) );
UpdateGMCPNumber( d, GMCP_HITROLL, GET_HITROLL( d->character ) );
UpdateGMCPNumber( d, GMCP_DAMROLL, GET_DAMROLL( d->character ) );
UpdateGMCPNumber( d, GMCP_WIMPY, d->character->wimpy );
UpdateGMCPNumber( d, GMCP_AC_PIERCE, GET_AC( d->character, AC_PIERCE ) );
UpdateGMCPNumber( d, GMCP_AC_BASH, GET_AC( d->character, AC_BASH ) );
UpdateGMCPNumber( d, GMCP_AC_SLASH, GET_AC( d->character, AC_SLASH ) );
UpdateGMCPNumber( d, GMCP_AC_EXOTIC, GET_AC( d->character, AC_EXOTIC ) );
UpdateGMCPNumber( d, GMCP_ALIGNMENT, d->character->alignment );
UpdateGMCPNumber( d, GMCP_XP, d->character->exp );
UpdateGMCPNumber( d, GMCP_XP_MAX, exp_per_level( d->character, d->character->pcdata->points) );
UpdateGMCPNumber( d, GMCP_XP_TNL, ( ( d->character->level + 1 ) * exp_per_level( d->character, d->character->pcdata->points ) - d->character->exp ) );
UpdateGMCPNumber( d, GMCP_PRACTICE, d->character->practice );
UpdateGMCPNumber( d, GMCP_MONEY, d->character->gold );
sprintf( buf, "%d", room->vnum );
if ( room && strcmp( buf, d->pProtocol->GMCPVariable[GMCP_ROOM_VNUM] ) )
{
static const char *exit[] = { "n", "e", "s", "w", "u", "d" };
int i;
UpdateGMCPString( d, GMCP_AREA, d->character->in_room->area->name );
UpdateGMCPString( d, GMCP_ROOM_NAME, d->character->in_room->name );
UpdateGMCPNumber( d, GMCP_ROOM_VNUM, d->character->in_room->vnum );
buf[0] = '\0';
buf2[0] = '\0';
for ( i = DIR_NORTH; i <= DIR_DOWN; i++ )
{
if ( !room->exit[i] )
continue;
if ( buf[0] == '\0' )
{
#ifndef COLOR_CODE_FIX
sprintf( buf, "\"%s\": \"%d\"", exit[i], room->exit[i]->u1.to_room->vnum );
#else
sprintf( buf, "\"%s\": \"%d\"", exit[i], room->exit[i]->u1.to_room->vnum );
#endif
}
else
{
sprintf( buf2, ", \"%s\": \"%d\"", exit[i], room->exit[i]->u1.to_room->vnum );
strcat( buf, buf2 );
}
}
UpdateGMCPString( d, GMCP_ROOM_EXITS, buf );
}
if ( enemy )
{
CHAR_DATA *ch;
buf[0] = '\0';
buf2[0] = '\0';
for ( ch = room->people; ch; ch = ch->next_in_room )
{
/* Don't check current ch as this will double up enemies. */
if ( ch == d->character )
continue;
if ( enemy == ch->fighting || ch->fighting == d->character )
{
#ifndef COLOR_CODE_FIX
if ( buf[0] == '\0' ) sprintf( buf, "[ { \"name\": \"%s\", \"level\": \"%d\", \"hp\": \"%d\", \"maxhp\": \"%d\" }", enemy->name, enemy->level, enemy->hit, enemy->max_hit );
else
{
sprintf( buf2, ", { \"name\": \"%s\", \"level\": \"%d\", \"hp\": \"%d\", \"maxhp\": \"%d\" }", enemy->name, enemy->level, enemy->hit, enemy->max_hit );
strcat( buf, buf2 );
}
#else
if ( buf[0] == '\0' ) sprintf( buf, "[ {{ \"name\": \"%s\", \"level\": \"%d\", \"hp\": \"%d\", \"maxhp\": \"%d\" }", enemy->name, enemy->level, enemy->hit, enemy->max_hit );
else
{
sprintf( buf2, ", {{ \"name\": \"%s\", \"level\": \"%d\", \"hp\": \"%d\", \"maxhp\": \"%d\" }", enemy->name, enemy->level, enemy->hit, enemy->max_hit );
strcat( buf, buf2 );
}
#endif
}
}
strcat( buf, " ]" );
UpdateGMCPString( d, GMCP_ENEMY, buf );
}
else
{
UpdateGMCPString( d, GMCP_ENEMY, "" );
}
buf[0] = '\0';
buf2[0] = '\0';
for ( paf = d->character->affected; paf; paf = paf->next )
{
#ifndef COLOR_CODE_FIX
if ( buf[0] == '\0' ) sprintf( buf, "[ { \"name\": \"%s\", \"duration\": \"%d\" }", skill_table[paf->type].name, paf->duration );
else
{
sprintf( buf2, ", { \"name\": \"%s\", \"duration\": \"%d\" }", skill_table[paf->type].name, paf->duration );
strcat( buf, buf2 );
}
#else
if ( buf[0] == '\0' ) sprintf( buf, "[ {{ \"name\": \"%s\", \"duration\": \"%d\" }", skill_table[paf->type].name, paf->duration );
else
{
sprintf( buf2, ", {{ \"name\": \"%s\", \"duration\": \"%d\" }", skill_table[paf->type].name, paf->duration );
strcat( buf, buf2 );
}
#endif
}
if ( buf[0] == '\0' )
sprintf( buf, "[]" );
else
strcat( buf, " ]" );
UpdateGMCPString( d, GMCP_AFFECT, buf );
}
SendUpdatedGMCP( d );
}
return;
}
/***************************************************************************
* File: update.c
*
* Call msdp_update() from within the update_handler.
***************************************************************************/
void update_handler( void )
{
static int pulse_gain_exp;
static int pulse_area;
static int pulse_mobile;
static int pulse_violence;
static int pulse_point;
static int pulse_msdp; /* <--- Add this line */
Then further down in the function, call msdp_update():
if ( --pulse_msdp <= 0 )
{
pulse_msdp = PULSE_PER_SECOND;
msdp_update();
}
/***************************************************************************
* GMCP ADDON
* File: update.c
*
* Call gmcp_update() from within the update_handler.
***************************************************************************/
if ( --pulse_point <= 0 )
{
wiznet("TICK!",NULL,NULL,WIZ_TICKS,0,0);
pulse_point = PULSE_TICK;
/* number_range( PULSE_TICK / 2, 3 * PULSE_TICK / 2 ); */
weather_update ( );
char_update ( );
obj_update ( );
}
gmcp_update(); /* <---- Add this line */
aggr_update( );
tail_chain( );
return;
/***************************************************************************
* File: comm.c
*
* Add the protocol data to the descriptor in the init_descriptor() function.
***************************************************************************/
dnew = new_descriptor();
dnew->descriptor = desc;
dnew->connected = CON_GET_NAME;
dnew->showstr_head = NULL;
dnew->showstr_point = NULL;
dnew->outsize = 2000;
dnew->outbuf = alloc_mem( dnew->outsize );
dnew->pProtocol = ProtocolCreate(); /* <--- Add this line */
And later in the same function:
/*
* Init descriptor data.
*/
dnew->next = descriptor_list;
descriptor_list = dnew;
ProtocolNegotiate(dnew); /* <--- Add this line */
/***************************************************************************
* File: comm.c
*
* Free the protocol data at the end of the close_socket() function.
***************************************************************************/
ProtocolDestroy( dclose->pProtocol ); /* <--- Add this line */
close( dclose->descriptor );
free_descriptor(dclose);
#if defined(MSDOS) || defined(macintosh)
exit(1);
#endif
return;
}
/***************************************************************************
* File: comm.c
*
* Change read_from_descriptor() to parse negotiation sequences.
***************************************************************************/
bool read_from_descriptor( DESCRIPTOR_DATA *d )
{
int iStart;
static char read_buf[MAX_PROTOCOL_BUFFER]; /* <--- Add this line */
read_buf[0] = '\0'; /* <--- Add this line */
Replace this:
/* Check for overflow. */
iStart = strlen(d->inbuf);
if ( iStart >= sizeof(d->inbuf) - 10 )
With this:
/* Check for overflow. */
iStart = 0;
if ( strlen(d->inbuf) >= sizeof(d->inbuf) - 10 )
Replace this:
if ( c == '\r' )
putc( '\n', stdout );
d->inbuf[iStart++] = c;
With this:
if ( c == '\r' )
putc( '\n', stdout );
read_buf[iStart++] = c;
Replace this:
nRead = read( d->descriptor, d->inbuf + iStart,
sizeof(d->inbuf) - 10 - iStart );
if ( nRead > 0 )
{
iStart += nRead;
if ( d->inbuf[iStart-1] == '\n' || d->inbuf[iStart-1] == '\r' )
break;
}
With this:
nRead = read( d->descriptor, read_buf + iStart,
sizeof(read_buf) - 10 - iStart );
if ( nRead > 0 )
{
iStart += nRead;
if ( read_buf[iStart-1] == '\n' || read_buf[iStart-1] == '\r' )
break;
}
Then at the end of the function replace this:
d->inbuf[iStart] = '\0';
return TRUE;
With this:
read_buf[iStart] = '\0';
ProtocolInput( d, read_buf, iStart, d->inbuf );
return TRUE;
/***************************************************************************
* File: comm.c
*
* Change write_to_buffer() to avoid sending blank lines.
***************************************************************************/
At the beginning of the function, add this:
void write_to_buffer( DESCRIPTOR_DATA *d, const char *txt, int length )
{
txt = ProtocolOutput( d, txt, &length ); /* <--- Add this line */
if ( d->pProtocol->WriteOOB > 0 ) /* <--- Add this line */
--d->pProtocol->WriteOOB; /* <--- Add this line */
Replace this:
/*
* Initial \n\r if needed.
*/
if ( d->outtop == 0 && !d->fcommand )
With this:
/*
* Initial \n\r if needed.
*/
if ( d->outtop == 0 && !d->fcommand && !d->pProtocol->WriteOOB )
/***************************************************************************
* File: comm.c
*
* In nanny(), send the <VERSION> tag right after the player enters the game.
***************************************************************************/
act( "$n has entered the game.", ch, NULL, NULL, TO_ROOM );
MXPSendTag( d, "<VERSION>" ); /* <--- Add this line */
You should also do the same in check_reconnect, after setting d->connected:
d->connected = CON_PLAYING
MXPSendTag( d, "<VERSION>" ); /* <--- Add this line */
/***************************************************************************
* File: comm.c
*
* Change process_output() to avoid sending a prompt after sending OOB data.
***************************************************************************/
bool process_output( DESCRIPTOR_DATA *d, bool fPrompt )
{
extern bool merc_down;
/*
* Bust a prompt.
*/
if ( d->pProtocol->WriteOOB ) /* <-- Add this, and the ";" and "else" */
; /* The last sent data was OOB, so do NOT draw the prompt */
else if (!merc_down && d->showstr_point)
/***************************************************************************
* GMCP ADDON
* File: comm.c
*
* Add in process_output() to send out go ahead after prompt.
***************************************************************************/
if ( IS_SET(ch->comm, COMM_PROMPT) )
bust_a_prompt( d->character );
if ( !d->pProtocol->bSGA ) /* <- add this line */
write_to_buffer( d, GoAheadStr, 0 ); /* <- add this line */
/***************************************************************************
* File: comm.c
*
* Whenever d->fcommand is set to TRUE, clear the write OOB
***************************************************************************/
d->fcommand = TRUE;
if ( d->pProtocol != NULL )
d->pProtocol->WriteOOB = 0;
/***************************************************************************
* File: comm.c
*
* Replace the echo_off_str and echo_on_str with the new ECHO function.
***************************************************************************/
Replace this line:
write_to_buffer( d, echo_off_str, 0 );
With the following:
ProtocolNoEcho( d, true );
And these lines:
sprintf( buf, "New character.\n\rGive me a password for %s: %s",
ch->name, echo_off_str );
With the following:
ProtocolNoEcho( d, true );
sprintf( buf, "New character.\n\rGive me a password for %s: ",
ch->name );
Then replace both instances of this line:
write_to_buffer( d, echo_on_str, 0 );
With the following:
ProtocolNoEcho( d, false );