Bitfields for bpl15 [by Rick Glover]
Patch Posted Thursday, March 18th @ 07:20:56 PM, by George Greer.
Rick Glover wrote in with another first. A patch that exceeded the 64kB limit for a text field in my SQL server... It's about "... bitfields, which are used to eliminate the limitations on how many room, exit, player, mobile, preference, affect, item wear, item specials, etc. flags that you can have." Click below to read more about it. Click here to download.
These are bitfields, which are used to eliminate the limitations on how many
room, exit, player, mobile, preference, affect, item wear, item specials, etc.
flags that you can have.  Normally this is limited by the size of your
compiler's long integer length, but with bitfields you can ignore this and add
virtually as many as you like.  Some slight modifications to the code need to
take place to get the number of flags above 128 while parsing the mob and obj
files, but everything has been tested and works well as it is.

This appears to be somewhat portable.  It runs fine in Linux and in Win95 with
MSVC5.

This is NOT originally my code.  I took it from a previous version that was
applied to CircleMUD 3.0 bpl8, but the original author was a mystery.  This
patch was made to work with the latest version of CircleMUD 3.0 bpl15 (not
officially released) and I did make several modifications and fixed some bugs
from the original code.

Your pfiles and rent files will have to be wiped or converted (pfilecnv) to use
this modification to your code.

Most of the code is documented and you will, in general have to make the
following modifications to your non-stock code:
	-Any checks for IS_SET that will use bitfields change to IS_FIELD.
	-Any REMOVE_BIT code that will use bitfields change to REMOVE_FIELD.
	-Any SET_BIT code that will use bitfields change to SET_FIELD.
	-You may not directly assign a value to a field, such as
	  af.bitvector = AFF_POISON;
	Instead, you will have to EMPTY the field, then SET_FIELD the field.
	-You cannot use | to separate flags, they must be all separate checks.
	-You cannot use the asciiflag_conv() function for bitfields, use the
	  macro ASCIICONV() for that purpose.
	-You cannot use sprintbit() function for bitfields, use the
	  sprintfield() function instead.
	-Change spell definitions flags to their equivalent ascii values as
	  shown in that part of the code.

Please feel free to put my name in the credits of your mud for my effort on this
project.  Also, questions and reports are welcome, but I am not responsible for
any loss of data, hair, sleep, etc.

Rick Glover
magik@thegrid.net

<< CircleMUD 3.0 bpl15 | Reply | View as text | Flattened | Server-side compression for bpl15 >>

 


Related Links
  Linux
CircleMUD
Rick Glover
Click here to download.
Related Articles
More by greerga