105 Commits

Author SHA1 Message Date
KimLS
0c7a861caf Fix for spell target det crash. Also added a command line arg to world ignore_db that lets you ignore the db conversion process for servers that dont need it. 2015-01-25 14:18:30 -08:00
Akkadius
e1bfbfa30c Change some world server Logging to General (Level 1) debugging 2015-01-21 19:15:36 -06:00
Akkadius
46010fbfdf Rename LoadLogSysSettings to LoadLogSettings 2015-01-21 19:04:13 -06:00
Akkadius
37b5442028 Cleanup some log entries in world 2015-01-21 18:47:36 -06:00
Akkadius
92737339b3 Properly close process files in zone and world 2015-01-21 18:46:56 -06:00
Akkadius
e4829225f6 Add file log handling in every process 2015-01-20 06:15:56 -06:00
Akkadius
7f2f6a8612 Placing Log defaults after RegisterExecutablePlatform and installing database log setting loads right after database connection for all processes 2015-01-20 05:22:15 -06:00
Akkadius
d191086d3e Add LoadLogSysSettings to other processes 2015-01-20 04:45:14 -06:00
Akkadius
45560f6654 Remove some old MySQL logging for errors 2015-01-19 23:48:30 -06:00
Akkadius
0d9b6703a6 Rename debug.h to global_define.h, update cmakelists and such 2015-01-19 04:12:09 -06:00
Akkadius
d1572790b1 Remove eqemu_error.cpp/.h as they are useless 2015-01-18 04:15:26 -06:00
Akkadius
f81a8b716b Rip out load_log_settings in all projects 2015-01-18 02:52:32 -06:00
Akkadius
467b359d0c Moved all EQEmuLogSys:: enum references used in Log.Out to a namespace 'Logs' for shortening of syntax 2015-01-18 02:20:16 -06:00
Akkadius
c025765283 Renamed DoLog to Out as the aggregate logging function for simplicity of use and shortened syntax of Log.Out 2015-01-18 02:00:15 -06:00
Akkadius
1c048cb1d1 Renamed DebugCategory to DoLog as the aggregate logging function for simplicity of use and shortened syntax of Log.DoLog 2015-01-18 01:54:09 -06:00
Akkadius
7dbde36b03 Rename reference logger to Log 2015-01-18 00:41:18 -06:00
Akkadius
132fbbb0c6 Rename LogDebugType to DebugCategory 2015-01-16 03:09:02 -06:00
Akkadius
70fbf23d27 Rename LoadLogSettings to LoadLogSettingsDefaults 2015-01-16 00:07:30 -06:00
Akkadius
6e11baf308 Convert world debugging _log to logger.LogDebugType 2015-01-12 22:28:16 -06:00
Akkadius
fac1361d36 logger.LoadLogSettings() added after each platform executable registry
Added int return for platform executable
2015-01-12 05:15:31 -06:00
Akkadius
3c53d907da Fix double construction of EQEmuLogSys 2015-01-11 22:41:44 -06:00
Akkadius
7a9860fdd1 Added EQEmuLogSys logger; pointer to the rest of the projects 2015-01-10 18:12:58 -06:00
Michael Cook (mackal)
7e2661bbc1 clang-modernize -use-auto convert for world/net.cpp 2015-01-09 03:05:14 -05:00
Michael Cook (mackal)
395be050a3 Switch random function to std::mt19937
Added class EQEmu::Random
Functions:
EQEmu::Random::Int(int low, int high)
EQEmu::Random::Real(double low, double high)
EQEmu::Random::Roll(int required)
EQEmu::Random::Roll(double required)
EQEmu::Random::Reseed()

For zone, you will access the random object through the zone object
ex.
	zone->random.Int(0, 100);

Int returns a random int between low and high
Real returns a random double between low and high
Roll(int) returns true if Int(0, 99) < required is true
Roll(double) returns true if Real(0.0, 1.0) <= required is true
2014-12-01 18:13:12 -05:00
Akkadius
3c2b8d13b9 Restructure and refactoring of database convert/upgrade check routine, breaking out to individual functions 2014-11-23 23:46:06 -06:00
Akkadius
251d4fa3e3 Implemented Automatic Database update and versioning system
Created database revision define, this is located in version.h in common #define CURRENT_BINARY_DATABASE_VERSION 9057
	- This revision define will need to be incremented each time a database update is made
	- Along with a revision define increment, you will need to update the db_update manifest located in:
		- https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/db_update_manifest.txt
		- An entry needs to be made at the bottom of the manifest, the entry is quite simple
		- Example: 9057|2014_11_13_spells_new_updates.sql|SHOW COLUMNS FROM `spells_new` LIKE 'disallow_sit'|empty|
			- This latest example is checking to see if the spells_new table contains the column 'disallow_sit', if its empty, the update needs to be ran
				- More examples of match types below:
		# Example: Version|Filename.sql|Query_to_Check_Condition_For_Needed_Update|match type|text to match
		#	0 = Database Version
		#	1 = Filename.sql
		#	2 = Query_to_Check_Condition_For_Needed_Update
		#	3 = Match Type - If condition from match type to Value 4 is true, update will flag for needing to be ran
		#		contains = If query results contains text from 4th value
		#		match = If query results matches text from 4th value
		#		missing = If query result is missing text from 4th value
		#		empty = If the query results in no results
		#		not_empty = If the query is not empty
		#	4 = Text to match
	- The manifest contains all database updates 'Required' to be made to the schema, and it will contain a working backport all the way back to SVN -
		currently it is tested and backported through the beginning of our Github repo
	- On world bootup or standalone run of db_update.pl, users will be prompted with a simple menu that we will expand upon later:

		============================================================
			   EQEmu: Automatic Database Upgrade Check
		============================================================
				Operating System is: MSWin32
				(Windows) MySQL is in system path
				Path = C:\Program Files\MariaDB 10.0\bin/mysql
		============================================================
				Binary Database Version: (9057)
				Local Database Version: (9057)

				Database up to Date: Continuing World Bootup...
		============================================================
		Retrieving latest database manifest...
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/db_update_manifest.txt
        Saved:  db_update/db_update_manifest.txt

Database Management Menu (Please Select):
        1) Backup Database - (Saves to Backups folder)
                Ideal to perform before performing updates
        2) Backup Database Compressed - (Saves to Backups folder)
                Ideal to perform before performing updates
        3) Check for pending Database updates
                Stages updates for automatic upgrade...
        0) Exit

Created db_update.pl, placed in utils/scripts folder, used for the automatic database update routine (Linux/Windows)
	- db_update.pl script created db_version table if not created, if old one is present it will remove it
Created db_dumper.pl, placed in utils/scripts folder, used for the automatic database update routine backups and standalone backups (Linux/Windows)
World will now check the db_update.pl script on bootup, if the db_update.pl script is not present, it will fetch it remotely before running -
	when db_update.pl is done running, world will continue with bootup
world.exe db_version - will report database binary version
2014-11-16 19:26:59 -06:00
Michael Cook (mackal)
be0621de42 Partial implementation of leadership in raids
Currently working: stat bonuses and client side only effects
Currently not working: Mark NPC and others that need more server side work

Currently only tested on UF, Ti and 62 may work, but not tested
SoF, SoD, and RoF need packet translators, which are most likely the same as UF
2014-10-13 21:36:59 -04:00
Michael Cook (mackal)
c0cbbf3a65 World needs to load skill cap data for char creation 2014-09-25 03:14:43 -04:00
Akkadius
4432c07081 State of Commit: Testable if you ask me (Akkadius) what you need to do
- Need to convert a list of functions and columns and should be ready to start intensive testing phase
 - All preliminary tests show things working great

- All of player profile is saved and loaded from the database
- DBAsync has been completely removed from all code
	- Removed zone/dbasync.cpp/.h
	- Removed common/dbasync.cpp/.h
	- Removed dbasync from cmake commmon and zone
- Cleaned up a ton of functions
- Added several tables to world CheckDatabaseConversions script:
	- `character_skills`
	- `character_languages`
	- `character_bind`
	- `character_alternate_abilities`
	- `character_currency`
	- `character_data`
	- `character_spells`
	- `character_memmed_spells`
	- `character_disciplines`
	- `character_material`
	- `character_tribute`
	- `character_bandolier`
	- `character_potionbelt`
- Character select now loads from `character_data`
- Character creation now creates to `character_data`
- Updated function Database::UpdateName to use `character_data`
- Updated function Database::CheckUsedName to use `character_data`
- Updated function Database::MoveCharacterToZone to use `character_data`
- Updated function Database::SetLoginFlags to use `character_data`
- Updated function Database::SetFirstLogon to use `character_data`
- Updated function Database::SetLFG to use `character_data`
- Removed CopyCharacter functions and commands, to be recreated later since it never worked to begin with
- Removed SharedDatabase::SetPlayerProfile
- Trimmed down redundant case switch statements for World sendpackets to QueryServ
- Added Character Methods to Database class:
	Loads:
		bool	LoadCharacterBandolier(uint32 character_id, PlayerProfile_Struct* pp);
		bool	LoadCharacterTribute(uint32 character_id, PlayerProfile_Struct* pp);
		bool	LoadCharacterPotions(uint32 character_id, PlayerProfile_Struct* pp);
	Saves:
		bool	SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, uint32 instance_id, float x, float y, float z, float heading, uint8 is_home);
		bool	SaveCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
		bool	SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
		bool	SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 current_level);
		bool	SaveCharacterSpellSwap(uint32 character_id, uint32 spell_id, uint32 from_slot, uint32 to_slot);
		bool	SaveCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
		bool	SaveCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
		bool	SaveCharacterMaterialColor(uint32 character_id, uint32 slot_id, uint32 color);
		bool	SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value);
		bool	SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value);
		bool	SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id);
		bool	SaveCharacterTribute(uint32 character_id, PlayerProfile_Struct* pp);
		bool	SaveCharacterBandolier(uint32 character_id, uint8 bandolier_id, uint8 bandolier_slot, uint32 item_id, uint32 icon, const char* bandolier_name);
		bool	SaveCharacterPotionBelt(uint32 character_id, uint8 potion_id, uint32 item_id, uint32 icon);
	Deletes:
		bool	DeleteCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
		bool	DeleteCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
		bool	DeleteCharacterDisc(uint32 character_id, uint32 slot_id);
		bool	DeleteCharacterBandolier(uint32 character_id, uint32 band_id);
2014-09-04 07:24:17 -05:00
akkadius
4071d88290 At point of commit:
Basic character data, currency and AA are being loaded/saved from the database, currently working on the rest right now.
- Character blob removed from load for testing. Lots of cleanup yet to be done so don't judge code yet.

Saves:
- Two FULL saves when looting a corpse, this has been reduced to just currency saves on initial loot and trimmed to one save since AddToMoneyPP did it already
- Every time a player moves coin with any situation (Splits/Trades/Merchant/Skills/Bank Coin Exchange/Coin Moves), a full save is made, this is now just a currency save
- Every time a player skilled up at a skill vendor, a full blob save hit was made, this is not just a currency hit
2014-08-31 02:53:59 -05:00
Akkadius
5cf748d135 Initial work 2014-08-27 09:55:39 -05:00
KimLS
4821ed79fb More renames, world should be done 2014-08-21 23:30:09 -07:00
KimLS
7fc21b9e3a Tons of renames 2014-08-21 19:33:02 -07:00
KimLS
06f18225ce Renaming headers is hard work 2014-08-21 17:26:32 -07:00
KimLS
b7e36feeeb Removed more socket server stuff, changed some of the build stuff. 2014-07-14 15:44:28 -07:00
Chris M
a92b4c04e9 Initial Socket Server implementation with CMakeLists.txt updated. Socket server will connect to world at this point. 2014-07-02 22:17:45 -05:00
Corysia Taware
4d70cb20e7 Merge remote-tracking branch 'upstream/master' 2014-04-07 10:05:46 -07:00
Akkadius
7cfc5b085e (Performance Adjustment) Removed AsyncLoadVariables from InterserverTimer.Check() in both zone and world. By watching the MySQL general.log file on mass zone idle activity, you can
see that the query 'SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= timestamp' is called every 10 seconds. This function is loading
	variables that are initially loaded on World and Zone bootup. When running a large amount of zone servers, the amount of MySQL chatter that is produced is enormous and
	unnecessary. For example, if I ran 400 zone servers, I would see 3,456,000 unnecessary queries from all idle or active zone processes in a 24 hour interval.
2014-04-05 03:38:58 -05:00
Corysia Taware
f6046477b4 Changes for intel Mac OSX build 2014-04-03 14:10:03 -07:00
KimLS
fcd9b525a8 Removed Common Profiler and Zone Profiler. They're well past outdated status and are just code bloat. 2013-08-29 15:46:40 -07:00
j883376
0578f45490 Revert "Revert "Merge pull request #77 from j883376/cleanups""
This reverts commit d25205d9d381dc83d610fa1084019b90cfe83e1c.
2013-06-28 04:25:44 -04:00
KimLS
d25205d9d3 Revert "Merge pull request #77 from j883376/cleanups"
This reverts commit 4ff2efea435a235b634904c91381334ce2d38e4b, reversing
changes made to e811e3975b3e6f5f1c3274a501b6f964925281fb.
2013-06-27 12:50:20 -07:00
j883376
2a39449f6e Fix exit code values
- Change all exit codes to match the standard of 0 for success
and 1 for error

- Add empty shared folder to utils/defaults for shared_memory
2013-06-21 22:54:28 -04:00
KimLS
e6fba5ba82 Merging 2013-05-23 00:31:02 -07:00
Michael Cook
0fdfe025cb Remove 'using namespaces std' fixes #61 2013-05-22 16:17:19 -04:00
Arthur Ice
fca9c1458b Merge branch 'master' of https://github.com/EQEmu/Server
Conflicts:
	common/debug.cpp
	common/debug.h
	zone/PlayerCorpse.cpp
	zone/beacon.cpp
	zone/client.cpp
	zone/net.cpp
	zone/tribute.cpp
2013-05-19 16:19:22 -07:00
j883376
4bdd8b2502 Change space indentation to tabs 2013-05-09 11:37:51 -04:00
j883376
ffcff4aea1 Remove trailing whitespace 2013-05-09 11:13:16 -04:00
Arthur Ice
23c524812d Removed the _MSC_VER special cases for Visual Studio 2008 and lower.
We no longer support 2008 and lower so these defines will never be used.
2013-05-08 17:09:13 -07:00
Arthur Ice
7560b6b0a7 NULL to nullptr 2013-05-04 18:06:58 -07:00