-
Notifications
You must be signed in to change notification settings - Fork 1
/
DONE
1260 lines (855 loc) · 45.1 KB
/
DONE
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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
This has been done to 3.0.a0:
Number of arguments are checked at compile time, if possible.
lex isn't used any more, and no i-files need to be saved. The preprocessor
is built into the parser.
Strings written with write(), are now seen by NPCs. This means that more
intelligent monsters can be made.
A special object, /obj/master.c, is called at startup. This gives
possibilities to do special initialization, and debugging. This file must
exist ! You will find it in the source dir to 3.0.
Multiple inheritance is allowed.
Swapping of objects are done when a specified time has passed with no
reference of the object.
The reset is now called when a specified time has passed.
Player save files are saved in subdirectories named 'a' to 'z', after
the first letter of the player name. These directories has to be created
as /players/a /players/b/ etc. This also means that a wizard with a name
of only one character, suddenly will find saved characters in his directory.
New types: 'mixed', and 'type *'.
3.0.a1:
The type testing now seems to work. The types are enabled when the
type is defined for a function. Types available are 'int', 'status' (same
as 'int'), 'string', 'object', 'void' and 'mixed'. Any type can be
combined with a '*' to form an array of types. For example,
'int *' would declare an array of numbers.
The function 'command()' now returns the evaluation cost if successful,
otherwise 0.
3.0.a2:
The '+' instruction can add two arrays, and make a new big array with the
two arguments concatenated.
3.0.a3
Added flag -m, to use another mudlib directory.
Added the ? : conditional expression.
The default port is changed from 2000 to 3000.
Added a function exec(), which can be called from player.c to replace
with a new player object.
Add catch_tell(), which also catches strings sent to the monster with
'write()'.
3.0.a4
Fixed some bugs. Default port number is now 3000.
3.0.a5
Functions and variables now have both a flag field and a type field. The type
field is the type specified by the LPC program. The flag field is information
that the compiler found out.
Fixed type 'private', and 'private inherit' statement. Type 'no_mask' can
also be used.
3.0.a6
Added the empty statement.
3.0.a7
Fixed bug in find_player().
The documentation file LPmud.doc.ms was renamed to LPmud.doc.me, as it
was really on nroff -me format.
3.0.a8
The flag -o is now required when using the game driver with a mudlib of
version 2.4.6 or older. The flag stand for 'old compatibility mode'.
The following changes are nullified with the -o flag:
move_object(): Can only move current_object.
transfer(): Not supported any longer.
move_object(): exit() is not called any longer when a player leaves
a room.
Fixed a bug in create_wizard(). create_wizard() can take a second
argument, which is an optional domain name. That allows wizards too be
groped into domains, which resides in a common directory.
3.0.a9
The function destruct() was changed to behave differently. Instead of moving
objects with 'transfer()', they will be moved with the function 'move()'
called internally in the objects. As usual, when the -o flag is specified,
the old behaviour is used.
A new function shadow(), has been defined:
----------------------------------------------------------
object shadow(object ob, int flag)
If 'flag' is 0, then current object will shadow 'ob'. If 'flag' is 1,
then either 0 will be returned, or the object that is shadow for 'ob'.
An object that defines that funtion query_prevent_shadow() to return 1
can't be shadowed, and the shadow() function will return 0 instead
of 'ob'.
If an object 'a' shadows an object 'b', then all call_other() to 'b' will
be redirected to 'a'. If object 'a' has not defined the function, then
the call will be passed on to 'b'. There is only one object that can
call functions in 'b' with call_other(), and that is 'a'. Not even object 'b'
can call_other() itself. All normal (internal) function calls inside 'b'
will however remain internal to 'b'.
There are two ways to remove the shadow. Either destruct it, or the object
that was shadowed. In the latter case, the shadow will also be destructed
automatically.
The result is that it is possible to hide an object behind another one,
but everything can be totally transparent.
----------------------------------------------------------
3.0.a10
write() from a shadowing object will now be transfered to the shadowed
object.
say() will likewise be sent to objects around the shadowed object whe called
from a shadowing object.
Fixed some line number counting bugs.
3.0.a11
Fixed the shadowing data structure, to enable an unlimited number of
shadows to one object.
Objects must inherit std/object.c if they want to be moved, or moved into.
The -o flag will as usuall remove this requirement.
Fixed a bug in restore_object and save_object, so that the 'static'
information is used.
Merged from Marion's version:
Fixed some bugs.
swap now relocates the program pointers
main recognizes '-s<num>' for an alternate time to swap as an invocation
parameter
fixed the double include of time.h in interpret.c
function_exists had a null dereference when an overloaded function was
involved in the examined object - fixed
set reference debugging to level 3
save_object() and restore_object() can now handle arrays.
Included a large amount of fixes by Klaus Rennecke.
3.0.a12
call_out_info() returns an array of all pending call outs.
Every item in the array consists of 4 items (but only if the object not is
destructed):
* 0: The object.
* 1: The function (string).
* 2: The delay.
* 3: The argument.
Probably only interesting for administrators.
3.0.a13
player_parse() did not always restore current_object in time, which means that
static declared functions sometimes was not found.
fixed save_object(), which were broken when used in compatibility mode.
Fixed a bad bug in the inherit handling in lang.y. The error would occur
sometimes when multiple inheritance was used. An almost random address could
be called.
The documentation is slowly growing.
3.0.a14
Efuns file_name() and function_exists() returns filename with leading '/'
Efun living() returns 0 for other arguments than objects.
Implemented: string read_file(string).
Added a new complex permission system. Look at LPmud.doc for more information.
New function: version(). Will return "03.00.14" for this version.
The number 14 is the patchlevel.
Improved the line number report given at errors.
Fixed bug in 'ed', that made it impossible to use.
3.0.15
function_exists() and file_name() returns a leading '/' on the file names,
which was incompatible with mudlib 2.4.5 and older. This was fixed
when using -o flag.
3.0.16
Fixed some type tests and better error messages when type problems.
Fixed several small bugs when parsing commands.
Reinstalled call of 'load_first_objects()' when -o flag is used.
Added automatic include of documentation of lfuns and efuns into the
LPmud.doc document. They should be sorted also (by make_docs).
3.0.17
Fixed bug in dump_trace(), which could crash the game when in heart beat.
Fixed bug in save_object(), which enabled wizards to save anything on their
own player save file.
Fixed lex.c, so that comments are allowed in '#if' statements, and so that
the '#if' statement allows expressions of the type '!VAR'.
3.0.18
Allowed '*' i type of argument declarations.
Fixed bug in error message printed when type error.
The numeric value 0 can now be used to index arrays and strings. It did
generate a type error.
Fixed a better test of type equality.
3.0.19
Fixed load_object() to take an extra parameter for not resetting object
after load. This is used in mudlib 3.0 for inherited objects. Only when the
ENTIRE object is loaded (all inherited objects loaded) is its reset() called.
Fixed bug in input_to(), which did not check if command_giver was a valid
pointer.
A program truncated just after a string start with " would generate a fatal
error.
load_first_objects() should load objects using find_object(), not
load_object().
When swapped objects are destructed, they have to be loaded.
3.0.20
Fixed the type returned by '&&' and '||' operator.
The type checker now allows indexing on strings.
Indexing on a type 'mixed' now gives a type 'mixed'.
Use of an undeclared variable would give it a random type, which could
crash the game.
Fixed some memory leaks when restore_array failed.
create_wizard() can return 0, which must not be pushed as a string.
3.0.21
Changed restore_size(), to return -1 for failures instead of the legal value
0.
Implemented "#pragma strict_types", which will ensure strict type checking
for the rest of the code in that file.
Changed priority of assigment and the '?' - ':' operator, which was
erroneous.
Fixed how '\' was used in the 's' command to ed.
3.0.22
LA: Added query_ip_name changes.
LA: Added latest fixes to lex.c.
',' is allowed in the end of lists again: ({ 1, 2, 3, });
filter_objects() was accidently renamed to filter_array(). It has been
renamed again, to filter_objects().
query_ip_name() has been implemented. It uses an asynchronous process, to
ensure that no slow down is experienced.
3.0.23
JnA: When epilog() is called with o_flag false, it gets e_flag as argument.
JnA: Because preloading of objects is done in /secure/master.c in mudlib3.0
xt: In 3.0 void is in /d/Standard/void.c instead of /room, because of the
xt: new security stuff.
query_level should not be called from error() if the living object
is non-interactive or destructed.
A more careful limitation of number of read characters is used in comm1.c
when reading characters from players. It is difficult, becaus the read
text can expand up to a factor 3 in worst case.
Sources to some sub-programs are now provided in subdirectory 'util'.
The compiled results of these will be moved the a binary directory that
is defined in Makefile.
The new binaries are 'indent' (for reindenting LPC from inside the game),
and restart_mud (which is really a command procedure).
The definition of MUD_LIB has been moved from config.h to Makefile.
The function 'version()' had a bad return type, which was changed to 'string'.
3.0.24
exit() wasn't called in the -o mode.
present(object ob, object env) returned 'env', not 'ob' when true.
Fixed a severe memory leak in instruction F_RETURN.
Added a search list of where to search for include files.
ctime() returned current time, instead of using the argument.
Fixed some changes for SCO unix and AIX.
3.0.25
save_object() should not do fatal error whwn failure to open file for
writing.
The '#pragma strict_types' are now not propagated from #include files.
catch() is defined to return a value of type 'mixed'.
living() now only accepts an 'object' as argument.
objectp(), stringp(), intp() accepts any type.
explode() with empty string will no longer crash the game.
clear_vector_refs() now really does clear the ref counts.
count_ref_from_call_outs() failed to count references for arguments to
call outs.
Fixed updating of total_prog_block_size, so that the 'status' commands
reports correct info about programs.
3.0.26
There was a bug in '>=' for strings.
Fixed bug in >>=
LA: Added a 'trace()' efun to aid debugging.
Fixed a bad efficiency bug in add_to_mem_block().
Fixed a bug in crypt(), which would generate bad salts.
Implemented "int member_array(mixed elem, mixed *arr);" It will search
for "elem" as an item in array "arr", and return the index if found.
Otherwise, -1 is returned.
3.0.27
All calls to master_ob are now checked, to see if it has been destructed.
A function 'assert_master_ob_loaded()' will reload master_ob if destructed.
Do not do 'apply(fun, master_ob, args)' any more, but rather
'apply_master_ob(fun, args)'.
JnA: New scheme for preloading in 3.0, epilog() in master returns an array
JnA: of filenames and the gamedriver calls preload() in master with each of
JnA: those filenames as argument. This is done in: preload_objects()
The 'status' command now also shows the reserved memory area.
JnA: make_unique debugged, it should not dump the game anymore
JnA: process_string added to speed up 'value by function call' especially
JnA: in the say/'met' strategy used in mudlib3.
Moved array manipulation functions into array.c
The type system has been extended with checks for number of arguments.
The check is only done when type check is enabled. Functions can now be
declared of type 'varargs', which will turn off this check.
3.0.28
Line number reports were off one line per #if - #endif.
Error reports were given for calling specific functions defined
by inheritance.
Specific function calls defined by inheritance are now resolved
immediately.
Function 'implode()' now returns empty string instead of 0 for empty arrays.
JnA: All array efuns are now returning ({}) not int 0, explode is dubious
JnA: though.
JnA: filter_array and map_array can now take its 'object' argument as a
JnA: string in the same manner as the first argument to call_other()
3.0.29
Fixed a bug in player_parser, which could dereference a dangling pointer
(the sentence of a command just executed could be deallocated if the command
moved the player).
Fixed a bug in transfer(), which would not check prevent_insert correctly.
This bug did only affect the -o mode.
The hard-coded command 'status' now displays information about allocated
arrays.
The file void.c is no longer loaded, nor needed. The only difference, is that
objects in destroyed rooms are also destroyed, instead of being moved
to the void.
LA: Added some checking when hname starts to avoid looping in select.
Fixed a bug in call of hname, which could be problems on some
architecture.
There was a test in ed_start, that only allowed ed() to be started
by a special object. The test is removed, and is not needed as
valid_path_name() is called instead.
3.0.30
Fixed a bug in the shadow logic wich would fail to report facts about
shadows.
Fixed a bug in make_unique(), which didn't work when third argument
was missing.
Fixed a function
int find_call_out(string func_name);
which will return the time until this call out will occur.
Fixed a function
int interactive(object ob);
which will return a non-zero number if object ob is an interactive player.
The symbol "LPC3" will automatically be defined when loading
objects. It can be used for '#ifdef LPC3' etc. The symbol 'COMPAT_FLAG'
will automatically be defined if '-o' is specified as argument.
The swapping algorithm has been changed. A test is done for every object,
comparing to a time stamp. If the object hasn't been touched for a while,
it could be subject for swapping. Here comes the new thing: the function
'clean_up' will be called in the object. If the object still remains,
the old swapping algorithm will continue. That means that objects that
would never be subject to swapping (cloned objects) now has a chance
to self-destruct. It also means that rooms that contains no important
data can self-destruct. Self-destruction saves more memory than
swapping, as swapping only frees the program code, while self-destruction
also frees the internal object representation.
3.0.31
The 'status' command now reports the space used of object including
variables.
LA: Added object names in tracing.
LA: Added traceprefix to limit trace information.
LA: Merged changes to evaluate expression in #if.
Also added processing of defined in the expressions.
Fixed a memory leak in ed() when doing command 'x'.
There is a new function 'get_wiz_name()' that should be defined in
the master.c object. A master.c file is provided with the source, which
includes an example.
Fixed a memory leak in the compilation that occured when there was a
compilation error.
3.0.32
The call to legal_path() is done again (for the version not using -o).
Added support for NeXT.
Added support for using the system malloc.
A new access permission system has been added, much better than the old.
Look at ACCESS.ALLOW for more information. Don't forget to copy this file
to your mudlib if you use this new system (specified by config.h) !
Fixed a bug in make_unique(), which assigned an svalue without updating
the ref count.
Now testing and calling reset() from call_other(), as was done in
2.4.5. This test was accidently lost in 3.0.
3.0.33
When create_wizard() is called, the function 'verify_create_wizard'
will be called with the name the object that did the call. If this
function returns 0, then create_wizard() will fail. Note that
'valid_castle_place' is no longer called. Sorry for the change. See example
in the provided master.c.
It is now allowed again to do add_action() to a function named 'exit',
but only when not in -o mode.
Fixed a bug in shout(), that could modify the string argument.
Fixed yet another memory leak at compilation by ensuring that epilog()
is called.
3.0.34
LA: Fixed some bugs in lex.c.
The swap file is now automatically removed at shutdown().
Fixed a slight bug in save_array() that would save object as ",0" instead
of "0,".
query_level is no longer called from 'set_living_name()'. The results
is that wizard commands will again give points to the wizlist structure.
This should be solved in a cleaner way.
Fixed some bugs in 'ed', for how to handle '\'.
The 'ed_buffer' pointer has been moved into the interactive structure
from the object structure.
The command ed(), can now use a second argument, which is the function
to be called when the player exits ed. It will be called in the same
object that called ed().
JnA: Fixade 'fixen' i make_unique
The call of clean_up() has been modified. There is a constant in config.h
that defines how long time until clean_up is called in an object. This
call is independent of reset() and swapping. It is recommended that the
swapping time is something short, like 10 minutes to 30 minutes, while
the time to clean_up is longer.
3.0.35
Added a protection against recursive call of assert_master_ob_loaded().
This could happen when error in master object.
JnA: Fixed some bugs in process_string, it actually works now :-)
Fixed a bug in eval_instruction() where F_INDENT was executed. Added a missing
'break;', which would be disastrous when illegal file name was given.
Added new commands to the editor: help and indenting. There are thus two ways
to indent LPC code. Probably only one needed. Which one is preferred ?
Fixed several bugs in the swap/reset/clean_up logic. Recommended values
are that the swap time is short (less than 30 minutes), and that reset time
is medium (aprox 60 minutes), and that time to clean_up is long
(greater than 1.5h hours). Any feedback of how to best tune these values
are welcome. The call of reset will be done once, and not yet again until
the object has been touched. This enables reset'ed objects to stay swapped
out. If you have a mudlib that has no ojbects that defines 'clean_up', then
you may better define this time as 0, which means never call clean_up (and
thus never swap the object in needlessly). A well implemented usage
of clean_up is better than the swap algorithm, as even cloned objects
can be cleaned up and a self destruction is more efficient than swapping
(memory wise).
3.0.36
Fixed a bug in shadowing, how catch_tell was called. It would fail when
catch_tell is defined by the player object.
Fixed several bugs in the tracing mechanisms.
Changed mechanism of calling clean_up() slightly. Only objects that defines
the function will be called. And, only clean_up() that returns non-zero
will be called again. This will minimize calls of clean_up(), while still
cost very litte to maintain.
When an object is destructed, all pointers to it from the stack is
immediately removed. All tests of destructed objects as arguments on
the stack has been removed. Previously, there were tests in many efuns.
A simple command procedure, 'configure' is provided, that asks for
configuration details to be used by the Makefile. It will answers in
config.data, and reuse it if wanted. The idea is to simplify updates of
new versions of LPmud.
3.0.37
Provided support for IRIS-4D/340 using gcc (defining 'sgi').
create_wizard() will no longer make a workroom when in -o mode, so as to
be compatible.
The definition of CASTLE_ROOM (in config.h) has a new meaning when not
defined. In that case, the castle will be put in the same room as the
player.
The verify_create_wizard() defined in master.c was bad. A correct one
is now supported (for 2.4.5). If this function is incorrect or non-existent,
then create_wizard() can never be called successfully.
clean_up() now gets a flag as argument, which will be non-zero if the the
program of this object is used for inheritance by other objects.
3.0.38
Fixed a bug in catch() that could crash the game. This happened
when the code inside catch called a local function, which did something
that triggered an error.
JnA: trace() and traceprefix() fixed to work with mudlib3 in a correct way
RW: A missing call to valid_write() in log_file() added.
JnA: Local log files should be under peoples homedirs, not in /log This has
JnA: been fixed for mudlib3.
JnA: Efun geteuid() added for 3.0, the simul_efun version had no possibility
JnA: of finding out effuser 'from the start'. This messed up the secsystem.
move_object() in -o mode will clear the O_RESET_FLAG, which will force a
new call of reset() sometime. This is only needed in -o mode.
Added protection against snooping loops.
Fixed a fatal bug in shadow(), that crashed the game when asking for shadow
while non existed.
3.0.39
A new file, func_desc, has been created that defines number of arguments,
return types and types of arguments for all efuns. A program, make_func, will
automatically generate a file efun_defs.c that is included into lex.c.
The base for compile time type checking is also done this way.
JnA: get_log_file() added to get the filename of where to log errors for a
JnA: given file. This is a function in wiz_list.c called from smart_log. It
JnA: calls the corresponding function in /secure/master. It is not used
in -o mode.
JnA: Fixed a bug in map_array that dumped the GD when map on a nonexistent
JnA: function was performed.
A major change has been done with the way reset() is called. When the
object is loaded first time, create() is called instead of reset(0). When it
is time for next 'reset', then reset() will be called (without arguments).
The -o flag is a compatible mode as usual. A good coding technique may be
to call reset() from create(). The mudlib.n found at alcazar.cd.chalmers.se
has been changed apropriately.
3.0.40
Added handling of hexadecimal numbers in lex.c and fixed a line number
counting bug.
Fixed a bug for not clearing the O_RESET_STATE flag by
moving it from apply() to apply_low().
The setup in the editor can now be saved. Use 'hset' for info. The save
setup mechanism is in master.c: save_ed_setup() and retrieve_ed_setup().
There are two mechanisms provided. One that save setup into a file, and
one that saves setup in the player dedicated flags. The file saving
method is default.
Errors are now logged by calling function log_error(file_name, message)
in master.c. It is thus easy to change how to handle error messages.
The old function, get_log_file() in master.c has been removed. This is yet
another step of moving hard coded dependencies from the game driver to
the master.c object.
3.0.41
Types are now checked for all arguments to efuns. Expect errors if you
have not casted the return value from call_other(). No argument types are
checked if the the type checking is not enabled (which is done by defining the
type of a function definition).
Inet packets are now buffered, and flushed later.
The master.c (in -o mode) is now allowed to read and write any file in the
mudlib (but not outside).
The code for the efun creat_wizard() is now moved to master_creat_wizard()
in master.c (see example). It is thus easy to customize.
3.0.42
JnA: "destruct_environment_of" is now called in master when the environment
JnA: of an object gets destructed and the destructed environment does not
JnA: have an environment itself, ie in rooms. This is so players will not
JnA: get disconnected when the room they are in get destructed.
JnA: If this func does not exist in master or does not move the object from
JnA: its location then the object is destructed.
Efuns can now be access with the syntax 'efun::fun' where 'fun' is the name
of the efun. That means that efuns can be accessed even if it has
been redefined.
The bug that required prototypes for recursive functions has been fixed.
If a command moves the player and returns 0, then an error will be
generated. This was silently accepted previously.
JnA: process_string() is called from notify_no_command() i comm1.c
JnA: This enables notify_fail() to work with 'value by function call'.
JnA: Rehacked process_string() so it looks presentable, it didn't before.
Added add_xverb().
Fixed bugs in the auto indent option of ed.
The '?' command in ed started the search on the wrong line.
'ed' can now handle names for new files.
Fixed a bug when a player went link-dead with inet packets pending and some
other bugs for handling flushing.
3.0.43
Added an option 'excompatible', which means that round brackets in reg exp
needn't be escaped.
The regexp now allows \< and \> for matching start and end of word.
Fixed more bugs with the flushing of inet packages.
JnA: Total rehack of parse_command. Even I couldn't read the old mess.
JnA: Fixed a small bug in process_string which produced a star to much.
3.0.44
Made a constant array of size 0, for all to share. This saves memory, and
means that all variables set to ({}) uses as much memory as variables
containing numbers. It will also mean that the test "({}) == ({})"
will evaluate to true.
The types of arguments to '+' is now checked (when type testing is enabled).
Expect errors if there is a call_other with no cast.
Implemented switch() statement, which takes a number or string as argument
(thanks to J|rn Rennecke!) It uses a sorted table to speed up searching.
Strings are very efficient, using the shared string table. Don't have a
return statement inside the switch statement. It will crash the game due
to a bug.
The definition of INC_LIST in config.h has been removed. Instead, there
is a function 'define_include_dirs()' in master.c that returns an array
of these strings. That also means that the master.c is compiled without
automatica search for include files. If master.c inlucde any files, make
sure these has absolute path. This is simply found out when the game driver
is started :-)
Fixed some bugs in preload(). It didn't behave well when there was an error.
Nor did it free the array of castle names.
Changed read_file(), to take an optional start and end argument.
Fixed a bug in 'ed', which could crash the game when trying to edit a file
that you did not have permissions to.
3.0.45
Fixed a bug in call_out, where destructed objects would not increment the
time to next object in ther list of call outs to be executed.
call_out will now save and restore this_player(). That means that 'write()'
will send messages to the player etc. It also means that efuns requiring
valid_read and valid_write in the player object can be used (was only needed
for -o mode).
Fixed a bug in log_file() which would only work for -o mode because
valid_write was called with wrong argument.
Fixed a memory leak in load_object() which would not deallocate used arrays.
Changed the way reference counts for programs were updated, the old one was
ugly and buggy.
The 'status' command was cleaned up. The command 'status tables' can also be
given for verbose information about various tables.
Added interface for 'mudwho'. Define symbol MUDWHO in config.h and
some constants in mudwho.h if you want to use it.
Fixed a bug in smart_log(), which could crash the game for very long
error messages.
JnA: Replaced '*' in process_string with '@@', which is more uncommon
xt: made new efun rename().
cat() now returns number of lines that was printed.
It is now considered an error if objects are destructed at call of init().
Strings were not freed when multiple calls of notify_fail() was done.
The switch-statement has now been fixed so that it is poossible to do
'return' in it. It is also possible to use numeric intervals like
'case 1..100:'.
JnA: Fixed small bug in new_call_out which dumped the GD if command_giver == 0
JnA: Fixed a bug with fclose() in restore_object(), dumped the GD
RW: snoop: Added a backwards compatible patch to set_snoop. There is
now a new function in comm1.c (new_set_snoop) that defines the
mudlib 3.0 version of set_snoop. The difference is that the efun
in !o_flag mode takes two arguments, snooper and snopee and checks
with the function valid_snoop() in master.c if this is permissable
or not. The new function breaks previous snoops if necessary
relying on the mudlib to decide if this is ok or not. Neither does
the new function write anything to the player, but expects the mudlib
to take care of that as well. The efun returns the object snooped on if
success, otherwise 0. Note however, that in o_flag mode, the
functionality is just as before.
RW: query_snoop: Fixed so that in !o_flag mode query_snoop can only be
called from the master object.
3.0.46
RW: query_snoop was declared as returning string while actually returning
object. Fixed in efun_spec.
Fixed a bug in log_file(), which called valid_read instead of valid_write()
(does not apply to the -o mode).
The saved commandgiver in call_out() was not properly freed in circumstances
of errors.
JnA: Added read_bytes() to read a given number of bytes from a given position
JnA: in a file. This will be used in CDlib to implement the worldmap.
JnA: Remade the principal functionality of parse_command(). It is now a lot
JnA: more efficient if properly supported by the mudlib. This makes it not
JnA: backwards compatible, meaning the old parse_command() is run in -o mode.
JnA: this_player(1) returning current_interactive
Applied changes for MSDOS.
JnA: move_or_destruct: should call move(to,1) in objects in mudlib 3.0
JnA: It is dubious if the objects should be moved at all and not just
JnA: destructed.
New restrictions has been defined for when a shadow may be used. A function
query_allow_shadow() is called in master.c, which should return 0 or 1
to deny respectively allow shadowing. The example in the provided master.c
will define such a function that is compatible with the old way of calling
query_prevent_shadow() in the victim. It is thus easy to change the shadowing
into both allow never, allow always and allow sometimes, whatever you prefer.
The file lang.y is now automatically generated from prelang.y and postlang.y
with make_func, which uses func_spec.
JnA: Added docs in parse.c and some support functions in master.c
3.0.47
Got rid of the shift/reduce conflict from lang.y.
Renamed the game driver to 'driver' instead of 'debug'.
Enabled subtracting of arrays, which will do a set operation.
Enabled default argument to some efuns. For example, all_inventory() will
use this_object() as argument if none specified.
There can now be third optional argument to tell_room(), an array of objects
to be excluded.
There is a new function:
string *get_dir(string)
that takes a path as argument and returns an array of file names in that
directory.
get_dir("/w"); returns ({ "w" })
get_dir("/w/"); and get_dir("/w/."); return contents of directory "/w"
get_dir("/");, get_dir("."); and get_dir("/."); return contents of
directory "/".
New efun:
mixed assoc(mixed key, mixed *keys, mixed *|void data_or_fail, mixed|void fail);
Searches a key in an alist.
Three modes of calling:
i ) With exactly two arguments, the second being an array which's first
element is no array.
In this case the entire array is searched for the key; -1 is returned
if not found, else the index ( like member_array, but faster ).
ii) With two or three arguments, the second being an array which's first
element is an array.
The array has to have a second element of the same size;
the key is searched in the first and the associated element of the
second array that is element of second argument is returned if succesful;
if not, 0 is returned, or the third argument, if given.
iii) With three or four arguments, the second being an array of keys
( first element no array ) and the second is a matching data array.
returns 0 or fourth argument ( if given ) for failure,
or the matching entry in the array given as third argument for success.
Complexity : O( lg(n) ) , where n is the number of keys.
Return value is undefined if another list is given in place of a presorted
key list.
New efun:
mixed insert_alist( mixed key, mixed data_or_key_list..., mixed * alist);
inserts an entry into an alist, or shows the place where this is to be done.
When called with the last argument being an alist:
The first argument is a key to be inserted, the second and all the
following but the last are data to associate it with.
The last has to be an array with as much elements as key and data arguments
are given, the matching key and data arrays; this should be already an
alist, or the return value will neither be an alist.
Return value is the enlarged assoc list ( array of two arrays ).
If the key is already in the list, the data is simply replaced
in the returned list.
When called with the last argument beinig a list of non-lists:
The call has to be done with exactly two arguments.
The first argument is a key to be inserted in the presorted key list
( first element of an array that is an alist )
that has to be given as second argument. Return value is the index
where the key has to be inserted to preserve the structure of a presorted
alist, or the index where the key has been found.
Return value is an int.
CEVEATS: when called with certain string keys, the correct place might
change after the call. So better don't use this mode of calling with
a string key.
Complexity O( lg(n) + a*n ) Where n is the number of keys and s is
a very small constant ( for block move );
New efun:
mixed *order_alist(mixed *keys, mixed *|void data, ...);
Creates an alist.
Either takes an array containing keys, and others containing the associated
data, where all arrays are to be of the same length,
or takes a single array that contains as first member the array of keys
and has an arbitrary number of other members containing data, each of wich
has to be of the same length as the key array.
Returns an array holding the sorted key array and the data arrays; the same
permutation that is applied to the key array is applied to all data arrays.
Complexity is O( n * lg(n) * m ) , where n is the number of elements in the key
array and m is the number of data arrays + 1;
Note that the the dimensions of the arrays are used the other way than in lisp
to allow for faster searching.
Keys have to be of type integer, string or object. Types can be mixed.
New efun:
mixed *sort_array(mixed *arr, string greater_fun, object ob);
Returns an array sorted by the ordering function ob->greater_fun()
The function 'greater_fun' in the object 'ob' is continously passed two
arguments which are two of the elements of the array 'arr'. It should return
true or a positive number if the first argument is greater than the second.
A parse_old.c was copied from 3.0.45 parse.c, and the new parse.c is not used
currently.
3.0.48
get_dir() and ls() will now also return files with the suffix .i.
Fixed a function in array.c that was defined in the ANSI way.
read_bytes() will no longer convert newlines to spaces.