Commit graph

12 commits

Author SHA1 Message Date
Xoduz
37a76083de Rest of the changes for 0.99.6-RC1
Misc cleanup and standardization of style and naming conventions in code and scripts
Added missing code for showing race in paperdoll based on ini setting
Players can no longer use Polymorph spell while incognitoed, or while under effect of tribal paint
Players can no longer use Incognito spell while polymorphed, or while under the effects of tribal paint
Facial hair is now removed from players who are under the effects of Incognito spell that changes their gender for female
2022-10-24 18:39:33 +08:00
Charles Kerr
d90e16af86 changed defined FALSE/TRUE to intrinsic false/true 2022-06-06 03:55:13 -04:00
Charles Kerr
d540835eb4 2022 project filters, and name change for strutil 2022-03-04 07:35:46 -05:00
Charles Kerr
2bc886128c updated trim/ltrim/rtrim/simplify to not use regex (seems rather slow for our string sizes).
Updated to lower/toupper to be upper/lower
replaced occurrences of stripTrim with trim(removeTrailing))
replace stripComment with removeTrailing
2021-07-19 13:41:59 -04:00
Charles Kerr
75fc56b0dd NULL to nullptr 2021-06-12 07:30:23 -04:00
Xoduz
52ed2376f3 Some maintenance changes
Replaced UOX_MIN and UOX_MAX with std::min and std::max (punt)
Moved StringUtility functions into a new namespace: strutil (punt)
2021-05-27 05:42:35 +08:00
Xoduz
29acded626 Misc JS-related fixes/changes
Fixed an issue where the JS function TriggerEvent() didn't restore the original JSContext and JSObject of the calling script after calling an event in a separate script, causing timers to be associated with the wrong script when both TriggerEvent and StartTimer were used in same script
(In a previous commit) Updated KillTimers JS method to support an optional argument specifying the timerID of the timer to be killed. If no arguments are provided, it will - as previously - kill all timers for the object
2021-05-25 19:48:49 +08:00
Xoduz
f5545bf224 Additional string handling updates, a few other fixes
Fixed some missing icons in dfndata/creatures/creatures.dfn
	Updated server status HTML template page (dfndata/html/online.htf) to match other templates
	Additional string handling modernization in magic.cpp, JSEncapsulate.cpp, jail.cpp, house.cpp, fileio.cpp, network.cpp, msgboard.cpp and mapstuff.cpp (punt)

Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-27 00:26:38 +08:00
Xoduz
166d3b0119 Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
	cont		// Targeted item will be made a container, set to nondecay and movable 2
	endfight	// Targeted character (and character being fought) will stop fighting
	getmulti	// Get multiObject for targeted item
	finditem	// Find item at layer X
	movespeed	// Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)

Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
Xoduz
3e8006c648 Code cleanup
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
2020-08-12 23:46:33 +08:00
Xoduz
2a1e3685a6 More code cleanup, new JS commands
Some more code cleanup
Documented temp effect cases in code
Added SETAMMOEFFECT, SETAMMOTYPE, GETAMMOEFFECT, GETAMMOTYPE, REGIONINFO and XREGIONINFO commands to misc-cmd.js
2018-09-22 00:47:12 +08:00
Geir Ove Alnes
e1d376a1fd Updating CVS to bring it up to speed with latest UOX3 version - 0.99.2 2012-11-03 18:11:04 +00:00