Embraced the usage of R32, R64, SI16, UI16, SI32, UI32, SI64 and UI64 typedef aliases as replacement for built-in types throughout the sourcecode:
typedef float R32;
typedef double R64;
typedef signed char SI08;
typedef unsigned char UI08;
typedef signed short int SI16;
typedef unsigned short int UI16;
typedef signed int SI32;
typedef unsigned int UI32;
typedef signed long long SI64;
typedef unsigned long long UI64;
As part of this process, UI32 was redefined from unsigned long int to unsigned int, and SI32 from signed long int to signed int to ensure the size of variables using these remain the same (32bit) across both Windows, Linux and MacOS for both 32bit and 64bit platforms
Replaced instances of toLong() with toInt(), and toULong() to toUInt()
Replaced instances of "long" and "int" with SI32 where possible
Replaced instances of "unsigned long" and "unsigned int" with UI32 where possible
Replaced instances of "float" with R32 where possible
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
Resolved an issue with uninitialized struct members
Removed some redundant conditional checks
Made the boolean part of JS function RegisterSkill( <skillnum>, <bool> ) actually work; can now be used to disable/enable JS-implemented skills
Fixed a bug with cHTMLTemplate::Process() where the same expression was used for both branches of a ternary operator
Various minor cleanups; removed some unused variables, addressed some potential portability issues
-JS Get/Set "vulnerable" handlers for character properties (Abaddon)
-willHunger with Get/Set HungerStatus() wrappers to CChar class (can now
selectively stop a character/creature from continuing to hunger)
-JS Get/Set "willhunger" handlers for character properties Changed:
Linux compile fixes (thanks Malketh)
Hash.h warning fixed (thanks Philantrop)
Fixes to getRootPack() and getPackOwner()
Removed many #includes from the global scope, including them in the specific files that need them
This should greatly reduce compile time and filesize, along with the need to recompile after altering most headers
Removed the linux ifdefs around typedefd function declarations, this should work with gcc 3.2
Moved global loading functions into a new cFileIO() class to take them out of global scope
Fixed an issue causing items to not be sent to the client (thanks Malketh)
Moved some global structs into the CWorldMain class
Fixed a bug causing a crash on character / item creation
Moved all effects stuff into its own class to take it out of global scope
Changed the variable CChar::region to CChar::regionNum to avoid conflicts with the cTownRegion region[] indexes
Moved getbestskill(), isHuman(), and inDungeon() into the CChar class to remove them from global scope
Took npcSimpleAttackTarget() out of global scope
Rewrote restock() to make use of restockNPC()
Changed the typedef'd iterator in hash.h to HASHITERATOR to kill a Linux warning
Renamed cEffects::soundeffect() to PlaySound() and removed unneeded overloads
Fixed a bug causing executebatch to be set with locationcount data
Rewrote cEffects::bgsound()
Documented sounds.cpp
Misc minor cleanups / fixes
Removed:
sendItemsInRange() (CChar::Teleport() does the same thing)
Many #includes that were not being used
deathMenu()
respawnnow() and moved all of its code into command_respawn()
one instance of cEffects::scpSoundEffect() and renamed the other to PlaySound()
3/13/2003
Changed
Fixed an issue allowing the server to not have a dictionary.ZRO (which would cause a crash when a dictionary entry was called with no language)
Fixed an issue causing the server to puke when it attempted a restart
Moved SpawnRandomItem() into cItem class
Moved SpawnRandomMonster() into cCharHandle class
Broke necro.dfn into fishing.dfn and digging.dfn
Made better use of SpawnRandomItem() and SpawnRandomMonster()
3/12/2003
Added:
CPOpenGump and CPSpeech packet class to remove some global vars (Note these are pretty basic classes and someone
with a better understanding of how we handle sending/recieving packets could probably expand these to make better use of them)
Changed:
Moved many global vars into the CWorldMain() class
Cleaned ResetVars() in uox3.cpp as ResetDefaults() in CWorldMain() now handles much of that
Added a check to ensure text wasn't sent twice in talking(), should fix double-speech
Cleaned up cmdtable.cpp removing a couple duplicate entries, etc
Changed target() to only require 4 values (as the first two were always 0 and 1)
Removed many unneeded typedefs and globals
Went through cServerData() and noted unused server.ini entries
Moved title1(), title2(), and title3() to cClick.cpp since that is their only usage, made use
of MAX_TITLE to ensure we wouldn't overrun the buffers, and renamed them matching what title they were
3/11/2003
Changed:
Fixed a potentially very serious bugs with how containers were being set upon loading the world
Fixed possible re-adding of weight to containers and characters at load
Fixed a bug causing equipped items that were not weapons to take damage in combat
Minor cleanups / warning fixes / Linux compatability issues (punt)
3/7/2003
Overhauls/Additions/Major Changes
Changed:
Tweaks/Object Conversions/Misc Small Changes
Changed:
Changed CItem::Get/SetLayer() to a UI08
Fixed a bug in speech causing you to see your own text twice
Fixed a nasty crash bug
-Fixed an issue allowing the server to not have a dictionary.ZRO (which
would
cause a crash when a dictionary entry was called with no language)
-Fixed an issue causing the server to puke when it attempted a restart
-Moved SpawnRandomItem() into cItem class
-Moved SpawnRandomMonster() into cCharHandle class
-Broke necro.dfn into fishing.dfn and digging.dfn
-Made better use of SpawnRandomItem() and SpawnRandomMonster()
-Moved many global vars into the CWorldMain() class
-Cleaned ResetVars() in uox3.cpp as ResetDefaults() in CWorldMain() now
handles much of that
-Added a check to ensure text wasn't sent twice in talking(), should fix
double-speech
-Cleaned up cmdtable.cpp removing a couple duplicate entries, etc
-Changed target() to only require 4 values (as the first two were always 0
and 1)
-Removed many unneeded typedefs and globals
-Went through cServerData() and noted unused server.ini entries
-Moved title1(), title2(), and title3() to cClick.cpp since that is their only
usage, made use of MAX_TITLE to ensure we wouldn't overrun the buffers,
and renamed them matching what title they were
Added:
-CPOpenGump and CPSpeech packet class to remove some global vars
(Note these are pretty basic classes and someone with a better
understanding of how we handle sending/recieving packets could probably expand these to make better use of them)
-Fixed a potentially very serious bugs with how containers were being set upon
loading the world
-Fixed possible re-adding of weight to containers and characters at load
-Fixed a bug causing equipped items that were not weapons to take damage in
combat
-Minor cleanups / warning fixes / Linux compatability issues (punt)
-Changed CItem::Get/SetLayer() to a UI08
-Fixed a bug in speech causing you to see your own text twice
-Fixed a nasty crash bug caused by changing an items layer
-Fixed a bug causing NPC's to always be the first attacker
-Armor DEF system overhauled to match OSI system
-Updated Hash Table Remove() calls to remove unrefrenced parameter "index"
-Changed cSocket::Get/SetDWord() to a UI32 to fix problems checking it against
INVALIDSERIAL and storing large serial numbers
-Changed cSocket::AddID() to a UI32 for the same reason as above
-Changed cSocket:::Get/SetWord() to a UI16 to fix possible problems storing ID's
-Fixed up calcStealDiff() to match new weight system
-Minor updates to CPStatsWindow to match the new Armor DEF system and Weight
system
-Fixed calls to getTileName() so the names container was set with MAX_NAME
-Fixed up getFieldDir() using direction typedefs
-Changed Get/SetMagic() to Get/SetMovable()
-Cleaned up some unrefrenced params
-Changed some int's to UI16's in books.cpp
-WorldSave Changes:
-XYZ and worldnum to Location=x,y,z,worldnum
-HiDamage and LoDamage into Damage=hidamage,lodamage
-Strength,st2,Dexterity,dx2,Intelligence,in2 changed to Strength=str,st2,
Intelligence=int,in2, Dexterity=dex,dx2
-DWord0-3 changed to DWords=0,1,2,3
-FX1,FY1,FX2,FY2,FZ1 changed to WanderArea=FX1,FY1,FX2,FY2,FZ1
-MoreX,MoreY,MoreZ changed to MoreXYZ=morex,morey,morez
-More,More2 changed to More=more,more2
-Type,Type2 changed to Type=type,type2
-Light,Rain,Heat,Cold,Snow,Lightning changed to
RaceDamage=Light,Rain,Heat,Cold,Snow,Lightning
-Fame,Karma,Kills changed to Reputation=fame,karma,kills
-Complete rewrite to the Weight system
-Weight is more permanent, removed need to recalc it constantly
-Packs now show the weight of themselves and all their contents
-Packs now have a weight limit (currently hardcapped to 400, should make it
based on type of container and possibly scriptable)
-All items use the weight value given to them in the scripts unless the entry
is 0 in which case they pull weight from the MUL's
-Better handling of overloaded for teleport / recall / walking
-Weight will max out at 65535 stones and can not go lower than 0 stones
-Items container is now set as a cBaseObject
-Fixed up itemsfx() and renamed it to itemSound(), now better handles Gold
sfx and where an item was dropped (ie in a pack or on the ground)
-Cleaned up goldsfx() and renamed it to goldSound()
-Many fixes to get/drop/wear/packItem functions
-Minor fixes/cleanups in movement.cpp
-Fixed a worldsave crash with tamed creatures
-Pressing 0 in console reloads items as well as everything else
-Made dagger usable for carve again
-Fixed a horse mounting distance check
-Noted (and in some cases fixed) unrefrenced variables throughout the code
-Converted inscribe.gmp to inscribe.dfn and used NewMakeMenu() in favor of the
old make menu system
-Updated GetMagic() == 3 calls to IsLockedDown() calls (as that is all it
should be used for)
-Fixed up all IsLockedDown() calls, resources that are LockedDown can NOT be
used, even by GM, until released
-Also note, items that should be usable if locked: Skill items (looms, training
dummies, etc, Recall runes)
-Moved the two functions from newbie.cpp to pcmanage.cpp and removed newbie.cpp
from the project
-Moved action() and impaction() to effects.cpp
-Moved isHuman() to npcs.cpp
-Where possible made functions that were part of classes private
-Made use of cCombat::getWeaponTyp
-Removed namespace dependance on std
-Fix for Items vanisishin when dragged to the paperdoll (xuri)
-Fix for multiple Item equip (xuri)
-Fix for linux complie issues under gcc3.2+ (maarc)
-Fix for performance dump/Logs (Dreoth)
-Fix for npcSpawn (maarc)
-Fix VC precompiler issues, For some resons warnings were not surprsesed
-Added onCommand, and GetCommandSize meathods (Brakhtus)
-Added some additional logging information for an effect and its ID (maarc)
-Replaced previous account system with new re-write(DB Support soon)