Compare commits

...

1517 Commits

Author SHA1 Message Date
aleos89
d8b554f1ad Removed Gospel buffs on logout
* Fixes #3426.
* Remove miscellaneous buffs given by Gospel on logout to prevent stacking.
Thanks to @FriggRM and @mrjnumber1!
2018-08-27 10:02:25 -04:00
Atemo
c856b07c45 Suggestion of 'killedgid', variable set when a monster is killed containing the monster game ID (#3418) 2018-08-23 15:49:32 +02:00
Atemo
d8bcc912d8 Fix for issue #3412 'Global instance timer' (#3414)
On official server the instance timer starts when the instance is created.
2018-08-23 15:48:54 +02:00
Atemo
8e51117aaa Updated accessory enchants of ep16 according to kRO 2015.02.25 (#3415)
* Additionally fixed a potential warning in RoomOfConsciousness.txt
2018-08-23 15:48:06 +02:00
rAthenaAPI
da18243981 SQL synchronization 2018-08-23 15:47:40 +02:00
Atemo
68d53c1940 Added card in monster's card slot for monster in sarah and fenrir instance (#3416) 2018-08-23 15:47:32 +02:00
Aleos
7730160299 Corrected a compilation error (#3423)
* Fixes #3422.
* Resolves CELL_NOSTACK having a compile error when enabled.
Thanks to @SnotraRM!
2018-08-23 09:21:02 -04:00
rAthenaAPI
429541fb81 SQL synchronization 2018-08-20 17:09:04 +02:00
Atemo
2e133ed07f Item scripts from kRO 2017.05.10 update (#3411)
Item scripts from kRO 2017.05.10 update
* Iara Card
* Piranha Card
* Curupira Card
* Tucan Card
* Jaguar Card
* Headless Mule Card
* Boitata Card

* 'Tucan Card' have been changed to 'Toucan Card' to match the monster's name which drops the card
* Added the cards in the monster's card drop slot as suggested by @Lemongrass3110 !
2018-08-20 17:08:53 +02:00
Kakaroto
ef2bf5b0ef Insignia MATK Fix (#3404)
Fix of the magic attack bonus of the skills was not increasing.
2018-08-18 14:19:28 +07:00
Lemongrass3110
f42696bfd7 Added new quest info icons
Fixes #3374

Thanks to @Balferian
2018-08-18 00:08:20 +02:00
Lemongrass3110
0d4b351703 Added Lutie Kafra in renewal
Fixes #2976

Thanks to @AzarthMZintos
2018-08-17 23:33:12 +02:00
rAthenaAPI
3fc88fe6c6 SQL synchronization 2018-08-17 10:27:35 +02:00
zackdreaver
91667a9a11 Update Renewal and Pre-renewal Morocc NPCs (#2977)
Fixes #3392 

Thanks to @zackdreaver, @AzarthMZintos and @Lemongrass3110
2018-08-17 10:27:26 +02:00
Lemongrass3110
ae89b3a7b2 Fixed a possible mapserver crash 2018-08-16 21:15:25 +02:00
Atemo
3d8104d7fb Suggestion: checkwall script command (#3393)
* Added checkwall script command
- Included the checkwall in npc folder
2018-08-14 20:58:49 +02:00
Sader Fawall
9cba66c22e Fix string case in inarray command script (#3401)
* Fixes #3400.
Thanks to @anacondaqq and @sader1992!
2018-08-14 12:26:29 -04:00
Aleos
4befcf747f Corrected SECURE_NPCTIMEOUT behavior (#3394)
* Fixes #3381 and fixes #3391.
* Properly end NPC sessions when a player times out.
Thanks to @mazvi, @anacondaqq, and @gustavobrigo!
2018-08-11 16:13:24 -04:00
Aleos
9ca000a4a7 Official Spiritual Sphere Absorption behavior (#3367)
* Follow up to 4f97c74.
* Fixes #3357.
* Updated Sphere Absorption to official behavior
* Sphere Absorption will fail if casted on an ally.
* Should only succeed on self or enemy targets.
* Removed Cursed Circle check as it's not needed anymore.
2018-08-10 20:29:05 -04:00
Yashim Wong
c731465a52 Updated Acid Terror damage modifier for renewal (#3346)
* Renewal formula adjusted to 80 * skillLevel + 200.
Thanks to @syracuase and @mrjnumber1!
2018-08-10 17:54:12 -04:00
Aleos
2ab298076c Cleaned up header guard names (#3395)
* Fixes #3385.
* Updated the header guard names to C++ standards.
Thanks to @elfring's suggestion!
2018-08-10 15:57:50 -04:00
Aleos
48ae1a1e05 Cleaned up map storage type (#3384)
* Fixes #3369, fixes #3370, and fixes #3382.
* Converted maps storage container back to static array.
* Converted mapflag storage containers to unordered_map.
* Removed a lot of redundancy and recursive lookups.
* Fixed a couple short-circuit checks to help with performance.
* Fixed multiple instance creation/destruction issues.
* Fixed PK Mode attempting to set PvP on flags that are already active.
* Getting MF_RESTRICTED will return the map's zone value instead of the state.
* Converted mapflag macros to inline functions.
Thanks to @teededung, @lelouch22, @mazvi, @Lemongrass3110, and @cydh!
2018-08-10 13:52:07 -04:00
rAthenaAPI
11b255e0e9 SQL synchronization 2018-08-07 05:01:22 +02:00
rAthenaAPI
5032a5fb59 Mob and NPC Identity Update 2018-08-07 05:00:56 +02:00
Cydh Ramdh
83c8183a2e Added IG_PRIVATE_AIRSHIP (#3378)
* Item group for Private Airship tickets
2018-08-06 08:06:30 +07:00
rAthenaAPI
a0f55ac7e0 SQL synchronization 2018-08-05 00:39:06 +02:00
BrOgBr
f69d5d397d Fixed some items and combos (#3352)
* Fixed some items and combos

Thanks to https://divine-pride.net to provide them!
2018-08-05 00:38:52 +02:00
Atemo
fce5919bce Corrected npc's name (warnings from emotion command) (#3388) 2018-08-05 00:00:11 +02:00
Maz-V
7593ae52dd Fix No such NPC 'Sweet Married Couple#dew2' (#3380) 2018-08-04 22:04:49 +02:00
Maz-V
68fccf447b Fix wrong npc name for emotion in malangdo (#3375) 2018-08-01 23:11:24 +02:00
rAthenaAPI
374bfa72cb SQL synchronization 2018-08-01 06:01:25 +02:00
rAthenaAPI
b469e91616 Mob and NPC Identity Update 2018-08-01 06:00:59 +02:00
rAthenaAPI
aa40c3a7ba SQL synchronization 2018-08-01 04:01:28 +02:00
rAthenaAPI
0891da004e Mob and NPC Identity Update 2018-08-01 04:01:01 +02:00
Atemo
5f5df82d7f Wolfchev lab prerequisite (#3372)
Prerequisite is Cursed Spirit Quest

Thanks to @admkakaroto !
2018-08-01 00:30:48 +02:00
Jittapan Pluemsumran
3165e52123 Added .editorconfig file to force editor settings for certain file types (#3334) 2018-07-30 15:27:33 +07:00
Lemongrass3110
a05ed6e814 Fixed walk_choices's type (#3353)
Fixes #3310

Replaced some still hardcoded values with their define constants.
Added a function to check if a walk will be diagonal and fixed invalid calculation for it.

Thanks to @DavidPS92
2018-07-30 00:24:31 +02:00
Aleos
4f97c749c4 Corrected Spiritual Sphere Absorption and Cursed Circle interaction (#3358)
* Revert of 9a009bf.
* Spiritual Sphere Absorption should still take the spheres from the target even if Cursed Circle is used on the caster.
Thanks to @Raf4h!
2018-07-29 17:16:04 -04:00
rAthenaAPI
45dad2cd1d SQL synchronization 2018-07-29 20:11:29 +02:00
Lemongrass3110
8dea04a8b3 Initial release of private airship system (#3354)
Fixes #3314 

Thanks to @aleos89 for his help.
2018-07-29 20:11:15 +02:00
Cydh Ramdh
3de9a44f9a Fixes channel command crash (#3364)
* Fixed #3363
2018-07-29 17:48:24 +07:00
Aleos
584fcac43a Cleaned up map data storage (#3347)
Follow up to a942853.
Fixes #3336.
Moved map_data storage to std::map container.
Created map_getmapdata to obtain pointer to map_data.
Got rid of MAX_MAP_PER_SERVER define.
Resolved deletion of instances causing other instances to lose their intended map ID.
Refactored warp suggestions

Thanks to @teededung, @anacondaqq, @cydh and @Lemongrass3110!
2018-07-26 01:06:59 +02:00
Cydh Ramdh
62ac5be447 Update tools/config.pl (#3322)
* Corrected target config variables
2018-07-26 05:52:58 +07:00
Gustavo Brigo
952ac43e59 Fixed EXP bug and added failsafe to family check functions (#3350)
Fixes #3349
2018-07-25 21:58:58 +02:00
BrOgBr
fa4021d217 Fixed a mistake in 2008 headgear quest (#3344)
Fixes  #3343

Thank you @Kutikuti
2018-07-25 21:04:16 +02:00
rAthenaAPI
534b666ffa SQL synchronization 2018-07-25 06:01:00 +02:00
rAthenaAPI
90cef1e536 Mob and NPC Identity Update 2018-07-25 06:00:42 +02:00
Lemongrass3110
6b3f0717c7 Hotfix for issue 3277 (#3279)
Fixes #3277 

Thanks to @cydh and @aleos89
2018-07-24 22:55:17 +02:00
Lemongrass3110
95c3aed810 Fixing party death icon in newer clients
Fixes #2356

Thanks to @admkakaroto and @4144
2018-07-23 23:05:18 +02:00
Aleos
9313922656 Further cleanup to mapflags (#3332)
* Follow up to a942853.
* Removed ADJUST_SKILL_DAMAGE define so that the mapflag is always enabled.
* Cleaned up atcommand mapinfo and skill_damage mapflag interaction.
* Cleaned up atcommand mapflag to not allow setting of special mapflags that require extra arguments (Please use script command setmapflag).
* Using script command setmapflag for MF_NOSAVE will default to SavePoint.
* Using script command setmapflag for MF_PVP_NIGHTMAREDROP will default to normal official drop values.
* Exported constants for skill_damage mapflag types.
Thanks to @ecdarreola, @cydh, and @Lemongrass3110!
2018-07-23 13:40:35 -04:00
rAthenaAPI
1d88575f90 SQL synchronization 2018-07-20 18:51:26 +02:00
Atemo
7717c1e6bc Update Airship Assault Monster stats (#3338)
* Update Airship Assault Monster stats

Thanks to @Lemongrass3110, @gladio78 and https://www.divine-pride.net !
2018-07-20 18:51:11 +02:00
Lemongrass3110
58eadcda15 Fixed npc location for Lutie quest (#3329)
Fixes #3316

Thanks to @AzarthMZintos and @aleos89
2018-07-19 21:22:12 +02:00
Lemongrass3110
123303ef84 Fixed missing curly braces in reloadscript
Fixes #3330

Thanks to @hendra814
2018-07-19 08:26:06 +02:00
Aleos
a942853d55 Cleaned up the mapflag system (#2943)
* Created setter and getter functions.
* Adjusted all calls to use these functions.
* Converted mapflags to C++ map container.
* Converted drop_list to vector.
* Converted skill_damage ERS into vector and increased limit from UINT8 to UINT16.
* Cleaned up several functions to be more dynamic to reduce redundancy that was all over the place.
* Renamed nosumstarmiracle to nosunmoonstarmiracle.
* Adjusted skill_damage mapflag to use proper defined constants.
* Refactored map index into a vector.
Thanks to @Lemongrass3110 for a lot of help and @secretdataz!
2018-07-18 20:00:33 -04:00
Aleos
bbe552d1d3 Resolved Guild Storage Expansion not updating (#3321)
* Fixes #3317.
* Resolves the Guild Storage Expansion skill not refreshing the map server cached data.
* Updated some inter server checks to grab the proper max size of guild storages.
Thanks to @admkakaroto and @Lemongrass3110!
2018-07-18 17:10:07 -04:00
rAthenaAPI
8a353697b0 Effect State Update 2018-07-18 05:06:17 +02:00
rAthenaAPI
726f9302e5 SQL synchronization 2018-07-18 05:01:23 +02:00
rAthenaAPI
8a5b0a6aa4 Mob and NPC Identity Update 2018-07-18 05:00:56 +02:00
Aleos
b409936f8d Updated max recovery weight to 70% for renewal (#3309)
* Fixes #2622.
* Added a new battle config for renewal.
* Adjusted the battle config to support dropping the recovery weight to 0.
* Added the new weight limit packet.
Thanks to @functor-x and @Lemongrass3110!
2018-07-17 16:18:39 -04:00
rAthenaAPI
f85dc5762d SQL synchronization 2018-07-16 21:40:19 +02:00
Lemongrass3110
a5588dd9ab Initial Release of Attendance Feature (#3297)
Thanks to @secretdataz and @aleos89 for their help.
Thanks to @Haikenz and @admkakaroto for testing.
Thanks to @Daegaladh for his ideas.
2018-07-16 21:39:42 +02:00
flamefury
030443c9d3 Negative MDEF should not increase damage taken from magic (#3190)
* Fixes #3189.
* MDEF should never go below 0.
Thanks to @flamefury!
2018-07-16 12:43:29 -04:00
Atemo
f1f4709127 Added extra nowarpto on some maps (#3320) 2018-07-16 17:02:16 +02:00
flamefury
1a6bc209a8 Freezing and Burning can occur at the same time (#3313)
* Fixes #3312.
* Freezing and Burning should be able to be stacked.
Thanks to @flamefury!
2018-07-16 10:10:51 -04:00
Lemongrass3110
c4d7dc76d3 Hid timer function parameters in a macro (#3311) 2018-07-15 23:17:15 +02:00
rAthenaAPI
ec1d6d28d7 SQL synchronization 2018-07-13 15:49:41 +02:00
Atemo
7a8ac46421 Banquet for Heroes ep 16.1 (#3234)
Banquet for Heroes ep16.1 - walkthrough conversion
* Added main quests of ep16.1 and the quests entries
*** Walther's daily quest will be enabled after quest_db refactor
* Added instances Ritual of Blessing and Room of Consciousness
* Added monsters spawn and entries on prt_prison, prt_cas and prt_q maps
* Prontera castle map changed in this ep
- Moved some NPCs from prt_castle to prt_cas
- Added warps on prt_cas
- Succession of the Prince quest is removed in ep16.1

Thanks to @admkakaroto, https://www.divine-pride.net/ 
@yoonjunho72, @teededung, @ecdarreola, @spinzaku and to all the contributors !
2018-07-13 15:49:33 +02:00
rAthenaAPI
e832eb77e2 SQL synchronization 2018-07-11 00:00:34 +02:00
Atemo
cd05eb1500 Corrected TWO skills according to aegis datas (#3307) 2018-07-11 00:00:12 +02:00
Aleos
bfd7af3423 Fixed Guild Storage Expansion skill saving (#3306)
* Fixes #3301.
* Force the Guild Storage Expansion skill to save on level up so the next time the guild storage is opened the proper increase is shown.
Thanks to @spinzaku!
2018-07-10 16:46:20 -04:00
Aleos
042b88623b Pets should mimic master's walk speed (#3303)
* Pets should have the same walk speed as their master.
* Corrected homunculus speed check to use the proper battle config.
2018-07-09 17:29:55 -04:00
Aleos
eeb0192318 Adjusted Shield Chain range (#3299)
* Shield Chain should be melee skill, not ranged.
2018-07-08 20:39:18 -04:00
Aleos
3de5824757 Adjusted Amistr's Defense behavior (#3300)
* Effect should not be shown above master.
2018-07-08 18:28:09 -04:00
Aleos
fdd2475622 Corrected some item bonuses not triggering (#3298)
* Fixes #3265.
* Fixes bAddDamageClass, bAddMagicDamageClass, bAddDefMonster, and bAddMDefMonster not checking for the correct source/target class.
Thanks to @uddevil!
2018-07-08 17:44:20 -04:00
Lemongrass3110
b2c026d4b0 Cleaned up Summer 2 code (#3294)
Fixes #3293

Thanks to @Everade for reporting.
2018-07-08 11:58:50 +02:00
Aleos
f2437f4a63 Updated Masquerade effects (#3291)
* Masquerades are now unable to effect Boss monsters.
2018-07-07 19:49:51 -04:00
Aleos
20a72e0c6b Updated Axe Mastery behavior (#3292)
* Axe Mastery does not increase damage for 2H Swords.
2018-07-07 18:20:42 -04:00
Lemongrass3110
74efc7d65d Added empty packet functions for private airship
Thanks to @Daniel4rt
2018-07-07 18:47:38 +02:00
Atemo
12f62e6302 Quest warning in quests_amatsu.txt (#3296) 2018-07-07 15:53:25 +02:00
Sader Fawall
500cfdc41f Missing returns for inarray and countinarray (#3295)
Added some return cases if empty arrays are given to these two commands.

Thanks to @sader1992
2018-07-07 13:46:14 +02:00
rAthenaAPI
255baff290 SQL synchronization 2018-07-06 22:40:27 +02:00
Lemongrass3110
fe7c0a78ec Refactored roulette system (#3271)
Fixes #2887 - thanks to @Everade
Fixes #3292 - thanks to @admkakaroto

Added a script command to open the roulette window from server side.
Added support for clients >= 2018-05-16
Fixed losing behavior for roulette
Enabled roulette system by default
Added a server side delay
Added missing sql log enum value 'Y'

Thanks to @Everade, @admkakaroto, @V0rr, @ecdarreola, @Haikenz and everyone else who contributed to this.
2018-07-06 22:39:58 +02:00
Aleos
d612788ed7 Updated Shield Spell behavior (#3290)
* Fixes #3236.
* Shield Spell is now canceled when the user switches shields.
Thanks to @EthernalFriend and @MrLekkz!
2018-07-06 13:30:38 -04:00
Aleos
6b148d5c35 Corrected SC_MTF_CRIDAMAGE bonus not triggering (#3289)
* Resolves SC_MTF_CRIDAMAGE never triggering the critical damage bonus.
2018-07-06 10:42:55 -04:00
Lemongrass3110
cea5ad7199 Fixed a bug with warlock's spheres (#3288)
Fixes #3264

Thanks to @nornane for reporting this and coming up with a solution.
2018-07-06 07:52:04 +02:00
Atemo
4db212bf1b Academy monster re-spawn (#3280)
* This PR adds a custom delay to avoid abusive behaviour in the novice academy.
2018-07-06 01:46:56 +02:00
Lemongrass3110
91169d7ebc Fixed a few compiler warnings on clang (#3263)
Mostly pointer-bool-conversion and autological-pointer-compare
2018-07-05 22:53:20 +02:00
Atemo
532e043490 Fixed issue #3286 and corrected npc name (#3287)
Thanks to @AzarthMZintos !
Fixed #3286
2018-07-05 02:13:12 +02:00
Balfear
1b72f727b8 Fixed incorrect drop_id in quests (#3283)
Fixed incorrect drop_id in Eclage quests.
Fixed #3282
2018-07-04 15:54:27 +02:00
Atemo
6b19b72def Follow up 6e8599cd5b
Corrected wrong eq num

Thanks to @teededung !
2018-07-04 15:50:06 +02:00
rAthenaAPI
a0496c4817 SQL synchronization 2018-07-04 05:01:32 +02:00
rAthenaAPI
e06984a73e Mob and NPC Identity Update 2018-07-04 05:01:03 +02:00
rAthenaAPI
948c31d4b8 SQL synchronization 2018-07-04 04:01:38 +02:00
rAthenaAPI
3f1de9c45a Mob and NPC Identity Update 2018-07-04 04:01:06 +02:00
Atemo
6e8599cd5b Extra npc checks (#3274)
* Extra checks
- Added some extra check in npcs script to prevent wrong behaviour
2018-07-03 23:24:04 +02:00
Atemo
84299027bc Added comments in custom quest_shop.txt (#3270) 2018-07-03 19:56:03 +02:00
Atemo
f979710985 Fixed rate for HD material in shadow refiner npc (#3276)
- HD ore have normal rates on official
2018-07-03 16:04:18 +02:00
Aleos
e13ca63cc8 Added Guild Storage Expansion Skill (#3244)
* Fixes #499 and part of #1303.
* Implements Guild Storage Expansion Skill which requires client 2013-12-23 or newer (enable by default depending on client date in src/config/packets.hpp).
* Implements guild storage permission which requires client 2014-02-05 or newer.
* Expanded script command guildopenstorage return values.
2018-07-03 08:49:34 -04:00
Atemo
e4eddc3e61 Fixed for issue #3273 (#3275)
The npc should give Gunslinger Manual when the player doesn't have one
Fixed #3273

Thanks to @lRaikeNl !
2018-07-03 01:51:26 +02:00
Lemongrass3110
a8b7476c96 Updated travis script
Added MariaDB build template
Added early termination if one of the steps fails
2018-07-02 22:54:47 +02:00
Lemongrass3110
145b60f7b6 Added support for packet sending map data(0xAC5) 2018-07-02 22:39:06 +02:00
Lemongrass3110
3faf700443 Added possibility to log without attached player (#3260)
Fixes #2268

Thanks to @Akkarinage
2018-07-02 11:45:55 +02:00
Cydh Ramdh
ce9cbd2e65 Fixed logging of #CASHPOINTS and #KAFRAPOINTS (#3252)
* Fixes #2169
* #CASHPOINTS and #KAFRAPOINTS now will be logged correctly when used by scripting
* Fixed a bug where points removed cash as well
* Small cleanup for pc_paycash and pc_getcash
* Thanks to @Lemongrass3110, @ecdarreola
2018-07-02 13:21:41 +07:00
Lemongrass3110
b3a51eaa35 Fixed broken guild notices (#3262)
Fixes #641

Thanks to @tmav94, @RadianFord, @Akkarinage and @vykimo
2018-07-01 23:22:22 +02:00
Lemongrass3110
b3643bfe45 Added a 'force' option to attachrid (#3261)
Fixes #1763
2018-07-01 22:28:56 +02:00
Cydh Ramdh
e7fd6aa5bd Enable autobonus to be reactivated (#3199)
* Fixes #3039, #3158
* Thanks to @Raf4h @laziem
2018-06-28 20:56:39 +07:00
Lemongrass3110
a4336fd8ae Fixed compiler warnings in malloc.cpp on x86
Fixes #3248

Thanks to @laziem
2018-06-27 22:42:11 +02:00
Lemongrass3110
796a67be4b Fixed Silvervine Root Twist animation for players (#3255)
Fixed status changes that are displayed for players that walk into the area after status change start being sent out with an invalid duration, since the timer was not yet created and causing an infinite duration packet to be sent.

Fixes #3182

Thanks to @Everade
2018-06-27 22:08:52 +02:00
rAthenaAPI
f196304f0e SQL synchronization 2018-06-27 09:58:16 +02:00
Jittapan Pluemsumran
cd1dd886b1 Merge pull request #3243 from rathena/hotfix/refineable_acc 2018-06-27 14:58:05 +07:00
rAthenaAPI
abe46baa97 SQL synchronization 2018-06-27 09:56:38 +02:00
crazyarashi
8c4be8db03 Bunker Shield's item script fix. (#3250)
* Bunker Shield's item script fix.

Fix the Item ID: 28915 Bunker Shield's item script.

* ASPD Bonus Add

Added the missed ASPD bonus.

* Change ASPD Bonus to -

* Corrected Bonus.

Thanks to Atemo for noticing it :))
2018-06-27 14:56:27 +07:00
Lemongrass3110
55f1b01bd8 Removed useless debug variables for an old issue (#3247)
Closes #1986
2018-06-27 07:37:35 +02:00
rAthenaAPI
852f893a81 SQL synchronization 2018-06-27 05:01:02 +02:00
rAthenaAPI
9a7617cfc5 Mob and NPC Identity Update 2018-06-27 05:00:44 +02:00
Lemongrass3110
9a7e27b690 Added clan name display
Clients that do not support this ignore this anyway.
Party name is not displayed when you are in a clan unlike with a guild.
You can use display_party_name if you want to show it.
2018-06-27 00:29:35 +02:00
Atemo
915c15622c Typo fixed in guildcastles.txt (#3253) 2018-06-26 23:42:12 +02:00
rAthenaAPI
0047d4168d SQL synchronization 2018-06-25 23:42:07 +02:00
BrOgBr
1c9506277c Fixed and Improved 18673 script and Fixed Imperial Spear script (#3233)
* Fixed and Improved 18673 script and combo

Fixed #3240

Thanks @slyx88
Thanks Lemongrass3110 and @Atemo
2018-06-25 23:41:37 +02:00
Atemo
9c50cd7606 Follow-up 380dde040c
- Fixed more accessory being refineable
2018-06-25 19:40:52 +02:00
Lemongrass3110
3733044858 Added jTynne to mailmap 2018-06-25 02:43:21 +02:00
Lemongrass3110
4044966e38 Added a build test for GCC-8 (#3230) 2018-06-24 23:19:11 +02:00
Lemongrass3110
880e227ea2 Cleaned up some hardcoded variables (#3237) 2018-06-24 22:16:28 +02:00
Atemo
1887355536 Additionally removed refineable value from "Dungeon_Ticket" (usable item) 2018-06-24 16:36:39 +02:00
Jittapan Pluemsumran
380dde040c Fixed some accessory being refineable 2018-06-24 21:03:18 +07:00
Cydh Ramdh
d5a815a6e2 Added item random options into picklog (#3239)
* Fixes #3238
2018-06-24 21:00:32 +07:00
Lemongrass3110
23f7b945ec Fixed a map-server crash from getitem3 (#3122)
Fixes #3121

Wrong usage by supplying a non-array variable.
Using a non-server variable without having a player attached.

Thanks to @Everade
2018-06-23 18:49:38 +02:00
Lemongrass3110
4633ab5ca1 Fixed CMake on Windows (#3204)
It is now usable in Visual Studio as well
2018-06-21 00:26:40 +02:00
Aleos
11b42569fc Synchronized source file headers (#3212)
* Alphabetically sorted includes.
* Updated copyright and license text to match across all files.
* Removed pragma once define in header files in lieu of ifdef guards.
2018-06-20 18:08:30 -04:00
Aleos
aef2356134 Corrected Sightless Mind range (#3215)
* Fixes #3210.
* Sightless Mind splash range should be 9 cells.
Thanks to @Everade!
2018-06-20 17:42:27 -04:00
Lemongrass3110
21cb1a2260 Fixed MariaDB compilation problems
Credits to Sergei Golubchik on https://jira.mariadb.org/browse/MDEV-13773
2018-06-20 17:41:10 +02:00
Lemongrass3110
90083fc7f9 Another follow-up for 6c0da90
Added missing npc load.

Thanks to @BrOgBr and @Haikenz
2018-06-20 10:24:38 +02:00
Daniel Bernard
87913bcdc1 Corrected spelling and made name change in Rune Knight Job Change Quest (#3222)
* Fixes #3220.
* Correct Jungberg's name in Rune Knight Job Change Quest.
* Corrected spelling in Rune Knight job change quest.
Thanks to @danielbernard and @zackdreaver!
2018-06-19 12:13:42 -04:00
aleos89
8e9f7a59e3 Follow up to 375f0ae
* Crystallize Wind damage increase should only apply to Magic-type skills.
Thanks to @flamefury!
2018-06-19 12:10:27 -04:00
Aleos
375f0ae465 Corrected Crystallized state effect (#3226)
* Fixes #3225.
* While Crystallized Wind damage is increased 50%.
* Corrected an arrow state check for Crystallization on weapon damage reduction.
* Corrected elemental damage calculation for targets in pre-renewal mode.
Thanks to @flamefury!
2018-06-18 16:51:43 -04:00
Aleos
f3eab9dd4a Corrected Cloud Kill behavior (#3127)
* Fixes #2731.
* Corrected Cloud Kill status being removed and not damaging players who are in the AoE.
Thanks to @redlightliu!
2018-06-18 16:02:04 -04:00
flamefury
5e9a23de03 Updated Freezing effects (#3207)
* Fixes #3191.
* Adjusted movement speed reduction from -50% to -70%.
* Adjusted ASPD reduction from -15% to -30%.
* Adjusted physical DEF reduction from -10% to -30% for players only (mobs are still -10%).
* Adjusted variable cast time increase from +15% to fixed cast time +50%.
Thanks to @flamefury!
2018-06-18 13:13:27 -04:00
rAthenaAPI
f75b845430 SQL synchronization 2018-06-18 18:31:22 +02:00
Aleos
4a64eb49b3 Corrected End Sektura bonus (#3216)
* Fixes #3213.
* Should inflict Crystallization status, not Freeze.
Thanks to @flamefury!
2018-06-18 12:31:06 -04:00
Daniel Bernard
f67b353ac0 Corrected spelling issues in Dewata Quests (#3218)
* Fixes #3217.
* A number of spelling and grammatical issues across the Dewata quests fixed in addition to the above issue.
Thanks to @danielbernard and @teededung!
2018-06-18 10:56:45 -04:00
Cydh Ramdh
105cc3ab7d Fixed over refine bonus (#3194)
* Fixes #3193
* Overrefine never been calculated in renewal
2018-06-17 11:02:36 +07:00
rAthenaAPI
49ebb1a578 SQL synchronization 2018-06-17 03:22:29 +02:00
Aleos
a215ed97bd Corrected Devil Whisper Costume drops (#3214)
* Fixes #3211.
* The Angel and Demon drops were swapped.
Thanks to @Everade!
2018-06-16 21:22:06 -04:00
Aleos
1ce3792a3a Resolved some compile issues (#3206)
* Fixes #3205.
* Follow up to 801d3ed.
* Resolved some string literals requiring a space.
* Redefine my_bool for MySQL 8.0 or later.
Thanks to @bentheexo and @secretdataz!
2018-06-16 18:50:02 -04:00
Atemo
006efe11ed Updated custom mushroom script (#3202)
* Slight edits of custom Mushroom Event
- changed the monster count variable to mobcount script command
- changed killmonster label to only kill the mushrooms of the event
2018-06-16 19:49:52 +02:00
Atemo
967f28ed00 Follow-up 6c0da909d8
- Added missing checkweight and delitem

Thanks to @Balferian !
2018-06-15 21:34:15 +02:00
rAthenaAPI
64eaf0f2f5 SQL synchronization 2018-06-15 15:52:08 +02:00
Atemo
6c0da909d8 Hero ring exchanger and enchant npcs (#3203)
* Some texts and system are customs
2018-06-15 15:51:57 +02:00
rAthenaAPI
43513e9ba5 SQL synchronization 2018-06-14 23:28:29 +02:00
Aleos
dc413a3c57 Updated Mado Gear effects (#2103)
* Fixes #2099.
* Added Emergency Magic Gear.
-- Mounts the user to a Madogear.
-- Only usable by Mechanic class.
-- Has a reuse delay of 3 minutes.
* Increased maximum weight limit by 1500.
* HP naturally recovers similar to Swordman Moving HP-Recovery.
* Updated Emergency Cool's interaction with Overheat calculation.
* Added new Emergency Cool cooling devices.
* The three cooling devices now lower Overheat by 45, 75, and 105 respectively.
* Overheat now only increases on every attack by 1 or by 3 with Fire element.
* The Overheat limit is increased to 150, 200, 280, 360, and 450 respective to skill level.
* Updated the check for Acceleration, Self Destruction, Shape Shift, Emergency Cool, Magnetic Field, Neutral Barrier, and Stealth Field to also check inventory for required equipment.
* Updated Magic Gear Master NPC.
-- Added Emergency Magic Gear purchase option.
-- Added High Quality Cooler and Special Cooler upgrade options.
Thanks to @Felleonel, @Rytech2, @exneval and @mrjnumber1!
2018-06-14 17:28:16 -04:00
Lemongrass3110
801d3ed942 Moved common, config and mapcache to C++ (#3200)
Dropped BETA_THREAD_TEST and everything around it
Dropped mt19937
Replaced msinttypes with cinttypes
Removed IRC link and updated README name
2018-06-14 21:51:58 +02:00
Lemongrass3110
fc951469e7 Initial support for Star Emperor and Soul Reaper (#3184)
Merges 3CeAM/3CeAM@7df0f57 and 3CeAM/3CeAM@028d2e8
Credits to @Rytech2
2018-06-14 08:16:10 +02:00
aleos
3a918fa4a1 Removed an extra semicolon
Thanks to @Haikenz!
2018-06-13 17:24:01 -04:00
Aleos
7c4d769234 Added Old Glastheim Buffs (#3167)
* Fixes #2772.
* Added missing Old Glastheim buffs.
* Added buffs to Old Glastheim script.
* Renamed Glastheim -> Glast Heim.
Thanks to @Atemo and @mrjnumber1!
2018-06-13 15:55:30 -04:00
Cydh Ramdh
87db2326b4 Added missing maps to map_cache and its mapflags (#3198)
* Added missing maps to map_cache and its mapflags
* Added nowarp, nowarpto, pvp_noparty for RWC maps suggested by @Atemo 
* Added mapflag/gvg_noparty.txt file to ignores party alliances on GvG-enabled maps.
2018-06-13 20:35:26 +02:00
rAthenaAPI
5a4295ce73 SQL synchronization 2018-06-13 20:33:46 +02:00
Atemo
d388a7122b Initial release of morse cave instance (#3173)
* Initial release of morse cave instance
* Implemented NPC_JACKFROST skill

Thanks to @laziem, @ecdarreola, @Questune09 and https://www.divine-pride.net !
2018-06-13 20:33:36 +02:00
rAthenaAPI
7653d4f93a SQL synchronization 2018-06-13 16:44:09 +02:00
Daniel Bernard
e4a80565b8 Fix Bloody_Roar and Bloody_Roar_C item scripts (#3201)
* Fixes #3197.
* Bloody_Roar: Perfect dodge should not be affected, Flee should be reduced by Agi + BLvl instead of flat -160
* Bloody_Roar_C: Flee/Perfect dodge should not be affected, should restore 3 HP every 5 seconds
Thanks to @danielbernard!
2018-06-13 10:44:01 -04:00
Lemongrass3110
85413183d9 Added Valaris to mailmap 2018-06-13 01:30:22 +02:00
Atemo
acebcd38bc Added missing maps to map_cache (#3192)
* Added missing maps to map_cache
- additionnally removed the commented 'extra maps'
- Added mapflags on instances and dungeons maps

Credit to @zackdreaver for some map name
2018-06-12 16:19:56 +02:00
Lemongrass3110
98e2cfd22b Added Inkfish to mailmap 2018-06-12 10:27:55 +02:00
rAthenaAPI
52c5c18337 SQL synchronization 2018-06-12 05:00:35 +02:00
rAthenaAPI
723cdf87c4 Mob and NPC Identity Update 2018-06-12 05:00:23 +02:00
rAthenaAPI
6ca18bd2e8 SQL synchronization 2018-06-10 17:41:29 +02:00
BrOgBr
f7c62d28aa Many fixes at items databases (#3136)
* Many fixes at items databases pre-renewal and renewal
2018-06-10 17:41:22 +02:00
rAthenaAPI
076ef546e0 SQL synchronization 2018-06-10 17:38:54 +02:00
Daniel Bernard
00e518b24d Corrects Variable Cast Rate for Geffen Magic Robe (Renewal) (#3196)
* Correct Variable Cast Rate for Geffen Magic Robe
* Fixes #3195
* Geffen Magic Robe (Renewal) (15074) is currently set to reduce variable cast rate by 15%, with an additional 5% at refine level 9. This should be an increase of 15%, reduced to 10% at level 9.

Thanks to @Balferian !
2018-06-10 17:38:48 +02:00
Aleos
f4e8dee5d6 Corrected Tarot Card dispelling Clan buffs (#3186)
* Corrected Tarot Card dispelling Clan buffs
* Fixes #3179.
* Resolved Tarot Card dispelling Clan buffs from players.
* Added Doram buffs and RODEX from being Dispelled as well.
Thanks to @cahya1992!
2018-06-08 10:14:02 -04:00
rAthenaAPI
046d2e6c44 SQL synchronization 2018-06-07 19:39:07 +02:00
Aleos
f675895955 Fixed Chewy Ricecake and Oriental Pastry bonuses (#3187)
* Fixes #3180.
* Bonuses should last for 30 minutes, not 3 minutes.
Thanks to @Everade!
2018-06-07 13:38:56 -04:00
rAthenaAPI
92530045e2 SQL synchronization 2018-06-07 16:16:31 +02:00
Aleos
879ef2afaa Fixed Goldsmith Dagger class equip requirement (#3188)
* Fixes #3181.
* Should be able to be worn by 2-1 and 2-2 classes as well.
Thanks to @Everade!
2018-06-07 10:16:23 -04:00
Lemongrass3110
b2594f4842 Added new jRO hat effects 2018-06-06 23:38:29 +02:00
Aleos
ef046159d6 Updated Achievement database (#3165)
* Added new achievement.
* Updated score for Exploring Poring's life (2).
* Updated Reborn in Valhalla reward.
* Removed The Beginning of Outdoor and The First Step Becoming a Chef achievements as they are no longer listed.
2018-06-06 14:27:29 -04:00
rAthenaAPI
2e15fae725 SQL synchronization 2018-06-05 04:00:45 +02:00
rAthenaAPI
7c3158b367 Mob and NPC Identity Update 2018-06-05 04:00:32 +02:00
Atemo
f025be5f17 Added lhz_d_n2 map (#3183)
Added mapflags on several maps
2018-06-03 15:45:49 +02:00
rAthenaAPI
1b6aab3667 SQL synchronization 2018-05-30 23:13:49 +02:00
Atemo
d2b5222da6 Corrected airship monster item drop slot (#3174)
* Follow-up c1c308a1d4
- changed the item drop slot of some airship instance monsters
- added the Captain Felock Card to Felock
2018-05-30 23:13:38 +02:00
rAthenaAPI
c68da31f67 Effect State Update 2018-05-30 05:06:10 +02:00
rAthenaAPI
73584c6c9a Mob and NPC Identity Update 2018-05-30 05:00:31 +02:00
rAthenaAPI
dc3bac8245 SQL synchronization 2018-05-29 16:16:28 +02:00
Atemo
c1c308a1d4 Script/airship instance (#3141)
* Initiale release of Instance Airship Assault

Walkthrough of airship assault instance based on Ziu's work
Thanks to @aleos89, @secretdataz and https://www.divine-pride.net/ !
2018-05-29 16:16:21 +02:00
Aleos
9d176c9f1d Corrected B.S. Sacramenti behavior (#3149)
* Fixes #611.
* Status is now removed on player log out.
* Status is not given to targets who have the Undead/Demon element.
Thanks to @Atemo!
2018-05-28 12:52:30 -04:00
Aleos
fb951d2b7f Corrected Mora NPC name (#3170)
* Fixes #3155.
* Adjusted Mora NPC from General Good Deal -> General Goods Dealer.
Thanks to @teededung!
2018-05-28 12:37:14 -04:00
rAthenaAPI
6842798d6e SQL synchronization 2018-05-28 15:48:58 +02:00
Atemo
6c64fc9587 Imperial Set Combos BIS (#3166)
* Follow up 87e7e8891b

- combo 18823:19246 : value for bResEff should be 10000 to immune the status
- combo 18823:28372 : according to the description the cast reduction is 2s
- item Imperial_Feather : according to the description of ID 18823 the bonus apply when base agi is 108 too

* Reverted combo 18823:28372 to match the database value, thanks to @aleos89 !
2018-05-28 15:48:52 +02:00
rAthenaAPI
847fdc9e13 SQL synchronization 2018-05-28 13:14:26 +02:00
Cydh Ramdh
36c15d151d Corrected item type for Biscuit Sticks to usable item (#3153)
* Changes for Biscuit Sticks with id 14616-14621
2018-05-28 18:14:19 +07:00
Lemongrass3110
dd60f4c47e Added 2 new parameters for getpetinfo (#3164)
Fixed inter-server handling for creation of pets that are not incubated.

Thanks to @Everade for his idea.
2018-05-27 22:52:08 +02:00
Sader Fawall
151c8476af inarray script commands (#3071)
Thanks to @anacondaqq, @Lemongrass3110, @Jeybla, @secretdataz, @aleos89, @Atemo and @hurtsky for reviewing and testing.
2018-05-27 22:51:37 +02:00
Aleos
a12c79f782 Moved remaining refine NPC to the database (#3145)
* Fixes #2510.
* Added Holink and Wagjak values to their own entries in the refine database.
* Added several anti-hack checks to refine NPC.
Thanks to the suggestion from @mazvi and @Atemo!
2018-05-27 16:07:39 -04:00
Atemo
394fb8acff Added extra check in some renewal instances
* Added extra check in some renewal instances to prevent unexpected behaviour

Thanks to @Lemongrass3110 !
2018-05-27 21:55:34 +02:00
Atemo
a381d33314 Added missing quests parameters issue #3156 (#3160)
Thanks to @mazvi !
2018-05-27 19:56:10 +02:00
Atemo
8aa6e8d299 Removed duplicates and added some missing mapflags (#3161) 2018-05-27 19:44:34 +02:00
rAthenaAPI
1192beef44 SQL synchronization 2018-05-26 18:50:48 +02:00
Aleos
87e7e8891b Added missing Imperial Set Combos (#3151)
* Fixes #3031.
* Added missing Royal Guard Necklace and Imperial Glove.
* Added bSkillDelay bonus which increases delay of skill sk by t milliseconds.
Thanks to @iubantot and @Secret!
2018-05-26 12:50:39 -04:00
Lemongrass3110
ecbab96403 Fixed a possible crash
Follow up to 1e2032c

Thanks to @Everade
2018-05-26 00:22:53 +02:00
flamefury
e067815947 Changing bAtkRate to bAddClass,Class_All (#3147)
* Fixes #3146.
* Removed remaining bAtkRate bonuses from databases as it's not an official bonus.
Thanks to @flamefury!
2018-05-23 14:33:13 -04:00
Lemongrass3110
8202555514 Fixed client blocking mail deletion
Fixes #3144

Thanks to @kraaijmakers
2018-05-23 10:06:04 +02:00
rAthenaAPI
f2413307cf SQL synchronization 2018-05-23 05:00:39 +02:00
rAthenaAPI
9a84005d8f Mob and NPC Identity Update 2018-05-23 05:00:27 +02:00
Aleos
d060ff79dc Corrected refine bonus when importing (#3142)
* Fixes #2722.
* Properly reset refine bonuses before parsing the import file.
Thanks to @sader1992!
2018-05-22 12:09:27 -04:00
Aleos
42c3375693 Corrected Invisibility CRI bonus (#3138)
* Fixes #3133.
* Should be a static +100 not +100%.
Thanks to @redlightliu!
2018-05-22 10:36:35 -04:00
rAthenaAPI
0a939e9f00 SQL synchronization 2018-05-22 09:39:09 +02:00
Lemongrass3110
8d76d349b0 Fixed a few items having getrefine in script (#3140) 2018-05-22 09:39:02 +02:00
Aleos
1d1a179b72 Corrected QD Shot and Crimson Marker interaction (#3131)
* Fixes #2863.
* QD Shot should not remove Crimson Marker.
Thanks to @rye305 and Fyrus!
2018-05-21 10:43:10 -04:00
rAthenaAPI
0ac27e4eba SQL synchronization 2018-05-20 21:34:10 +02:00
Aleos
a80d9c6d41 Added Gambler Seal and Gambler Card item combo (#3128)
* Fixes #2958.
* Adjusted Gambler Seal equip level requirement.
* Added Gambler Card item.
* Added missing combo for both items.
Thanks to @AzarthMZintos, @teededung, and @Atemo!
2018-05-20 15:34:02 -04:00
rAthenaAPI
3453198c33 SQL synchronization 2018-05-20 02:08:12 +02:00
Daniel Bernard
f57022fb4b Correct Refinable State for Wandering Wolf Helm (Renewal) (#3135)
* Fixes #3134.
* Wandering Wolf Helm (Renewal) (5498) has refine-level based effects.
Thanks to @danielbernard and @MrAntares!
2018-05-19 20:08:04 -04:00
rAthenaAPI
9aa406e406 SQL synchronization 2018-05-19 18:09:01 +02:00
Aleos
a2b6cb6901 Corrected Baby Dragon hat bonus (#3126)
* Fixes #3020.
* Corrected the double attack bonus.
* Added missing pre-renewal entry.
Thanks to @MrAntares, @Daegaladh, and @BrOgBr!
2018-05-19 12:08:54 -04:00
Akkarinage
8dc049aa8b Removed City Cleaners from RE monster spawn files (#3082)
* Fixes #2978.
* Moved Wild Rose to PRE-RE spawn files.

Signed-off-by: Akkarinage <akkarin@rathena.org>
2018-05-19 11:36:59 -04:00
Lemongrass3110
d16e7e6160 Added support for changedress command (#3109)
This adds support for /changedress and /nocosplay by adding an atcommand for it and redirecting the client command to it.

Thanks to @Everade for finding this.
2018-05-19 00:37:41 +02:00
Lemongrass3110
bfe6266921 Fixed a few hardcoded limits in status.cpp (#3130)
Also fixed an array definition in battle.cpp/.hpp
2018-05-19 00:09:25 +02:00
Maytichai Saowa
a8fd92c6da Update/doc packet (#3111) 2018-05-18 20:12:37 +02:00
Lemongrass3110
09fd14c41f Fixed an invalid declaration of cached events (#3116)
Fixes #3108

Fixed wrong usage of EVENT_NAME_LENGTH, since this should have been UCHAR_MAX as well.
Converted C struct to C++ map/vector.
Removed limit of 255 events of a cached type.

Thanks to @ignizh and @secretdataz
2018-05-18 14:58:23 +02:00
rAthenaAPI
180866178c SQL synchronization 2018-05-18 11:57:27 +02:00
Lemongrass3110
6d351fa254 Added blueprints for excellion enchants
Thanks to @Daniel4rt
2018-05-18 11:57:16 +02:00
Lemongrass3110
3e269ace66 Added an option to disable homun autofeed notify (#3119)
Thanks to @haikenz for the suggestion.
2018-05-18 11:17:34 +02:00
Aleos
c4eae4b361 Corrected reflected damage applying twice (#3115)
* Fixes #2920.
* Follow up to 333f0dd.
* Corrected trap behavior reflect and slightly reverted previous commit.
Thanks to @Badarosk0.
2018-05-17 23:10:27 -04:00
Aleos
12c01b0b40 Cleaned up item broadcast code (#3117)
* Fixes #2847.
* Removed some unused variables.
Thanks to @anacondaqq!
2018-05-17 18:55:41 -04:00
Lemongrass3110
6d5ee67692 Fixed login mail notification (#3124)
Fixes #3123

Always update the top right icon and the N icon in the menu bar no matter what inter server call it was.

Thanks to @Everade.
2018-05-17 22:12:43 +02:00
Aleos
53d70b3e24 Corrected skills that lose mob targets (#3120)
* Fixes #2163, fixes #2720, and fixes #2761.
* Feint Bomb now closer mimics official behavior.
* Monsters now properly target the clone and refrain from attacking the Shadow Chaser.
* Shadow Chasers are now able to cast skills while in Feint Bomb hiding state.
* Removed extra skill cast value that wasn't used.
* Removed extra mob target release function as one already existed.
* Corrected Zanzou and Genwaku target release behavior as well.
Thanks to @ilovelemon, @redlightliu, and @MrAntares!
2018-05-17 15:58:55 -04:00
Lemongrass3110
923199d464 Removed old visual studio projects from gitignore (#3125) 2018-05-17 21:38:58 +02:00
Lemongrass3110
0a84542220 Added a template function for std::map search (#3107)
Thanks to @secretdataz for his help.
2018-05-16 08:26:48 +02:00
rAthenaAPI
620e397558 SQL synchronization 2018-05-14 16:10:35 +02:00
Aleos
39f7ae13cb Added Excellion Armor and Wing (#3110)
* Fixes #3066.
* Added missing items Excellion Armor and Excellion Wing.
2018-05-14 10:10:28 -04:00
Atemo
df9bac9b78 Clean-up and fixed quest issue of hunter.txt (#3059)
Thanks to @AzarthMZintos !
2018-05-11 15:59:35 +02:00
Lemongrass3110
ce324ad13d Added atcommand for limited sale (#3103)
Removed permission
Added state tracking instead to make sure player can use the atcommand

Thanks to @secretdataz for his idea.
2018-05-08 21:32:52 +02:00
Atemo
b0aa1f8756 Fixed #3105 (#3106)
- A wrong quest ID was erased for Monthly Brigan quest

Thanks to @teededung !
2018-05-08 20:18:13 +02:00
Aleos
14f6ce4c20 Fixed UF_RANGEDSINGLEUNIT skill interactions (#3098)
* Fixes #2969.
* Resolves unit skills that use UF_RANGEDSINGLEUNIT not being properly removed by other skills that clear unit types.
Thanks to @admkakaroto and @exneval!
2018-05-08 12:38:26 -04:00
Lemongrass3110
34adde7623 Added new hateffect HAT_EF_C_BLESSINGS_OF_SOUL 2018-05-08 00:01:06 +02:00
Lemongrass3110
953f7cf47e Follow up to 5b13dc7
Added missing flag for npc sent mails.
This will prevent showing the reply button on supported clients.
2018-05-06 17:21:41 +02:00
Akkarinage
8d638b9f72 Updated Readme.md (#3096)
* Fixes #3058.
* Updated links for prerequisites
* Updated Discord link as subdomain no longer exists
* Removed IRC links.. we haven't used this in forever!

Signed-off-by: Akkarinage <akkarin@rathena.org>
2018-05-03 14:09:29 -04:00
Aleos
7f8b9c43c5 Corrected Demonic Fire and FE Acid behavior (#3088)
* Fixes #1086, fixes #2799, and fixes #3049.
* Fire Expansion Level 1 now lasts 10 seconds longer with stacked with Demonic Fire.
* Fire Expansion Tear Gas will no longer damage players on non-PvP type maps.
* Fire Expansion Acid is now misc type instead of magic.
* Corrected a possible map crash with Demonic Fire and Fire Expansion interactions.
* Demonic Fire can only have one instance on the ground at a time.
* Miscellaneous cleanups.
Thanks to @jamon18, @uddevil, and @LolyAll!
2018-05-03 12:11:03 -04:00
rAthenaAPI
5d2a3e43a0 Effect State Update 2018-05-02 05:06:09 +02:00
rAthenaAPI
571ab431e6 SQL synchronization 2018-05-01 16:06:55 +02:00
Aleos
26c02e9a3f Updated Bullet Cartridges (#3075)
* Fixes #3052.
* Changed previous cartridges to item type 2 from item type 18.
* Added missing cartridges: Flare, Lightning, Ice, Poison, and Blind.
Thanks to @Questune09!
2018-05-01 10:06:47 -04:00
rAthenaAPI
924abed485 SQL synchronization 2018-04-29 19:19:20 +02:00
Atemo
fac4d9beb3 Corrected White_Slim_Pot_Box2 and White_Slim_Potion_Box item script (#3094)
Fixed #3092
2018-04-29 19:19:12 +02:00
rAthenaAPI
e07542136a SQL synchronization 2018-04-29 15:22:05 +02:00
Atemo
e7ccee76e4 Corrected NPC_COMET ratio and Hero_Judgement_Shawl / Hero_Taget_Suits item script (#3091)
Thanks to @kukuasir1 and @Akaineko-astasi !
2018-04-29 15:21:57 +02:00
Jittapan Pluemsumran
258069daff Added missing getpartymember calls in MVP ladder script
Thanks to @AnnieRuru
2018-04-28 10:05:24 +07:00
rAthenaAPI
f9e9741d88 SQL synchronization 2018-04-26 23:06:37 +02:00
Aleos
e23f06d6e9 Corrected Fidelity Necklace slot count (#3086)
* Fixes #3085.
* Added missing slot for Fidelity Necklace.
Thanks to @gegewu85!
2018-04-26 17:06:28 -04:00
rAthenaAPI
37c5399ac7 SQL synchronization 2018-04-26 16:49:31 +02:00
Aleos
72c0f9c8d0 Corrected Akaraje duration (#3081)
* Fixes #3079.
* Bonus should last for 20 minutes instead of 2 minutes.
Thanks to @gegewu85!
2018-04-26 10:49:25 -04:00
rAthenaAPI
86bb4912ce SQL synchronization 2018-04-26 16:26:51 +02:00
Aleos
33960fef3e Corrected some shadow equipment (#3080)
* Fixes #3078.
* Made some shadow equipment that were unable to be refined, refinable.
Thanks to @Angelic234!
2018-04-26 10:26:44 -04:00
Lemongrass3110
8c7cd293e0 Added support for missing 2018 clients
This will add support for all clients after 2018-03-07bRagexeRE.
This will work as long as Gravity does not add obfuscation or shuffling back in their clients.
2018-04-25 22:34:15 +02:00
Lemongrass3110
4ffb1b043a Reverted 0184671
This commit broke the "clear" command, which only required 2 columns.
2018-04-25 22:17:52 +02:00
rAthenaAPI
d623b1fa11 SQL synchronization 2018-04-24 23:00:50 +02:00
rAthenaAPI
94e6893087 Mob and NPC Identity Update 2018-04-24 23:00:36 +02:00
rAthenaAPI
10782d83ed SQL synchronization 2018-04-24 05:00:42 +02:00
rAthenaAPI
ae65e2e248 Mob and NPC Identity Update 2018-04-24 05:00:31 +02:00
Aleos
0184671094 Updated item_group_db column requirements (#3068)
Fixes #3065.
Should require 3 columns, not 2.
Thanks to @RadianFord!
2018-04-23 23:22:16 +02:00
rAthenaAPI
4a022e19a2 SQL synchronization 2018-04-23 19:08:15 +02:00
Aleos
963d9b04aa Removed ranged attack bonus from Hunting Arrow (#3069)
* Fixes #3067.
* Bonus should only apply when arrow is equipped with Hunter Bow.
Thanks to @teededung!
2018-04-23 13:08:06 -04:00
Cydh Ramdh
c4d3f0fd25 Item Bonus Documentation update
Updated doc for `bHPGainValue`, `bSPGainValue`, and `bSPGainRace`. To avoid a mislead, added "melee" word.
2018-04-22 12:23:24 +07:00
Lemongrass3110
55bf142ab8 Follow up to d13d6a6
Thanks to @RadianFord
2018-04-20 22:53:09 +02:00
Lemongrass3110
aaffbaaa14 Added ZC_NPCACK_SERVERMOVE2
Thanks to @mrdiablo
2018-04-20 22:44:35 +02:00
Lemongrass3110
2c68db9faa Fixed a few problems with homunculus autofeed (#3062) 2018-04-20 19:22:13 +02:00
rAthenaAPI
7df4c6b80a SQL synchronization 2018-04-20 18:24:29 +02:00
Lemongrass3110
d13d6a6e19 Changed SI_ enum to the official EFST_ enum (#2995) 2018-04-20 18:24:20 +02:00
rAthenaAPI
24abd2a4ee SQL synchronization 2018-04-20 15:37:31 +02:00
rAthenaAPI
33e3680995 Mob and NPC Identity Update 2018-04-20 15:37:20 +02:00
Kisuka
872eb00c55 Added mailmap file to coalesce together commits. (#2502)
If you want to be added to the list or want your mail address adjusted, please feel free to contact us.

Thanks to @kisuka for the original idea and the initial file.
2018-04-18 08:46:24 +02:00
Vincent Stumpf
3b385d956a Fix default mob ai spawn (#3054) 2018-04-18 08:00:22 +02:00
Atemo
3a8814ac4e Fixed Regenschirm Guard Laboratory Permit issue (#3056)
Thanks to @juanfus !
2018-04-16 17:01:01 +02:00
rAthenaAPI
7ab7724edd SQL synchronization 2018-04-16 16:55:03 +02:00
Atemo
5a0b72a7d1 Initiale release of Instance isle bios (#3041)
Initial release of isle of Bios instance

* Implemented NPC_COMET
* Adjusted skillratio for NPC_COMET. Thanks to @secretdataz !
* Fixed typo, thanks to @Lemongrass3110 and @zackdreaver !
- Replaced Morroc -> Morocc and Reaper Yanku -> Grim Reaper Ankou
* Fixed typo in mob_db.txt, thanks to @talesofragnarok 

Thanks to https://www.divine-pride.net/ for a lot of information !
2018-04-16 16:54:53 +02:00
Atemo
aee83557a9 Corrected a NPC name in academy.txt
Fixed #3048

Thanks to @Angelic234 !
2018-04-16 15:26:38 +02:00
rAthenaAPI
a360fa1142 SQL synchronization 2018-04-14 20:49:37 +02:00
Atemo
282012a8a1 Fixed #3050
- Corrected location of Noble Mask (item ID 5985) and it refineable value

Thanks to @Questune09
2018-04-14 20:48:43 +02:00
Atemo
d21e4df512 Corrected some quests parameter of Episode 15 in quest_db.txt 2018-04-13 19:39:23 +02:00
Aleos
524260183e Corrected Homunculus healing (#3047)
* Fixes #3013.
* Homunculus should only be automatically healed at creation.
Thanks to @Thekobe and @Lemongrass3110!
2018-04-11 21:52:40 -04:00
Lemongrass3110
5b13dc7009 Added script command mail (#3043) 2018-04-12 00:46:01 +02:00
Lemongrass3110
cc63bb594f Follow up to 07e2bf0
Fixed a missing switch case.

Thanks to @teededung and @RadianFord.
2018-04-11 14:50:35 +02:00
Jittapan Pluemsumran
e2b9e42b7d Cleaned up custom battleground scripts (#3025)
Added a warning to script command delwall
2018-04-11 11:22:29 +02:00
rAthenaAPI
73d471b81b SQL synchronization 2018-04-11 10:31:01 +02:00
Crazy Arashi
05dd7b31d5 Phantasmagorika Mobskill Placeholder (#2791)
Phantasmagorika Mobskill gathered from jRO
2018-04-11 10:30:51 +02:00
rAthenaAPI
f046d6e69e SQL synchronization 2018-04-10 19:39:23 +02:00
Jittapan Pluemsumran
07e2bf09af Made the second parameter for bonus script command optional (#2902)
* Made the second parameter for bonus script command optional

* Updated item scripts to reflect the bonus command change
2018-04-10 19:38:56 +02:00
Lemongrass3110
25f2626cf8 Removed a stack push from getvar (#2912)
Fixes #2891.
Thanks to @sader1992!
2018-04-10 12:27:48 -04:00
rAthenaAPI
7157dad0b9 SQL synchronization 2018-04-10 17:03:16 +02:00
BrOgBr
7a361690ef New items, some fixes and missing duplicates (#2954)
Fixes #2953
Fixes #2987

Thanks to @llchrisll, @zackdreaver, @Atemo and @Lemongrass3110
2018-04-10 17:03:06 +02:00
Aleos
8893ef1ccf Resolved storage saving on server crash (#3028)
* Fixes #3023.
* Properly save inventory and cart when closing storage and premium storages for the save_settings config.
Thanks to @Encon21!
2018-04-09 19:31:36 -04:00
Atemo
cdae404e6a Updated getunitdata / setunitdata (#3029)
Added the possibility to retrieve / change the current target id of a Mob, Homunculus, Mercenary and Elemental through getunitdata / setunitdata
2018-04-10 00:23:22 +02:00
Vincent Stumpf
f948b9a665 No matter what MAX_ITEM_RDM_OPT is, send 5 random options (#3040)
Thanks to @syracuase for the hint with RODEX
2018-04-08 23:33:15 +02:00
Atemo
dca8cc6027 Fixed typos in Phantasmagorika quests (#3026)
* Fixed typos in Phantasmagorika quests

Thanks to @Rolfxx !
2018-04-08 18:37:39 +02:00
Vincent Stumpf
ec1470b613 Corrected item_db script curly parsing (#2998)
* Fixes #2964
* Correctly finds the last right curly.
Thanks to @ecdarreola
2018-04-07 15:32:59 -07:00
flamefury
7f2c6cf2f5 Apply MHP limit based on bLv (#3003)
* Fixes #814.
* Applies the official maximum HP limit on players.
* Official notice: http://ro.gnjoy.com/news/notice/View.asp?BBSMode=10001&seq=6322
* Levels caps are as follows: Lv 99 = 330k; Lv 150 = 660k; Lv 175 = 1.1m
Thanks to @flamefury!
2018-04-06 12:29:54 -04:00
Aleos
e509930a67 Updated Shadow Chaser skills (#3014)
* Fixes #2972.
* Updated Auto Shadow Spell:
-- Will now trigger even on ranged physical attacks.
-- Increased spell cast level to 3/3/4/4/5/5/6/6/7/7.
* Updated Reproduce:
-- SP penalty for casting spells is now 30% extra.
Thanks to @zackdreaver!
2018-04-05 14:42:25 -04:00
Aleos
1d539c3e99 Corrected a potential integer overflow (#3012)
* Fixes #3001.
* Resolved a potential integer overflow for Magical Bullet damage calculation.
Thanks to @Valacobino!
2018-04-05 14:02:50 -04:00
Lemongrass3110
7901c1b2ff Fixed a compile warning from homunculus autofeed
Thanks to @arby89
2018-04-04 22:20:34 +02:00
Aleos
1efd7b5e2a Adjusted Madogear interaction with skills (#3027)
* Fixes #3022.
* Magnetic Field, Neutral Barrier, and Stealth Field will now end when a player dismounts from a Madogear.
Thanks to @admkakaroto!
2018-04-04 09:50:26 -04:00
Jittapan Pluemsumran
aab5d54945 Added a config for disabling novice/summoner character creation (#3008)
* Added a config for disabling novice/summoner character creation.
* Summoner can no longer be created on pre-renewal by default.
Thanks to @Lemongrass3110 for the help
2018-04-04 16:40:03 +07:00
Lemongrass3110
fdc48770aa Fixed a few typos and language mistakes (#2781)
Thanks to @Everade, @zackdreaver, @Atemo, @Akkarinage and @aleos89.
2018-04-04 10:13:00 +02:00
Lemongrass3110
aff70f6482 Added support for homunculus autofeeding (#3007)
* Added support for homunculus autofeeding
This feature is available in 2017-09-20bRagexeRE or later

Credits to @Asheraf in HerculesWS/Hercules#1898
2018-04-04 13:55:51 +07:00
Sader Fawall
1390930ca5 HotFix getinventorylist (#3033)
* Follow up to f07a1c4.
* Expanded the char array.
Thanks to @RadianFord and @sader1992!
2018-04-03 22:47:46 -04:00
rAthenaAPI
4ae1567e4f SQL synchronization 2018-04-03 19:42:11 +02:00
Aleos
71bf8cc8f6 Corrected Biscuit Stick bonus (#3011)
* Fixes #3004.
* Stat bonus should persist beyond death.
Thanks to @iubantot!
2018-04-03 13:41:41 -04:00
Aleos
f07a1c4b4d Added Random Option item data to getinventorylist (#3030)
* Closes #3021.
* Added Random Option item data to script command getinventorylist return values.
Thanks to @Yuchinin!
2018-04-03 10:40:29 -04:00
Lemongrass3110
170da17844 Dropped an unused declaration 2018-04-03 10:15:46 +02:00
rAthenaAPI
73483a64a1 SQL synchronization 2018-04-02 20:29:03 +02:00
Atemo
e96807cc44 Fixed #3010
Updated Muscle_Fool bonus to +200 VIT rather than +1000 DEF

Thanks to @zackdreaver !
2018-04-02 20:28:25 +02:00
Aleos
333f0dddc8 Corrected ShortWeaponDamageReturn behavior (#2744)
* Fixes #2685.
* Item bonus ShortWeaponDamageReturn should work in all cases.
Thanks to @kyeme and @zakudam!
2018-03-20 12:07:10 -04:00
Jittapan Pluemsumran
41ea1531bc Prevent unloadnpc script command to unload the invoking NPC. (#3000)
* Prevent unloadnpc script command to unload the invoking NPC.
Addressed #2999
2018-03-20 21:56:11 +07:00
Valacobino
bde3aeb9e8 Fixes a map-server crash when using @showmobs (#2997) 2018-03-18 18:28:51 +01:00
Lemongrass3110
db8234b9ee Fixed a missing comma in atcommand.cpp
Fixes #2993

Thanks to @arby89
2018-03-18 12:19:52 +01:00
Aleos
9bbb4cb5b9 Corrected Lightning Walk requirements (#2984)
* Fixes #2974.
* Corrected SP consumption.
* Corrected spirit sphere consumption.
Thanks to @admkakaroto!
2018-03-16 13:22:21 -04:00
Aleos
378322592e Corrected guild storage saving (#2957)
* Fixes #2946.
* Resolves players being unable to transfer items when the character data is saved while a guild storage is open.
Thanks to @CodexRegius!
2018-03-16 13:06:02 -04:00
Chisee
794f497914 Corrects Spirit/Charm absorption behaviour on Ninja Spirit Charm (#2980)
* Fixes #2087.
* The conditional was missing a check on Kagero/Oboro's Spirit Charm, therefore not removing the charms nor applying SP regeneration on caster.
Thanks to @Chisee!
2018-03-16 12:50:19 -04:00
Aleos
ad5416e271 Corrected Shadow Warrior double attack rate (#2988)
* Fixes #2968.
* The rate of double attack should match the rate of Thief's Double Attack even levels.
* Confirmed that the double attack bonus does not work when weapons are not equipped.
Thanks to @redlightliu!
2018-03-16 12:35:18 -04:00
Daegaladh
987ec9bdce Fixed turbo track fee and min level in solo mode 2018-03-16 16:58:29 +01:00
Lemongrass3110
a16fe436e3 Disabled achievement NPCs if feature is disabled (#2986)
Fixes #2983

Thanks to @zackdreaver
2018-03-15 07:27:08 +01:00
rAthenaAPI
fb80bd3ac2 SQL synchronization 2018-03-15 02:12:15 +01:00
Aleos
609b6177e5 Corrected Parasite Card script (#2985)
* Fixes #2973.
* Should reduce damage received from Formless race monsters.
Thanks to @zackdreaver!
2018-03-14 21:11:36 -04:00
s8nozieb
fcd181231d Added missing documentation for mapflag nobranch (#2981) 2018-03-14 23:07:26 +01:00
Lemongrass3110
f338d53c2c Added support for clients up to 2018-03-07bRagexeRE (#2975)
Thanks to @4144 as always
Credits to @dastgir and the leaked 2015 dump for the quest packets
Thanks to @idamonli for testing and feedback
2018-03-14 23:05:01 +01:00
rAthenaAPI
c1b9ee8694 SQL synchronization 2018-03-11 19:49:30 +01:00
zackdreaver
d0d4250832 Costumes update (#2961)
Signed-off-by: zackdreaver <zackdreaver@gmail.com>
2018-03-11 19:49:03 +01:00
Lemongrass3110
42dda258a1 Added new hat effects 2018-03-08 22:24:47 +01:00
rAthenaAPI
bc02c4e054 SQL synchronization 2018-03-08 20:44:51 +01:00
Lemongrass3110
dee40ff4e3 Added items 4951-4969 (#2925)
Added real Loki & Nidhoggur's Hat(19050)

Thanks to @mrdiablo and @Atemo for their help.
2018-03-08 20:44:28 +01:00
rAthenaAPI
40d9d5ab73 SQL synchronization 2018-03-08 00:42:26 +01:00
Lemongrass3110
5c9d7a41a9 Added support for the second summer costume (#2942)
Fixed other costumes being able to be removed by Dispell

Fixes #2788

Thanks to @admkakaroto
2018-03-08 00:41:52 +01:00
Lemongrass3110
a7df035854 Fixed titles only being added on relog (#2945)
Fixes #2944

Thanks to @admkakaroto
2018-03-07 18:57:00 +01:00
rAthenaAPI
9d857836e7 SQL synchronization 2018-03-06 08:54:11 +01:00
Lemongrass3110
d7f226a66b Fixed a few issues with TXT item db parsing (#2940)
Fixed an issue with comments in the middle of the line
Fixed the curly mismatches not being reported

Fixes #2938

Thanks to @kaninhot004
2018-03-06 08:54:00 +01:00
BrOgBr
a8ca85d514 Fixed Malangdo Culvert Warp (#2951)
Fixed a minor error at Malangdo Culvert Instance's warp.
*Fixes #2950

Thanks to @llchrisll
2018-03-05 07:59:59 +01:00
Daegaladh
96a594262b Fixed Frenzy (LK_BERSERK) job level requirement. 2018-03-05 00:56:03 +01:00
s8nozieb
39ba3d600b Fixed typo in BUILDIN_FUNC(sleep) (#2949)
[ci skip]
2018-03-04 13:02:26 +07:00
Daegaladh
5f34efdf7a Fixed no reiteration unit skills fail message back to USESKILL_FAIL_LEVEL. 2018-03-01 19:49:26 +01:00
Daegaladh
6f91de806c Fixed party_skill_check not updating the party members 2018-03-01 00:31:33 +01:00
Daegaladh
99af1a4471 Fixed default traps invisibility setting for renewal (#2934) 2018-02-28 21:58:14 +01:00
Aleos
31e2871d7e Resolved renewal ASPD and two-handed weapons (#2933)
* Fixes #2930.
* Follow up to 267fd3e.
* Fixes ASPD dropping drastically for two-handed weapons.
Thanks to @luan122 and @Tokeiburu!
2018-02-27 13:49:53 -05:00
Lemongrass3110
a0a55dada1 Fixed unitwalkto calls in unit walk events (#2913)
* Fixes #2341.
* Fixed unitkill for mobs inside the walk event.
* Also fixed the state tracking of the walk event script.
Thanks to @Atemo!
2018-02-27 13:33:12 -05:00
Jittapan Pluemsumran
7188619325 Added a new packet for the equipment swap system (#2932)
* Changed introduction client date for packet 0x0ACE
2018-02-26 19:00:35 -05:00
Lemongrass3110
f6e0a0a344 Added support for 2018-02-13aRagexeRE
Thanks to @4144
2018-02-27 00:20:27 +01:00
Daegaladh
c1081f434a Merge pull request #2928 from Daegaladh/hotfix/bs_skintemper
Fixed Skin Tempering (BS_SKINTEMPER) fire resistance percentage.
2018-02-26 16:24:59 +01:00
Daegaladh
b989844fcc Fixed Sheltering Bliss (CG_MOONLIT) max level
Wrong since it's first implementation 12 years ago.
2018-02-25 23:05:02 +07:00
Daegaladh
a40b69f378 Fixed Skin Tempering (BS_SKINTEMPER) fire resistance percentage.
iRO wiki is wrong, it's 5% per level.
2018-02-23 20:34:59 +01:00
aleos89
fdb7aefdd8 Corrected Power Swing weapon requirement
* Fixes #2904.
* All weapons are usable, not limited to just Axe types.
Thanks to @Badarosk0!
2018-02-23 14:23:12 -05:00
Lemongrass3110
38a00aa54b Added map_msg_mal.conf
If someone wants to translate some messages feel free to create a pull request for it!

Fixes #2927

Thanks to @hendra814
2018-02-23 11:32:27 +01:00
Jittapan Pluemsumran
1e766a7b4a Converted pet_data::petDB into a getter function (#2901)
* Converted pet_data::petDB into a getter function
Fixed #2900
Thanks to @Lemongrass3110
2018-02-23 17:14:46 +07:00
Lemongrass3110
c16b7b1795 Fixed display of newly added pet eggs in storage (#2911)
Fixes #2864

Thanks to @talesofragnarok for reporting and @aleos89 for confirmation.
2018-02-23 01:46:27 +01:00
rAthenaAPI
46dbf857ee SQL synchronization 2018-02-23 01:25:18 +01:00
rAthenaAPI
e9919620b6 Mob and NPC Identity Update 2018-02-23 01:24:47 +01:00
rAthenaAPI
3b3fc07e71 SQL synchronization 2018-02-23 01:14:32 +01:00
Aleos
d4c1a57fb5 Cleaned up atcommand accinfo leftovers (#2926)
* Follow up to 2746e0d
* Cleaned up some variable assignments when parsing the packet.
* Updated packet documentation.
* Freed message 220.
Thanks to @RadianFord and @Lemongrass3110!
2018-02-22 17:14:20 -05:00
Aleos
5e354494b2 Corrected Disarm and Steal Coin formulas (#2890)
* Fixes #2889.
* Updated Disarm's strip chance.
* Updated Steal Coin's steal chance.
* Updated Steal Coin's zeny amount.
Thanks to @mrjnumber1and @Lemongrass3110!
2018-02-22 16:58:06 -05:00
Daegaladh
1e2032cc21 Fixed Endow skills to match official behavior. (#2918)
* Endows are now interchangeable.
* No longer break the weapon on failure and now unequips instead.
Thanks to @Daegaladh!
2018-02-22 16:23:11 -05:00
flamefury
5998cca3b7 Cart Termination should be affected by % effects (#2924)
* Fixes #253.
* Only applies to renewal mode.
Thanks to @raynra and @flamefury!
2018-02-22 16:05:35 -05:00
inhyositsu
fe575ddac8 Changing DBMap into STL::Map in C++ for guild storage (#2915) 2018-02-22 21:48:25 +01:00
rAthenaAPI
749bb60be7 SQL synchronization 2018-02-22 11:16:59 +01:00
Jittapan Pluemsumran
97c1e8b9ee Fixed STR/INT/VIT Biscuit Sticks item script. Fixed #2841 (#2846)
Thanks to @laziem
2018-02-22 17:16:48 +07:00
Lemongrass3110
3c41d4eeb0 Fixed item creation with full inventory (#2914)
* Fixes #2858.
* Prevented items from being created if adding them to the inventory failed for whatever reason.
* Introduced a new config that allows to keep the old behavior.
Thanks to @Artuvazro and @Daegaladh!
2018-02-21 19:42:49 -05:00
rAthenaAPI
839f738565 SQL synchronization 2018-02-21 00:54:24 +01:00
BrOgBr
7bb35d28ba Reactors from Charleston Instance (#2921)
* Reactors from Charleston Instance

These Reactors are from Charleston Instance: https://www.novaragnarok.com/forum/news/excellion-patch-notes-r163/

* Correct Names.

Thanks to NovaRO.

* Fixed scripts from some reactors.

Thanks to @Atemo
2018-02-21 00:54:03 +01:00
Cydh Ramdh
eaf44078bf Set max Zeny to 2,147,483,647 (#2756)
* This is the client's limitation.
2018-02-20 17:32:36 -05:00
rAthenaAPI
0f5542f666 SQL synchronization 2018-02-20 23:13:15 +01:00
Cydh Ramdh
d3ea313b8c Removed unnecessary RC_PLAYER item bonuses (#2800)
* Removed unnecessary RC_PLAYER item bonuses

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

* Follow up for pre-re items
2018-02-20 23:12:26 +01:00
Atemo
6e0187bc2b * Initial release of dimensional travel quest (access to flame bassin) (#2775)
* * Initial release of dimensional travel quest (access to flame bassin)

* Include misc npcs related to ep14.3

* Implementation of NPC_DEATHSUMMON - summon monsters at the location of master grave.

Thanks @ecdarreola, @rye305 for testing
Thanks to https://www.divine-pride.net/ !
2018-02-20 23:11:56 +01:00
Aleos
0e23f3fec0 Updated Tiger Fist stop duration (#2917)
* Updated Tiger Fist stop duration
* Fixes #2893.
* Updated the stop duration to match official values.
Thanks to @mrjnumber1!
2018-02-20 16:56:26 -05:00
aleos89
6411a1d4ff Follow up to b7d3828
* Fixed a compile error.
2018-02-20 13:26:16 -05:00
aleos89
b7d38283d7 Follow up to 267fd3e
* Fixed a compile error.
2018-02-20 13:18:51 -05:00
aleos89
267fd3e6db Corrected renewal ASPD off-hand calculation
* The case of unarmed and weapon (off-hand) resulted in the ASPD not being calculated properly.
* kRO includes the 1/4th ASPD penalty for off-hand weapons.
Thanks to @Tokeiburu!
2018-02-20 13:13:48 -05:00
Aleos
6e5de84a2a Updated guild skill Guard Up (#2908)
* Fixes #2854.
* Updated guild skill Guard Up bonuses for pre-renewal and renewal.
* Removed SP adjustment as mobs don't have SP checks.
Thanks to @mrjnumber1!
2018-02-20 10:11:13 -05:00
secretdataz
dfe279fb0f Fixed compatibility with some newer MySQL client library derivatives 2018-02-20 15:51:56 +07:00
rAthenaAPI
f3520e56ea SQL synchronization 2018-02-19 23:25:06 +01:00
Atemo
4fef4d0480 Corrected the amount of slots of Spartacus (item ID 1835).
Thanks @BrOgBr !
2018-02-19 23:24:30 +01:00
rAthenaAPI
11dc0f6852 SQL synchronization 2018-02-18 18:01:47 +01:00
Yudi Maharlika
77f75c0510 Corrected missing ATK / MATK bonus From Old Wind Whisper (Item ID 18980) (#2822)
* Corrected missing ATK / MATK bonus From Old Wind Whisper (Item ID 18980)
* Source : https://www.divine-pride.net/database/item/18980
* Thanks to Divine Pride and TheDerpySupport
2018-02-18 18:00:39 +01:00
Sader Fawall
ead017b396 Clear script command(#2840) 2018-02-18 17:47:41 +01:00
Lemongrass3110
132feeb621 Made mercenary db dynamic (#2883)
Removed hard limit of the mercenary database
Cleaned up the hard coded duplicated logic
Turned hard coded mercenary ids into constants
2018-02-18 17:15:09 +01:00
Daegaladh
7f9f185c58 Fixed athena-start newlines not set to unix type (#2916) 2018-02-16 16:11:21 +01:00
Aleos
02983c4f63 Fixed Mystical Amplification and Chain Lightning (#2907)
* Fixes #2897.
* Mystical Amplification should only boost the damage for the first Chain Lightning attack.
Thanks to @admkakaroto!
2018-02-16 09:43:49 -05:00
Aleos
d2c5ca99fa Updated Masquerade - Weakness behavior (#2909)
* Fixes #2905.
* Players can no longer equip weapons/shields while the status is active.
Thanks to @Everade!
2018-02-15 22:24:12 -05:00
Aleos
a40b1da4d0 Updated Cultivation plant spawn formula (#2910)
* Fixes #2892.
* Corrected level 2 Cultivation formula for spawning plants.
Thanks to @mrjnumber1!
2018-02-15 21:49:12 -05:00
Daegaladh
2ecb30abb2 Fixed AL_HOLYWATER behavior (#2860)
* Fixes #2853.
* Holy Water should not cast or consume SP when the player has no empty bottles, both in water (and water skills) and outside water.
Thanks to @Daegaladh!
2018-02-15 19:00:11 -05:00
Lemongrass3110
2746e0d351 Removed password output from atcommand accinfo
Thanks to @4144 for bringing this absurd thing to our attention in HerculesWS/Hercules#1975
2018-02-15 23:19:27 +01:00
Lemongrass3110
e1b9d24324 Added support for 2018-02-07bRagexeRE
Thanks to @4144
2018-02-15 17:27:06 +01:00
Maytichai Saowa
e43f03add6 Fix atcommands.txt ban > Charban 2018-02-15 20:50:27 +07:00
rAthenaAPI
0396011819 SQL synchronization 2018-02-15 05:17:30 +01:00
Jittapan Pluemsumran
cacf450daf Fixed some autobonus scripts in item_db 2018-02-15 11:16:55 +07:00
rAthenaAPI
b48f0e8896 SQL synchronization 2018-02-10 15:37:35 +01:00
BrOgBr
41dbb30f64 More Items Correction (In general Equips) And new item 1835 (#2828)
* More Items Correction (In general Equips) And new item 1835

Most errors in Item's Script. (but in some items, Weight and ATK/MATK rate too)

And new item "1835" Spartacus [2].

Special thanks to @sader1992, @Lemongrass3110 and Haruka Mayumi. (helped with some script).
Thanks to @aleos89 !
2018-02-10 15:37:12 +01:00
Lemongrass3110
9d4fa62e65 Fixed a bug with pin code on 2018-01-24
The button to access pin code menu after entering the correct code was likely removed in this client.
It was rendered in between all the characters if we send out the PASSED state instead of the OK state.

Thanks to Bruno
2018-02-10 02:31:29 +01:00
Lemongrass3110
afab80fb6e Updated card seller (#2851)
* Updated card seller

Fixes #2844

Thanks to @vstumpf, @Atemo !
2018-02-09 19:55:54 +01:00
Aleos
75a8f520a6 Corrected Heat Barrel bonuses (#2882)
* Fixes #2875.
* Attack was not factoring in coins.
* Corrected fixed cast time to also factor in coins.
Thanks to @rye305!
2018-02-09 13:27:39 -05:00
Atemo
3bcb37bf86 Workaround to solve issue with news cards in enchants NPCs (#2795)
* Workaround to solve issue with news cards in enchants NPCs

Thanks to @Lemongrass3110, @Everade !
2018-02-09 19:06:21 +01:00
Atemo
139f6f2538 Hotfix for issue #2879 (#2888)
* Fixed issue #2879
Little clean-up of kafra functions
2018-02-09 17:26:40 +01:00
Lemongrass3110
8792960df2 Added support for 2018-01-24 (#2884)
In this client the new character select and cash shop UI from Ragnarok Zero were merged into the Sakray client.
Increased MAX_CHARS to 15 to fit the new character select
Added possibility to overwrite MAX_CHARS in defines_pre.h

As always thanks to @4144 for the shuffle packets and keys.
2018-02-09 15:35:58 +01:00
Jittapan Pluemsumran
62d3021764 Merge pull request #2881 from flamefury/hotfix/runeMasteryQty
Rune Mastery Lv5 can create 2 rune stones
2018-02-08 21:21:16 +07:00
flamefury
31d725554d Merge branch 'hotfix/runeMasteryQty' of https://github.com/flamefury/rathena into hotfix/runeMasteryQty 2018-02-08 00:12:47 -08:00
rAthenaAPI
fd768c6cc5 SQL synchronization 2018-02-08 02:27:58 +01:00
flamefury
8258df6473 Chance to craft 2 runes starts at RuneMasteryLv5, not 6 2018-02-07 17:26:27 -08:00
Lemongrass3110
eea76c8e62 New mob placeholders 2018-02-08 02:26:22 +01:00
flamefury
82035609d4 Correct the party member ATK bonus of RK_FIGHTINGSPIRIT (#2877)
Fixes #2876
2018-02-07 22:32:00 +01:00
rAthenaAPI
ebbd37be18 SQL synchronization 2018-02-06 16:26:49 +01:00
aleos89
24a9e4c6d2 Corrected True Seyren Windsor Card bonus
* Fixes #2868.
* Item was attempting to grant an invalid skill.
Thanks to @ArcherDs!
2018-02-06 10:23:17 -05:00
Lemongrass3110
2f358d8f5a Updated CI tool configurations (#2852)
Fixed permissions for the created MySQL user.
Switched travis to a matrix form.
2018-02-02 15:57:45 +01:00
Lemongrass3110
31988abd19 Changed forking reference link (#2848) 2018-01-30 22:40:46 +01:00
Aleos
4171cd1801 Updates Rolling Cutter counter behavior (#2837)
* Fixes #2835.
* Rolling Cutter counter should only be reset on physical click-walks, not by any other movement.
Thanks to @ecdarreola and @secretdataz!
2018-01-30 14:15:42 -05:00
rAthenaAPI
c5789f1e27 SQL synchronization 2018-01-30 18:11:20 +01:00
Lemongrass3110
1a560dd0b9 Implemented heroes trail cards (#2839)
* Implemented cards for Heroes' Trail instances
Thanks to @Lemongrass3110 and @Atemo for their help!
2018-01-31 00:10:57 +07:00
Aleos
f2c7384890 Cleaned up Miracle damage bonus (#2811)
* Cleaned up Miracle damage bonus
* Fixes #2809, #2823.
* Moved the bulk of the checks outside of the status change check.
* This was possibly preventing the bonus from being applied when no statuses are active.
Thanks to @Dakado!
* Fixed Star Gladiator's SLS Wrath ATK calculation to match official servers.
2018-01-28 23:20:59 +07:00
Maytichai Saowa
db4e9b2565 Fixed minor style typo in clif_obfuscation.hpp (#2845) 2018-01-28 22:10:09 +07:00
Daegaladh
de9b4efd1a Fixed required weapon messages. (#2808)
Fixes #2804 

Thanks to @Daegaladh
2018-01-27 00:26:51 +01:00
Lemongrass3110
ec59e95520 Fixed a problem with instance_db import
Fixes #2824

Thanks to @luan122
2018-01-25 19:08:56 +01:00
Lemongrass3110
bb0dd7b8dc Fixed mapserver crash on script command warp (#2766)
Fixes #2765

Thanks to @LunarSHINING
2018-01-24 19:30:05 +01:00
Lemongrass3110
3a8c8a9da4 Cleaned up whisper code between map-servers (#2763)
Fixes #2760
Fixes #2762

Thanks to @LunarSHINING
2018-01-24 18:33:09 +01:00
Lemongrass3110
c4a57c571c Added support for 2018-01-17aRagexeRE
Fixed char select on 2018 clients
2018-01-24 00:41:38 +01:00
Artuvazro
e9bb1064ee Updated Spanish message conf (#2813)
* Updated translation with missing lines and several linguistic fixes.
Thanks to @Artuvazro!
2018-01-23 09:53:24 -05:00
rAthenaAPI
eb1635fc56 SQL synchronization 2018-01-22 00:17:16 +01:00
Lemongrass3110
585f419ee2 Synced mob skill db (#2776)
Fixed Amdarias' Vampire Gift cast rate
2018-01-22 00:16:35 +01:00
rAthenaAPI
2ba3c9dcf4 SQL synchronization 2018-01-21 22:48:34 +01:00
syracuase
8530a7b1fe Job Level check for Blacksmith and Alchemist (#2819)
* Job Level check for Blacksmith and Alchemist
2018-01-21 14:51:38 +01:00
aleos
fe9f1ace66 Corrected 'Reborn in Valhalla' achievement
* Removed the base level requirement as it's not needed.
Thanks to @Atemo!
2018-01-20 10:54:22 -05:00
aleos
a8976dd2ac Added combos for Legionaire Helm
* Fixes #2812.
* Adds missing combos for Pike, Pike [3], Pike [4], Gladius, Gladius [2], Gladius [3], and Strong Shield [1].
Thanks to @AzarthMZintos!
2018-01-19 17:22:58 -05:00
Sader Fawall
31bd28df44 hotfix sleep error Geffen Magic Tournament (#2815) 2018-01-18 19:35:36 +01:00
rAthenaAPI
d306f1711c SQL synchronization 2018-01-16 22:49:53 +01:00
aleos
8616332f24 Corrected Strawberry Decoration sets
* Fixes #2792.
* Added the missing HP bonus for Tasty Strawberry Hat (18852).
* Added the missing combo bonus for Tasty Strawberry Hat (18853).
* Corrected the buy price and equip level for Strawberry Decoration.
Thanks to @win4517!
2018-01-16 16:49:26 -05:00
rAthenaAPI
59fead3231 SQL synchronization 2018-01-16 22:39:49 +01:00
aleos
805114c3f4 Corrected Old Glast Heim items
* Fixes #2801.
* Added Colorful Key.
* Corrected item buy prices.
* Corrected item weights.
* Corrected item name Flashy Brooch to Colorful Brooch.
Thanks to @BrOgBr!
2018-01-16 16:39:20 -05:00
rAthenaAPI
a6a2c4301b SQL synchronization 2018-01-13 18:03:41 +01:00
Yudi Maharlika
d04d307e61 Fixes missing item view on Lapine Shield (2198) and White Gold Shield… (#2798)
* Fixes missing item view on Lapine Shield (2198) and White Gold Shield (2196)
* Missing item view on shield causing shield-related spell cannot be used.

* Added View ID on Lian Shield (2195)

* Fixed View ID Lian Shield, Lapine Shield, and White Gold Shield
Thanks to @Atemo
2018-01-13 18:03:16 +01:00
Aleos
2e90136dc3 Corrected Reverberation behavior (#2758)
* Fixes #2757.
* Reverberation will no longer trigger the cast animation on the caster when a target walks into it.
Thanks to @MrAntares!
2018-01-12 10:45:52 -05:00
Jittapan Pluemsumran
0ccf309ccc your -> you are* 2018-01-11 16:42:19 +07:00
Lemongrass3110
7a0f3d0eaf Added RagexeRE support until 2018-01-03
Thanks to @4144
2018-01-10 22:44:10 +01:00
Lemongrass3110
16780638be Fixed a few name typos with Niflheim (#2782)
Thanks to @Daegaladh for his input
2018-01-09 23:36:20 +01:00
Jittapan Pluemsumran
48d79cef43 Don't allocate space for new castle data if castle with the same ID already exists. Fixed #2793.
Thanks to @Daegaladh
2018-01-09 19:44:56 +07:00
rAthenaAPI
6ed40baad1 SQL synchronization 2018-01-09 05:48:29 +01:00
admkakaroto
5e0d3e54ce Small bonus correction MATK in the item 'Infinity Dagger'.
Font: https://raw.githubusercontent.com/zackdreaver/ROenglishRE/master/System/itemInfo.lua
2018-01-09 11:48:09 +07:00
rAthenaAPI
6aa3e88f61 SQL synchronization 2018-01-08 08:05:24 +01:00
Yudi Maharlika
a524e39a0f Fixes Badge Of Order Grace missing bonus (#2790)
Added ATK, MATK, and Max HP Bonus
Source : https://www.divine-pride.net/database/item/5825
2018-01-08 08:05:15 +01:00
Lemongrass3110
a65e7dbf46 Fixed F_SexMes call
Fixed #2785

Thanks to @insanchen
2018-01-07 21:07:34 +01:00
Yudi Maharlika
a6818eb501 Fixes typo in atcommand.cpp that makes atcommand @accept after duel cannot be used because of limit player reached. (#2778) 2018-01-07 11:30:37 -05:00
Atemo
1f7ceabbb1 Fixed #2783
Thanks to @insanchen !
2018-01-07 16:59:23 +01:00
rAthenaAPI
81d2531bf4 SQL synchronization 2018-01-07 16:37:43 +01:00
Atemo
ad53dba49b Implemented item "Lunar Rainbow" (#2771)
* Implemented item "Lunar Rainbow"

Fixed #2759

Thanks to @AzarthMZintos !
2018-01-07 16:37:33 +01:00
rAthenaAPI
6fa1a89e1e SQL synchronization 2018-01-07 12:55:09 +01:00
Lemongrass3110
f02cde4e5d Fixed SQL sync
Thanks to @Haikenz
2018-01-07 12:54:53 +01:00
rAthenaAPI
bd1e880d65 SQL synchronization 2018-01-06 21:18:29 +01:00
Atemo
0360137abe Initial release of Phantasmagorika Quests (Walkthrough conversion). (#2215)
Initial release of Phantasmagorika Quests containing

* Phantasmagorika Quests ep 15.1 and 15.2
* Central Lab instance
* The Last Room instance
* News monsters around verus (credits divine-pride.net)

Thanks to @rofasindo @Valorro @jenkijo @ecdarreola @Jeybla !
Special thanks to Divine Pride !
2018-01-06 21:18:02 +01:00
Lemongrass3110
de50a5e304 Fixed a typo in 2008's Christmas event
Thanks to @Everade
2018-01-05 23:22:29 +01:00
rAthenaAPI
5aa26dc925 SQL synchronization 2018-01-05 16:38:50 +01:00
Jittapan Pluemsumran
c04c2e7ef1 Updated Old Glast Heim instance (#1554)
** Updated Old Glast Heim instance
* Changed hardcoded sprite ID for NPCs in Old Glast Heim to constant
* Cleaned up Old Glast Heim NPC dialogues

* Merged OGH merchants from idathena (credits @exneval)

* Updated Old Glast Heim mobs
* Updated stats and skills for all Old Glast Heim mobs.

* Added Modified Boots (Temporal Boots for Oboro/Kagerou, Rebellion) entries.
* Added Gigant Snake Skin + Modified Boots item combo

Thanks to @secretdataz @aleos89 @srhmike @ecdarreola Heris, @zackdreaver @exneval and the reviewers
Special thanks to Divine-Pride.net!
2018-01-05 16:38:38 +01:00
rAthenaAPI
6265964974 SQL synchronization 2018-01-05 16:01:10 +01:00
Lemongrass3110
dea92eef91 New mob placeholders 2018-01-05 16:00:52 +01:00
Technoken
15b6d5cc83 Corrected Cannibalize behavior (#2769)
* Fixes #2768.
* Fixes Cannibalize level 5 spawning multiple Geographer due to a typo.
Thanks to @technoken!
2018-01-04 10:38:28 -05:00
Lemongrass3110
6f01321b27 Merged two similar conditions on mapchange 2018-01-03 22:41:58 +01:00
Lemongrass3110
c4bfe0b122 Fixed a wrong fifohead allocation 2018-01-03 22:31:04 +01:00
Jittapan Pluemsumran
bfb6972c59 Implemented getequiptradability script command (#2750)
Thanks to @aleos89 @anacondaqq @Lemongrass3110
2018-01-03 21:51:38 +01:00
syracuase
d5c6c6d36f Update twintowers.txt (#2764) 2018-01-03 20:45:33 +01:00
rAthenaAPI
7e72809f63 SQL synchronization 2018-01-02 19:47:22 +01:00
Lemongrass3110
8c53679a94 New mob placeholders and npc ids 2018-01-02 19:46:43 +01:00
Cydh Ramdh
32950ecead Updated Item Group features (#2692)
* Added config to hide last chars of player's name `broadcast_hide_name` and its default value is 2.
* Fixed `getgroupitem` that should give unidentified item for equipment types.
* Added optional param for `getgroupitem` and `getrandgroupitem` to always give player identified item, ignores the `itemdb_isidentified`'s check.
* Thanks to @aleos89 @Lemongrass3110
2018-01-02 12:55:52 +07:00
Lemongrass3110
fb966a12e0 Turned pet db into a dynamic map (#2727)
Thanks to @Jeybla, @lighta and @aleos89
2018-01-01 22:57:47 +01:00
rAthenaAPI
ef651df6a4 SQL synchronization 2018-01-01 18:36:43 +01:00
Jittapan Pluemsumran
19e712c87d Fixed Heart Wing Hairband (18563) item script (#2752)
Thanks to @im-mi
2018-01-02 00:36:26 +07:00
Jittapan Pluemsumran
8e45966c24 Fixed combo script for Survivor's Rod + Survivor's Meanteau combo (#2753)
Thanks to @BrOgBr
2018-01-02 00:36:00 +07:00
aleos
5602bb04f8 Follow up to 1f0ea81
* Removed specific job restrictions from atcommand bodystyle.
2017-12-30 15:43:17 -05:00
flamefury
84085d7ecd Evil Marcher Hat script fix (#2742)
* Fixes #2741.
* Added missing Critical Attack bonus.
* Added missing Long Attack bonus.
Thanks to @flamefury!
2017-12-30 15:26:37 -05:00
aleos
1f0ea81d3f Added Rune Knight to atcommand bodystyle
* Fixes #2746.
Thanks to @mazvi!
2017-12-30 10:50:47 -05:00
Cydh Ramdh
b4ce1e3d1f Removed Duplicate Entries in Renewal Quest DB (#2740)
* Removed duplicate entries for Rebellion Job Change Quest
2017-12-30 00:56:45 +07:00
Sader Fawall
e88785b181 Resolved a compile error (#2743) 2017-12-29 20:41:54 +07:00
aleos
e385e167ab Resolved a compile warning
* Follow up to 716f6c0.
* Fixes #2738.
Thanks to @sader1992!
2017-12-28 16:28:58 -05:00
rAthenaAPI
9c531b0af6 SQL synchronization 2017-12-28 16:25:36 +01:00
Yudi Maharlika
4302fe6409 Corrected Supplement Part Dex (Item ID : 2995) script (#2723)
* Should have bSkillCooldown instead of bSkillVariableCast.
* Source : https://www.divine-pride.net/database/item/2995
Thanks to @uddevil!
2017-12-28 10:25:28 -05:00
Sader Fawall
d19ba918ae Update pet script command (#2705)
* Fixes #2703.
* Added alternative for script command bpet: birthpet.
* Added alternative for script command pet: catchpet.
* Updated documentation for script command pet.
* Added PET_CATCH_UNIVERSAL_ITEM for script command pet which will attempt to catch the targeted monster as long as it is in the pet database and the targeted monster requires the lure item used.
Thanks to @sader1992!
2017-12-27 21:27:04 -05:00
lighta
716f6c0f29 Duel allocation (#2734)
* Duels are now dynamically created and no longer statically consumes memory.
* Removed max number of duel at once.
* Updated duel modules for multi-thread and safer management.
* Remove various statically allocated tab.
* Removed duplicate code for npc_movenpc.
* Fix few warnings.
Thanks for suggestions from @anacondaqq.
2017-12-27 19:39:45 -05:00
Aleos
ae69e50626 Cleaned up renewal ASPD calculations (#2244)
* Cleaned up renewal ASPD calculations
* Fixes #2067 and fixes #2224.
* Adjusted the ASPD table to match Aegis values.
* Angra Manyu now disregards base ASPD values (Pre-Renewal only).

* Relocated Angra Manyu check
* Moved Angra Manyu check to the front to avoid useless calculations.
Thanks to @Lemongrass3110!

* Corrected double weapon calculations
* Resolved wearing two weapons causing ASPD to drop significantly.
* Corrected some typos in the Assassin class ASPD table.
* Added a missing Shadow Arms equipment check.
Thanks to @Lilori!

* Removed some unneeded defines

* Removed the single handed and double handed weapon max defines.
Thanks to @Jeybla!

* Renamed constants to keep legacy values

* Update status.cpp
2017-12-23 16:00:54 -05:00
Aleos
5e2dd2afee Relocated restricted equip failure check (#2735)
* Fixes #2534.
* Moved the restricted equipment failure check before the Super Novice Soul Link check.
Thanks to @admkakaroto!
2017-12-23 14:17:09 -05:00
lighta
5ad35eb66b Fix #2694 (#2732)
* Fix #2694

Move down skill_unit_move(bl,gettick(),4) of unit_remove_map_ to avoid conflict with duel changing realm.
The issue was that skill_unit_onleft was called before the duel_leave handling which was reapplying skill_unit_onplace causing an infinite status duration.
Other skill might had same issue.

* Small optimisation.
Avoid calling status_change_end when we have no status set yet (or no status_change holder).
Move down overrecurent call to status_change_end SC_ROLLINGCUTTER.
2017-12-22 14:29:44 -05:00
Lemongrass3110
65771a8ec1 Switched mob db searches to find (#2726)
* Switched mob db searches to find
* Replace NULL with nullptr

As suggested by @Jeybla
This way no (caught) exceptions will be reported in visual studio anymore
2017-12-22 07:43:44 -05:00
aleos89
d44367690c Exported the pet catch constant
* Exported to allow usage in scripts.
2017-12-21 13:00:15 -05:00
Aleos
9315781a48 Updated Pet catching values (#2719)
* Added pet catching constants.
* Converted catch_target_class from short to uint16 for future expansion.
Thanks to @Lemongrass3110!
2017-12-21 12:54:19 -05:00
Lemongrass3110
6e7e97cac7 Fixed a crash caused by setquest in login events (#2728)
Fixes #2700

Thanks to @ignizh
2017-12-21 11:06:16 -04:00
lighta
a0c8961e62 Fix #2724 (#2725)
Prevents accessing a nullpointer from a non existant mob when using mobsearch
2017-12-21 00:14:16 +01:00
rAthenaAPI
97ea9efe50 SQL synchronization 2017-12-20 23:54:32 +01:00
Vennren
13721c106e Adventurer Pack (#2698)
The adventurer pack gives stat food items that are not working and not having a continuous reference to items in the same ID range.
2017-12-20 23:54:12 +01:00
Lemongrass3110
88e48ed6ff Follow up to 7a1a76a
Thanks to @AthenaStudioz and @sader1992
2017-12-20 21:55:06 +01:00
Sader Fawall
eb8f33e40f Corrected mapcache build (#2715)
* Removed the hyphen from the name in the Windows build.
Thanks to @sader1992!
2017-12-20 10:02:52 -05:00
Jeybla
5a80f29b65 Fixes potential map server crashes. (#2695)
* status_change_timer refactorization
* Changes some pointers to const pointers to prevent unwanted behavoir.
* Changes sc_timer_next to a lambda function with only the tick as a
  paramter.
* sce is not reassigned in sc_timer_next anymore, therefore it should be
  crash safe (see #2414 and #2539)
* Fixes #2539
* Thanks to @whupdo, @MuzTank and @admkakaroto!
2017-12-20 01:00:10 +01:00
aleos89
1ae1e312da Minor cleanups
* Resolved some miscellaneous typos.
2017-12-19 14:42:15 -05:00
lighta
7a1a76a9a9 Fix #2425 Character variable lengths and char-server (#2647)
* Fix #2425 Character variable lengths and char-server

Medium term fox for crash on char-serv caused by too long character variable.
Add few error msg and safety.
Add npc/test/npc_test_longvar.txt as a basic test.

NB:
The config.in for max_colum size if not really set as best would either retrive that value from sql, or use the same config file to actually set the sql column size...
May be handle later with some kind of hibernate ORM.

Thanks to @Tokeiburu, @aleos89, @Lemongrass3110.
2017-12-19 15:13:55 -04:00
Lemongrass3110
b9981b2e27 Fixed a compilation warning on winapi.cpp
Fixes #2690

Thanks to @hurtsky, @reymarbc and @keitenai
2017-12-19 08:43:16 +01:00
Lemongrass3110
15e509fedd Added November and current December clients (#2702)
Credits to @4144
2017-12-17 17:07:08 +01:00
sader fawall
1b68303f74 Update sc_end_class (#2673)
* Adjusted script command sc_end_class to accept an optional job ID.
Thanks to @sader1992!
2017-12-17 10:29:30 -05:00
rAthenaAPI
f0686828e7 SQL synchronization 2017-12-16 16:37:08 +01:00
Cydh Ramdh
fa35e8b93c Item DB Updates (#2707)
* Snowman Hat (5738): Drop chance Buche de Noel and Candy Cane were reversed
* Holy Mom Love (5790): Corrected auto cast skill to Blessing
* Event Xmas Cake (12200): Heals HP by 5%
* Fixes #2706
2017-12-16 22:36:57 +07:00
Aleos
b3e67d2172 Resolved enchants not executing unequip script (#2676)
* Fixes #2668.
* Fixes enchant items not properly calling the unequip item script.
Thanks to @admkakaroto and @mrjnumber1!
2017-12-15 14:29:46 -05:00
rAthenaAPI
377ca7585c SQL synchronization 2017-12-15 18:48:04 +01:00
Yudi Maharlika
758e319dfa * Drooping Pope should be refineable (#2713)
* Fixes #2712.
Thanks to @Questune09 and @uddevil!
2017-12-15 12:47:38 -05:00
Aleos
947875d27b Corrected Chain Lightning behavior (#2683)
* Fixes #2674 and fixes #2678.
* Chain Lightning will no longer bounce across Ice Wall.
* Chain Lightning damage should slowly decrease based on the number of bounces remaining.
* Removed the splash effect which was causing the damage to iterate faster on the first two hits.
* Removed the skill unit defines.
Thanks to @Sweet520!
2017-12-15 10:09:23 -05:00
rAthenaAPI
91a8ed3747 SQL synchronization 2017-12-15 08:29:22 +01:00
Yudi Maharlika
346fcef57e * Fixes Hervor (Item ID 2181) (#2709)
* Should have unbreakable shield instead of armor
* Source : https://www.divine-pride.net/database/item/2181
2017-12-15 08:29:14 +01:00
Aleos
ab1fa803a2 Fixed Giant Growth damage bonus (#2688)
* Fixed Crush Strike damage bonus
* Fixes #2684.
* Base damage increase should not be affected by a success rate.
* Adjusted Crush Strike weapon attack to take from the current indexed value.
Thanks to @Badarosk0 and @Paoly28!
2017-12-14 18:52:19 -05:00
Aleos
0f33de9b4d Updated Sorcerer Insignia Skills (#2645)
* Updated Sorcerer Insignia Skills
* Fixes #2630.
* Added missing Elemental 20% damage bonus for level 1 Insignia.
* Adjusted the recovery bonus to only apply to Elementals.
* Adjusted 25% magic damage bonus calculation.
* Added the missing ASPD bonus for Wind Insignia.
* Insignias should not affect status immune.
* Removed the BATK addition.
* Miscellaneous cleanups.
Thanks to @admkakaroto and @exneval!
2017-12-12 18:33:08 -05:00
Jey
d08bc1ce2d Revert "status_change_timer refactorization"
This reverts commit 00d8ace8d8.
2017-12-11 03:02:47 +01:00
Jey
00d8ace8d8 status_change_timer refactorization
* Changes some pointers to const pointers to prevent unwanted behavoir.
* Changes sc_timer_next to a lambda function with only the tick as a
  paramter.
* sce is not reassigned in sc_timer_next anymore, therefore it should be
  crash safe (see #2414 and #2539)
2017-12-11 02:57:03 +01:00
Cydh Ramdh
1e1bd71e5a Fixed script commands for Item Option
* Fixes #2682: `getitem3`, `delitem3`, and `countitem3` always fail if `RandomValueArray` or `RandomParamArray` are not defined (Not all Item Options need 'Value' and 'Param')
* Thanks to @rAthenaCN
2017-12-10 18:40:01 +07:00
syracuase
336a475dba Wrong NPC name (#2696)
* Fixed wrong npc name in npc/events/xmas.txt
2017-12-09 18:35:14 +01:00
Aleos
33bfe1d214 Updated script command npcskill documentation (#2691)
* Fixes #2681.
* NPCs must have basic stats applied to them for specific skills to work properly.
Thanks to @sader1992!
2017-12-09 14:05:53 +01:00
Yudi Maharlika
7113743cb4 Updated status change documentation (#2686)
* Updated status change documentation for SC_STRIKING, SC_MOONLITSERENADE, SC_RUSHWINDMILL, SC_GT_REVITALIZE, SC_GT_ENERGYGAIN, SC_GT_CHANGE.
Thanks to @uddevil!
2017-12-07 10:25:39 -05:00
sader fawall
6afc36255b packet.h clarification (#2639)
* Added comments to clarify PACKETVER changes.
Thanks to @sader1992!
2017-12-06 14:45:59 -05:00
lighta
fd8e1fe2cd Introduced utilities to gradually replace utils. (#2651)
* Replace current levenshtein with much faster implementation.
* Remove usage of alias to simplify code for VS 2013.
2017-12-06 10:38:10 -05:00
Jittapan Pluemsumran
3f88826bf0 Merge pull request #2680 from rathena/hotfix/megingard_seal-1
Update Megingard Seal Quest
2017-12-06 10:19:25 +07:00
Cydh Ramdh
bb4a88a362 Update Megingard Seal Quest
* Wrong Item ID for for Baphomet Doll (750). 744 is Bouquet
2017-12-06 08:24:55 +07:00
aleos89
34a905df65 Corrected the Windows runserver script
* Fixes #2679.
* Follow up to 53db435.
* Changed the start label to a non-standard name.
Thanks to @gusjungsza.
2017-12-05 12:21:36 -05:00
aleos89
0fa57e2bbe Follow up to 53db435
* Corrected some typos.
Thanks to @keitenai!
2017-12-04 14:20:13 -05:00
aleos89
c5b7850a9a Fixed atcommand where parsing
* Fixes #2675.
* Resolves atcommand where not accepting players with spaces in their name.
Thanks to @Tokeiburu!
2017-12-04 13:26:21 -05:00
rAthenaAPI
44ddc9fd15 SQL synchronization 2017-12-04 19:21:36 +01:00
Aleos
5531fef9ed Corrected Celine Kimi Card (#2646)
* Fixes #1875.
* Should cast level 3 Critical Wound on all the enemies within the area, rather than level 5 on self.
Thanks to @Everade!
2017-12-04 13:21:15 -05:00
rAthenaAPI
22cd02843f SQL synchronization 2017-12-03 23:40:59 +01:00
Yudi Maharlika
f639c0012f Fixes Item ID 14677 (Limited Power Booster) (#2667)
* bAddClass should use bonus2 instead of bonus
2017-12-03 23:40:41 +01:00
sader fawall
4dde4c664b Fixes title selection in ui window (#2662)
* Fixes #2660
* Thanks to @hnomkeng
2017-12-03 01:56:56 +01:00
Lemongrass3110
f7bc3bca66 Fixed an issue with invisible item shops
Thanks to @Everade
2017-12-02 12:18:07 +01:00
Lemongrass3110
7c1a88270b Added support for custom constant import (#2656) 2017-12-01 13:58:24 -05:00
lighta
53db4358b7 Add few test to travis and appveyor. (#2641)
* Add few test to travis and appveyor.
* Update runserver.bat to be more alike athena-start. (nb terminating cmd.bat would be better)
2017-12-01 13:46:09 -05:00
Lemongrass3110
f59298adda Added support for windows admin detection (#2657)
Credits to Microsoft
2017-12-01 13:09:51 -05:00
Lemongrass3110
b3cfd12228 Added the custom and test scripts to the buildbot (#2658)
* Added the custom and test scripts to the buildbot

All scripts inside the custom and test npc directory are now parsed and executed automatically by the buildbot.
The only exceptions are the custom battleground scripts that would cause duplication warnings.

Thanks to @Jeybla for the Unix script!
2017-12-01 12:50:34 -05:00
Lemongrass3110
812e3a9a04 Disabled root/admin user check for build bots (#2659)
Thanks to @hurtsky
2017-12-01 17:24:16 +01:00
rAthenaAPI
217bd0e5bf SQL synchronization 2017-12-01 16:39:11 +01:00
Aleos
37b95826fb Corrected some item bonuses (#2642)
* Fixes #1430.
* Corrected the bonuses for Flying Galapago and Falconer's Claw.
* Added missing item Falconer's Flute.
Thanks to @Everade and @exneval!
2017-12-01 10:39:02 -05:00
rAthenaAPI
8223f46867 SQL synchronization 2017-11-30 19:52:27 +01:00
Aleos
da152c6f7e Corrected Gray and Thanatos equipment sets (#2638)
* Corrected Gray and Thanatos equipment sets
* Fixes #2636.
* Corrected display names.
* Corrected applicable jobs.
* Corrected item bonuses.
Thanks to @mazvi and @Atemo!
2017-11-30 13:52:10 -05:00
rAthenaAPI
21aa0155df SQL synchronization 2017-11-30 18:20:33 +01:00
Aleos
b00f3bcf5f Corrected Magical Ring bonus (#2640)
* Fixes #2635.
* Should add ATK versus element and not add DEF against element.
Thanks to @uddevil!
2017-11-30 12:20:16 -05:00
Cydh Ramdh
02044c0d58 Added custom src files to rAthena.sln (#2650)
Listed all files inside src/custom/ to rAthena.sln makes easier to find the file while opening the solution
2017-11-29 10:31:54 +07:00
Lemongrass3110
c5af8c76e3 Added 2 new hat effects
Thanks to @RagnarokNova
2017-11-28 23:15:00 +01:00
lighta
664ea47891 Fix basic_test not having common.lib has dependancies registered in solution.
(cause some build failure due to linking trying to be process before lib was finished)
2017-11-28 03:57:07 -04:00
lighta
618b9356fc Fix #2591 spinlock issue. (#2637)
* Fix #2591 spinlock issue.
Add basic_test, for few integration test.
Add thread_local_storage support in cmake
Fix thread.c for linux and fix small typo
2017-11-26 22:30:17 -04:00
sader fawall
cfb8b42d84 Fix Bifrost Tower (#2644) 2017-11-26 19:02:40 +01:00
aleos
1645fc0cdb Corrected a ShowError output
* The new mob database range error message was missing the new ranges.
Thanks to @CairoLee!
2017-11-26 10:29:41 -05:00
rAthenaAPI
4128740a1a SQL synchronization 2017-11-25 21:46:35 +01:00
Atemo
c45db5d6ef Fixed issue #2629 "Dummy at Prontera prevents critical attack from being displayed" 2017-11-25 21:46:15 +01:00
Atemo
d708fb35d7 * Move close3 function into Global_Functions.txt
* Added mapflag for some instance
2017-11-25 21:42:03 +01:00
aleos
114bebac68 Corrected a potential map crash with achievements
* Follow up to 1c66035.
* Reverted a lambda function which was causing a mismatch between achievement vectors and player achievements.
Thanks to @reymarbc and @cydh!
2017-11-23 16:40:06 -05:00
lighta
03da2f6854 Fix tools/config.pl
Add current path to @inc
Add more support for public_ip / private_ip.
Add pincode support
2017-11-22 07:29:05 -05:00
Aleos
cdbb14b90d Resolved a compile warning on pre-renewal (#2625)
* Fixes #2624.
* Resolves a switch statement warning with only a default case for pre-renewal builds.
Thanks to @Daegaladh!
2017-11-21 17:35:32 -05:00
aleos89
3ce3bc3fed Added a new Vending Tax config
* Follow up to 8e002bc.
* Added vending_tax_min which allows for defining a custom minimum value to apply taxes to.
Thanks to @cydh's suggestion!
2017-11-21 10:27:18 -05:00
aleos89
6fdb605932 Corrected Hell Inferno Dark damage behavior
* Follow up to dc2c51c.
* Fixes #2623.
* Resolved the Dark damage not being flagged properly.
Thanks to @Sweet520 and @hartonox!
2017-11-21 09:36:52 -05:00
Atemo
ead1ed9100 Fixed typo in Weapons Expert BK (issue #2619) follow up 08338e0a64 (diff-2b9b79c7ee5796ba7f5073001e69aa06)
Thanks to @mazvi !
2017-11-21 14:40:08 +01:00
Jey
b2d904b764 Follow up to ba9314cba5
* Fixes #2621
* Makes the getspawn functions independent of the mob_db struct.
  Removes the getMobID() function from the struct which caused the
  the issue.
* Thanks to @Lemongrass3110 and @uddevil!
2017-11-21 12:35:51 +01:00
Aleos
8e002bc993 Adjusting Vending tax to match official (#2620)
* Adjusting Vending tax to match official
* Fixes #2528.
* There are no taxes on items being sold for less than 100 million. Anything above incurs a 5% tax.
* Refactored the tax code to use a single function.
Thanks to @mazvi, @Jeybla, and @lighta!
2017-11-20 22:07:55 -05:00
Aleos
1c66035761 Refactored achievements to utilize C++ features (#2607)
* Refactored achievements to utilize C++ features
* Cleaned up the YAML parser.
* Moved achievements from DBMap to an unordered_map.
* Moved achievement targets from DBMap to a vector.
* Changed all struct arrays into vectors.
* Changed all char arrays to strings.
* Changed all int arrays to std::arrays.
* Removed achievement_dummy as it's no longer needed.
* Achievements now use smart pointer to ensure proper construction and deconstruction of objects.
Thanks to @lighta!
2017-11-20 21:34:16 -05:00
Atemo
ca1b980ede Fixed issue #2616 and #2617 (#2618)
* Added savepoint from int_land -> izlude
* Updated monsters spawn in prt_fild08 based from Divine Pride

Thanks to zackdreaver and Divine Pride !
2017-11-20 18:15:36 +01:00
Lemongrass3110
60b5491766 Fixed compilation for the Windows XP API (#2611)
* Fixed compilation for the Windows XP API

Fixes #2137

Thanks to @zackdreaver

* Fixed Windows version initialization

Respecting the SDK's Windows version and only use our own defines if they are not set by the SDK, which should not happen.

Thanks to @lighta.

* Moved Windows Vista declaration up

This way all defines that should actually come from sdkddkver.h will be checked right behind it and defined if they were not.

* Reverted line deletion
2017-11-20 00:30:31 -05:00
Lemongrass3110
4de727efbc Changed minimum VS version to VS 2013 SP5 (#2610)
With this you will not be able to open the solution with any older visual studio version anymore.
2017-11-19 12:33:32 -05:00
Lemongrass3110
a2e8d02752 Respect the default platform toolset (#2609)
With this you will not have to upgrade your solution everytime you clone a fresh copy of rAthena and the problem with having to stash between branch switches should also be gone.
If you want to compile it for another toolset you simply have to set the target toolset by yourself.
2017-11-19 12:19:36 -05:00
Lemongrass3110
a49a1a52a3 Fixed a compiler warning due to a wrong include
Follow up to c4a364b
2017-11-19 04:11:53 +01:00
Lemongrass3110
b2ab9724fe Implemented new monster range (#2604)
With this the internal static array was changed to a std::map which manages it's memory dynamically when needed.

Dropped mob_dummy since it was useless to have it in the first place.

Replaced a lot of direct accesses to the mob db by the "get" function.

With this you can now use 20021-31998 for monsters and also 4000-20020 will be used for player clones whenever needed.

Dropped mobdb_exists
Replaced almost all references to MAX_MOB_DB

Moved MAX_MOB_DB from the header directly into the source file to make it only visible to the .cpp file itself and not to any other.

Moved the mob drop calculation function from itemdb.cpp into mob.cpp, because it needs to iterate over the whole mob db.

Added a few missing clone checks.

Thanks to @lighta, @Jeybla and @aleos89.
2017-11-19 01:22:29 +01:00
Jey
34817c9715 Adds auto parse of consts in convert_emotions.
* Thanks to @lighta for the suggestion
2017-11-18 21:02:11 +01:00
Jey
4f62f68e0f Extends convert_emotions script
* Replaces magic numbers
* Replaces unitemote
* Replaces emotion e,0,name; with emotion e, getnpcid(0, name);
* Replaces emotion e,1; with emotion e,playerattached();
2017-11-18 19:03:17 +01:00
Jey
c5ceda03f5 Shebang of conv_emotion to be platform independent 2017-11-17 10:34:38 +01:00
rAthenaAPI
1a7f2db6a9 SQL synchronization 2017-11-16 21:38:45 +01:00
Haziel
50ef5650a0 Wickebine's Black Cat Ears (#2606)
* Removed Unofficial Bonuses
* Fixed Class Restriction
* Fixed Level Requirement
* Added Code to item 19134.
* Added Official Autobonus Code
* Arbitrary 'Power Up' Effect
Thanks to @SirHaziel and @hendra814!
2017-11-16 15:38:26 -05:00
Jey
e148bd3a63 Follow up to ba9314cba5
* Now mob_get_spawn does not add empty vectors to mob_spawn_data, when the
  mobid does not exist in mob_spawn_data
* Saves a bit more memory space
* Thanks to @Lemongrass3110 for the suggestion
2017-11-16 11:19:26 +01:00
Jeybla
ba9314cba5 Fixes spawn infos after mobdb reload. (#2469)
* Moves the monster spawn infos from the mob_db struct to an own
  data structure.
* Fixes whereis after mobdb reload. Fixes #2360
* Fixes Taekwon Mission after mobdb reload. Closes #2460
* Thanks to @uddevil, @mgksrt8, @lighta and @aleos89!
2017-11-16 02:02:37 +01:00
aleos
9766ec9489 Corrected Free Cast and Exceed Break walk speed
* Fixes #2599.
* Follow up to 1f7a314.
Thanks to @mazvi and @uddevil!
2017-11-14 20:08:49 -05:00
rAthenaAPI
90f79cc2c5 SQL synchronization 2017-11-14 16:39:47 +01:00
Haziel
c4ce8cfeba Item DB Fix: Part I (#2602)
* Fixed Valhalla Idol based on item's description.
Thanks to @AetherHaziel!
2017-11-14 10:39:38 -05:00
Lemongrass3110
c20d1cc3e9 Follow up to 243f4ca 2017-11-13 21:04:23 +01:00
Lemongrass3110
243f4ca3be Support for 2017-10-25 and 2017-11-01
Merges HerculesWS/Hercules@3e03556

Thanks to @4144
2017-11-13 20:51:58 +01:00
Aleos
805a6fb69a Updated Heal formulas to match kRO (#2585)
* Fixes #2575 and fixes #2574.
* Adjusted the formula to properly account for bonuses which are additive of one another, not multiplicative.
* Added the global multiplier which is added on after MATK.
* Updated Highness Heal, Fresh Shrimp, and Bunch of Shrimp heal formulas.
Thanks to @Tokeiburu for his extensive research and code!
2017-11-13 13:02:39 -05:00
Jeybla
576d48865d Adds Emotion Conversion Script (#2600)
* Simple scripts which replaces the old emotion script constants to new constants
* Follow up to ea88ea5054
2017-11-13 16:39:14 +01:00
Aleos
da0883572d Small cleanup of Rune Knight Runes (#2596)
* Small cleanup of Rune Knight Runes
* Stone Hard Skin weapon break chance only applies to physical melee attacks.
* Giant Growth's physical bonus damage only applies to Rune Knights.
* Corrected weapon break chance to only happen when damage is increased for Giant Growth.
Thanks to @Rytech2 and @Jeybla!
2017-11-13 09:59:24 -05:00
Jey
cd08915530 Follow up to ea88ea5054
* Fixes wrong syntax in GeffenMagicTournament due
* Fixes #2598
2017-11-13 09:58:57 +01:00
sader fawall
c6fe9e9cde Update warper NPC (#2542)
* Adds several dungeons and fields
* Adds options for WOE TE Castles and dungeons
* Adds option to disable satan morroc and re-enable old morroc maps
* Adds option to warp only on the first level (of dungeons/fields)
* Adds Lasagna Town
* Adds castles Kafragarten and Gloria
* Adds several instances
* Adds Dimensional Rift and Para Market
2017-11-10 19:42:56 +01:00
rAthenaAPI
333d978a9d SQL synchronization 2017-11-10 19:22:16 +01:00
Aleos
e0b43ecc93 Corrected Mavka Card item bonus (#2597)
* Fixes #2594.
* The item bonus should increase MATK damage for Fire and Earth.
Thanks to @uddevil!
2017-11-10 19:22:00 +01:00
Atemo
ea88ea5054 Emoticons constant name (#2527)
This PR change the emoticons constant name to match emoticonlist from client side.
Note: the previous emoticons names are now deprecated.

Additionnally emotion and unitemote scripts commands are being merged together to the new format
-> emotion <emotion number>{,<target>};
Where target use the target Game ID (GID) of the unit (npc, pet, character etc..).

* unitemote is now deprecated.
* Additionnally fixed incorrect variable in quests_brasilis.txt

Thanks to @aleos89 and @Lemongrass3110 !
2017-11-10 18:35:21 +01:00
Roman Kalashnikov
1f7a314c78 Fixed twice assigned values (#2560)
* Resolves the skill timer getting assigned twice.
Thanks to @lunixoid!
2017-11-09 14:50:11 -05:00
Aleos
63daab5860 Added battle config autoloot_adjust (#2562)
* Fixes #2540.
* Added battle config autoloot_adjust that allows autoloot to take player drop penalties and bonuses into account.
Thanks to @ecdarreola!
2017-11-08 18:55:20 -05:00
Aleos
86241b0eb8 Adjusted item drop minimum value limit (#2561)
* Fixes #2551.
* Lowered the item drop minimum value limits to be able to be set to 0.
Thanks to @mazvi!
2017-11-08 18:44:32 -05:00
aleos89
c13f271a94 Resolved some compile warnings
* Fixes #2588.
* Clean up from 24b3509.
Thanks to @darhlism!
2017-11-08 13:36:01 -05:00
lighta
a587b913fa Initial work for login server to C++ (#2583)
* Initial progression of moving the map-server to C++ format.
* Converted all core files to .cpp and header files to .hpp.
Thanks to @lighta!
2017-11-08 12:56:41 -05:00
aleos89
728a29d435 Harmonized include guards
* Follow up to 24b3509 and c4a364b.
* Harmonized the include guards for char-server and map-server header files.
2017-11-07 10:22:03 -05:00
lighta
24b3509e53 Initial work for char server to C++ (#2567)
* Initial work for char server to C++

* Changes suggested from @Lemongrass3110

* Removes unwanted beginning white spaces.
2017-11-06 22:40:35 -04:00
aleos
6decf6c6d0 Resolved skill NK checks
* Fixes #2577.
* Adjusted the battle checks to properly return the NK value rather than bool.
Thanks to @darhylism!
2017-11-06 17:16:45 -05:00
lighta
673315994b Temporary adjustment for strict aliasing (#2582)
* Fixes #2572.
* Added a custom rule to avoid optimization causing monsters to not attack. (From tests this appears to be npc.cpp on Centos 7 and mob.cpp on Windows vc141)
* Added -fno-strict-alising to CMake when building with GCC. (Clang and VS have it by default)
* Fixed cmake output path.
Thanks to @lighta!
2017-11-06 16:59:59 -05:00
lighta
e7e9cf6d73 Cleanup and harmonize cmake. 2017-11-03 03:42:29 -04:00
Aleos
c4a364be2c Initial work for map server to C++ (#2565)
* Initial progression of moving the map-server to C++ format.
* Converted all core files to .cpp and header files to .hpp.
* Refactored the refine database parser to utilize native YAML C++.
Thanks to @Jeybla and @lighta for their help!
2017-11-02 17:39:03 -04:00
Maz-V
c6cc8edeb4 Mapflag NoWarpTo: Novice Island (#2566)
Added Mapflag nowarpto on Novice Island Renewal.

Thanks to @mazvi !
2017-11-02 15:12:38 +01:00
Jey
c09929aa16 Negative npc input checks for arena_points.
* Related issue: #2557
* Thanks to @mazvi
2017-11-01 22:17:31 +01:00
rAthenaAPI
fbb447ac8c SQL synchronization 2017-11-01 16:57:26 +01:00
Lemongrass3110
125ab2853a Last missing mob ids from old range 2017-11-01 16:57:05 +01:00
rAthenaAPI
d6171801ca SQL synchronization 2017-11-01 16:40:39 +01:00
Lemongrass3110
af358809b9 New npc and mob IDs
The old range has been fully used up now.
2017-11-01 16:40:22 +01:00
rAthenaAPI
4d602135fc SQL synchronization 2017-10-30 22:16:53 +01:00
Aleos
d15b5fc584 Corrected St. Patrick's Hat and Green Ale (#2558)
* Fixes #2547.
* St. Patrick's Hat bonus should be granted from +8 or higher refine.
* Green Ale has a 10 second use delay.
Thanks to @uddevil!
2017-10-30 17:16:28 -04:00
lighta
611dee0753 Fix cmake (#2554)
* Fix cmake
Thanks to @secretdataz for help. (cherry-picked from refactor)
2017-10-30 13:19:27 -04:00
Maz-V
c76f3675a2 Global_Function: Added "F_GetPlatinumSkills" (#2545)
* Added global function F_GetPlatinumSkills.
* Adjusted the Job Master and Platinum Skills NPCs to use this function.
Thanks to @mazvi!
2017-10-30 10:57:57 -04:00
Jittapan Pluemsumran
09519f3b37 Merge pull request #2546 from lighta/fix_configure
Add check in configure to ensure c++ compiler
2017-10-29 05:35:13 -07:00
Roman Kalashnikov
9772639ae7 Fixed duplicated condition (#2553)
The condition `if(node->prev)` was checked in the previous:
`if( node->prev && n > 5 ) {`
2017-10-29 11:00:59 +01:00
rAthenaAPI
618e668bdf SQL synchronization 2017-10-28 01:56:35 +02:00
Atemo
c9ee8eb647 Follow up 5ed2113251 2017-10-28 01:56:00 +02:00
rAthenaAPI
af20c0ca8c SQL synchronization 2017-10-27 23:42:34 +02:00
Atemo
5ed2113251 Initial release of Sarah and Fenrir memorial (#2504)
Initial release of Sarah and Fenrir memorial
Notes:
* Some monsters status are inaccurated.
* Sarah seems to cast NPC_WIDESOULDRAIN and Gigantes cast NPC_PETRIFYATTACK (need more infos).

Thanks to @aleos89 for the grammatical fixes !
Big thanks to Divine Pride for the infos!
2017-10-27 23:42:12 +02:00
Aleos
2c1df58ba4 Corrected Dark Claw behavior (#2548)
* Fixes #2537.
* The wound effect should be applied even if Dark Claw misses.
Thanks to @esu1214!
2017-10-27 14:25:03 -04:00
Lemongrass3110
18e0f0ab48 Fixed searchstore for vendings with item id > 32k 2017-10-27 00:57:32 +02:00
lighta
feb1ab9d95 Add check in configure to ensure c++ compiler 2017-10-26 09:00:02 -04:00
Aleos
5208d16995 Item Shop Trade Restriction adjustment (#2517)
* Item Shop Trade Restriction adjustment
* Fixes #2503.
* Added a config to allow usage of sell-restricted items as currency in Item Shops.
Thanks to @Mickosis!

* Cleaned up some final things
* Fixed some typos in the configuration file.
* Resolved the shop ID not being stored at the time of checking the currency.
* Optimized the inventory check.
2017-10-25 13:49:39 -04:00
Maz-V
10d405706b Platinum Skill: skill MC_CARTDECORATE (#2521)
* Added MC_CARTDECORATE for Merchant Class
* Added PACKETVER check
Thanks to @mazvi and @anacondaqq!
2017-10-25 10:38:31 -04:00
Lemongrass3110
93ad3a1378 2 new NPC constants 2017-10-24 23:19:57 +02:00
Lemongrass3110
3b219565d3 Enabled import for translations by default (#2535)
Added possibility to override MAP_MAX_MSG with defines_pre.h
Added possibility to override LANG_ENABLE with defines_pre.h

Thanks to @Daegaladh for the idea with LANG_ENABLE.
2017-10-24 22:36:59 +02:00
Lemongrass3110
cb760a0a42 Adjusted atcommand go for new novi grounds
Follow up to c7d5b61
2017-10-22 17:18:54 +02:00
Atemo
c7d5b61409 New Intro for Renewal - continuation of https://github.com/rathena/rathena/pull/2309 (#2530)
* Update map iz_int in mapcache.dat for the new Intro Map
* Update Academy script for the new Intro based on kRO: [http://www.inven.co.kr/webzine/news/?news=176048&site=ro](http://www.inven.co.kr/webzine/news/?news=176048&site=ro)
* Add monster spawn in the new Intro Map
     
Thanks 805a2b3b1a (diff-8d1dca8dc246e9f4d38c6f1ad0d2c930) for original script.

Thanks @jenkijo for the base, @Lemongrass3110 and @aleos89 for the review, and Divine Pride for some infos !
2017-10-21 00:23:49 +02:00
Atemo
0a96c9089b Merge branch 'master' of https://github.com/rathena/rathena 2017-10-20 16:02:45 +02:00
Atemo
f07ceced91 Added missing warps from dali to dali02, dali02 to dali (issue #2531)
Thanks @hendra814 !
2017-10-20 16:02:10 +02:00
rAthenaAPI
535804be6a SQL synchronization 2017-10-20 15:52:30 +02:00
Atemo
b90df89380 Fixed Crimson Saber (Item ID: 13454) equip class requirement
Thanks @ToiletMaster !
2017-10-20 15:52:17 +02:00
Lemongrass3110
828f7d6ec2 Fixed a typo with SC_CHEERUP
Follow up to c73e10c
Fixes #2532

Thanks to @mazvi
2017-10-20 09:57:50 +02:00
Lemongrass3110
caf31521d0 Fixed an import issue in mapindex (#2512)
* Fixes #2511.
Thanks to @Daegaladh for his input!
2017-10-19 14:11:56 -04:00
rAthenaAPI
3d8a16bfff SQL synchronization 2017-10-19 19:23:18 +02:00
Aleos
c73e10cb30 Added new 2016 Wedding skills (#2479)
* Added new 2016 Wedding skills
* Adds Call All Family, One Forever, and Cheer Up skills to the renewal databases.
* Removed Enlarge Weight Limit R skill from a few job skill trees as it's not needed to be defined there.
Thanks to @Rytech2, @Jeybla, and @Lemongrass3110!
2017-10-19 13:22:55 -04:00
Aleos
ea0b54e03f Corrected Endure hit count behavior (#2525)
* Fixes #2508.
* Endure should have 7 hits (instead of 8) in PvM.
Thanks to @kaninhot004!
2017-10-19 10:14:57 -04:00
Lemongrass3110
7dc6f7577c Support for october clients
Thanks to @4144
2017-10-19 01:15:46 +02:00
Jittapan Pluemsumran
2830183eaa Implemented round,floor,ceil script commands. (#2524) 2017-10-18 03:10:10 -07:00
Aleos
b4106eb988 Adjusted script command bindatcmd (#2518)
* Fixes #2513.
* Defaulted the char-command level to 100.
Thanks to @mazvi and @Lemongrass3110!
2017-10-16 14:49:39 -04:00
Maz-V
7991f47a01 Adds jobmaster option disable Baby Novice only (#2514) 2017-10-16 09:54:03 +02:00
Jey
48fcc92a9c Follow up to 828f78322b
* Only checks item names of items with new ids.
* Fixes warnings on import itemdb overwrites.
* Note: The duplicate name check should be refactored after the Cpp
  migration. It'd be much faster with a C++ map with the
  name string as the key.
* Thanks to @Daegaladh!
2017-10-15 13:38:15 +02:00
Aleos
db37fc7ddd Fixes required equipment check for skills (#2374)
* Fixes required equipment check for skills
* Fixes #2372.
* Required equipment check was allowing the skill to cast without the proper equipment.
* Adjusted the skill fail messages to their appropriate responses.
Thanks to @M4karov, @exneval, @Jeybla, and @Lemongrass3110!
2017-10-14 22:37:55 -04:00
Lemongrass3110
8c2f727f64 Added support for 3 new hat effects 2017-10-15 02:29:38 +02:00
Lemongrass3110
b196b46bd5 Follow up to f42c2ff
Fixes some missing randoms

Thanks to @aleos89
2017-10-15 02:19:58 +02:00
Aleos
2606cf977f Migrated skill.c to C++ (#2500)
* Migrated skill.c to C++
* Needed in preparation for future projects.
2017-10-14 13:03:27 -04:00
Lemongrass3110
f42c2ff211 Moved some remaining constants into src (#2501)
* Moved all npc view constants into src

Source side the constants will use Gravity's naming standard(JT_*)
NPC side still supports the old names without JT_

* Moved all effect constants into src

Added check for effect validation to atcommand effect and all script commands using them
Removed the unused and broken function unit_changeviewsize from unit.c
Replaced a lot of hardcoded effect ids with their respective constants
Cleaned up the effect documentations

* Moved all hat effect constants into src

Added check for effect validation to script command hateffect
2017-10-14 18:13:51 +02:00
Aleos
951ff55573 Updated Convex Mirror to match official behavior (#2506)
* Updated Convex Mirror to match official behavior
* Fixes #2498.
* When a MVP dies it will only show the respawn time once instead of flooding the chat window.
* The Boss icon will now properly display itself when the MVP respawns if the player has already consumed a Convex Mirror.
* Converted some integers to constant values.
* Made use of the other BOSS_INFO packet messages.
* Properly end the status when the player changes maps.
* Small cleanups and updated status change documentation.
Thanks to @esu1214 and @Lemongrass3110!
2017-10-14 11:45:24 -04:00
aleos
76923ac506 Corrected some refiner checks
* Follow up to e24d30a.
* Fixes #2505 and fixes #2507.
* Added a missing material check for Suhnbi.
* Added a missing safe limit check for normal refiners. Safe limit was always 0.
Thanks to @mazvi, @Mickosis, and @cydh!
2017-10-14 09:11:30 -04:00
aleos89
3ab39c4cb3 Follow up to 6a2c122
* Removed an unused variable.
2017-10-13 09:53:36 -04:00
rAthenaAPI
57113d1fbb SQL synchronization 2017-10-12 17:04:12 +02:00
Aleos
6a2c1229d0 Updated Rebellion class (#1692)
* Updated Rebellion class
* Information based on Rebellion Awakening patch from kRO.
- http://ro.gnjoy.com/news/update/View.asp?seq=183&curpage=1
* Fixes #859 and fixes #1449.
Thanks to @RagnarokNova and Fyrus for their information!
2017-10-12 11:04:03 -04:00
rAthenaAPI
db2d332cab SQL synchronization 2017-10-11 15:24:39 +02:00
Lemongrass3110
705cc5a869 Mob DB placeholders
kRO patch 2017-10-11
2017-10-11 15:24:06 +02:00
Aleos
fa425b834f Updated callshop selling list variables (#2480)
* Updated callshop selling list variables
* Updated script command callshop OnSellItem list to include random item options.
* See documentation for more information.
2017-10-10 12:15:51 +02:00
rAthenaAPI
7898a667df SQL synchronization 2017-10-09 14:37:51 +02:00
Jey
3e78cc1c3a Fixes item positions
* 28310,Earring_Of_Sarah_L
* 28311,Earring_Of_Sarah_R
* Closes #2493
* Thanks to @Yuchinin
2017-10-09 14:35:59 +02:00
rAthenaAPI
9e1c5dbec1 SQL synchronization 2017-10-09 03:55:27 +02:00
Jeybla
828f78322b Adds a duplicate name check for the itemdb. (#2492)
* Fixes #2487
* Fixes some duplicate itemdb entries.
2017-10-09 03:55:12 +02:00
Jey
ff6722c924 Follow up to fb882c4aa0
* Fixes #2489
* Thanks to @Yuchinin
2017-10-08 20:20:33 +02:00
rAthenaAPI
ba7a766472 SQL synchronization 2017-10-08 16:50:46 +02:00
Jittapan Pluemsumran
800fd3da45 Fixed Zaha Doll Hat not being refinable. Fixes #2485
Thanks to @uddevil
2017-10-08 21:50:38 +07:00
rAthenaAPI
8a93b12020 SQL synchronization 2017-10-08 00:58:05 +02:00
Atemo
319fc4d18c Fixed a duplicate aegis name
Thanks @Jeybla !
2017-10-08 00:57:43 +02:00
Aleos
54a119c56a Resolves Skill Unit Database parsing issue (#2484)
* Fixes #2483.
* Properly trims the target field so it can be processed accurately.
2017-10-07 17:29:50 +02:00
Jeybla
b8562932cf Removes SCRIPT_CALLFUNC_CHECK ifdef-directives. (#2482)
* Closes #2205
* The SCRIPT_CALLFUNC_CHECK define was to enforce function
  calling with callfunc in scripts. Because I don't think calling
  functions without callfunc will give us performancy issues,
  this check is simply removed by this commit.
2017-10-07 16:59:45 +02:00
Jeybla
2676d05394 Jobmaster update (#2369)
* Major changes due to readability and some corrections
* Adds the option to disable Rebirth Classes
* Adds the possibility to give players job related 
  Equipment (mostly weapons) on job change
* Adds more level requirement settings
* Adds BabyExpanded and BabySummoner Jobs
* Thanks to @Braniff, @mazvi, @Mikegyver, @Lemongrass3110, @Akkarinage, @Stolao and @secretdataz!
2017-10-06 17:40:39 +02:00
rpdigos
fb882c4aa0 Fix a couple of warnings. (#2462)
* Fix a couple of warnings.
Thanks to @rpdigos!
2017-10-06 10:58:17 -04:00
Jey
ae0da362f8 Follow up to fe75aea
* Fixes a compile warning
* Thanks to @Haikenz
2017-10-06 02:23:56 +02:00
Aleos
fe75aeab50 Corrected character slot movement (#2452)
* Corrected character slot movement
* Resolves characters changing slots (on the char-selection screen) to the first empty slot rather than to the actual slot index.
Thanks to @Tokeiburu, @Lemongrass3110, and @Jeybla!
2017-10-05 18:31:30 -04:00
Aleos
0068268337 Follow up to 2c8ab4f
* Fixed some typos.
Thanks to @Akkarinage!
2017-10-05 14:27:19 -04:00
aleos89
9210bf5d68 Follow up to 2c8ab4f
* Fixed some visual issues for the contributing documentation.
2017-10-05 14:04:25 -04:00
aleos89
2c8ab4ff79 Updated the contributing documentation
* Updated the label documentation.
2017-10-05 13:57:43 -04:00
Jittapan Pluemsumran
872cb42a48 Fixed a bug where refine bonuses was being incorrectly parsed. Fixes #2456
Thanks to @hc3490
2017-10-05 22:43:38 +07:00
rAthenaAPI
6f634735aa SQL synchronization 2017-10-05 08:17:51 +02:00
rAthenaAPI
1679521a4b SQL synchronization 2017-10-05 08:17:41 +02:00
Jittapan Pluemsumran
67518f4def Merge pull request #2470 from rathena/feature/moscovia_cards
Implemented cards for Moscovia monsters
2017-10-05 13:17:33 +07:00
Aleos
53ba373c43 Corrected Overed Boost behavior (#2474)
* Fixes #2473.
* Skill was draining double homunculus hunger and double master SP.
Thanks to @Everade!
2017-10-04 21:14:55 -04:00
rAthenaAPI
1aa8c072b7 SQL synchronization 2017-10-04 16:38:29 +02:00
Atemo
0791adb4f4 Corrected duplicate item name follow up 7f9747c15d (diff-23f1393132fc5ca16140f50c9591e550R4554) 2017-10-04 16:38:00 +02:00
rAthenaAPI
771d4b94ba SQL synchronization 2017-10-04 16:30:35 +02:00
Atemo
7f9747c15d Aegis item name (#2451)
* Correct Aegis item name from https://rathena.org/board/topic/107649-aegis_id2name_v2/

Thanks @esu1214
2017-10-04 16:30:28 +02:00
Atemo
75653d9da1 Adjust Wood_Goblin_Card item script from the description 2017-10-04 00:00:36 +02:00
Lemongrass3110
b8844a0973 Fixed @Atemo's comments 2017-10-03 15:46:45 +02:00
Lemongrass3110
77a7bc2d9a Fixed a missing comma 2017-10-03 14:55:29 +02:00
Jey
6b6717748e Fixes homunculus being able to attack from Manhole
* Fixes #2068
2017-10-03 08:07:57 +02:00
Jey
215aa158ed Follow up to aa6e8987db.
* Fixes compile warnings.
2017-10-02 22:16:12 +02:00
Jittapan Pluemsumran
fc8534f766 Implemented cards for Moscovia monsters 2017-10-02 23:34:35 +07:00
rAthenaAPI
5b874a15f1 SQL synchronization 2017-10-02 18:19:47 +02:00
Jittapan Pluemsumran
091738ac7e Implemented Terra Gloria cards (#2464) 2017-10-02 23:19:27 +07:00
Jeybla
aa6e8987db Merge pull request #2466 from rathena/refactor/mob_cpp
* Convert mob.c to mob.cpp.
2017-10-02 17:49:55 +02:00
Jittapan Pluemsumran
16d8abbd0f Merge pull request #2468 from MuzTank/issue-1432
Added AB_RENOVATIO as reproducible skill.
2017-10-02 21:43:27 +07:00
Edwin
2df18b12e6 Added AB_RENOVATIO as reproducible skill. 2017-10-02 15:00:45 +07:00
Jittapan Pluemsumran
f20ac015d1 Fixed random options with negative values being stored as 0 in database. (#2465)
* Made random option database columns signed
* Negative values can now be stored for random options
* Fixed #2415
Thanks to @uddevil

* Follow up to ea28ff4. Updated main SQL scripts.
2017-10-02 09:05:41 +07:00
Jey
a5719e7228 Prefer static_casts instead of C casts. 2017-10-01 18:32:52 +02:00
Jey
593ac62757 Convert mob.c to mob.cpp. 2017-10-01 18:25:16 +02:00
rAthenaAPI
af86a07c39 SQL synchronization 2017-09-30 18:19:07 +02:00
Lemongrass3110
6899c89e5d Added new mob db placeholders
With this gravity used up the old monster id range and their client will probably support the new range on kRO sakray soon!
2017-09-30 18:18:35 +02:00
Aleos
ab014246cc Corrected Elemental Cure healing behavior (#2443)
* Fixes #2440.
* The HP/SP heal should be based on the caster's current HP/SP, not the Elemental's max HP/SP.
Thanks to @Barigas!
2017-09-29 09:41:34 -04:00
Lemongrass3110
7de7472782 Added support for some missing clients (#2458) 2017-09-28 23:52:56 +02:00
Jey
e6ec0f528f Follow up to 0e4ffdacdb. 2017-09-28 23:29:29 +02:00
Jeybla
0e4ffdacdb Adds pk_mode_mes displayed on joining a pk zone. (#2400)
* When pk_mode and pk_mode_mes is enabled, the player gets notified joining a pk-zone map.
* It's now possible to specify the target in showscript.
  Default is still AREA.
* pk_mode_mes is now using showscript to SELF.
* Thanks to @Atemo, @RadianFord, @Lemongrass3110, @aleos89
2017-09-28 22:53:16 +02:00
Aleos
ee552d67d4 Updated Kaite renewal behavior (#2457)
* Fixes #2409.
* Kaite no longer reflects AoE magic.
Thanks to @esu1214!
2017-09-28 09:45:51 -04:00
aleos
d9a2bdbe05 Changed atcommand follow behavior
* Fixes #2424.
* Atcommand follow will now continue to follow the target even if the target dies.
Thanks to @MrAntares!
2017-09-26 17:02:39 -04:00
aleos
82ed67a01c Corrected script command instance ID lookups
* Fixes #2448.
* Resolves script_instancegetid causing scripts to end prematurely during player lookups.
Thanks to @Yuchinin and @Atemo!
2017-09-26 16:46:13 -04:00
aleos
2572bbbcb9 Updated script command callshop documentation
* Fixes #2419.
* Updated documentation to show that the option parameter only works on the 'shop' type NPC.
Thanks to @anacondaqq!
2017-09-26 16:17:04 -04:00
rAthenaAPI
9b66c32ef7 SQL synchronization 2017-09-26 16:32:54 +02:00
aleos89
549d6f5b55 Corrected Bawaya Agimat Tattoo item bonus
* Fixes #2422.
* Adjusted bonus from variable cast time to fixed cast time.
Thanks to @esu1214!
2017-09-26 10:32:35 -04:00
Vincent Stumpf
cd43f32ffb Shadow Refiner and getequiprefinecost (#2447)
* Fixes #2445 and fixes #2446.
* Fixed shadow refiner.
— The script uses the values of the array instead of the indexes to loop through it.
* Fixed segfault in getequiprefinecost.
— No checks in getequiprefinecost meant there were possibilities using negative indexes in arrays.
* Added to the script documentation what happens on failure when calling getequiprefinecost (it returns -1).
Thanks to @vstmpf, @crazystorm2017, and @hendra814!
2017-09-24 09:53:40 -04:00
anity99
052b9bc819 Fix duplicate location (#2442)
* Corrected Shadow Blacksmith overlapping with Mighty Hammer.
Thanks to @anity99!
2017-09-22 14:19:50 -04:00
Aleos
80a251ef02 Migrated clif.c to C++ (#2435)
* Migrated clif.c to C++
* Needed in preparation for future projects.
Thanks to @Daegaladh and @Mikegyver for testing!
2017-09-21 11:41:57 -04:00
aleos89
1bfe8475c8 Corrected Elemental flee calculation
* Fixes #2436.
* Added missing caster's flee into the formula.
Thanks to @Barigas!
2017-09-21 11:03:10 -04:00
anity99
c71f105083 Fix typo in achievements.txt (#2433)
* Resolves some typos in the AG_ADVENTURE script resulting in some not being able to be completed.
Thanks to @anity99!
2017-09-20 14:39:23 -04:00
Vincent Stumpf
0e74b5f55b Fixed potential crash in pc_bonus (#2423)
* Fixes #2420.
* If a bonus script command is used in an NPC with a non-existent bonus type, the server crashes.
Thanks to @vstumpf and @anacondaqq!
2017-09-20 14:33:25 -04:00
Vincent Stumpf
70f1d86404 Fixed msvc warning casting int to bool in getequiprefinecost (#2429)
* Fixes #2428.
Thanks to @vstumpf and @Haikenz!
2017-09-19 10:15:42 -04:00
Jittapan Pluemsumran
78c63c3a47 Merge pull request #2430 from anity99/updated-alternate-3rd-job-bodystyles
Updated alternate 3rd job bodystyles
2017-09-19 18:08:21 +07:00
Phong Truong
303bfb54aa Update atcommand.c 2017-09-19 12:35:32 +07:00
Jittapan Pluemsumran
e24d30a711 Refine overhaul (#2295)
* Converted refine_db.txt to refine_db.yml
* Refine success rates can now be set in refine_db.yml. rAthena's default NPCs will respect this database by default.
* Added shadow equipment refiner
Thanks to @Akkarinage @aleos89 @Atemo and @Mikegyver for their inputs.
2017-09-18 21:52:52 +07:00
sader fawall
8222208421 update item group file location (#2418)
* Updated documentation for item groups.
Thanks to @sader1992!
2017-09-15 13:54:01 -04:00
Aleos
5c7c089320 Corrected OPT1 behavior (#2378)
* Fixes #869.
* Damage skills should fully cast when OPT1 statuses are active.
Thanks to @panko11 and @Playtester!
2017-09-15 13:08:32 -04:00
Jeybla
557cccac9c Adds allow_bound_sell configuration. (#2401)
- It is possible to sell bound items, when allow_bound_sell is enabled.
- Fixes #2398.
- Changes made by @aleos89
- Thanks to @Everade
2017-09-12 15:53:55 -04:00
rAthenaAPI
cabb547164 SQL synchronization 2017-09-12 17:13:24 +02:00
Luan da Silva Santos
734ec22577 Fix for issue #2391 https://github.com/rathena/rathena/issues/2391 (#2416)
* Resolves Lex Aeterna autospell for Laser of Eagle.
2017-09-12 11:13:17 -04:00
Jey
5fda4f0f65 Fixed potential map server crash.
* Added a null pointer check
* Thanks to @admkakaroto!
2017-09-11 03:04:28 +02:00
rAthenaAPI
de441d6d2c SQL synchronization 2017-09-09 20:22:01 +02:00
Atemo
969c10fbc1 Leprechaun_Hat should be refineable (issue #2407)
Thanks @uddevil !
2017-09-09 20:21:29 +02:00
Atemo
3cc29d04cc Fixed another issue follow up b275412bcc 2017-09-08 19:22:34 +02:00
Jey
b275412bcc Fixes a warning in HorrorToyFactory.
* Replaces an unattached sleep2 to sleep
* Thanks to @admkakaroto and @technoken!
2017-09-08 11:22:23 +02:00
Jey
b4952aae09 Fixes a potential map-server crash.
* Follow up to 816d8ab2
* "buf" length in clif_party_info adjusted. (Buffer overflow)
* Thanks to @plsfixrito!
2017-09-07 23:21:52 +02:00
Jey
6434a83088 Follow up to 38d225c444
- Fixes a compile warning
- Thanks to @Mikegyver and @Daegaladh
2017-09-07 15:34:33 +02:00
Jey
38d225c444 Follow up to 60d59124a3.
* Fixes a map server crash due to wrong casting
* Fixes #2406
* Thanks to @keitenai!
2017-09-07 13:18:28 +02:00
Jey
528539f621 Follow up to 60d59124a3
* Fixes some compile warnings
* "Forcing value to bool"
* Thanks @M4karov
2017-09-07 12:51:00 +02:00
Daegaladh
60d59124a3 Migrated script.c to C++ (#2404)
* Thanks to @Daegaladh!
* Originial pull request: #2395
2017-09-07 04:13:42 +02:00
Jittapan Pluemsumran
0379774cd2 Revert "Migrated script.c to C++ (#2395)" (#2403)
This reverts commit 965edbf47d.
2017-09-05 22:40:24 +07:00
Daegaladh
965edbf47d Migrated script.c to C++ (#2395)
* Migrated script.c to C++
2017-09-05 19:51:04 +07:00
rAthenaAPI
d770de8015 SQL synchronization 2017-09-02 16:49:26 +02:00
Aleos
6ef8a97cf0 Updated Guillotine Poison item behavior (#2396)
* Fixes #1044.
* Poisons are now consumable by all classes.
* Using the item directly gives no benefit.
* Adjusted the item type to 2 (usable) from 0 (healing).
* A Dagger or Katar weapon is required to use Poisoning Weapon.
* Casting Poisoning Weapon again will cancel the previous bonus.
Thanks to @cydh and @Playtester!
2017-09-02 10:49:18 -04:00
aleos
470364cbe1 Corrected a second changequest attempt
* Related to #2070.
Thanks to @LiamKarlMitchell!
2017-08-31 20:24:04 -04:00
Aleos
e92fc9672f Resolved bonus WeaponMATKRate (#2383)
* Fixes #2275.
* Moved the bonus check after equipment is parsed.
Thanks to @Felleonel!
2017-08-31 14:26:17 -04:00
rAthenaAPI
a0da1ffb75 SQL synchronization 2017-08-31 20:05:13 +02:00
Aleos
d353b6682b Updated Rune Stone item behavior (#2384)
* Fixes #1045.
* Rune Stones are now consumable by all classes.
* Adjusted the item type to 2 (usable item) from 11 (delayed item).
* Removed the IG_RUNE item group.
Thanks to @cydh and @Paoly28!
2017-08-31 14:05:06 -04:00
Aleos
dfe714e9a1 Corrected broadcast item flag with autoloot (#2392)
* Fixes #1796.
* Moved the broadcast flag check before party share loot check.
Thanks to @whupdo!
2017-08-31 13:51:07 -04:00
Jeybla
f197f82f1f Removed reset of monster drops on mobdb reload. (#2394)
Does not clear item_drop_ers on mobdbreload anymore.
- Fixes #2355
- Thanks to @Zellukas.
2017-08-31 19:02:22 +02:00
Aleos
fc115b85a1 Adjusted HP, Max HP, SP, and Max SP SQL defines (#2389)
* Fixes #2387.
* Adjusted column define from mediumint to unsigned int.
* Synchronized default values to 0.
* Adjusted the parser format specifier
* Adjusted the specifiers to support unsigned.
Thanks to @M45T3Ryu and @Lemongrass3110!
2017-08-31 10:49:48 -04:00
Aleos
b19325b842 Corrected mob chat display checks (#2390)
* Fixes #2388.
* Added a validation check when monsters try to talk and attempt to lookup and invalid chat message on skill usage.
* Clones of players will now have no mob chat ID associated to their skills.
Thanks to @M4karov!
2017-08-31 10:15:00 -04:00
aleos
3e51f68570 Adjusted the Achievement Chat Counter
* Fixes #2334.
* Moved the achievement objective update function before the NPC waiting room event trigger.
Thanks to @ClayJensen and @Atemo!
2017-08-29 19:09:41 -04:00
Aleos
e4072e1361 Updated Silvervine Root Twist behavior (#2377)
* Fixes #1139.
* Should be removable by Earth Shaker.
* Removed maxcount limit as it's not a ground skill anymore.
2017-08-29 09:39:52 -04:00
Aleos
515fa6a163 Corrected the Chorus skills damage bonus (#2379)
* Added the missing range value when searching the map.
* Resolves an incorrect calculation in the bonus when less than 8 of the members are a Minstrel or Wanderer.
* Moved the Chorus check to the respective skills to avoid unnecessary calls to the function.
* Added documentation.
* Removed redundancy.
Thanks to @Tokeiburu and @Lemongrass3110!
2017-08-28 19:43:57 -04:00
Aleos
7a1b2e0f0a Cleaned up Item Shop checks (#2373)
* Fixes #2352.
* Removed an extra bound check when selling items.
* Added a check to return failure when unable to delete an item.
* Added checks when counting sellable items in an Item Shop.
- Items that can't be sold, favorite items, rental items, and bound items will now be ignored unless the GM has required permissions.
Thanks to @chadn4u, @Jeybla, @Lemongrass3110!
2017-08-28 10:08:29 -04:00
Aleos
39a5d38b9d Corrected Fatal Menace behavior (#2371)
* Resolves an issue with targets in the Fatal Menace area not getting teleported with the player.
Thanks to @Tokeiburu!
2017-08-28 09:40:23 -04:00
Stolao
9db3c386ea Fix bAddEffOnSkill (#2370)
* Fixes #2357.
* Fixed a copy paste error.
2017-08-25 14:41:15 -04:00
Aleos
4539d557e2 Added script command sc_end_class (#2368)
* Added a new script command sc_end_class to remove status changes from any learned skills.
* Adjusted the custom Reset NPC to make use of this behavior.
Thanks to @sader1992!

* Follow up to f93680b
* Adjusted documentation.

* Follow up to f93680b
* Removed the check from script command resetskill.
* Added a new script command sc_end_class.

* Fixed a compile error
* Corrected the define of the script command.
* Adjusted some documentation.
* Reverted some formatting from the original commit.
Thanks to @sader1992 and @Lemongrass3110!
2017-08-25 13:26:22 -04:00
Moch. Luthfi Rahmadi
c9ce29c00e Update Readme.md (#2337)
* Added Centos 64bit build option with MariaDB.
Thanks to @mazvi!
2017-08-23 10:21:06 -04:00
Lemongrass3110
1fc0ed600f Added support for the all 2017-06 clients 2017-08-21 00:10:06 +02:00
Lemongrass3110
3183c39cfe Fixed 2 compiler warnings
Fixes #2346

Thanks to @hurtsky
2017-08-20 15:01:05 +02:00
Lemongrass3110
6f985080a8 Follow up to 5fdebec
Fixed a typo
2017-08-18 11:49:20 +02:00
Lemongrass3110
5fdebec3af Fixed rebinding of mob view data for killed mobs
Fixes #2351

Thanks to @TesLA-Git
2017-08-18 11:47:40 +02:00
rAthenaAPI
2d31bc3c43 SQL synchronization 2017-08-16 19:52:33 +02:00
aleos89
b9627dd879 Resolved non-weapon items having a weapon level
* Fixes #2343.
* Removed all weapon level values from non-weapons in the renewal item database.
Thanks to @admkakaroto!
2017-08-16 13:52:10 -04:00
Lemongrass3110
d319ff7ca5 Fixed character creation for expired VIP accounts
Fixes #2333

Thanks to @Everade
2017-08-16 13:50:13 +02:00
Lemongrass3110
4cb4d60fee Fixed return value of unitattack for players
Fixes #2345

Thanks to @anacondaqq
2017-08-16 11:33:35 +02:00
Lemongrass3110
165197d26f Fixed cast time for the npcskill script command
Fixes #2342

Thanks to @Atemo
2017-08-16 09:40:38 +02:00
rAthenaAPI
374ecd0c99 SQL synchronization 2017-08-15 20:13:25 +02:00
Atemo
11d33007d9 Initial release of Ghost Palace Memorial (#2331)
* Initial release of Ghost Palace Memorial (Walkthrough conversion)

Thanks @Lemongrass3110, @aleos89 and @Jeybla for their help!
Thanks to Divine Pride for the monsters datas !
2017-08-15 20:11:50 +02:00
Jittapan Pluemsumran
eac3365282 Merge pull request #2340 from rathena/hotfix/issue2339
Fixed std::string reference being an incomplete type in inter.h
2017-08-15 16:26:07 +07:00
Jittapan Pluemsumran
bfb92940d5 Fixed std::string reference being an incomplete type in inter.h
Fixes #2339
2017-08-15 11:17:16 +07:00
rAthenaAPI
b04f79ed86 SQL synchronization 2017-08-14 19:57:44 +02:00
Atemo
641a1f1e88 Updated item_db.txt (16.1 episode) 2017-08-14 19:57:24 +02:00
Aleos
7554b53d68 Adjusted script command gettimestr (#2329)
* Fixes #2328.
* Added an optional parameter to pass in a Unix tick value to convert to a readable format.
Thanks to @hendra814 and @Lemongrass3110!
2017-08-14 13:51:18 -04:00
Jittapan Pluemsumran
74d809d139 Merge pull request #2338 from keitenai/patch-3
Fixed incorrect use of 'close' command
2017-08-14 22:59:15 +07:00
keitenai
f4de91b407 Fixed incorrect use of 'close' command 2017-08-14 23:25:29 +08:00
Lemongrass3110
d673d25978 Fixed another error from mobdb reloading
Thanks to @Everade
2017-08-14 04:22:55 +02:00
Lemongrass3110
693e958525 Fixed wrong crimson staff being dropped
Thanks to @Everade
2017-08-14 03:06:58 +02:00
Jittapan Pluemsumran
cc1d26fe74 Inter server C++ conversion (#2322)
* Renamed inter.c to inter.cpp and refactored it

* Converted inter_server.conf to inter_server.yml

* Updated the makefiles

* Refactored inter-server storage handling logic

* Fixed a bug with wrong maximum being displayed
When you took out an item of the storage it would always display the maximum amount of the normal storage.

* Fixed a bug with storages that are over maximum

Thanks to @Akkarinage, @Lemongrass3110 and @Jeybla
2017-08-14 01:27:58 +02:00
Vincent Stumpf
f9c6b92a63 Fixes memory leak in char-server (#2335)
Fixes #2330

Allocated memory in various StringBuf instances was being cleared instead of freeing it completely.
2017-08-13 23:44:18 +02:00
keitenai
fcc4936b23 Fixed script dialogue's NPC name to its proper order. (#2320)
Fixed script dialogue's NPC name to its proper order.

Credit @keitenai
2017-08-13 14:35:51 +02:00
Lemongrass3110
a2fc7d51b3 Fixed a PACKETVER mismatch for the random options
Fixes #2332

Thanks to @Milchdealer
2017-08-13 00:30:54 +02:00
Lemongrass3110
37f7fc5708 Fixed memory manager still using SVN revision 2017-08-12 16:50:00 +02:00
Atemo
087a72731d Fixed storage condition in lasagna town
From cb580e1f0d
Credits @exneval
2017-08-12 14:13:51 +02:00
Lemongrass3110
dce6ff1bea Fixed a memory leak in the script engine
Returning NPC variables in a user defined script function inside the same NPC does not require to allocate any additional stack.

Fixes #1205

Thanks to @Jeybla
2017-08-11 22:52:51 +02:00
Lemongrass3110
6b18ea56a0 Fixed x64 release mode not building all servers 2017-08-11 21:21:09 +02:00
Lemongrass3110
abfd1980de Made view_data for mob unit changes persistent (#2316)
Made view_data for mobs changes persistent

Fixes #2269

Thanks to @Yuchinin
---
Fixed reloadmobdb breaking the view ids

Fixes #2326

Thanks to @karlseven
---
Allowed updating mob's class to a pc class
Fixed sex change so that the client is automatically refreshed
Respawn the monster on clientside if the class is changed

Thanks to @Jeybla and @aleos89 for helping!
2017-08-11 19:27:33 +02:00
rAthenaAPI
9c6a89076d SQL synchronization 2017-08-11 00:53:48 +02:00
Lemongrass3110
b30d0fdf64 New NPC IDs and mob ID placeholders 2017-08-11 00:53:35 +02:00
Lemongrass3110
74cc00f88e Follow up to ac1cf04
Thanks to @CairoLee
2017-08-10 23:33:41 +02:00
Akkarinage
8417d7616b Details of import/ dirs and examples
Signed-off-by: Akkarinage <akkarin@rathena.org>
2017-08-10 00:34:43 +01:00
aleos
ac1cf0499a Follow up to dcbb2df
* Adjusted the checks to one-line.
* Corrected the map-server from spitting out an error for the achievements import file.
2017-08-08 21:12:20 -04:00
aleos
dcbb2df776 Corrected YAML file parsing
* Fixes #2323.
* YAML file parsing will now properly catch and display warnings when unable to read a file.
Thanks to @CairoLee!
2017-08-08 20:50:09 -04:00
Lemongrass3110
4a28c8c1b0 Follow up to 8310253
Achievement code now matches the Quest code.

Fixed a few small typos and removed some leftovers by @aleos89

Thanks to @CairoLee and @Tokeiburu
2017-08-09 00:45:51 +02:00
Jittapan Pluemsumran
71421a4268 Made global variables in header files extern and implement them in their respective source file. (#2318) 2017-08-08 15:33:39 +07:00
Lemongrass3110
8310253b84 Follow up to ee12429
The incomplete count was not updated before moving the memory that way the counter had the wrong value.
Also the memory manager would complain that the pointer is invalid when we have zero achievements.

Thanks to @CairoLee
2017-08-07 12:54:16 +02:00
Lemongrass3110
34aa59d82b Added missing MySQL column check for show_equip
Follow up to 983d164
2017-08-07 09:31:32 +02:00
Lemongrass3110
9084d01536 Fixed a compilation problem with CentOS
Fixes #2317

Thanks to @keitenai and @sanny1128
2017-08-07 07:59:09 +02:00
Jittapan Pluemsumran
a46e012619 Made cbasetypes.h more C++ compatible (#2315)
* Removed inline macro in cbasetypes.h
* Renamed swap macro to avoid name clash with std::swap
2017-08-07 06:33:47 +07:00
Lemongrass3110
829f0a1f59 Added dummy entries for the equip switch feature
With this the players will not get disconnected when they click the button or drag an item into the new part of the equip window.
2017-08-06 22:25:47 +02:00
Lemongrass3110
5424ab85c9 Fixed mob database reloading
Fixes #2304
Thanks to @uddevil and @anacondaqq

Closes #2305
Thanks to @vstumpf
2017-08-06 18:11:54 +02:00
Lemongrass3110
f8e4aabf87 Follow up to 70c14fa 2017-08-06 17:48:24 +02:00
Lemongrass3110
983d164b7d Fixed public equip switch not being saved
Fixes #2310

Thanks to @mrjnumber1
2017-08-06 13:49:29 +02:00
Lemongrass3110
43949b8ab6 Fixed misleading indentation in script.c
Fixes #2307

Thanks to @Akkarinage
2017-08-06 13:23:30 +02:00
Lemongrass3110
70c14fa567 Fixed achievement handling in OnPCStatCalcEvent
Fixes #2314

Thanks to @CairoLee
2017-08-06 13:10:34 +02:00
Lemongrass3110
ee1242908b Fixed a memory leak in achievementremove
Fixes #2313

Thanks to @CairoLee
2017-08-06 12:55:59 +02:00
Atemo
115c1b9f5f Fixed a typo in quests_eclage.txt issue #2311 2017-08-05 13:42:39 +02:00
rAthenaAPI
93cf197a2f SQL synchronization 2017-08-05 01:11:12 +02:00
Aleos
cd164d74cd Removed some hardcoded item checks (#2303)
* Fixes #991.
* Removed hardcoded checks for SC_ITEMBOOST, SC_EXPBOOST, and SC_JEXPBOOST.
* Players are able to still consume these items even if the status is already active.
* Corrected the item bonus for Malangdo Cat Can.
Thanks to @cydh!
2017-08-04 19:11:05 -04:00
Lemongrass3110
bbd42e7f12 Cleaned up character deletion code (#2296)
* Fixes #2271
Thanks to @Tokeiburu
2017-08-04 18:46:17 -04:00
rAthenaAPI
de3f924afc SQL synchronization 2017-08-05 00:38:48 +02:00
Aleos
fe5f1e115d Added a new item flag for delayed consumption (#2300)
* Added a new item flag for delayed consumption
* Fixes #550.
* The new flag will never consume the item.
* Supports script command itemskill.
Thanks to @cydh!
2017-08-04 18:38:39 -04:00
Atemo
9d6b3d06a9 Fixed readparam when 2nd parameter is a variable
Related issue #2276
2017-08-04 15:45:57 +02:00
Daegaladh
627a178ca9 Fixed a lot of "next" on Old Pharmacist (#2308)
* Corrected the usage of script command next which was causing the NPC dialogue to be combined in certain cases.
Thanks to @Daegaladh!
2017-08-03 14:17:21 -04:00
rAthenaAPI
915c9ddb26 SQL synchronization 2017-08-03 19:41:11 +02:00
aleos89
166836d7b3 Follow up to cd3f42e
* Swapped equip locations for Sarah's Left Earring (28310) and Sarah's Right Earring (28311).
2017-08-03 13:40:50 -04:00
Temtaime
cd3f42eb6a Fix swapped accsessories (#2281)
* Enum was swapped, you can view it by calling @itemlist with one accessory equipped.
Thanks to @Temtaime!
2017-08-03 13:38:59 -04:00
aleos89
4c62f581a8 Corrected guild bound item retrieval deletion
* Corrected a SQL statement deleting all guild bound items in the inventory table for offline characters.
Thanks to @Canoe!
2017-08-01 14:20:58 -04:00
aleos89
c0556a397e Follow up to 6748ff7
* Fixed pre-increment and pre-decrement operators for achievement condition parsing.
Thanks to @Lemongrass3110!
2017-07-31 14:25:31 -04:00
aleos89
f4338adab7 Follow up to 6581bac
* Fixed some compile errors.
* Clarified documentation for script command achievementupdate a bit more.
2017-07-31 13:13:23 -04:00
aleos89
6581bac83b Added script command achievementupdate
* Updates the specified achievement's value.
Thanks to @Tokeiburu!
2017-07-31 12:57:39 -04:00
rAthenaAPI
1e71d50cb4 SQL synchronization 2017-07-31 16:18:15 +02:00
aleos89
4af6860302 Corrected Crimson Spear class requirement
* Fixes #2297.
* Added missing support for Swordman, Transcendent Swordman, and Baby Swordman.
Thanks to @ToiletMaster!
2017-07-31 10:17:57 -04:00
Lemongrass3110
b2c5424af1 Fixed some memleaks in skill_require_db
Thanks to @Everade
2017-07-30 16:40:48 +02:00
Lemongrass3110
6748ff7e17 Fixed pre-increment and pre-decrement operators
Fixes #2176
2017-07-28 22:51:13 +02:00
aleos
0126759d00 Fixed some typos in the achievement database
* Corrected documentation in the import database.
* Corrected a typo for dependent achievements in renewal.
Thanks to @Atemo!
2017-07-28 16:47:16 -04:00
Lemongrass3110
dfbd6f6cc4 Fixed item selection dialog
Fixes #2293

This was broken in 95!!! different client versions

A real big thank you to @admkakaroto
2017-07-28 21:24:14 +02:00
Lemongrass3110
000786d991 Fixed some RODEX related compile warnings
Fixes #2286

Thanks to @Valorro
2017-07-28 17:50:51 +02:00
Lemongrass3110
d7c7d58d5d Fixed some compilation warnings in release mode
Fixes #2219

Thanks to @keitenai, @CairoLee and @kukuasir1
2017-07-28 17:43:01 +02:00
Lemongrass3110
1e63f892d9 Fixed release mode building of map-server
Related to #2294

Thanks to @keitenai and @admkakaroto
2017-07-28 15:11:28 +02:00
aleos
fdbdcb266e Renamed the Achievement SQL upgrade file
* Renamed the Achievement SQL upgrade file date to match the release date.
Thanks to @sikiro!
2017-07-27 19:54:04 -04:00
aleos
a5e18f1250 Allow negative Equipment Attack
* Fixes #2191.
* In renewal Equipment Attack can become negative and is not capped to 0.
Thanks to @jezznar and @reigneil!
2017-07-27 19:03:01 -04:00
Lemongrass3110
f0a07d6d80 Respecting enchants in combos
Follow up to 3f8ff5a

Thanks to @esu1214
2017-07-27 23:07:05 +02:00
Jeybla
3f8ff5a3fb Fixes Item Combos in same equip index. (#2080)
Fixes #1710

Thanks to @esu1214
2017-07-27 22:45:21 +02:00
f0und3r
b21f7c0a1f Config for guild alliance only by master (#2291)
Added a new configuration to allow to restrict alliance requests to the guild master.

Thanks to @f0und3r
2017-07-27 22:18:52 +02:00
Lemongrass3110
02135c4e2e Added support for RODEX 2017 (#2290) 2017-07-27 21:52:43 +02:00
Vincent Stumpf
3a55613537 Allows families to share exp (#2280)
* Fixes #2265
* Family is Mother + Child, Father + Child, or Mother + Father + Child
Thanks to @vstumpf!
2017-07-27 13:23:25 -04:00
rAthenaAPI
77e8d51570 SQL synchronization 2017-07-27 18:41:06 +02:00
aleos89
1bfd28ee67 Corrected some new shield defines
* Fixes #2292.
* Fixed Scutum, Shield of Flame, Shield of Gust, Shield of Water, and Shield of Earth resolving as weapons.
Thanks to @uddevil and @Lemongrass3110!
2017-07-27 12:40:50 -04:00
rAthenaAPI
51ef5595af SQL synchronization 2017-07-27 15:43:09 +02:00
Lemongrass3110
77718c325f Fixed weapon level of Tempest
Fixes #2287

Thanks to @ToiletMaster
2017-07-27 15:42:29 +02:00
rAthenaAPI
d113d24bce SQL synchronization 2017-07-27 15:33:12 +02:00
Aleos
7f5411da07 Initial release of the Achievement System (#2044)
* Information based on kRO patch notes.
- http://ro.gnjoy.com/news/update/View.asp?seq=163&curpage=1
* Includes Title System which is integrated into the Achievement System.
* Includes RODEX integration for rewards.
* Added new atcommand reloadachievementdb.
* Added new script commands achievementinfo, achievementadd, achievementremove, achievementcomplete, and achievementexists.
Thanks to @Lux-uri, @RagnarokNova, @Lemongrass3110, and @Tokeiburu for their help!
2017-07-27 09:33:03 -04:00
Lemongrass3110
433490a202 Fixed homunculus menu for a few clients 2017-07-27 01:37:58 +02:00
hazimjauhari90
cac49fda1b Updated alternate 3rd job bodystyles (#2288)
* Added Sorcerer class to the bodystyle atcommand.
2017-07-26 13:49:47 -04:00
Aleos
8b3e9cd28f Disable instances from using OnPC Events (#2278)
* Fixes #2273.
* Disable the use of OnPC Events in instance scripts since player's aren't actually attached to the event thus causing a crash.
Thanks to @Tokeiburu!
2017-07-24 17:38:05 -04:00
Lemongrass3110
7c2f3c4db9 Fixed 2017-06-07cRagexeRE and 2017-06-14bRagexeRE
Fixed #2285
Follow up to 2f453e7

Thanks to @hendra814
2017-07-24 19:32:16 +02:00
Lemongrass3110
cf0cfe84a7 Added script command progressbar_npc (#2272)
* Fixes #1473
Thanks to @Tokeiburu and @kukuasir1
2017-07-24 13:21:35 -04:00
Akkarinage
d912c5039b Removed SQL upgrade files dated prior to 2016 (#2282)
Signed-off-by: Akkarinage <akkarin@rathena.org>
2017-07-24 15:35:05 +01:00
Lemongrass3110
be15b62912 Follow up to a3c0590
Added a missing field check
2017-07-24 10:35:44 +02:00
hazimjauhari90
2f453e79ec Added shuffle packets for 2017-06-14bRagexeRE (#2277)
Thanks to @Rytech2 and @hazimjauhari90.
2017-07-23 19:03:38 +02:00
aleos89
ad036d08a4 Follow up to 94aa28a
* Resolved some compile warnings.
2017-07-20 13:36:23 -04:00
aleos89
94aa28aafc Follow up to df2c3e1
* Resolved a compile warning.
2017-07-20 13:24:44 -04:00
Lemongrass3110
eda85943f7 Fixed an issue with git hash lookup 2017-07-18 23:02:31 +02:00
Aleos
504b249d20 Updated Rogue Spirit potion bonus (#2225)
* Fixes #2139.
* Added missing 50% HP bonus.
* Removed extra 50% SP bonus.
* Cleaned up overall pc_itemheal function calculations.
Thanks to @mrjnumber1 and @exneval, and @Lemongrass3110!
2017-07-18 12:53:33 -04:00
Lemongrass3110
9eaabd5f6c Fixed mod permissions for private channels (#2262) 2017-07-17 23:25:55 +02:00
Lemongrass3110
e157e05c1c Fixed file order in map-server project for VS 2017-07-17 23:01:53 +02:00
aleos89
df2c3e1645 Fixed a compile warning for ADJUST_SKILL_DAMAGE
* Fixes #2231.
Thanks to @technoken!
2017-07-17 14:56:08 -04:00
Lemongrass3110
dae5030650 Fixed unitwarp to unwalkable areas for NPCs
Fixed #2270

Thanks to @Yuchinin
2017-07-16 22:29:48 +02:00
Lemongrass3110
d324cd1e25 Fixed a warning when obfuscation is disabled
Thanks to @sader1992 and @Jeybla
2017-07-16 16:36:46 +02:00
Lemongrass3110
19d7c44298 Removed packet_db copy from VS project
Thanks to @Everade
2017-07-16 16:15:34 +02:00
Aleos
d86c8a81be Expanded script command unitstopwalk (#2258)
Fixes #2254.
Added an optional flag to specify the types of methods to stop a unit from walking.
Created an enum for the unit_stop_walking flags.
Thanks to @Yuchinin and @Lemongrass3110!
2017-07-16 16:05:17 +02:00
Lemongrass3110
574c753945 Follow up to f0ab8d2
Fixed #2266

Thanks to @hendra814
2017-07-16 05:28:03 +02:00
Lemongrass3110
f0ab8d2a52 Overhauled and dropped packet db (#2263)
Adds support for a lot of missing clients and features almost all clients from 2016 and 2017
clientinfo.xml's version value will be ignored from now on
By setting PACKETVER the server will configure everything else on it's own from now on
Dropped is_clientver script command
And a lot more
2017-07-15 22:45:12 +02:00
aleos89
0d103bf6a7 Fixed a small bug with atcommand addwarp
* The function that creates the warp was using the wrong Y area argument.
Thanks to @mrjnumber1!
2017-07-14 13:54:52 -04:00
rAthenaAPI
77ad410607 SQL synchronization 2017-07-14 19:19:14 +02:00
aleos89
2bd0fd5a16 Corrected Shield of Death bonus
* Wearer should receive 10% more damage not gain 10% damage against normal monsters.
Thanks to Divine-Pride.net!
2017-07-14 13:18:58 -04:00
rAthenaAPI
4071801bdc SQL synchronization 2017-07-14 00:15:41 +02:00
Lemongrass3110
6e2ab60016 Fixed a warning for guild master change time
Fixed #2246

Thanks to @anacondaqq
2017-07-14 00:15:24 +02:00
Lemongrass3110
b0f5672a74 Fixed character deletion on 2014-10-22
Fixed #2251

Thanks to @lelouch22
2017-07-14 00:13:21 +02:00
Lemongrass3110
e00d843836 Mob DB placeholder 2017-07-14 00:10:58 +02:00
Akkarinage
d9d9042b87 Added Lasagna to atcommand go locations 2017-07-13 15:58:03 +01:00
rAthenaAPI
c6c8d0bc88 SQL synchronization 2017-07-10 18:27:38 +02:00
aleos89
7a3a64960b Corrected Siege Arrow Quivers
* Fixes #2249.
* Siege Arrow Quiver S should give Arrow S while Siege Arrow Quiver A should give Arrow A.
Thanks to @uddevil!
2017-07-10 12:27:23 -04:00
aleos89
9959c919dc VIP Drop calculation correction
* Fixes #2247.
* Adjusted the drop rate to properly float the value before converting to integer.
Thanks to @talesvalente!
2017-07-10 10:29:28 -04:00
aleos
0739275508 Cleaned up Hells Plant damage formula
* Fixes #2230.
Thanks to @RagnarokValor!
2017-07-08 13:18:04 -04:00
aleos
4dfeeade06 Resolve some compile warnings
* Fixes #2245.
Thanks to @lelouch22!
2017-07-08 11:42:53 -04:00
Lemongrass3110
b2aa7e698d Fixed thief's back sliding animation
Fixed #1914

Thanks to @zackdreaver for reporting and @aleos89 for his help!
2017-07-07 23:52:00 +02:00
aleos89
27a30ffa51 Removed an unused variable
* Follow up to bae5c31.
* Fixes #2241.
Thanks to @hazimjauhari90!
2017-07-07 08:36:30 -04:00
Aleos
bae5c31201 Miscellaneous atcommand parsing cleanups (#2238)
* Removed several typecasts.
* Adjusted atcommands that interpret character names to make use of atcmd_player_name.
* Added some missing comments.
* Adjusted a few return messages to match the appropriate scenario.
* Assume atcommand changeleader is successful after initial checks.
Thanks to @Lemongrass3110!
2017-07-06 17:15:45 -04:00
aleos
5462b08d28 Follow up to dc2c51c
* Added a missing break.
2017-07-06 16:43:21 -04:00
aleos
dc2c51cd83 Corrected Hell Inferno behavior
* Fixes #2236.
* Hell Inferno's shadow attack will now properly do elemental damage.
* Burning should only start when the fire attack successfully lands.
* Gave a slight delay to the shadow attack to mimic officials.
Thanks to @hartonox!
2017-07-06 16:38:45 -04:00
rAthenaAPI
2f35069fd6 SQL synchronization 2017-07-06 15:47:53 +02:00
Atemo
c7438aa0fd Corrected class requirement for item ID 2027 (issue #2240)
Thanks @hendra814
2017-07-06 15:47:31 +02:00
Aleos
5f7a143d3e Updated Summoner class (#1965)
* Fixes #1865.
* Updated and added new Summoner class skills.
* Information based on kRO patch notes.
- http://ro.gnjoy.com/news/devnote/View.asp?category=1&seq=1987966&curpage=1
* Updated previously implemented skills to better mimic official behavior.
Thanks to @RagnarokNova, Fyrus, and Jet for their hard work on gathering the information!
Thanks to @Grimfiend, @Atemo, @feltenc, @Lemongrass3110, @Felleonel, and @sanny1128 for the rapid test and reports!
2017-07-05 19:40:35 -04:00
Lemongrass3110
689a3ff9b3 Added a few missing cashpoint message comments 2017-07-03 22:25:14 +02:00
Lemongrass3110
f86ba2b6b8 Added a state check for the cash shop
If the cash shop is open you can not use the atcommands cash and points.
This is because no update packet exists and the cash shop only gets the current amount when you open the cash shop.
The second way to update the cash shop values is on a successful purchase.
2017-07-03 22:14:34 +02:00
Lemongrass3110
eaeec3973e Follow up to a3c0590
Fixed a wrong configuration value from testing the no-delay option.
2017-07-02 23:42:40 +02:00
Lemongrass3110
a3c0590508 Added some checks to guild leader change
Introduces two new configurations:
1) Allow guild leader changes in WoE (yes/no)
	Default: no
2) Delay between the changes (in minutes)
	Default: 1440 minutes = 1 day

Follow up to b51617c
2017-07-02 23:40:30 +02:00
Lemongrass3110
2072fe3643 Fixed unitwalk and unitwalkto label reset
Fixed #2222

Thanks to @zellkennedy
2017-07-02 18:21:33 +02:00
Atemo
4b8720b44c Removed extra tabs/spaces in script_commands.txt 2017-07-02 16:31:16 +02:00
Lemongrass3110
045f4be573 Fixed getequipid returning 0 instead of -1
Fixed #2228 and updated the documentation a little

Thanks to @talesvalente
2017-07-02 15:39:35 +02:00
Lemongrass3110
2aefe6c188 Fixed 2 compilation warnings 2017-07-02 15:06:27 +02:00
hazimjauhari90
ad80914981 Follow up to 7351b88 (#2200)
Merged HerculesWS/Hercules@73db1e2

The exact client date for the implementation of new party ui window is actually 2017-05-02dRagexeRE

Thanks to @4144, @Asheraf and @dastgir
2017-07-02 14:18:08 +02:00
Jittapan Pluemsumran
fa24b2134d Expanded bg_get_data script command (#2179)
* Expanded bg_get_data script command.
* Now able accept type parameter of 1 to list account IDs of battleground members.
* Originally implemented by @AnnieRuru at https://rathena.org/board/topic/72571-b/
2017-06-30 14:06:04 -04:00
Aleos
ba242eb9ed Resolved function timers not being freed properly (#2223)
* Fixes #2216.
* Properly free a function's timer when reloading scripts.
* Renamed script_stop_instances to not confuse it with the Instance System.
Thanks to @Tokeiburu!
2017-06-30 12:43:20 -04:00
Lemongrass3110
45e91e2a3a Added clan emblems to the NPCs (#2221)
* Added clan emblems to the NPCs
* Partial merge of/based on idathena/trunk@1f84c5d
Thanks to @exneval
2017-06-30 12:31:06 -04:00
Atemo
a8e4c83ef1 Updated sleep2: (#2208)
* Updated sleep2:
Currently sleep2 is supposed to return 0 or 1 if the unit is still attached. Actually mapserv throws a warning and the script end if the timer is still running and unit offline. With this update the script ends if there is no unit attached for sleep2.
* Corrected comments / docs
Thanks @secretdataz, @Lemongrass3110
2017-06-30 10:25:14 -04:00
rAthenaAPI
f0aed89aad SQL synchronization 2017-06-28 22:59:07 +02:00
Lemongrass3110
c8496a159d Mob DB placeholders 2017-06-28 22:58:31 +02:00
Lemongrass3110
9827bf6153 Fixed motd parsing
Fixed #2220

Thanks to @anacondaqq
2017-06-27 19:00:59 +02:00
Lemongrass3110
da036de523 Follow up to 4a2574c and 76786e2 2017-06-27 18:44:23 +02:00
Jittapan Pluemsumran
e87626cc76 Fixed compile error when ADJUST_SKILL_DAMAGE macro is defined 2017-06-27 16:45:19 +07:00
aleos89
20908ee9c0 Replaced some final uses of rand()
* Replaced some final left overs of rand() with rnd() from MT19937AR.
2017-06-26 14:36:31 -04:00
aleos89
a7c8751a10 Resolve an issue with script command strnpcinfo
* Resolved the NPC map name lookup for floating NPC returning arbitrary values.
2017-06-26 14:12:24 -04:00
rAthenaAPI
73a8ceb947 SQL synchronization 2017-06-26 00:54:32 +02:00
Atemo
a5afb06979 Initial release of lasagna npcs (#2105)
* First release of lasagna npcs (playing conversion).

* Added a new parameter for npctalk script command
Target for <flag>:
- bc_all  : Broadcast message is sent server-wide (only in the chat window).
- bc_map  : Message is sent to everyone in the same map as the source of the npc.
- bc_area : Message is sent to players in the vicinity of the source (default value).
- bc_self : Message is sent only to player attached.

* Implemented doram food buffs

* Updated npctalk:
*npctalk "<message>"{,"<NPC name>",<flag>};
- Empty string for "<NPC name>" now means attached NPC

* Added flag parameter for unittalk script command
*unittalk <GID>,"<text>"{,<flag>};
flag: Specify target
   bc_area - Message is sent to players in the vicinity of the source (default).
   bc_self - Message is sent only to player attached.
 
* Updated classchange script command:
classchange(<view id>{,"<NPC name>",<flag>});
flag: Specify target
   bc_area - Data is sent to players in the vicinity of the source (default).
   bc_self - Data is sent only to player attached.

* Updated Time Limit for quests to allow HH:MM format

Thanks @secretdataz, @Lemongrass3110, @aleos89, @Jeybla, @anacondaqq, @jenkijo, @sikiro, @admkakaroto for contributing !
2017-06-26 00:54:25 +02:00
Jey
809fc35b0e Follow up to 4a2574c.\r\nThanks to @Jeybla! 2017-06-26 01:24:54 +07:00
Jittapan Pluemsumran
4a2574c599 Migrate core source files to C++. Add yaml-cpp project as dependency (#2207)
By updating to this commit, Linux users have to regenerate Makefiles by re-running the configure script.

* Added yaml-cpp project as a 3rdparty library
* Migrated source files core to C++
* Updated configure scripts
* Make Linux installations compile *.cpp files
* Made server components' main source file C++
* Also made headers CPP-aware.

* Added basic C wrapper for yaml-cpp library
* YAML-node path is delimited by periods.
* Basic integer types and string are supported.
* Strings returned from this wrapper have to be freed with malloc.h::aFree
* Arrays (sequence) is supported with iterator wrapper.
* Remember to free every wrapper you create!

* Add yaml-cpp as dependency of common project
* Made the repo not ignore *.yml files

Thanks to @aleos89 and @Lemongrass3110.
2017-06-25 23:33:24 +07:00
Aleos
e804970c49 Added a config for Banana Bombs (#2211)
* Fixes #2095.
* Added a battle config banana_bomb_duration to allow people to adjust the default duration of Make Bomb - Banana Bomb.
2017-06-23 09:39:27 -04:00
rAthenaAPI
6c5fabad50 SQL synchronization 2017-06-23 00:37:11 +02:00
Aleos
d5b67f35a0 Remove all bAtkRate item bonuses from renewal (#2199)
* Fixes #2198.
* Removed all bAtkRate item bonuses from the renewal item database and replaced with bAddClass.
* Updated item bonuses to match current descriptions.
* Updated various Aegis names.
Thanks to @Tokeiburu!
2017-06-22 18:37:03 -04:00
aleos89
2a6277a3dc Adjusted NPC casted skill cast times
* Fixes #2045.
* NPC's that cast skills through script commands unitskilluseid or unitskillusepos with a given cast time will no longer be instant cast.
2017-06-22 14:39:05 -04:00
Jittapan Pluemsumran
6fc2399df1 Fixed compiler warnings
Thanks to @RadianFord
2017-06-21 22:31:01 +07:00
Jittapan Pluemsumran
bd33f01e53 Resolved compiler warning when compiling rAthena with clang++ 2017-06-21 22:26:49 +07:00
Atemo
56201aead5 Update re/refine_db.txt (normal rate), issue #1492 (#1558)
Thanks @zackdreaver
2017-06-21 10:29:46 -04:00
Lemongrass3110
3acf1aada3 Follow up to 58776da
Fixed a few compiler warnings.
Thanks to @RadianFord
2017-06-21 15:07:37 +02:00
aleos
9d7d368a33 Adjusted RODEX mail return and delete timers
* Adjusted from 14 -> 15 days.
2017-06-20 18:52:12 -04:00
Lemongrass3110
58776da1ac Basic RODEX support (#2186)
Adds basic support for the new mail UI RODEX.

Fixes #1567

Thanks to @RagnarokNova, @Atemo, @aleos89 and everyone else that helped me with this.
Additionally I would like to thank @jezznar and @hazimjauhari90 for their good testing in the pull request.
2017-06-21 00:00:29 +02:00
Lemongrass3110
76786e2977 Cleaned up visual studio project minicore (#2166)
Cleaned up leftover defines(PCRE_SUPPORT and FD_SETSIZE) in the projects
2017-06-20 22:25:24 +02:00
Lemongrass3110
d0ca637ddd Fixed vip_status command (#2184)
Fixed different return types for the same function call
Also introduced constants for better function usage.

Fixes #2183
Thanks to @anacondaqq
2017-06-20 19:22:46 +02:00
Ninja
1005b46735 Added instructions on how to get GitHub Hash (#2189)
* Added instruction on how to get GitHub Hash
2017-06-17 10:39:49 -04:00
rAthenaAPI
48df8e0730 SQL synchronization 2017-06-16 19:10:25 +02:00
aleos89
55935a1111 Corrected Sword Stick view type
* Fixes #2193.
* Changed from Mace to 1 Handed Staff.
Thanks to @uddevil!
2017-06-16 13:10:06 -04:00
Ninja
6b8dbf9a82 Fix for Issue #2143 False Duplication of Items (#2157)
* Fixes #2143.
* Resolves the inventory looking like there are duplicate items when players use atcommand refresh during trades.
2017-06-16 10:17:02 -04:00
rAthenaAPI
f52e4b61be SQL synchronization 2017-06-15 21:15:25 +02:00
Atemo
6ce846883e Updated produce_db.txt to include Combination Kit
Thanks @anacondaqq
2017-06-15 21:14:56 +02:00
Atemo
b9db8611c8 Updated map_cache.dat 2017-06-15 18:42:26 +02:00
aleos
3093824bbe Updated atcommand changegm area name update
* Changing a guild's leader will now properly update the respective player names to the area.
Thanks to @anacondaqq!
2017-06-14 20:11:46 -04:00
Jeybla
05a778d6a3 Fixes damage skills which ignored walls. (#1453)
* Fixes damage skills which ignored walls.
* The following functions were adjusted for the battle config skill_wall_check.
* Changed map_foreachinrange behavior:
- map_foreachinallrange is now the old map_foreachinrange
- map_foreachinrange does not check for a wall
- map_foreachinshootrange always checks for a wall
* Changed map_foreachinarea behavior:
- map_foreachinallarea is now the old map_foreachinarea
- map_foreachinarea does not check for a wall
- map_foreachinshootarea always checks for a wall
2017-06-14 19:28:59 -04:00
rAthenaAPI
5f61ee6ecd SQL synchronization 2017-06-14 19:35:39 +02:00
Jittapan Pluemsumran
887efa4ea4 Item DB update and script command adjustment (#1739)
* Made getequipid script command accept EQI_COMPOUND_ON (-1) for current equipment slot when running in item script.
* Added new equipment index for current item in item script context.
* Fixed typo in Fulbuk_Card item script.
* Fixed typo in Lich_Lord_Card effect.
2017-06-14 13:35:32 -04:00
Jittapan Pluemsumran
264af55b42 Change some GvG checks (#2172)
* Fixes #1600.
* Adjusted various GvG checks to ignore the Agit mode check.
* Blocked Anodyne on GvG zones.
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2017-06-12 17:59:44 -04:00
aleos89
399d11cd78 Follow up to 6d962d7
* Corrected a missed constant rename which caused a compile error.
2017-06-12 13:18:41 -04:00
Atemo
ad82c6b790 Fixed color by default in questinfo script command
Thanks @anacondaqq
2017-06-12 18:59:37 +02:00
aleos89
6d962d73d1 Corrected enum constant naming convention.
Follow up to 6c266ae.
2017-06-12 12:13:02 -04:00
rAthenaAPI
fa1c722149 SQL synchronization 2017-06-12 16:57:55 +02:00
Jittapan Pluemsumran
6c266ae1f5 Item package and Aegis names updates (#2170)
* Item DB Updates
* Updated Item Packages that were added based on idRO's updates
* Added some Item Packages
* Corrected some Aegis item names
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2017-06-12 10:57:46 -04:00
rAthenaAPI
65fa130896 SQL synchronization 2017-06-09 11:23:36 +02:00
Lemongrass3110
8e7d739fcf kRO data patch 2017-06-07 2017-06-09 11:23:04 +02:00
rAthenaAPI
1b27a15c15 SQL synchronization 2017-06-08 17:05:26 +02:00
aleos89
fb2ab5baff Corrected some Aegis item names
* Follow up to a89e051.
* Removed the remaining invalid characters.
2017-06-08 11:04:53 -04:00
rAthenaAPI
5be6d191d5 SQL synchronization 2017-06-08 16:10:04 +02:00
aleos89
a89e051ef5 Corrected some Aegis item names
* Removed some invalid characters for Aegis item names.
2017-06-08 10:09:44 -04:00
aleos89
128259407c Corrected a SQL buffer type for bound items
* Resolves the equip value of bound items being truncated.
Thanks to @Tokeiburu!
2017-06-08 09:42:54 -04:00
Lemongrass3110
7351b88c14 Follow up to 816d8ab
Thanks to @admkakaroto

Source: http://ro.gnjoy.com/news/update/View.asp?seq=208
2017-06-06 21:26:28 +02:00
aleos89
b2d72ca625 Fixed Status Recovery's interaction with skills
* Fixes #2188.
* Poem of the Netherworld will now properly be removed with Status Recovery.
Thanks to @awayne910!
2017-06-06 08:45:49 -04:00
Lemongrass3110
816d8ab2d0 Fixed party window for 2017 clients
Thanks to @mrdiablo for his help again!
2017-06-05 23:07:09 +02:00
Lemongrass3110
b51617cb73 Added support for 2017's guild leader change 2017-06-03 17:03:56 +02:00
Lemongrass3110
52ac564215 Fixed login on 2017-03-15 and later 2017-06-03 14:32:29 +02:00
Lemongrass3110
9412ebb9f7 Added support for 2016's guild packets
Thanks to @mrdiablo for his help.
2017-06-03 14:08:06 +02:00
Lemongrass3110
c212b2ed05 Follow up to 4a2bd82 2017-06-01 21:43:10 +02:00
Lemongrass3110
b00f1e06b1 Revert of d259ba3 2017-06-01 19:14:52 +02:00
Aleos
4a2bd82883 Updated Rune Knight Runestone effects (#2181)
* Fixes #2144.
* Based on kRO update: http://ro.gnjoy.com/news/devnote/View.asp?category=1&seq=3708477&curpage=1
* Turisus Runestone - Reduce amplified bonus damage when dealing normal attacks from 300% to 200%. Add an additional increase ATK-based physical damage by 250% instead on normal maps and 125% on VS maps. Rhydo Runestone won't benefit from this bonus.
* Asir Runestone - Adds a static +70 ATK. Party members now receive 1/2 of the bonus instead of 1/4.
* Pertz Runestone - Changed factor in formula from INT to STR.
* Removed the limit of Turisus Runestone, Asir Runestone and Pertz Runestone that can be held while increasing the limit of the other runestones from 20 to 60.
2017-06-01 12:06:16 -04:00
Aleos
f450538f4c Implemented Clan Instance support (#2178)
* Allows instances to be created specifically for clans.
* Added script command instance_check_clan.
Thanks to @Lemongrass3110 for the idea and testing!
2017-06-01 10:48:34 -04:00
Lemongrass3110
ddee418cd5 Fixed warps between 2 maps of the same instance
Right now they would have always used the source map of the warp as the target map.

Thanks to @kukuasir1
2017-06-01 11:37:38 +02:00
rAthenaAPI
a01dab7e2f SQL synchronization 2017-05-30 16:13:33 +02:00
Lemongrass3110
bff62ed117 Mob DB placeholders
Also added support for 2 new NPC IDs
2017-05-30 16:12:21 +02:00
Aleos
3e625dfdf9 Fixes Tetra Vortex Fire animation (#2091)
* Added a damage animation motion for Tetra Vortex Fire.
* Resolves the black animation being displayed.
Thanks to @exneval, @spinzaku, @secretdataz, @reigneil, and @feltenc!
2017-05-27 09:32:26 -04:00
Lemongrass3110
8d8712f85e Corrected some wrong inter packet documentation 2017-05-25 23:38:51 +02:00
Atemo
4d126047e8 Follow-up b7cd40e7a3
Restricted JOB_BABY_KAGEROU, JOB_BABY_OBORO and JOB_BABY_REBELLION to enter woe TE castles

Thanks @Lemongrass3110 !
2017-05-25 01:12:46 +02:00
Atemo
b7cd40e7a3 Restricted Summoner Jobs to enter in woe TE castles 2017-05-24 20:53:29 +02:00
Lemongrass3110
0fcc9b6be4 Follow up to 2043c95
Fixes #2102

Thanks to @whupdo
2017-05-23 00:02:34 +02:00
Lemongrass3110
bba3da2fd7 Fixed a missing alliance channel check
Fixes #2158

Thanks to @Canoe for the bug report and solution!
2017-05-22 22:36:27 +02:00
Jeybla
cc700f1fb5 Fixes Instance idle timer. (#2155)
* Fixes #2154
* Fixes an incorrect start of the instance idle timer.
* Thanks to generic!
2017-05-22 06:23:34 +02:00
hazimjauhari90
39dbb9abd3 follow up to 9716233 (#2130)
ZC_ACCEPT_ENTER2 will be used for client authentication again.

Used 2016-03-30 for now until the exact date is confirmed.

Credits to @4144 HerculesWS/Hercules@964268d

Thanks to @hazimjauhari90 for his pull request.
2017-05-22 00:50:11 +02:00
Jittapan Pluemsumran
6a75b17380 Skip MapN parsing if it is equal to EnterMap for instances (#2131)
Added a check to prevent instance from adding duplicate maps
2017-05-20 19:50:01 +02:00
Lemongrass3110
ae540f133f Fixed linux server shutdown order (#2151)
Fixes #2141

Thanks to @hurtsky, @RadianFord, @hazimjauhari90 and @aleos89
2017-05-20 18:40:08 +02:00
Aleos
ce4ebbe5bc Updated leftover pet variables to 64k support (#2129)
* Small follow up to 7cd82d0.
* Fixes #2121.
* Updated pet egg and pet equips to support 64k values.
Thanks to @TrueNoir!
2017-05-16 22:28:17 +02:00
Lemongrass3110
068ea0a4ba Fixed char saving after buyingstore transactions
Fixes #2148
Thanks to @Encon21
2017-05-16 20:33:03 +02:00
nanakiwurtz
c0476f6bfe Fixed chat color bug in Channel System (#2140)
`@channel setcolor` command failed to change the font color, resulting in black font color.
2017-05-16 15:27:53 +07:00
Jey
79ad0a1902 Fixed bAutoSpellOnSkill applied on wrong target.
* Target is now determined by the AutoSpell, not the casted one.
* Fixes #2136
2017-05-11 23:31:03 +02:00
Lemongrass3110
562d6d1e34 Added automatic clan member removal (#2135) 2017-05-10 23:27:20 +02:00
Lemongrass3110
55735ea8f8 Follow up to 9716233
Thanks to @hazimjauhari90 and @admkakaroto.
2017-05-10 23:23:48 +02:00
Jittapan Pluemsumran
d259ba3385 Added zlib1.dll to .gitignore 2017-05-10 20:30:41 +07:00
Atemo
809754379b Added 'warp2' NPC
Unlike 'warp', 'warp2' NPC will also be triggered by hidden player.
Thanks @secretdataz and @Lemongrass3110 !

* Replace script using OnTouch:([\r\n\t]+)warp by warp2

* Removed sprite id from warp duplicates in Bangungot instance

* Fixed a bug where warp/warp2 parsing is too greedy
2017-05-09 23:45:34 +02:00
rAthenaAPI
ea4d192aaa SQL synchronization 2017-05-09 13:34:27 +02:00
Atemo
1e1d7e54f0 Merged Faceworm Instance from idathena https://github.com/idathena/tr… (#1889)
* Merged Faceworm Instance from idathena 20f71d8c62

Credits to @exneval !
2017-05-09 13:34:19 +02:00
Lemongrass3110
9716233c84 Introducing the equip preview window
Fixes some bugs for 2016-09-21 onward, where you can preview how a item would like if you put it on.
This works on other people's vending and on your own inventory.

Thanks to @Rytech2 and @hazimjauhari90
2017-05-08 23:40:05 +02:00
Jittapan Pluemsumran
999c411ecd Update README.md 2017-05-08 15:13:37 +07:00
rAthenaAPI
b7f3ee9772 SQL synchronization 2017-05-06 16:16:12 +02:00
Atemo
f539d9797f Fixed issue #2110
bBaseAtk is capped and can't be sustracted

Thanks @jamon18 and @admkakaroto
2017-05-06 16:15:55 +02:00
rAthenaAPI
e59d5d78d8 SQL synchronization 2017-05-06 15:36:56 +02:00
Atemo
6cc9b955f5 Changed Vellum Glaive effect to follow kRO description
issue #2109

Thanks to @jamon18
2017-05-06 15:36:38 +02:00
Jittapan Pluemsumran
4a004ad4b8 Merge branch 'feature/cpp' 2017-05-05 16:53:25 +07:00
Jittapan Pluemsumran
2e524f18fc Removed an extra C linkage declaration in core.h 2017-05-05 16:50:58 +07:00
aleos89
a3282c1730 Corrected a compile error
* Follow up to 900548f.
2017-05-04 13:28:06 -04:00
aleos89
900548f34b Corrected a compile warning
* Follow up to a15661e.
2017-05-04 13:20:17 -04:00
Aleos
12756ba8ec Homunculi configuration adjustments (#2092)
* Fixes #2073.
* Homunculi will no longer autoloot items by default.
* Homunculi will not Vaporize if their HP is below 80% when the master dies.
* The battle configuration homunculus_auto_vapor is now a percentage value to allow for further customization.
Thanks to @TheNoobCompany!
2017-05-04 12:28:57 -04:00
Cydh Ramdh
a15661ecfa RE:Initial release script commands for Item Random Options (#2066)
* Added script commands getitem3, getitembound3, makeitem3, rentitem3, countitem3, and delitem3.
2017-05-04 12:11:43 -04:00
aleos89
4bb6aa13a0 Revert "Status Change display in status window (#1481)"
This reverts commit a75133eb4d.
2017-05-04 10:25:44 -04:00
aleos89
9ba2513ff4 Revert "Fixed hidden statuses not being applied"
This reverts commit ef3ad997c7.
2017-05-04 10:24:04 -04:00
Jittapan Pluemsumran
7749c18a06 Prepared the project for mixing C++ code in 2017-05-03 22:32:46 +07:00
Jeybla
cc59048d86 Adjusted Feint Bomb behavior near a Maelstrom Cell. (#2107)
* Feint Bomb near a Maelstrom Cell now matches the official behavior.

Rathena before:
* FB was possible to use near Maelstrom, but didn't trigger an explosion

Now:
* FB fails near Maelstrom, displaying a "skill failed" message.
* It's possible to use FB right after it failed.
2017-05-03 07:54:39 +02:00
Aleos
10b512b859 Updated Giant Fly Wing behavior (#2098)
* Party members should be recalled to their own positions in a 3x3 area around the party leader.
* Added two missing client messages.
* Adjusted script command warpparty to support range values.
* Adjusted script command warpparty to not warp the party leader if "Leader" is passed as the map.
2017-05-02 20:51:26 -04:00
Lemongrass3110
cac27fc3d5 Refactored script_rid2sd (#2062)
It now matches the other script_***2sd or script_***2bl functions.
Also added script_mapid2sd for mapid to map session lookups.
Cleaned up the order of some of the checks in the script functions that used script_rid2sd and sometimes checked the validity of the retrieved session to late or even never at all.
2017-05-03 00:17:46 +02:00
aleos
ef3ad997c7 Fixed hidden statuses not being applied
* Follow up to a75133e.
* Fixes #2111.
Thanks to @Canoe, @Lemongrass3110, and @Jeybla!
2017-05-02 17:33:54 -04:00
rpdigos
07e1a670bc Replaced strcopy with memmove (#2061)
Shortened the original title and commit message a little.
Thanks to @rpdigos!

Original commit message:
When we try to run the application we got the signal Abort trap 6 and the application is interrupted by the OS.
This issue is related with the fact that when using strncpy the source and destination string should not overlap, as we can see in the man page:

man stpncpy()
...
The source and destination strings should not overlap, as the behavior is undefined.

We've replaced it by the function memove:

man memmove()
...
The two strings may overlap; the copy is always done in a non-destructive manner.

Follow ec1fe15d7d
2017-05-02 23:30:47 +02:00
Lemongrass3110
799f781ac2 Fixed MySQL 5.7 compatibility (#2074) 2017-05-02 22:59:05 +02:00
Playtester
b6ff1c6030 Claymore Trap and Blast Mine in Renewal (fixes #1028, fixes #2113)
* Reverted 574f69e
* These traps were already working fine before that commit, so no further changes needed
2017-05-02 20:03:25 +02:00
Jittapan Pluemsumran
cacd98ddeb Merge pull request #2089 from rathena/refactor/windows-build
* Dropped support for VS older than 2012
* Delete all solutions
* Added a new global VS2013 solution (2015+ also supported by this solution)
* Added x64 build support for Windows (Thanks to @Lemongrass3110)
2017-05-02 12:52:39 +07:00
Jeybla
9e6b02ae59 Fixes a getcharid error message. (#2106)
* In quests/quests_morroc.txt Continental Guard.
2017-04-29 19:20:25 +02:00
Lemongrass3110
4a6498665c Enabled x64 in appveyor 2017-04-28 15:13:30 +02:00
Lemongrass3110
be9b13d0bc Removed dbghelp.dll
Follow up to b1881ea by @wilkemeyer
2017-04-28 14:54:48 +02:00
Lemongrass3110
6bbce0f372 Merge branch 'master' into refactor/windows-build
Added all missing import-tmpl copies to the map-server project

# Conflicts:
#	vcproj-10/map-server.vcxproj
#	vcproj-12/map-server.vcxproj
#	vcproj-13/map-server.vcxproj
#	vcproj-14/map-server.vcxproj
2017-04-28 14:38:07 +02:00
Lemongrass3110
07b2ef28a0 Added Visual Studio x64 support
Removed the .dll files for the libraries from the root directory.
They are now copied from the 3rdparty folder when your build finishes and the project requires them.
If you clean your project they will also automatically be removed from the root directory again.

Updated libraries:
MySQL 5.0.20 -> 6.1.9
PCRE 8.30 -> 8.33.0.1 UTF8

Both Win32 and x64 are now supported. Remember to clean and build when you switch the target platform, otherwise you will end up with the wrong .dll files at runtime.
2017-04-28 13:40:08 +02:00
rAthenaAPI
bf2461f2b0 SQL synchronization 2017-04-28 00:43:16 +02:00
Cydh Ramdh
e59cdfff90 RE:Initial release item random option for monster drop (#2065)
* Initial release item random option for monster drop
* To add item for monster with random option group, see 'db/[pre-]re/mob_drop.txt'
* To add item random option group with random option group, see 'db/[pre-]re/mob_item_randomopt_group.txt'
* Default entries for random options are follow iRO Crimson/Scarlet Weapon based on
  * "[Renewal] Episode 15.2 Crimson Weapon System", see http://www.playragnarok.com/news/updatedetail.aspx?id=280&p=1.
  * File uploaded by Oda (iRO's CM) on https://forums.warpportal.com/index.php?/topic/168763-fansitedb-information-distribution-and-request-station/?p=2495922

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

* Follow up 3b7db36288
* Moved `RDMOPTG_Crimson_Weapon` from const.txt to `enum Random_Option_Group` in `itemdb.h`.
* Removed `RDMOPT_WEAPON_ATTR_POISON`, `RDMOPT_WEAPON_ATTR_TELEKINESIS`, and `RDMOPT_WEAPON_ATTR_UNDEAD` from Crimson Weapon random group (`RDMOPTG_Crimson_Weapon`), thanks to @atemo
* Added db header for impot-tmpl files, thanks to @secretdataz

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

* Follow up ac0cdd8dc8
* Fixed type on steal checking

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

* Cleared some drop slot for crimson weapon
2017-04-28 00:43:09 +02:00
Lemongrass3110
31cd394d1d Follow up to 4cfaa18
Removed the duplicated lines
Also removed project dependencies for libconfig and mt19937ar from common-minicore
2017-04-27 11:06:59 +02:00
Jittapan Pluemsumran
4cfaa1817b Removed unneccessary library includes 2017-04-27 15:05:08 +07:00
Jey
cbc3b260c8 Follow up to caed38927a
* Fixed a possible map server crash
* Fixes #2094

Thanks to @spangler88.
2017-04-26 15:03:40 +02:00
Lemongrass3110
4348ef3b89 Added a -D equivalent for msbuild
Fixes appveyor not building in pre-renewal mode
See original commit 15b4050
2017-04-26 03:44:37 +02:00
Lemongrass3110
bfeb697933 Redirected build output into the .vs folder 2017-04-26 03:38:08 +02:00
Lemongrass3110
3995fff863 Updated gitignore for the moved shell scripts
Added some of the new visual studio output files to the ignore list too
2017-04-26 03:18:58 +02:00
Jey
4f99567e41 Channel System message correction
* Follow up to c87dba5.
* Fixed the member limit message pointing to the wrong index.
2017-04-26 03:18:48 +02:00
Lemongrass3110
448e5e893f Moved the bat scripts into the tools folder
Added post build copies and post cleanup deletions for the required bat scripts for each project
2017-04-26 02:58:39 +02:00
Lemongrass3110
5923633ad7 Added deprecation functionality to script engine (#2064)
This commit adds support to deprecate script commands or constants.

Based on the following two commits by @MishimaHaruna
HerculesWS/Hercules@ce85609
HerculesWS/Hercules@6ae9045
2017-04-25 23:43:29 +02:00
aleos89
b4857cca83 Follow up to 452d9c6
* Added missing cases for Midnight Frenzy and Silvervein Rush.
2017-04-25 14:06:12 -04:00
Aleos
452d9c60eb Updated Homunculus S skill failure messages (#2082)
* Fixes #2058.
* Added missing skill failure messages for Homunculus S.
* Eternal Quick Combo can no longer be used on Status Immune monsters.
* Disabled the Style Change message for Eleanor. Aegis does not display a message when switching fighting style.
Thanks to @feltenc and @Jeybla!
2017-04-25 13:33:05 -04:00
aleos89
f1af3210d6 Follow up to eb0a79f
* Fixed Blessing ending Curse before the Curse check.
2017-04-25 12:46:57 -04:00
Jittapan Pluemsumran
fcba7b7213 Added missing EOL in project files 2017-04-25 23:11:58 +07:00
Jittapan Pluemsumran
7fb245b8e6 Updated appveyor.yml to use new solution. 2017-04-25 21:14:43 +07:00
Jittapan Pluemsumran
da36b26572 Remove rAthena-15.sln 2017-04-25 21:05:30 +07:00
Jittapan Pluemsumran
f9a0f81d4e Resolve compile errors 2017-04-25 21:05:18 +07:00
Jittapan Pluemsumran
96073607bf Merge branch 'master' into refactor/windows-build
# Conflicts:
#	vcproj-10/char-server.vcxproj
#	vcproj-10/char-server.vcxproj.filters
#	vcproj-10/login-server.vcxproj
#	vcproj-10/map-server.vcxproj
#	vcproj-10/map-server.vcxproj.filters
#	vcproj-10/mapcache.vcxproj
#	vcproj-12/char-server.vcxproj
#	vcproj-12/char-server.vcxproj.filters
#	vcproj-12/login-server.vcxproj
#	vcproj-12/map-server.vcxproj
#	vcproj-12/map-server.vcxproj.filters
#	vcproj-12/mapcache.vcxproj
#	vcproj-13/char-server.vcxproj
#	vcproj-13/char-server.vcxproj.filters
#	vcproj-13/login-server.vcxproj
#	vcproj-13/map-server.vcxproj
#	vcproj-13/map-server.vcxproj.filters
#	vcproj-13/mapcache.vcxproj
#	vcproj-14/char-server.vcxproj
#	vcproj-14/char-server.vcxproj.filters
#	vcproj-14/login-server.vcxproj
#	vcproj-14/map-server.vcxproj
#	vcproj-14/map-server.vcxproj.filters
#	vcproj-14/mapcache.vcxproj
#	vcproj-9/char-server.vcproj
#	vcproj-9/dbghelpplug.vcproj
#	vcproj-9/login-server.vcproj
#	vcproj-9/map-server.vcproj
#	vcproj-9/mapcache.vcproj
2017-04-25 21:00:33 +07:00
rAthenaAPI
f56a3f6d1e SQL synchronization 2017-04-25 15:50:12 +02:00
Arashi
a040a52764 Fixed some Armors wLV and refineables (#2077)
Fixed armors level 1 weapons
Fixed accessories and lower headgears being refinable

Thank you @crazystorm2017 !
2017-04-25 15:50:05 +02:00
Jeybla
a7c682ff12 Adjusted skill_nocast_db settings. (#2081)
For the following skills:
* SC_MANHOLE - PvP only
* SC_DIMENSIONDOOR - town and field, doesn't work in PvP
* SC_CHAOSPANIC - No restriction
* SC_BLOODYLUST - Enabled in town

Fixes #1496.

Thanks to @Everade and @aleos89.
2017-04-25 14:37:44 +02:00
Lemongrass3110
cdc0527b71 Converted some scripts to warps (#1947)
Credits to @Atemo!
2017-04-24 23:54:43 +02:00
aleos89
c3ad04dc90 Channel System message correction
* Follow up to c87dba5.
* Fixed the join message pointing to the wrong index.
Thanks to @CairoLee!
2017-04-24 10:18:51 -04:00
Cydh Ramdh
c87dba5a52 Channel System is Expanded! (#1933)
* Many changes on conf/channel.conf!
- Now capable of setting default values for channels through the config such as the channel name, channel password, member capacity, chat color, chat delay, and more.
* Many new channel script commands!
- Added script commands channel_create, channel_setopt channel_setcolor, channel_setpass, channel_setgroup, channel_chat, channel_ban, channel_unban, channel_kick, and channel_delete.
2017-04-19 14:12:00 -04:00
rAthenaAPI
97f989f7d8 SQL synchronization 2017-04-19 10:36:12 +02:00
Akkarinage
25da0fe4fd NPC ID Updates (#2075)
Also added new commented Mob IDs to mob_db.txt

Signed-off-by: Akkarinage <akkarin@rathena.org>
2017-04-19 10:36:05 +02:00
Akkarinage
58bad46c32 Misc grammar changes to documentation.
Signed-off-by: Akkarinage <akkarin@rathena.org>
2017-04-19 03:13:17 +01:00
Akkarinage
33c31ca368 Updated default PACKETVER
It makes no sense to use 20130807 as the default PACKETVER when we use 55 (20151104) as the default packet_ver in /db/packet_db.txt

Signed-off-by: Akkarinage <akkarin@rathena.org>
2017-04-18 15:23:43 +01:00
rAthenaAPI
e18d636d79 SQL synchronization 2017-04-17 23:03:14 +02:00
aleos
38e0496027 Removed empty script check for usable items
* Fixes #2069.
* Usable items that don't have a script will now execute as normal.
* Items that have a special effect with no script were not displaying their effect since the check was stopping any execution.
* Cleared up some usages of script command end.
Thanks to @LiamKarlMitchell!
2017-04-17 17:03:03 -04:00
Aleos
a75133eb4d Status Change display in status window (#1481)
* Adjusted the way some status changes display in the player's status window.
- Some status changes are hidden from the display.
* Katar critical bonus is no longer shown in the status window.
- Added a configuration to enable or disable the critical display for Katars.
* SC_INCCRI now has doubled critical rate while wearing Katars. Thanks to @Limestone!
* Refactored some status_calc_* functions to no longer be static and moved them to the header.
2017-04-14 23:56:34 -04:00
Lemongrass3110
ed24be1625 Cleaned up MAPID definitions
Fixed the wrong initialization for baby summoner, who was actually a baby swordman summoner like this.
Follow up to 39e54d6
2017-04-14 23:34:25 +02:00
rAthenaAPI
ccefbd9ece SQL synchronization 2017-04-14 22:38:31 +02:00
Lemongrass3110
7d20033d5d Added support for the latest NPC IDs 2017-04-14 22:38:19 +02:00
hazimjauhari90
ad0731fec1 follow up to 39e54d6 (#2056)
* Corrected Baby Kagerou/Oboro & Baby Rebellion base level to match respective adult base level.
2017-04-14 12:26:15 -04:00
Lemongrass3110
2029f2e708 Added constants for new baby jobs
Follow up to 39e54d6
2017-04-14 09:44:04 +02:00
Lemongrass3110
384917b83f Added current_equip_item_index check
getrefine and getequipweaponlv(-1) should only be useable within item scripts.
2017-04-14 00:17:23 +02:00
aleos
800f49181f Pain Killer damage correction
* Added a check so Pain Killer damage doesn't heal targets.
Thanks to @Jeybla!
2017-04-12 22:37:25 -04:00
aleos
caed38927a Updated Feint Bomb to match official behavior
* Fixes #728 and fixes #1070.
* Players can no longer use skills while in the hidden state from Feint Bomb.
* Targets will now properly release the caster as a target and follow the bomb.
Thanks to @Tokeiburu, @MrAntares, and @stealth62!
2017-04-12 16:41:27 -04:00
Atemo
c098d0c518 Fixed wrong condition in monk.txt issue #2057
Thanks @TheNoobCompany !
2017-04-12 20:42:25 +02:00
aleos
1261d92c43 Corrected Feint Bomb behavior (fixes #1999)
* Feint Bomb will no longer give players permanent effects of AoE when they backslide into them.
* Feint Bomb no longer consumes 1 SP every second while hidden.
* Stealth Field will now apply to all targets, not just allies (party + guildmates).
* Miscellaneous cleanups for Neutral Barrier and Stealth Field.
Thanks to @feltenc!
2017-04-11 21:17:23 -04:00
Akkarinage
9af37d21b7 Removed ancient SQL Upgrade files.
* Old SVN upgrades are no longer needed.
* Retained the last 3 years of upgrades.

Signed-off-by: Akkarinage <akkarin@rathena.org>
2017-04-11 17:58:18 +01:00
hazimjauhari90
b7d802ad55 follow up to 39e54d6 (#2054)
* Fixed job name display for baby expanded jobs.
2017-04-10 19:49:44 -04:00
Lemongrass3110
100d71e659 Remove password outputs on login server console (#2052) 2017-04-11 00:23:03 +02:00
Lemongrass3110
780ebd16db Fixed debug output for missing char server tables 2017-04-10 22:02:35 +02:00
Liam Mitchell
398619556a Update dts_warper.txt moc_ruins wrong id. (#2038)
* Update dts_warper.txt moc_ruins wrong id.

Wrong display ID and directions.
#2037

* Tweaked dts_warper.

According to what @Atemo said in issue #2037
2017-04-10 19:04:58 +02:00
aleos
0c2ccc77c7 Added script command getfreecell
* The command can randomly find a free cell on the given map and store the references to the found cell in the given variables.
* Check out the script commands documentation for more information.
Thanks to @Tokeiburu!
2017-04-10 10:45:33 -04:00
rAthenaAPI
425c0a6f09 SQL synchronization 2017-04-10 16:33:11 +02:00
hazimjauhari90
f57f3e7db1 Added missing quest ID in quest_db.txt (#2033)
* Added missing quests to the quest database
2017-04-10 10:33:04 -04:00
aleos
4b9ade33ee Fixed sleep timers getting freed twice
* Fixes #2042.
Thanks to @Encon21!
2017-04-06 21:01:08 -04:00
aleos
d6594eefda Re-link monster drop data with item data
* Fixes script commands addmonsterdrop and delmonsterdrop to update the monster drop data that is stored within the item data struct.
* This refreshes atcommand whodrops and other functions that use this data.
Thanks to @technoken!
2017-04-06 18:42:27 -04:00
hazimjauhari90
39e54d65bb Expanded baby jobs (#2039)
* Added support for expanded baby jobs.
* All jobs listed below are now fully playable.
- Baby Summoner
- Baby Ninja
- Baby Kagerou
- Baby Oboro
- Baby Taekwon
- Baby Star Gladiator
- Baby Soul Linker
- Baby Gunslinger
- Baby Rebellion
2017-04-06 18:00:30 -04:00
Jeybla
72fe4cd515 Adds chatmes (scriptcommand). (#1924)
* Adds chatmes script command.
* chatmes writes a given message to the waitingroom of the NPC.
2017-04-06 17:55:58 -04:00
Atemo
73b798bf12 Removed extra semi-colon 2017-04-06 14:40:36 +02:00
Lemongrass3110
ec1fe15d7d Fixed an error with renewal table loading
Follow up to 5d22e1c
Fixes #2040
Thanks to @Yuchinin
2017-04-05 22:33:15 +02:00
Lemongrass3110
5d204e55d3 Merge branch 'master' of https://github.com/rathena/rathena 2017-04-05 21:57:20 +02:00
Playtester
0a35e3a976 Bomb used by monsters (fixes #2041)
* When Bomb used by monsters deals damage, it is now always considered melee damage
2017-04-05 17:37:50 +02:00
Atemo
a6b252c01e Added rid check in SaraMemory.txt (issue #2032) 2017-04-04 19:20:26 +02:00
Lemongrass3110
858634112c Merge branch 'master' of https://github.com/rathena/rathena 2017-04-03 22:39:06 +02:00
Lemongrass3110
3cce333fc6 Added cash shop support for 2012-04-10
Fixed #1982
Thanks to @anacondaqq!

These packets were actually added way before this client date, but for now this is the earliest packet version, where we support the cash shop for now.
2017-04-03 22:35:11 +02:00
Lemongrass3110
c218eb6120 Fixes #2022 (#2023)
Thanks to @Joy-Ro
2017-04-03 22:12:28 +02:00
Lemongrass3110
f45f9efda0 Merge branch 'master' of https://github.com/rathena/rathena 2017-04-03 22:01:13 +02:00
Playtester
4369b4715b Fixed compiler warning (follow-up to 5d90380) 2017-04-03 20:40:09 +02:00
Playtester
5d90380fcc Claymore Trap, Blast Mine, Land Mine renewal damage (fixes #2036)
- Fixed a rounding issue when calculating trap damage
2017-04-03 20:33:55 +02:00
rAthenaAPI
6d58946864 SQL synchronization 2017-04-03 15:31:27 +02:00
Jeybla
f0b7feb3f6 Makes Breeze Armor (Shadow) 24024 refineable. (#2034) 2017-04-03 15:31:22 +02:00
Atemo
82967fceb4 Updated doc/sample/instancing.txt follow up cb703c5bfa 2017-04-01 16:42:39 +02:00
Aleos
e655a73815 Corrected a random option warning
* Fixed a small typo in the itemdb_read_randomopt.
2017-03-31 12:40:53 -04:00
aleos89
c1ef0aa4ce Fixed invalid vending items being saved
* Fixes #2030
* Resolves a potential case of an invalid item being saved to the vending table resulting in a random item being sold for 0 zeny.
Thanks to @Tokeiburu!
2017-03-31 12:24:24 -04:00
Lemongrass3110
2a7fecbe24 Merge branch 'master' of https://github.com/rathena/rathena 2017-03-28 22:59:24 +02:00
Aleos
ebc39cda6b Follow up to 5fa2db9 2017-03-28 15:57:43 -04:00
Lemongrass3110
92b4a56919 Follow up to 11f5009
Sorry I should not rush.
2017-03-28 19:41:44 +02:00
Lemongrass3110
3b225f6f0c Rebase 2017-03-28 19:39:38 +02:00
Lemongrass3110
11f5009e82 Partial revert of b8d1dc6
Sorry guys.
2017-03-28 19:38:51 +02:00
Lemongrass3110
5fa2db993d Fixed #2028 2017-03-28 19:36:40 +02:00
Lemongrass3110
b8d1dc6b14 Fixed #2027
Thanks to @RadianFord
2017-03-28 19:34:55 +02:00
Atemo
0b5687db13 Fixed a typo in GeffenMagicTournament.txt issue #2002
Thanks to @srhmike
2017-03-27 18:35:42 +02:00
Radian
12ee8aa2a7 Updated alternate 3rd job bodystyles (#2021)
* Added Shadow Chaser, Minstrel, and Wanderer classes to the bodystyle atcommand.
Thanks to @RadianFord and @admkakaroto!
2017-03-27 11:23:24 -04:00
Lemongrass3110
6eb4cc408f Fixes #2004
Thanks to @daisyanne1380

Make sure to make a backup of your tables' content before running the upgrade script - in case of any conversion problems that might occur.
2017-03-27 00:31:02 +02:00
Lemongrass3110
55e445b588 Fixes #2005
Thanks to @cold-hr for reporting and @anacondaqq for the fix.
2017-03-26 22:50:52 +02:00
Atemo
08338e0a64 Summoner Eden Group Equip Quest Implementation
Edit from PR https://github.com/rathena/rathena/pull/1152
Credit @MysticFurur0RE
2017-03-22 21:43:08 +01:00
Atemo
f581d26c21 Partial fix of issue #2002 (cannot access instance variable "'ins_nyd2") 2017-03-22 21:30:33 +01:00
hazimjauhari90
29b06700ff Fixed job name display (#2013)
* Corrected job_name conversions because of the gap created from special event jobs.
Thanks to @hazimjauhari90!
2017-03-22 14:21:47 -04:00
Atemo
17a273864a Added missing quest ID in quest_db.txt (issue #2012)
Partial fix of issue #2002, Incorrect use of 'close' command in quests_eclage.txt
2017-03-20 15:30:46 +01:00
rAthenaAPI
744042066b SQL synchronization 2017-03-20 02:07:34 +01:00
Cydh Ramdh
870001c755 * Changed getexp to getexp2 for pre-re items.
* Fixed #2001
  * Novice Fly Wings (12323) now cannot be used in `noteleport` map
  * Novice Butterfly Wings (12324) now cannot be used in `noreturn` map

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2017-03-20 08:06:31 +07:00
Mr.Akarachai Jaitrong
61ff2512e6 Update main.sql (#2006)
* Added SQL table creation checks for db_roulette, clan, and clan_alliance tables.
Thanks to @ex0ample!
2017-03-17 11:30:34 -04:00
Playtester
8f82d046c0 Monsters placing traps (see #1998)
* Monsters can no longer place traps on themselves, the skill will fail
2017-03-08 22:34:44 +01:00
Akkarinage
08e862c0e0 Removed Doxygen related files, since we no longer use it.
Signed-off-by: Akkarinage <akkarin@rathena.org>
2017-03-07 21:29:14 +00:00
aleos89
601857819f Added missing Quest DB entries (fixes #1997)
* Added missing Thor Volcano Base Camp quest database entries.
Thanks to @Indigo000!
2017-03-07 10:45:47 -05:00
Atemo
f6488a2a9e Corrected a warp destination typo in The Sign quest (credit c215c9c21a) 2017-03-06 23:26:10 +01:00
Atemo
c6e09fdf35 Added parenthesis in tu_ma_th01.txt 2017-03-06 23:21:05 +01:00
Jittapan Pluemsumran
1a233da1ab Removed an extra semicolon in kafras.txt 2017-03-06 18:26:14 +07:00
Lemongrass3110
800f22b77b Removed an unused character variable
Fixes #1976
2017-03-02 23:20:45 +01:00
Lemongrass3110
43ba736401 Follow up to 7ecaf8b
Fixed a typo
2017-03-02 22:30:26 +01:00
Lemongrass3110
7ecaf8bc74 Added support for 0xa3d 2017-03-02 22:28:00 +01:00
Playtester
40f6b7f44a Taekwon Kick Damage, Sprint, Flying Kick (fixes #1991)
* Taekwon Kicks no longer get a percentual damage increase from learning Sprint
* Counter Kick, Heel Drop, Storm Kick and Counter Kick now get a +10 ATK bonus per level of Sprint
-- This bonus is on top of the normal +10 ATK bonus from Sprint for fists
* Using Flying Kick as a counter will now deal 4%*baselevel damage
* Using Flying Kick while running will now deal 4%*baselevel damage regardless of skill level used
-- When having the spurt buff on top, it will deal 8%*baselevel damage instead
* Tumbling is now properly removed on logout
* Fixed a problem that sometimes caused Tumbling to become unusable
2017-03-02 21:23:33 +01:00
Lemongrass3110
da23d877d1 Fixed a compiler warning
Fixes #1988
Thanks to @cold-hr
2017-03-01 09:42:36 +01:00
Atemo
4270ef876d Fixed #1981 Clearchus Mercenary Npc
- Delete / give the quest when the time limit has been reached
2017-02-24 12:42:09 +01:00
Matheus Macabu
4a2964f763 Fixed some misc. stuff (#1974)
* Empty string checking
* Unsigned/signed variables changed to fit their context
* Assignment order within if clause
* hom_is_active already checks for sd->hd
* Fixed SC_MDEFSET being set by the wrong condition
* channel_ajoin inner for has same iter variable as outer
2017-02-23 10:14:21 -05:00
aleos
8bdaf1e920 Small VIP cleanups
* Adjusted default battle_config struct values to match the configuration file.
* Follow up to 251c400 to clean up the VIP Gemstone check.
2017-02-21 20:51:17 -05:00
aleos
251c40061b Expanded VIP Gemstone configuration (fixes #1975)
* Expanded the VIP Gemstone configuration so it has the following options:
- 0 = Disabled
- 1 = Behave like Mistress Card
- 2 = Remove all gemstone requirements (default)
2017-02-21 20:27:57 -05:00
aleos
2931b76b7b Adjusted check to remove prereqs from skill_tree
* Fixes #1973.
* Setting a prerequisite skill to 0 will now remove it rather than skip it in the skill_tree import.
Thanks to @KrokusPokus!
2017-02-20 09:02:43 -05:00
rAthenaAPI
d20c6b5080 SQL synchronization 2017-02-19 17:58:42 +01:00
aleos
987901f2f7 Corrected Shoes of Valor bonus (fixes #1966)
* Changed bonus skill from Heal level 1 to Increase Agility level 1.
Thanks to @hendra814 and @cydh!
2017-02-19 11:58:27 -05:00
aleos
3d711607b0 Follow up to 8492f6c
* Moved the knockback check to the correct location.
Thanks to @Everade!
2017-02-18 17:13:43 -05:00
aleos
6c0debb9ba Increased the integer storage type for EXP
* Adjusted the homunculus and mvplog tables to support increased EXP amounts.
2017-02-18 15:30:29 -05:00
Lemongrass3110
03ffd99c4d Fixed cashshop removal issue
Fixes #1971
Thanks to @RadianFord
2017-02-17 09:42:37 +01:00
Lemongrass3110
93f74cf567 Fixed the day of the year function 2017-02-16 20:48:36 +01:00
Lemongrass3110
eebbf1de93 Fixed a compile warning on centos
Fixes #1969
Thanks to @technoken
2017-02-16 17:58:11 +01:00
Lemongrass3110
aaa4ea919e Initial release of the cash shop sales (#1825)
Added a permission for the cashshop sales

Thanks to @Angelic234 and everyone else who tested this feature while it was sleeping waiting in a pull request.
Thanks to @aleos89, @secretdataz and @lighta for reviewing and commenting.
2017-02-15 14:04:18 +01:00
Lemongrass3110
7cf081c24b Fixed character rename feature (#1943)
This feature was broken for clients after 2011-11-01.
Added 2 new options for allowing it when the character is inside a party or guild.
The server now delivers the corresponding error messages if the player is inside a party or guild.
2017-02-15 13:06:31 +01:00
Lemongrass3110
2f659e419f Fixed invalid damage on WoE maps
Fixes #1951
Thanks to @keitenai
2017-02-14 22:39:42 +01:00
Aleos
afa880ebd6 Remove sleep timers when a script is unloaded (#1956)
* Fixes #1791 and fixes #1792.
* Removes sleep timers that are active when a script is unloaded from memory.
* Make sure duplicate NPC are properly removed.
Thanks to @exneval and @Tokeiburu!
2017-02-14 13:13:53 -05:00
aleos89
66cfa0618e Updated Issue and Pull Request templates
* Added HTML comment tags around descriptions.
* These descriptions will now be hidden on the preview of the Issue/Pull Request.
2017-02-14 12:41:09 -05:00
Aleos
5d22e1cf48 Cleaned up processing of secondary tables (#1946)
* Cleaned up processing of secondary tables
* Fixes #1934.
* Renewal and Pre-Renewal secondary tables are now properly loaded depending on the server mode.
* Includes item, monster, and monster skill tables.
Thanks to @Lemongrass3110 and @daisyanne1380!
2017-02-13 13:09:40 -05:00
Akkarinage
196017c9c4 Batch file for Windows Mapcache users
* Closes #1908
Signed-off-by: Akkarinage <akkarin@rathena.org>
2017-02-13 17:36:27 +00:00
aleos
0c20c596e0 Expanded script command setbattleflag
* Fixes #1945.
* Adds an optional flag to reload the monster database for specific map flags that are EXP/drop related.
* This resolves having to add atcommand reloadmobdb after setting the battle configs.
* Adjusted atcommand setbattleflag to also have the optional parameter.
* The reload should only have to be called on the final setbattleflag use.
2017-02-11 20:55:35 -05:00
aleos
ca051d185e Removed Freezing and Crystalize from OPT1
* Fixes #1955.
* Freezing and Crystalize are no longer considered Body Status Changes (OPT1).
* They are now stackable with other non-OPT1 statuses.
* Crystalize now works on monsters.
* Crystalize no longer has a Wind element damage bonus.
* Targets under Crystalize and Deep Sleep no can no longer consume items.
* Targets under Stun and White Imprison can no longer be affected by OPT1 statuses.
* Freezing no longer removes Burning.
Thanks to @FrFrMako, @Playtester, and Fyrus!
2017-02-10 17:45:33 -05:00
aleos
ce1429d4ff Merge branch 'master' of https://github.com/rathena/rathena 2017-02-07 19:39:56 -05:00
aleos
431f30aad4 Correct Cloud Kill Poison resistance
* Fixes #1948.
* Poisoning effect from Cloud Kill is now able to be resisted.
Thanks to @alxalmora!
2017-02-07 19:39:40 -05:00
Jeybla
3b5699eb46 Added some missing string escapes (#1869) 2017-02-07 22:36:09 +01:00
Lemongrass3110
c770990973 Added better documentation for skill splash range
This was brought up because of #1940.
Thanks to @Joy-Ro
2017-02-07 00:27:52 +01:00
Lemongrass3110
cc3b39c085 Added the packet db entry for 0x0A0E
Fixes #1918
Thanks to @mrjnumber1
2017-02-06 23:44:23 +01:00
Lemongrass3110
068d18c9d7 Fixed market shop weight calculation
Fixes #1897
Thanks to @Angelic234
2017-02-06 23:30:05 +01:00
rAthenaAPI
f2c27a86cb SQL synchronization 2017-02-06 22:24:53 +01:00
Jeybla
e1e2bfa7a3 Fixes Queen Scaraba Card (#1937)
Fixes #1935
2017-02-06 22:24:47 +01:00
Lemongrass3110
4623d376d0 Another follow up to d99c914 2017-02-05 19:58:57 +01:00
Matheus Macabu
aa7de205fe Update name for all party members on rename (#1715) 2017-02-05 19:52:31 +01:00
Lemongrass3110
90e3f89df2 Follow up to d99c914
Thanks to @RadianFord and @CairoLee
2017-02-04 17:43:50 +01:00
Lemongrass3110
7377f0f674 bindatcmd now supports the new event name length 2017-02-04 00:03:40 +01:00
Aleos
d99c91418a Cleaned up character saving (#1911)
* Fixes #1910.
* Changed chrif_save option to readable constant values.
* Added new Inventory and Cart options so that normal character save calls aren't flooded with requests to save Inventory and Cart data.
* Cleaned up storage and premium storage saving functions being unused.
2017-02-03 10:25:46 -05:00
aleos89
52f9bf63af Fixed Cart Weight calculation (fixes #1938)
* Resolves Cart weight not getting recalculated when using atcommand resetskill.
Thanks to @Hactus and @Tokeiburu!
2017-02-03 10:17:21 -05:00
Cydh Ramdh
ae182ef6a8 Fixed a broken character in skill.c's comment
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2017-02-03 21:09:21 +07:00
Jeybla
929384cead Fixes AgitEnd2 Scriptcommand. (#1936)
OnAgitEnd2 events were not triggered by using the AgitEnd2 script command.

Follow up to 2043c95
2017-02-03 08:38:15 +01:00
aleos
c853ef0303 Backslide against walls (fixes #1914)
* Backslide animation is not shown when the player is against a wall.
* SP is still consumed as normal.
Thanks to @zackdreaver!
2017-02-02 18:07:37 -05:00
aleos89
778e96e475 Follow up to 84df170
* Fixes a wrong status icon being set to a status change.
2017-02-02 13:44:05 -05:00
rAthenaAPI
8a95bc5aba SQL synchronization 2017-02-02 18:19:23 +01:00
aleos89
84df1708ee Added missing Elemental Resist Potion icon
* Fixes #1898.
* Separated the SC_ARMOR_ELEMENT to each element (Water, Earth, Fire, Wind).
* Added the status icon for the respective element.
Thanks to @zackdreaver!
2017-02-02 12:19:04 -05:00
aleos89
bb42b3183c Added missing SCB for Geffen Magic statuses
* SC_GEFFEN_MAGIC1, SC_GEFFEN_MAGIC2, and SC_GEFFEN_MAGIC3 were missing their SCB_ALL flags.
2017-02-02 09:53:29 -05:00
aleos
320bf9073b Fixed VIP gemstone requirement setting (fixes #1846)
* Resolves the VIP gemstone requirement setting get reset on each status_calc_pc.
* Removed some duplicate code during gemstone avoidance calculation.
Thanks to @Everade!
2017-01-31 20:05:15 -05:00
aleos89
baa91f834c Follow up to 4af46ba and e8b9cf0
* Ensures all instances of players disconnecting from the server has their shop removed.
2017-01-31 13:37:02 -05:00
Jeybla
e31428df64 Conf: hide favorite items while selling to NPCs (#1925)
Added a configuration for hiding favorite items in the sell menu.

Thanks to @Jeybla!
2017-01-31 13:55:01 +01:00
aleos
fa443eee30 Adjusted Meteor Assault interaction with EDP
* Fixes #1885.
* Enchant Dead Poison no longer increases Meteor Assault damage on renewal.
Thanks to @alxalmora and @Playtester!
2017-01-30 20:23:12 -05:00
aleos
e8b9cf06ce Follow up to 4af46ba
* Added a map session data check back into the GM kick process so atcommand kickall does not remove vendors or buyingstores.
* Adjusted the checks for when a player logs back into their account so it properly removes any vending or buyinstore information.
2017-01-29 15:10:42 -05:00
aleos
4af46ba8c2 Fixed vending/buyingstore info not being removed
* Fixes #1921.
* Resolves vending and buyinstore information not being removed from the SQL tables when a player is kicked.
Thanks to @Tokeiburu!
2017-01-29 12:22:04 -05:00
aleos
cb72a89fd5 Added battle config pet_master_dead (fixes #1916)
* Added a new battle config that will allow or disallow (default) a pet to continue attacking its target if the master is dead.
Thanks to @technoken!
2017-01-29 10:36:53 -05:00
aleos
bfab00a3c3 Fixed Vanish damage interaction with some skills
* Fixes #1721.
* Devotion and Shadow Form damage bypass Vanish damage.
Thanks to @jamon18!
2017-01-28 11:29:01 -05:00
aleos89
6e9cd4404a Amended script command checkweight documentation
* Fixes #1917.
* Second example is about arrays and should use script command checkweight2.
Thanks to @lucasoli!
2017-01-26 09:05:02 -05:00
aleos
10c4bacab5 Follow up to 6542773
* Added an alias for atcommand reloadnpcfile -> reloadnpc.
2017-01-25 20:53:07 -05:00
aleos
706345f56f Revamped script command setunitdata (fixes #1903)
* Resolved mobs having certain stats getting reset to their database value when the mob's status is recalculated.
* Resolved some monster, homunculus, mercenary, and elemental stats not properly recalculating when setting the unit data.
Thanks to @technoken and @Tokeiburu!
2017-01-25 20:48:24 -05:00
rAthenaAPI
b26793f2b1 SQL synchronization 2017-01-25 20:20:06 +01:00
Atemo
dfaee699fb Fixed bugs in Bangungot Hospital instance (issue #1504) (effects, warps, announce..) 2017-01-25 20:19:47 +01:00
Atemo
7e2dedc828 Corrected areamonster from aegis conversion 2017-01-25 20:04:41 +01:00
aleos89
65427737bf Follow up to 9c2026d
* Renamed atcommand reloadnpc to reloadnpcfile.
* Adjusted documentation to fit.
2017-01-25 13:48:37 -05:00
aleos89
9c2026d216 Fixed atcommands for NPC loading (fixes #203)
* Resolves atcommand loadnpc not working in sequence with atcommand unloadnpc multiple times on the same NPC.
* Added atcommand reloadnpc.
Thanks to @Tokeiburu!
2017-01-25 13:06:45 -05:00
aleos89
0b2e0cc3fd Adjusted Crush Strike duration (fixes #1900)
* Lowered Crush Strike's duration from 3 minutes to 30 seconds.
Thanks to @zackdreaver!
2017-01-25 10:38:30 -05:00
aleos89
10af42f488 Cleaned up Pull Request Template
* Removed HTML break tags.
* Added blank line to end of Issue Template.
2017-01-24 14:17:18 -05:00
Lemongrass3110
08d55d80f5 GTB should not block Masquerade status changes (#1905)
* Fixes #1901
Thanks to @zackdreaver and @RagnarokNova!
2017-01-24 12:04:32 -05:00
Jittapan Pluemsumran
14b381dcc7 Initial Release of Guild Daily Mission (#1582)
* Implemented Guild Daily Mission
Thanks to @cydh, @Atemo, and @Lemongrass3110 for their help!
2017-01-24 10:47:20 -05:00
Atemo
09cbf2dfa6 Follow up a63604d92a
The display name of the NPC won't get appended in front of the message for globalmes script command.

Corrected area monsters spawn in Nydhoggr's Nest Instance
2017-01-22 19:14:19 +01:00
aleos
7543f1cba7 Resolved a potential map-server crash
* Fixes #1839, fixes #1844, and fixes #1882.
* Resolves players at login attempting to calculate their statuses who haven't been fully loaded.
* Added a new state flag to make sure inventory and status data is loaded before player's statuses are calculated.
Thanks to @Tokeiburu, @Everade, and @MrAntares!
2017-01-22 13:03:46 -05:00
Atemo
c6470ff4ff Clean-up permanent monster spawn: (#1831)
* Clean-up permanent monster spawn:
- <delay1>,<delay2>,<event> are actually optionnal field
- <event> value 0 and 1 are meaningless (actually event name with length < 4 are skipped)

* Exported monster AI constants

* Updated docs for monster size constants (already exported)
Notes:
- the default size for monster script cmd was small not medium
- monster script cmd now display a warning for size above SZ_BIG (previously SZ_ALL)

* - Fixed an issue to make <xs> and <ys> optionnals
- Updated npcs scripts

* Leftover in the docs for permanent monster spawn

* Corrected english docs. Credit to @aleos89
Added additionnal warning for xs / ys negative input. Credit @Lemongrass3110 

Thanks to @cydh for the idea
2017-01-22 19:03:08 +01:00
Lemongrass3110
047ef1263b Fixed 2 compiler warnings on PACKETVER < 20110111 2017-01-19 22:05:11 +01:00
Lemongrass3110
9cd1ea4ebe Fixed wrong output in itemdb_read_itemdelay 2017-01-19 14:52:59 +01:00
aleos
d8768e4cae Cleaned up the colored messages (fixes #1855)
* Removed redundant clif_colormes and clif_messagecolor2 functions.
* Changed all clif_disp_onlyself to clif_messagecolor.
* Resolves several places around source using the 0x17F packet which now has a display toggle for Guild Chat resulting in these messages not related to Guild Chat not displaying.
* Added COLOR_LIGHT_GREEN to imitate the Guild Chat color.
2017-01-18 17:20:25 -05:00
rAthenaAPI
b0f8426e34 SQL synchronization 2017-01-18 16:06:50 +01:00
aleos89
2c4cd07af0 Corrected script command atcommand (fixes #1894)
* Resolves the map ID being stored instead of the map index when a dummy player is used.
Thanks to @Tokeiburu!
2017-01-18 10:06:37 -05:00
Lemongrass3110
b3112553b5 Added a missing zeroes for SQL synchronization
Follow up to c6ab722
2017-01-18 09:50:01 +01:00
rAthenaAPI
5a661cb136 SQL synchronization 2017-01-18 03:25:19 +01:00
Atemo
c6ab72207e Horror toy factory (#1813)
* Initial release of Horror Toy Factory instance.
Thanks to @aleos89, @secretdataz, @Lemongrass3110
Took some part from 52f6420abc
Credit @exneval

Todo : implement NPC_HELLBURNING skill
2017-01-18 03:25:12 +01:00
Lemongrass3110
7416ad79fd Fixed Emperium attack checks for slaveclones
Fixes #1890
2017-01-17 20:02:57 +01:00
Lemongrass3110
60652e2001 Fixed event OnBreakGuild not being triggered
Fixes #1888
Thanks to @guilherme-gm
2017-01-17 19:42:09 +01:00
Lemongrass3110
633d50fa72 Atcommand clanspy 2017-01-16 23:36:52 +01:00
aleos
961a945345 Issue Template cleanup
* Follow up to 414841a.
* Removed the HTML break tags.
2017-01-16 16:06:54 -05:00
Cydh Ramdh
414841a88b Add CONTRIBUTING.md, ISSUE_TEMPLATE.md, and PULL_REQUEST_TEMPLATE.md (#1688)
* Adds the contributing templates.
* Put the contributing files to a hidden folder so the root directory is less populated.
Thanks to @cydh and @Lemongrass3110!
2017-01-16 15:15:39 -05:00
Lemongrass3110
d6daffe737 Fixed aftercast animation of Coluceo Heal
Fixes #1884
Thanks to @Tokeiburu
2017-01-15 23:32:04 +01:00
Lemongrass3110
c09ce192f6 Updated renewal skill tree (#1740)
Updated pre-renewal accordingly(Only for renewal jobs and skills!)
2017-01-15 23:11:54 +01:00
Lemongrass3110
06c40e6cb4 Updated renewal skill SP costs (#1742)
Updated pre-renewal accordingly(only for renewal jobs!)
2017-01-14 22:19:54 +01:00
Lemongrass3110
958476f6ce Repaired line endings in logs.sql 2017-01-14 19:32:14 +01:00
rAthenaAPI
dd804c3dfe SQL synchronization 2017-01-14 19:28:01 +01:00
Lemongrass3110
a6f8dd5f61 Fixed Unity Guard and Buckler
Fixes #1880
Thanks to @sigtus
2017-01-14 19:27:42 +01:00
vstumpf
11f0a1f9d1 Clan Chat logging is now available 2017-01-14 17:47:36 +01:00
rAthenaAPI
c9cfc591df SQL synchronization 2017-01-14 08:34:20 +01:00
zackdreaver
07eb5ea810 Renewal item db update (#1848)
* Renewal item db update:
- Small fixes and cleanup
Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add itemID 5978 http://www.divine-pride.net/database/item/5978

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Update itemID 18564 scripts http://www.divine-pride.net/database/item/18564

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add itemID 18877 http://www.divine-pride.net/database/item/18877

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Update itemID 19116 scripts http://www.divine-pride.net/database/item/19116

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add itemID 20510 scripts http://www.divine-pride.net/database/item/20510

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add Unity gears
Unity_Violin http://www.divine-pride.net/database/item/1941,
Unity_Whip http://www.divine-pride.net/database/item/1995,
Unity_Two-Handed_Staff http://www.divine-pride.net/database/item/2025,
Unity_Revolver http://www.divine-pride.net/database/item/13129,
Unity_Huuma_Shuriken http://www.divine-pride.net/database/item/13329,
Unity_Sword http://www.divine-pride.net/database/item/13456,
Unity_Dagger http://www.divine-pride.net/database/item/13457,
Unity_Mail http://www.divine-pride.net/database/item/15152,
Unity_Mantle http://www.divine-pride.net/database/item/15153,
Unity_Suit http://www.divine-pride.net/database/item/15154,
Unity_Robe http://www.divine-pride.net/database/item/15155,
Unity_Mace http://www.divine-pride.net/database/item/16048,
Unity_Bow http://www.divine-pride.net/database/item/18132,
Unity_STR_Manteau http://www.divine-pride.net/database/item/20780,
Unity_AGI_Manteau http://www.divine-pride.net/database/item/20781,
Unity_INT_Muffler http://www.divine-pride.net/database/item/20782,
Unity_Exquisite_Muffler http://www.divine-pride.net/database/item/20787,
Unity_STR_Boots http://www.divine-pride.net/database/item/22078,
Unity_AGI_Boots http://www.divine-pride.net/database/item/22079,
Unity_DEX_Boots http://www.divine-pride.net/database/item/22080,
Unity_INT_Boots http://www.divine-pride.net/database/item/22081,
Unity_Katar http://www.divine-pride.net/database/item/28011,
Unity_Two-Handed_Axe http://www.divine-pride.net/database/item/28110
Unity_Bible http://www.divine-pride.net/database/item/28606,
Unity_Guard http://www.divine-pride.net/database/item/28904,
Unity_Buckler http://www.divine-pride.net/database/item/28905

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add Angel Poring Boots item set
Angel_Poring_Boots http://www.divine-pride.net/database/item/22101,
Leo_Stone http://www.divine-pride.net/database/item/29148,
Pisces_Stone http://www.divine-pride.net/database/item/29149,
Capricorn_Stone http://www.divine-pride.net/database/item/29150,
Aquarius_Stone http://www.divine-pride.net/database/item/29151,
Scorpio_Stone http://www.divine-pride.net/database/item/29152,
Taurus_Stone http://www.divine-pride.net/database/item/29153

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add itemID 26110 http://www.divine-pride.net/database/item/26110

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add new accessories
Vesper_Core01_ http://www.divine-pride.net/database/item/28302,
Vesper_Core02_ http://www.divine-pride.net/database/item/28303,
Vesper_Core03_ http://www.divine-pride.net/database/item/28304,
Vesper_Core04_ http://www.divine-pride.net/database/item/28305,
Falconer_Glove http://www.divine-pride.net/database/item/28322

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add jRO's LoVA cards
LoVA_Hades_Card http://www.divine-pride.net/database/item/31006,
LoVA_Realization_Hades_Card http://www.divine-pride.net/database/item/31007,
LoVA_Lulu_Card http://www.divine-pride.net/database/item/31008,
LoVA_Realization_Lulu_Card http://www.divine-pride.net/database/item/31009,
LoVA_Kima_Card http://www.divine-pride.net/database/item/31010,
LoVA_Realization_Kima_Card http://www.divine-pride.net/database/item/31011,
LoVA_Bahamut_Card http://www.divine-pride.net/database/item/31012,
LoVA_Realization_Bahamut_Card http://www.divine-pride.net/database/item/31013,
LoVA_Ragnarok_Card http://www.divine-pride.net/database/item/31014,
LoVA_Realization_Ragnarok_Card http://www.divine-pride.net/database/item/31015,

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add new costumes

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* follow up 12063498b6

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add new shields and their combo set
Proof_of_Glory http://www.divine-pride.net/database/item/28499
Cursed_Mad_Bunny http://www.divine-pride.net/database/item/28901
Mad_Bunny_ http://www.divine-pride.net/database/item/28902
Rectangular_Large_Sleeve http://www.divine-pride.net/database/item/28910
Ultralight_Magic_Shield http://www.divine-pride.net/database/item/28913
Bunker_Shield http://www.divine-pride.net/database/item/28915
Gaia_Shield http://www.divine-pride.net/database/item/28916
Diamond_Shield http://www.divine-pride.net/database/item/28920

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Update combo set of Enhanced Force Shadow Weapon and Enhanced Soul Shadow Weapon

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add first classes's Shadow equipment

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* follow up 12063498b6 thanks to @Cydh

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add new costumes

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- According to https://forums.warpportal.com/index.php?/topic/169125-shadow-gear-event/#entry2023963, The promotional shadow gear set bonus is 'all stats +3'after the event ends.

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add Caster Shadow Set

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix Armor_of_Gray missing mdef bonus

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add missing combo of Ozs_New_Ukulele and Ozs_New_Wing_Ring

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix Pendant_of_Harmony script, Element resistance should be Holy resistance only and the autocast of Renovation should be triggered by normal attack.

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* follow up e77dcea119

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add headgears from jRO
Pipe_Of_Jiraiya http://www.divine-pride.net/database/item/18947
Mask_Of_Orochimaru http://www.divine-pride.net/database/item/18948
Scroll_Of_Tsunade http://www.divine-pride.net/database/item/18949

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix Noble_Cross element bonus

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add combo script for Encyclopedia

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix Geffen_Magic_Robe refine bonus

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add combo set of GMT gears

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix Wind_Whisper matk script

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix Gigantic_Blade weapon type

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix axe weapons script
Tanos_Axe_ now become Two-Handed Axe
Axe_Tornado now become Two-Handed Axe and refinable
Blue_Twohand_Axe now become Two-Handed Axe

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add Soul Potion aka Stats Reduction potion
related to this https://github.com/rathena/rathena/pull/1509

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add combo script for temporal boots and gigant snake skins

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* follow up 72e1c4ad33

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix Magic_Stone_Hat and Schmidt_Helm matk bonus

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Minor fix and cleanup

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Add combo script for Pendant_of_Chaos and Pendant_of_Harmony
- Fix Pendant_of_Chaos element reduction bonus, should be Darkness only
- Fix wrong id order

Signed-off-by: zackdreaver <zackdreaver@gmail.com>

* Renewal item db update:
- Fix item scripts according review by secretdataz
- Add combo script for sloted version of vesper cores

Signed-off-by: zackdreaver <zackdreaver@gmail.com>
2017-01-14 14:34:13 +07:00
Lemongrass3110
f5c43329b2 Follow up to 9f4587a
Fixes #1877
Thanks to @Tokeiburu and @Everade for their help.
2017-01-13 23:34:06 +01:00
aleos89
6de7aa88e8 Resolved party bound item check (fixes #1874)
* Resolved a potential map-server crash.
* If a party bound item is attempted to be removed because the player was offline during party destruction, delete the item without recalculating the status.
Thanks to @Tokeiburu!
2017-01-13 12:29:18 -05:00
Lemongrass3110
a73814eeee Fixed some compile warnings
Fixes #1861
Thanks to @rubie123
2017-01-11 10:21:47 +01:00
rAthenaAPI
4da04a7f2c SQL synchronization 2017-01-10 22:58:13 +01:00
Lemongrass3110
2043c95e66 Refactored hardcoded npc event names (#1767)
While refactoring those events the following other changes were made:

Introducing OnInstanceDestroy event. This event can be used to hook script code right in front of the instance destruction. This can be useful if you have any stored references to an instance id for example.

The script command cmdothernpc will now check if the target event exists and report failures. Therefore it now returns true or false.

All agit(FE,SE,TE) start and end commands from atcommand and script commands have been merged in their respective guild function which now returns a bool value of true for successful actions and false if it did not succeed(if the specific WoE was [not] running).

All global triggered events with mapserver status output now call the same function and therefore have the same mapserver output(including their respective event name of course).

Renamed a few events in the script configuration to match the other names

Added constants for months and weekdays

Additionally added constants for gettime types to make it easier to read.

Replaced all existing usages I found with their proper new syntax or better fitting functions.
2017-01-10 22:58:04 +01:00
Playtester
870273e48f Fixed Taekwon Mission not working (fixes #1862)
* Taekwon Mission will now work regardless of setting "taekwon_mission_mobname"

Special thanks to @vstumpf for the fix.
2017-01-09 20:36:30 +01:00
lighta
6a97675dc1 Merge branch 'johnfercher-master' 2017-01-08 15:44:46 -05:00
lighta
c93b9cec6e Small finalisation for ARM va_list issue 2017-01-08 15:43:54 -05:00
Johnathan Fercher
755329fe11 raspberry simple adaptation
added a new version of itemdb_group_free at map/itemdb.c.
2017-01-08 15:35:19 -05:00
Lemongrass3110
14b79eafcb Follow up to 88aaa9b
Fixes #1857
Thanks to @srhmike
2017-01-07 22:32:07 +01:00
Aleos
f14b5b34ec Adjusted the parameter size for NPC commands (#1856)
* Adjusted the parameter size for NPC commands
* Fixes #1805
* Changed NAME_LENGTH parameter size to NPC_NAME_LENGTH.
Thanks to @Tokeiburu!
2017-01-06 19:11:50 -05:00
Lemongrass3110
88aaa9be98 Added a parameter to map_nick2sd for partial name (#1852)
With this parameter the caller can decide if he wants to enable or disable partial name scan support.
Generally it was disabled in a lot of functions(clif,channel,script commands).
It is still available for some "non-critical" atcommands as well as for all charcommands.
2017-01-07 00:19:04 +01:00
Lemongrass3110
55459f30f2 Added a script command for instance information (#1815)
With this script command you can look up information about a specific instance. This way you do not have to hardcode values specified in the database in the script if you need it.

Thanks to @aleos89 for the script documentation.
2017-01-07 00:08:11 +01:00
Lemongrass3110
12457d342f Fixed sleep2 and awake functions for non-players (#1849)
Fixes #1837
2017-01-06 23:41:18 +01:00
Lemongrass3110
eb47d74f08 Added a config for maprespawnguildid's behaviour (#1836) 2017-01-06 23:29:49 +01:00
naffej
da526d1982 Update battle.c (#1850)
* Fixed Neutral Barrier not checking the target, instead of source, if attacks should hit.
2017-01-06 12:53:07 -05:00
Lemongrass3110
988bf12887 Fixed announces from Koschei the Immortal
Original Commit HerculesWS/Hercules@dbc54ea
Thanks to @landergate
2017-01-06 17:15:19 +01:00
Lemongrass3110
03a54402bc Fixed ZC_PROPERTY_HOMUN_2 packet
Homunculus also have their HP stored as int from 2014-10-16 onward.
Please note that the information windows is to small to show the numbers correctly, because Gravity certainly does not intend that the HP can become that high.
2017-01-04 13:21:47 +01:00
Lemongrass3110
0a303c7852 Fixed remote listing command in README
Thanks to @CairoLee
2017-01-04 12:16:21 +01:00
Lemongrass3110
8b6b9c19ac Follow up to b0bcd06
Added a special error message for timeout, since it does not set an error code when a timeout occurs.
Also added a message when the socket is not writeable after successful connection.
2017-01-03 15:44:08 +01:00
Playtester
396b5c3215 Renewal Stealth / Chase Walk (fixes #1826)
* Stopping Stealth aka Chase Walk in renewal now has a cast time
2016-12-30 20:53:52 +01:00
rAthenaAPI
a635255409 SQL synchronization 2016-12-30 20:21:54 +01:00
aleos
aa2868c807 Fixed the Eden Group Mark warp map (fixes #1841)
* Follow up to b62f4a2.
* Fixed the item trying to place the character on an incorrect map.
Thanks to @hendra814!
2016-12-30 14:21:41 -05:00
rAthenaAPI
c52a6de2c0 SQL synchronization 2016-12-30 20:00:19 +01:00
Locien
c712618116 Another small fix
Same as previous.
2016-12-30 19:59:55 +01:00
Locien
15ee996fb4 Revert "Another small fix"
This reverts commit bfb94d0abc.
2016-12-30 19:58:40 +01:00
Locien
bfb94d0abc Another small fix
Same as last time.
2016-12-30 19:58:07 +01:00
rAthenaAPI
dd1d78865a SQL synchronization 2016-12-30 19:48:28 +01:00
Locien
92174bbae6 More fixes to Geffen Magic Tournament
This should finally fix it.
2016-12-30 19:48:09 +01:00
rAthenaAPI
c1a26796e3 SQL synchronization 2016-12-30 19:44:49 +01:00
Locien
8ac9fb7f3d Another small fix to the Geffen Magical Tournament commit
Fixed missing values in mob_db.txt.
2016-12-30 19:44:31 +01:00
rAthenaAPI
44cdd34fce SQL synchronization 2016-12-30 19:34:16 +01:00
Locien
1efbe3675b Small fix to Geffen Magic Tournanment commit
Commented out missing monster skills and added a missing item.
2016-12-30 19:33:57 +01:00
rAthenaAPI
64858fba87 SQL synchronization 2016-12-30 18:48:40 +01:00
Locien
be1c0ee1e6 Geffen Magic Tournament instance - Semi-official implementation
Big thanks to @RagnarokNova for creating this script with the help of
@tokeiburu, Diablo and others. I simply converted it to be compliant
with rAthena master standard. Hope you guys enjoy it and report any bugs
:)

To clarify on the semi-official part: This script was made from scratch
by playing on iRO and may have inconsistencies with the official
version. If you want to use this on your server you must enable it
yourself by uncommenting the entry in scripts_athena.conf.
2016-12-30 18:45:49 +01:00
Atemo
a9faab82cb Fixed incorrect OnTouch label in Crow of Destiny Quest (issue #1840) and in Guild dungeon 2 event. Thanks @Tokeiburu 2016-12-29 23:00:37 +01:00
Dragonnnn
a06028bb48 Corrected misspelled git command. 2016-12-29 11:20:38 +07:00
Dragonnnn
39cc005feb Added guide to allow users to receive updates from main rAthena repo to their forked versions in Bitbucket/GitLab (#1828)
* Added guide to update forked repositories.
2016-12-28 15:21:48 -05:00
rAthenaAPI
36704f9045 SQL synchronization 2016-12-28 13:04:05 +01:00
Lemongrass3110
575583d0a6 Added some new NPC constants and mob placeholders 2016-12-28 13:03:44 +01:00
Playtester
260655a3c4 Songs and Dances vs. Dispell and Vanishing Buster (fixes #1824)
* Songs and Dances can no longer be dispelled by Dispell and Vanishing Buster
* Added a configuration to simulate the old behavior: Dispelling works if target not inside song area
2016-12-25 20:02:07 +01:00
Jittapan Pluemsumran
9f4587a652 Made prevent_logout effect on log-in optional (#1827)
* Made prevent_logout effect on log-in optional
kRO does not prevent players from logging out after connecting to its zone servers.
2016-12-25 22:16:30 +07:00
rAthenaAPI
eb142883c2 SQL synchronization 2016-12-21 08:04:07 +01:00
Jittapan Pluemsumran
b62f4a2c36 Made Para_Team_Mark_ (22508) follow kRO effect.
Fixed #1820.
2016-12-21 14:03:54 +07:00
Playtester
182557311b Official song and dance formulas (fixes #1808)
* Fixed musical lessons not having any effect on Song of Lutie's MaxHP bonus (lesson/2)
* Song of Lutie now heals 1 HP more every 2 vit instead of 5 HP more every 10 vit
* Perfect Tablature's flee bonus in renewal is now 3*skill_lv + agi/15 + lesson/2
* Perfect Tablature's perfect dodge bonus is now (skill_lv+1)/2 + luk/30 + lesson/5
* Focus Ballet's hit bonus in renewal is now 20 + 2*skill_lv + dex/15 + lesson
* Focus Ballet's hit bonus in pre-re is now 1 + 2*skill_lv + dex/10 + lesson
* Slow Grace's ASPD decrease in renewal is now 3*skill_lv + dex/15 + lesson
* Slow Grace's ASPD decrease in pre-re is now 5 + 3*skill_lv + dex/10 + lesson
* Slow Grace's speed decrease in renewal is now 2*skill_lv + agi/20 + lesson/2
* Slow Grace's speed decrease in pre-re is now 5 + 3*skill_lv + agi/10 + lesson
* Impressive Riff's ASPD increase in pre-re is now 5 + skill_lv + agi/20 + lesson/2
* Lady Luck's critical bonus is now 10 + skill_lv + luk/10 + 0.5*lesson (not rounded down)
2016-12-20 22:17:52 +01:00
Playtester
08812e0523 Monster level 10 Frost Diver and Decrease Agi (fixes #1819)
* Freeze from monster level 10 Frost Diver will now last 30s in pre-re and 32.5s in re
* Fixed monster level 10 Decrease Agi in renewal lasting way too
2016-12-20 17:17:48 +01:00
Playtester
e5a89a74f4 Fixed Satan Morroc not using most of his skills (fixes #1818)
* Satan Morroc will now be able to cast all of his skills if his HP are low
-- There is no "HP higher than" limit for casting skills, only "HP lower than"
* Satan Morroc no longer summons slaves on spawn or when idle
2016-12-20 16:56:07 +01:00
Playtester
d5357c3e9f Hell Power, Hallucination, Gospel (follow-up to 74d577c, fixes #1816)
* NPC_HELLPOWER is now a "no damage" skill and works similar to NPC_HALLUCINATION
* NPC_HALLUCINATION now has a fixed duration
* Both skills have a max level of 5 (for activation chance)
* Fixed Gospel's activation chance being 1% higher than it should be
* Fixed a compiler warning (see #1816)
2016-12-20 15:49:49 +01:00
rAthenaAPI
700950b1f4 SQL synchronization 2016-12-20 13:58:17 +01:00
Lemongrass3110
c407ec211d Fixed #1817
Additionally corrected iRO name.
2016-12-20 13:57:57 +01:00
rAthenaAPI
e3e752cdba SQL synchronization 2016-12-20 11:30:20 +01:00
Cydh Ramdh
ffb3182046 Fixed Location for Darklord Essences
* Follow up 9fcdcbde3b
* The compound location must be `1023`

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-12-20 17:26:25 +07:00
Cydh Ramdh
2896d894d1 Official Random Coordinates for Savepoint (#1756)
* Added parameters for `savepoint are range for `x` and `y` for random savepoint coordinates.
* Added documentation for new savepoint params. Credits to @aleos89
* Updated savepoint on script to follow official behaviour (random save in 3x3). All credits to @Atemo
2016-12-20 17:16:42 +07:00
Cydh Ramdh
388e699e15 Added party config change_party_leader_samemap (#1803)
* Added party config `change_party_leader_samemap`
* Prevent changing the party leader if the specified player is not on the same map (Note 1)
* Default is `yes` as official does
* This config will be ignored by `party_changeleader` script command
* Thanks to @aleos89 and @Lemongrass3110

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-12-20 17:06:14 +07:00
Locien
fb29b18b52 Consistency changes for script unit commands (#1801)
* Consistency changes for script unit commands

Made it so that all unit commands(except for unitexists) take 0 as the
unit ID argument which will reference the activator of the script.
Unitwarp has since previously had this functionality and it's very
useful. Example use: When a monster walks over an npc script with the
OnTouchNPC label unitkill 0; will kill the monster.

* Clean up and fixes to unit script commands self referencing with ID 0

Added a script_rid2bl function that will return the block list beloning
to an RID specified or the activator of the script if 0 is specified as
RID.
2016-12-20 02:08:35 +01:00
Lemongrass3110
1b634c8f42 Fixed showdigit's start values (#1807)
Fixed #1769
2016-12-20 01:37:40 +01:00
aleos
8492f6c35e Fixes Feint Bomb and bNoKnockBack (fixes #1814)
* Resolves Feint Bomb's backslide effect not working when the player is wearing an item that has the bonus NoKnockBack active.
Thanks to @Everade!
2016-12-19 19:32:35 -05:00
aleos
1a5e3a35bd Added readable constants for knockback functions
* Added enum for skill_blown.
* Added enum for unit_blown_immune.
2016-12-19 19:04:01 -05:00
Lemongrass3110
552c39acc3 Fixed #1809
Thanks to @Tokeiburu
2016-12-20 00:13:48 +01:00
Playtester
d1f8c8ca6c Fiber Lock vs. Land Protector (follow-up to 79e9afa)
* Fiber Lock now ends in all situations in which the unit group is removed (e.g. Land Protector)
2016-12-19 23:43:56 +01:00
Playtester
74d577ce52 Gospel, Tarot, Curse, Poison, Hallucination, Hell Power, NPC skills
* Official Gospel chances, effects and duration (fixes #1812)
-- Chance of Gospel to trigger increased from 10%*skill_lv to 50%+5%*skill_lv
-- Gospel's Heal effect now heals 1000-9999 HP instead of 1-9999 HP
-- Blessing and Increase Agi effects now last for 4 minutes instead of 60 seconds
-- Increase Defense now only lasts 10 seconds instead of 60 seconds
-- Gospel's damage is now twice likely to trigger with one of two different effects
-- Fixed Gospel's damage not showing the Holy Cross effect
-- Gospel's first damage effect deals 3000-7999 damage which is reduced by DEF (percentual in pre-re)
-- Gospel's second damage effect deals 1500-5499 damage which cannot be reduced by DEF
-- Curse, Blind and Poison effect now last 30 minutes instead of 60 seconds
-- Provoke lasts infinite, but is removed when changing maps or logging out
-- Fixed Provoke's icon from disappearing whenever a status changes
-- DEF, ATK, Flee and Speed super debuffs now only last 20 seconds instead of 60 seconds
* Official status change base duration for curse (fixes #1811)
-- Curse base duration is 30 seconds in pre-re and 20 seconds in renewal
-- Napalm Vulcan, Tarot Card of Fate, NPC_HELLJUDGEMENT, NPC_WIDECURSE use this duration
-- NPC_CURSEATTACK has a fixed 30 seconds duration
* Official status change base duration for poison (fixes #1811)
-- Poison base duration is 60 seconds in pre-re and 20 seconds in renewal
-- Duration is no longer halved for monsters in pre-re
-- Envenom, Venom Dust, Venom Splasher, Tarot Card of Fate, NPC_POISON, NPC_ACIDBREATH use this duration
* NPC_STOP now has a duration of 15 seconds instead of 10 seconds
* NPC_HELLPOWER and NPC_WIDEHELLDIGNITY now have a duration of 180 seconds instead of 300 seconds
* Tarot Card of Fate uses base duration for Curse, Poison, Stone, Freeze and Stun
-- For Confusion and Stop the duration remains fixed to 30 seconds
* All NPC status skills now have a 20%*skill_lv chance to trigger instead of 50%+10%*skill_lv
-- NPC_HALLUCINATION and NPC_HELLPOWER now only affect you to 20% instead of 100%/60%
* Damage shown by Hallucination is now completely random instead of being multiplied by 6
* The animation is now shown when trying to resurrect someone affected by Hell Power

Special thanks to @mrjnumber1 and Luke for providing various information on these.
2016-12-19 22:28:18 +01:00
Locien
a4a6dd896f Small fix to previous magic rod changes
Fixed a compiler error.
2016-12-17 04:10:07 +01:00
Locien
d92272eb89 Corrected behavior for magic rod showing its animation in pre-renewal
In pre-renewal the animation of magic rod only shows up when the user is
attacked with a spell that can be absorbed by it. In renewal it shows
when you cast the skill instead. This has been tested on iRO Chaos and
iRO Classic.
2016-12-17 00:55:34 +01:00
Lemongrass3110
b0bcd060c4 Added windows specific socket timeout code (#1714)
* Added windows specific socket timeout code

Added socket code for windows that respects our given timeout.
Also added some more ifndef checks to some stat reporting functions.
Updated the MSDN reference link.
Fixed the delay being milliseconds on windows, thanks to @theultramage
Fixes #794 on windows.
2016-12-17 00:36:23 +01:00
Stolao
25bcb51598 Merge pull request #1793 from rathena/Code_Consistancy_Edit
Code Consistency
2016-12-16 13:27:52 -08:00
Lemongrass3110
7df9962a72 Follow up to 9333921
Thanks to @Playtester's friend Ash for reporting this.
2016-12-13 09:10:07 +01:00
Stolao
f0059affb3 no message 2016-12-12 11:44:55 -08:00
Aleos
d095fe7a67 Merge pull request #1741 from rathena/cleanup/itemgroups
Cleaned up Item Groups
- Moved constants from const.txt to script_constants.h.
- Removes hard coded item groups into the IG_* database to easily be adjusted/created.
- Renamed IG_FingingOre -> IG_FindingOre.
2016-12-12 13:58:54 -05:00
Playtester
b4225e8436 Tarot Card of Fate Follow-Up (fixes #1789)
* The tarot card THE SUN no longer blocks other cards in pre-re (still does in renewal)
* Added a configuration for equal chance for all cards in case someone prefers eAthena behavior
2016-12-12 19:10:28 +01:00
Lemongrass3110
0e78dfca26 Fixed a compiler warning
Follow up to 79e9afa
Fixes #1787
Thanks to @srhmike
2016-12-12 08:47:58 +01:00
Playtester
f084db4f1c Monsters spreading out on hide (fixes #1786)
* When you hide and monsters are still on their original chase path, they will no longer spread out
-- This makes Grimtooth mobbing viable again on default settings
-- In all other situations, monsters will still spread out
2016-12-11 22:37:32 +01:00
Playtester
79e9afaff0 Fiber Lock / Spider Web (fixes #1782)
* Fiber Lock's duration now depends on the map and how many fiber locks have been stacked
-- PVM: 1st - 8s, 2nd - 16s (default - 8s)
-- PVP: 1st - 4s, 2nd - 8s, 3rd - 12s (default - 4s)
* Fiber Lock now always doubles fire damage, even in renewal
* When a unit affected by Fiber Lock takes fire damage, the Fiber Lock that lasts shortest is now removed
* A unit can now only move when all Fiber Locks on it were removed or have expired
* When a unit with multiple Fiber Locks on it dies, not all Fiber Locks are removed
* A unit can no longer be affected by more than 3 Fiber Locks at the same time
2016-12-11 19:25:48 +01:00
Lemongrass3110
ab38f2cd7e Fixed jobmasks for custom jobs(>32 bit)
Fixes #1784
Thanks to @Stolao
2016-12-11 16:33:41 +01:00
Lemongrass3110
93339212bc Fixed #1772 (#1773)
* Fixed #1772

Added support for char_id to readparam
Added a check and error message if get_var is used on a parameter instead of a variable
2016-12-11 16:00:44 +01:00
Lemongrass3110
d13acf3886 Fixed a bug with getarraysize
When the attached rid of the script was actually not a player, but a monster or something else the script was terminated. A good example for this was to use getarraysize on a OnTouchNPC event.

Thanks to MasterOfMuppets(@Locien) for reporting this.
2016-12-11 14:57:18 +01:00
Playtester
08406785c6 Skills that increase elemental damage (fixes #1780)
* Negative values in the attr_fix table will now longer be ignored
* Renewal: Skills that increase elemental damage stack linearly with the attr_fix value
(e.g. if the attr_fix value is -25% and a skill increases elemental damage by 50%, it becomes 25%)
* Pre-Renewal: Skills that increase elemental damage increase damage percentually
(e.g. if damage is 25 and a skill increases elemental damage by 20%, it becomes 30)
2016-12-10 18:39:03 +01:00
Playtester
fd892a0425 Monster idle/walk behavior (fixes #1778)
* Monsters will now remember which players have spotted them
* If all players that spotted the monster logged out, it will become inactive again
* Inactive monsters neither walk nor use any skills (e.g. Metamorphosis)
* Minor documentation fix
2016-12-10 17:05:09 +01:00
aleos
8399992598 Adjusted variable size
* Increased variable size for the item group check to prevent overflows.
2016-12-10 09:25:54 -05:00
Lemongrass3110
b9a8ab722e Added an additional parameter to instance_enter (#1720)
Added an additional parameter to instance_enter

This allows easier usage for instances in IM_NONE, where a player will never be attached to the instance.
All you have to do is remember the created instance id and supply this command with it. That way you do not have to use any workaround like the following anymore:
warp instance_mapname( <mapname>, <instance id> ), <hardcoded enter x coordinate>, <hardcoded enter y coordinate>;

Added usage of the new constants in the existing scripts

Fixed default checks and null pointer output
Thanks to @Atemo
2016-12-10 12:38:57 +01:00
Atemo
45bc42c305 Fix wrong command usage at sign quest
Credit Hercules@47834e8f6db03689595946af0cd95748005126c7
2016-12-09 19:58:01 +01:00
Jittapan Pluemsumran
99d0afaca0 Removed duplicated config in login_athena.conf 2016-12-09 15:47:14 +07:00
aleos89
0162ad890e Corrected Spore Explosion on GCC builds
* Follow up to 8f4660b.
* Resolves Spore Explosion not inflicting damage on targets for some GCC builds.
Thanks to @Tokeiburu!
2016-12-08 09:23:41 -05:00
Lemongrass3110
e490befb9a Follow up to e2eadcf 2016-12-08 01:41:21 +01:00
Lemongrass3110
e2eadcfbd8 Implemented mapflag nolockon correctly
Fixed #1736
Thanks to @GrumpyLittlePanda for reporting and @Playtester for pointing me into the right direction.
2016-12-07 23:09:53 +01:00
Lemongrass3110
2bb92a114b Fixed hallucination ignoring reloadbattleconf
Fixed #1765
2016-12-07 22:28:36 +01:00
Playtester
05783ade33 Follow-up to 0dbc83d (related to #1768)
* Moved the skill_tarotcard function up so the compiler doesn't throw warnings
* Minor code optimizations and comment updates
2016-12-07 22:09:09 +01:00
Playtester
0dbc83db9d Tarot Card of Fate (fixes #1768)
* Implemented official chances for each Tarot Card to occur
-- 15%: LOVERS
-- 10%: FOOL, MAGICIAN, HIGH PRIESTESS, STRENGTH, SUN
-- 8%: TEMPERANCE
-- 7%: CHARIOT
-- 6%: THE HANGED MAN
-- 5%: DEATH, STAR
-- 2%: TOWER
-- 1%: WHEEL OF FORTUNE, DEVIL
* The SUN tarot card will give you the tarot card status change
-- The status change makes you immune to other tarot card effects
-- The affected person will see a tarot card icon and the duration of the effect
* Fixed LOVERS healing self instead of the target
* The LOVERS tarot card now displays on self instead of target

Special thanks to @mrjnumber1
2016-12-07 21:28:32 +01:00
Lemongrass3110
fec4d7b0cf Added support for VS 2017 RC 2016-12-05 23:27:15 +01:00
Cydh Ramdh
342443bf61 Added new mapflag hidemobhpbar (#1537)
* Added new mapflag `hidemobhpbar` to hides monster's HP bar on a map.
* Added maps for this mapflag, credits to @Atemo and @Lemongrass3110 

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-12-04 10:52:14 +07:00
Atemo
222ee49802 Fix issue #1752
- NPC should give the Bioetics skill when changing to Creator
2016-12-03 23:50:46 +01:00
Atemo
d3f0aec324 Fix issue #1651
- The timer event wasn't updated on last tick event
2016-12-03 05:50:16 +01:00
aleos89
33fa182c48 Corrected damage immunity states (fixes #1754)
* Added unit data damage immunity to the GvG targeting function.
* Added unit data and mob mode damage immunity to the reflecting damage calculation function.
Thanks to @admkakaroto!
2016-12-02 07:38:53 -05:00
Atemo
d2651c45c1 Issue #1760 in woe 2
- The firsts barricades are now indestructible until both Guardian Stones are destroyed.
2016-12-01 23:58:43 +01:00
aleos89
c05808a305 Fixed item bonus bAddMaxWeight (fixes #1761)
* Stored bAddMaxWeight into it's own variable for later calculation.
* Created enum constants for status_calc_weight and status_calc_cart_weight for easier readability.
2016-12-01 13:00:38 -05:00
Lemongrass3110
ac2ba09415 Fixed areawarp cell check
The script command areawarp has been checking the wrong target map for ages. It has been checking the mapindex rather than the mapid and therefore returned a wrong result.
2016-12-01 13:06:54 +01:00
Atemo
d7e5f1b5d9 Fix issue #1758
- Players were warped outside the instance
2016-11-30 21:12:41 +01:00
Lemongrass3110
c88ca4432d Definition cleanup
Removed a few ghost definitions
Adjusted some definitions to use the same types

Related to #1738
2016-11-26 20:34:55 +01:00
aleos89
82675d86d0 Resolved the rental timer display (fixes #1745)
* Follow up to 45d9674.
* Fixes the timer message displaying too often.
Thanks to @whupdo!
2016-11-26 14:09:44 -05:00
Lemongrass3110
9aaf18eb33 Fixed some compile warnings
Follow up to 09a0c29
Fixes #1748 - thanks to @srhmike
2016-11-26 17:19:14 +01:00
aleos89
09a0c29a39 Corrected Lux Anima behavior (fixes #1110)
* Only transfers the most recent rune buff to the party.
* The source loses the rune buff that is passed to the party.
* There is a stack limit of 20 Lux Anima Runestones.
-- Stack only applies to renewal as the item isn't implemented in pre-renewal.
2016-11-25 15:42:44 -05:00
aleos89
2c3201116c Split item stack database between renewal and pre-renewal
* Separated the database between the two modes.
2016-11-25 15:31:16 -05:00
aleos89
595d9b743d Fixed a potential map server crash
* Resolves an invalid operator check for pc_check_available_item.
* Added a new flag for pc_delitem to not calculate a player's status when unequipping an item.
Thanks to @cydh!
2016-11-24 23:41:53 -05:00
Atemo
d78da42472 Fixed a potentiel quest warning issue #1737 2016-11-24 19:50:07 +01:00
Lemongrass3110
9040613fa6 Added missing empty newlines to a lot of files 2016-11-23 13:54:45 +01:00
Lemongrass3110
9b1b7b1a2b Replaced hardcoded genders with constants (#1730)
* Replaced hardcoded gender codes in source

Introduced a new constant for the account based gender and replaced all hardcoded gender references to code 99 with it.

* Replaced hardcoded gender codes in npcs

Exported the gender constants into the script engine and replaced all usages with references to the constants instead of expecting a value behind them.

* Corrected a typo

Thanks to Machiezmo from Discord.

* Fixed an inverted gender logic

Thanks to @secretdataz
2016-11-22 21:20:03 +01:00
aleos89
127c13bbdd Cleaned up Item Groups
* Moved constants from const.txt to script_constants.h.
* Removes hard coded item groups into the IG_* database to easily be adjusted/created.
* Renamed IG_FingingOre -> IG_FindingOre.

Enabled commented Item Groups
* Follow up to 50d5c14.
* Retains consistency between constant and ID values.
* Renamed duplicate item groups to avoid compile errors.
2016-11-22 09:32:14 -05:00
rAthenaAPI
c7a8909d42 SQL synchronization 2016-11-22 06:39:24 +01:00
zackdreaver
aaca85351d Renewal item_db update (#1723)
* Renewal item_db update:
- Add new costumes
- Fix item script

Signed-off-by: zackdreaver <zackdreaver@gmail.com>
2016-11-22 12:39:19 +07:00
Playtester
ee9a0f988d Renewal Sage ground effect visuals (fixes #1735)
* Fixed Land Protector, Volcano, Deluge and Violent Gale only displaying one cell
* Because 12-4=8 and not 10!
2016-11-21 18:05:47 +01:00
Cydh Ramdh
633a642e5a * Corrected combos of Elemental Clothes (19048)
* Updated Status Change documentation for `SC_SIEGFRIED` and `SC_SCRESIST`
* Fixed `bResEff` cannot be used to increase the rate (for reducing resistance)

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-11-20 11:35:02 +07:00
aleos89
0dd3c74c2e Fixed some arrays not zeroing out on status recalculation (fixes #1722)
* Follow up to 0f1b1af, f296409, and a79d065.
* Fixes several bonuses that are not zeroed out properly since the block order didn't match.
Thanks to @whupdo!
2016-11-19 09:26:33 -05:00
aleos89
ef63cffa30 Small OPTION_INVISIBLE refactor
* Cleaned up the usage of OPTION_INVISIBLE to utilize the macro that was defined for it.
2016-11-18 14:44:49 -05:00
Lemongrass3110
1aa2012cff Fixed a typo in an item group name
Fixes #1726
Thanks to @kukuasir1
2016-11-18 10:23:42 +01:00
Playtester
db3ef52fd2 Frost Nova AoE (fixes #1619)
- Increased Frost Nova AoE from 5x5 to 7x7
- Frost Nova no longer hits enemies that are on the same cell as the caster
2016-11-17 18:25:56 +01:00
Lemongrass3110
0fa8919749 Added sura jobs to the switch 2016-11-17 17:35:35 +07:00
aleos89
9910478ce2 Resolved some compile warnings
* Resolved two unreachable code warnings.
* Resolved two potentially uninitialized local variable warnings.
2016-11-16 13:07:19 -05:00
Lemongrass3110
ecc8cf9f0b Initial release of the clan system
Thanks to @cydh, @RagnarokNova and @aleos89 for their help.
2016-11-16 15:36:08 +01:00
aleos89
dfccb88785 Removed double saving attempts
* Follow up to 3dfdb38.
* Removed an extra save attempt if a player changes jobs and has fame.
2016-11-16 08:50:36 -05:00
aleos89
3dfdb38d32 Fixed atcommand changecharsex sync issue (fixes #1684)
* Resolves the map-server holding a different job value than what the char-server could be holding.
Thanks to @Grantea!
2016-11-16 08:41:16 -05:00
Lemongrass3110
9bf5d4a291 Fixed a shadowed variable
Fixes #1718
2016-11-16 08:18:18 +01:00
aleos89
cb279a7243 Resolved an uninitialized variable (fixes #1717)
* Follow up to ade1b17.
* Corrects the countitem script command having an uninitialized variable warning during compile.
Thanks to @hnomkeng!
2016-11-15 21:54:44 -05:00
aleos89
5332d7f0e7 Resolved a map crash with pet items (fixes #1716)
* Follow up to ade1b17.
* Added a pet data check that was removed.
Thanks to @Keniski!
2016-11-15 21:52:05 -05:00
aleos89
ab7ca67ff4 Corrected Doram item combos (fixes #1711)
* Fixed Charming Grass Necklace combo not working.
Thanks to @Darkelfen!
2016-11-15 20:05:39 -05:00
Lemongrass3110
6c27a13061 Added enc_temp_folder to gitignore list 2016-11-15 23:16:31 +01:00
aleos89
d1cc320769 Corrected Storage dirty flag check
* Follow up to ade1b17.
2016-11-15 16:17:11 -05:00
aleos89
00fd5e7078 Removed rAthena Stat Reporter
* Follow up to 0ffeec0.
* No longer being used so it will now be completely removed.
2016-11-15 10:19:58 -05:00
Lemongrass3110
28cee2caa9 Cleaned storage saving output 2016-11-14 20:05:19 +01:00
Aleos
ade1b171eb Optimized Inventory, Cart Inventory, and Storage usage (#1115)
* These storage types now mimic Guild Storage and can be loaded/saved whenever needed.
* Relieves mmo_charstatus from having to send storage types and lets the char-server handle it.
* All storage types now have an increased max amount.
* Implemented Premium Storage System. Thanks to @cydh!
* Fixes #441 - Players will no longer be required to log out to resync cart item data before opening a Vending Store.
* Refactored player weight and cart weight calculations into their own functions.
* Added script commands openstorage2, guildstoragecountitem[2] and guildstoragedelitem[2].
* Refactored several function return types as well as documentation.
Thanks to @lighta and @cydh for their help with it!
2016-11-14 13:11:43 -05:00
aleos89
8028789dee Removed unused functions
* Removed inter_storage_delete and inter_guild_storage_delete functions as they are not used.
2016-11-14 09:38:59 -05:00
Lemongrass3110
b5de7df013 Implemented correct windows socket cleanup
Resolves HerculesWS/Hercules#1513
Thanks to @mkbu95 for bringing this up
2016-11-14 10:44:43 +01:00
Lemongrass3110
4ed035b036 Cleaned up fame lists (#1660)
Added 0x97e into the packet length table
2016-11-14 09:04:42 +01:00
Atemo
dcc3285a5f WoE TE
- restricted HP/SP Increase potions and Concentrated White Potion Z inside castles (but SC not disabled). Issue #1713

Thanks to @Darkelfen
2016-11-13 23:15:48 +01:00
rAthenaAPI
8617f832a6 SQL synchronization 2016-11-13 21:07:29 +01:00
aleos89
eae1161d53 Corrected Sling Item behavior
* Partial revert of 89a33a7.
* Moved bonuses back to the item_db so items can easily be customized.
* Sling Item is no longer usable on self.
2016-11-13 15:07:14 -05:00
Atemo
afd6f2027d Fixed potential script (*)quest warning 2016-11-13 17:58:20 +01:00
Lemongrass3110
ea085f86f8 Follow up to 61ce61c 2016-11-12 13:47:54 +01:00
Yohanes Edwin
162c5a2c86 Fixed issue #1622: If player and NPC get same number of dice but the total is lower than 8 (#1650)
* Resolves players getting stuck in Airship Dice Quest.
Thanks to @MuzTank!
2016-11-11 16:25:28 -05:00
aleos89
c00c7346d2 Resolved some compile errors
* Follow up to 9c552ca and 5aa53e4.
2016-11-11 15:35:38 -05:00
aleos89
5aa53e4738 Merge branch 'master' into cleanup/storages_optimization 2016-11-11 14:54:43 -05:00
aleos89
56512ce116 Corrected vending order of similar item IDs
* Resolves an issue where if a similar item ID is vended more than once (non-stackable) the order of the vended items becomes incorrect when one is purchased.
Thanks to @Tokeiburu!
2016-11-11 14:26:32 -05:00
rAthenaAPI
4c2adc0d0b SQL synchronization 2016-11-11 05:41:34 +01:00
Cydh Ramdh
c7a9dd8b25 Corrected job for Crimson Weapons, Infinity Weapons, and a Spoon!
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-11-11 11:40:44 +07:00
Lemongrass3110
61ce61c7a0 Updated wiki references in README 2016-11-10 09:00:00 +01:00
Lemongrass3110
a03105b49d Fixed a potential map-server crash
Fixes #1398
2016-11-10 00:18:16 +01:00
Lemongrass3110
4687247769 Fixed a possible null pointer
Follow up to e93c888
See https://rathena.org/board/topic/108045-map-server-crash-after-using-skill-manhole/
2016-11-10 00:12:26 +01:00
aleos89
74a703d649 Corrected Anodyne usage on no teleport maps (fixes #1704)
* Added a missing break.
2016-11-09 09:36:10 -05:00
aleos89
550cfcad54 Merge branch 'master' of https://github.com/rathena/rathena 2016-11-08 11:10:33 -05:00
aleos89
623d845717 Fixed IgnoreDefClassRate check (fixes #1702)
* The item bonus will now properly check for a valid Class rather than a valid Race.
* Added IgnoreDefRaceRate and IgnoreDefClassRate to the item_bonus documentation.
Thanks to @Tokeiburu!
2016-11-08 11:07:08 -05:00
aleos89
9a009bf316 Corrected Spiritual Sphere Absorption and Cursed Circle interaction (fixes #1514)
* Spiritual Sphere Absorption will fail to go through if the caster is captured in Cursed Circle.
2016-11-07 16:46:21 -05:00
CairoLee
e21b39230a Clear unused battle configure "disp_serverbank_msg" 2016-11-07 22:00:37 +01:00
aleos89
c8d37c4448 Removed Frigg's Song from Group A Songs (fixes #1583)
* Song can now overlap with Group A and B Songs.
* Song was removed from group in Hero's Trail III patch.
2016-11-07 15:08:49 -05:00
aleos89
45d9674d2b Resolved rental timer display (fixes #1542)
* Resolves the timer display overflowing when an item is rented for a long duration.
Thanks to @mrjnumber1!
2016-11-07 14:39:43 -05:00
aleos89
cbc365d0f2 Corrected autospell bonuses (fixes #1593)
* Resolves the range check when the config is enabled not checking the proper distance between the two targets.
* Updated the item bonus documentation.
Thanks to @chriser-!
2016-11-06 14:15:12 -05:00
Playtester
78d9e2a245 Slave aggro (fixes #1676)
- Slaves will now become aggressive when their master starts chasing a target to attack it
2016-11-06 11:17:14 +01:00
rAthenaAPI
d0ce53e312 SQL synchronization 2016-11-06 06:10:56 +01:00
Sean Allen
8c3562a045 Fixed 3D_Glasses item script. (#1694)
* 3D_Glasses's item script Class=Job_Star_Gladiator2 is wrong, Changed to `Class==Job_Star_Gladiator2`
2016-11-06 12:10:50 +07:00
Aleos
0b68035248 Cleaned up instance parsing checks (#1610)
* Cleaned up instance parsing checks (fixes #1606)
* Changed atoi to strtol.
* Added data validation checks.
* References to #1609.
2016-11-05 09:56:28 -04:00
Cydh Ramdh
20e228a7f5 Fixed npc_cashshop_buy for 2010-11-16 client or older
* Failed to buy item from `itemshop` and `pointshop` NPC
* Thanks to Anime s2 that notices this

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-11-05 09:59:42 +07:00
aleos89
805f11d9f0 Added unit flag UF_CRAZYWEED_IMMUNE
* Follow up to 6e97762.
* Used to make unit skills immune to Crazy Vine's removal effect.
2016-11-03 21:54:04 -04:00
aleos89
6e9776203a Corrected Crazy Vines behavior (fixes #1522 and fixes #1689)
* Crazy Vines will now properly remove all ground type skills.
* Removed UF_REM_CRAZYWEED enum.
2016-11-03 21:17:34 -04:00
Cydh Ramdh
aa0b7cd7ba Removed duplicate check for storage size
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-11-04 07:27:26 +07:00
aleos89
cc733a9516 Corrected Voice of Siren's behavior (fixes #1680)
* Resolves traps not being avoided when the Maestro/Wanderer has enticed the trapper.
2016-11-03 18:10:34 -04:00
aleos89
06aec011c8 Fixed a potential map crash
* Follow up to dc8d466.
2016-11-03 10:17:19 -04:00
Cydh Ramdh
9c552ca256 Merge pull request #1620 from rathena/cleanup/storage_optimization-premium_storage
Initial release 'premium' storage
2016-11-03 11:41:05 +07:00
Akkarinage
9f888077c1 Adjusted Discord link in Readme.md
* Follow up to 378b4dd
2016-11-02 22:35:34 +00:00
Aleos
378b4dd569 Adjusted the Discord link in the README
* Follow up to 12ca9a0.
* Adjusted the link to a human readable format.
2016-11-02 18:06:27 -04:00
Lemongrass3110
418d8203e6 Refactored clif functions for unit names (#1664)
Refactored clif functions for unit names

Renamed clif_charnameack to clif_name and added additional parameters to follow other clif functions.

Removed clif_charnameupdate completely since it was just a copy of the BL_PC code in clif_charnameack and replaced all calls with clif_name_area.

Fixed guild position display
Fixes #1662
Thanks to @ghul3 for reporting it.

Removed useless params for some guild functions
2016-11-02 11:13:52 +01:00
Lemongrass3110
485ae6f8cf Fixed a bug in party creation
Fixes #1674
Thanks to @admkakaroto and @Grantea
2016-11-02 10:37:27 +01:00
Cydh Ramdh
4753407d63 Fixed memleak when player's string variable is cleared
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-11-01 20:33:08 +07:00
Jittapan Pluemsumran
12ca9a05e0 Add Discord link 2016-11-01 16:12:37 +07:00
rAthenaAPI
cf482a1f05 SQL synchronization 2016-11-01 06:13:27 +01:00
Cydh Ramdh
9fcdcbde3b Item DB Updates (#1592)
* Item DB Updates
* Corrected Aegis and English (iRO) names of Enchancement Stones & Shadow Equipments, credits to http://divine-pride.net
* Corrected Price for Shadow equipments to 0.
* Fixed #1586 item position for Essence of Evils.
* Updated effect of `Bear's Power`, script by @Lemongrass3110

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-11-01 12:13:24 +07:00
aleos89
b831287b0e Small documentation cleanups
* Cleaned up the inter_server.conf documentation.
* Cleaned up the script command openstorage2 documentation.
2016-11-01 09:08:59 +07:00
Cydh Ramdh
46b1de7d50 Initial release 'premium' storage
* Adapting official multiple storages.
* Added config to defines storages. See conf/import-tmpl/inter_server.conf.
* Added packet IZ `0x388c` for sending storage definitions.
* Added script command `openstorage2` to open premium storages.
* Removed `sd->storage_size`, replaced by `sd->storage.max_amount`. The value is defined in inter_server.conf in storage entries.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-11-01 09:08:55 +07:00
aleos89
dc8d466b03 Minor define cleanups
* Removed some variable defines that were redefines.
2016-10-31 21:58:28 -04:00
aleos89
c1d9520019 Added an extra ammo requirement for specific skills (fixes #1683)
* Severe Rainstorm, Round Trip, and Fire Rain now require +1 to their ammo requirement in order to successfully cast the skill.
* These skills will still consume their normal ammo amount.
Thanks to Fyrus for data mining!
2016-10-31 17:08:44 -04:00
Playtester
9a130fa0e8 SG counter and other status variables (bugreport:7449)
- Fixed extra status variables not being cleared correctly when the killed unit did not have any status change
(e.g. SG counter will now be set back to 0 when a monster dies)

Reference: https://rathena.org/board/tracker/issue-7449-storm-gust-counter-does-not-get-reset-on-mob-dead/
2016-10-30 13:27:30 +01:00
Akkarinage
644d809ddb Added missing items for IG_Mysterious_Travel_Sack4
Used Divine-Pride as a source of data. Their information seems to be the most up-to-date source at the moment.

Signed-off-by: Akkarinage <akkarin@rathena.org>
2016-10-30 10:24:23 +07:00
Playtester
5d24d73abf Lex Divina on allies (fixes #1668)
- Lex Divina can now be cast on a silenced ally
- When casting Lex Divina on an ally that is not silenced, it will no longer display the skill animation
2016-10-29 19:43:53 +02:00
aleos89
f310f335a1 Merge branch 'master' of https://github.com/rathena/rathena 2016-10-29 12:44:41 -04:00
aleos89
561a874833 Fixed Falcon Assault element (fixes #1659)
* Partial revert of 1d8bec3.
* Element should always be neutral.
* Renewal mode ignores the target's defense cards.
2016-10-29 12:44:11 -04:00
Lemongrass3110
6f67a65855 Added documentation for item links in mes (#1616)
Fixes #1614
2016-10-29 16:28:51 +01:00
aleos89
a0caaa1036 Fixed cart data for older cart types
* Follow up to c0bd422.
* Resolves older carts that don't use the SC_PUSH_CART status to update their weight and item data properly.
* Moved to pc_scdata_received so that it will hit both versions just fine.
Thanks to @Lemongrass3110!
2016-10-28 17:51:58 -04:00
aleos89
481a730ebc Adjusted some script syntax
* Follow up to d017e24.
Thanks to @Tokeiburu!
2016-10-28 17:33:30 -04:00
Jey
c14e67426b Fixes Phantom Thrust in PvE. 2016-10-28 12:27:52 +07:00
aleos89
c0bd422af2 Resolved some more inventory issues
* Moved storage type loading further up the chain to ensure data is loaded sooner.
* Resolved cart weight and cart count to update properly.
* Resolved item display index not displaying in the correct order when opening a Vending Shop.
Thanks to @Tokeiburu!
2016-10-27 20:28:31 -04:00
aleos89
e9c5dc6e16 Fixed instance maps not being freed
* Follow up to 2cfb844.
* Resolves instance maps not getting freed when the instance is destroyed.
Thanks to @Akkarinage!
2016-10-26 19:18:57 -04:00
Smokexyz
428e516187 Typo in ipban.c (#1654) 2016-10-24 23:40:52 +02:00
Jittapan Pluemsumran
1c74af7b1f Merge pull request #1637 from rathena/hotfix/issue1636
Fixed unknown state handling in mob skills
2016-10-23 18:29:33 +07:00
Playtester
6dfaa0b17b Siroma and Imp Cards (fixes #1646)
- Pre-re: Skill-specific cast time reductions no longer stack additively with global cast time reductions
2016-10-22 12:48:07 +02:00
Playtester
04cf397ea5 Occult Impaction damage (fixes #1641)
- Fixed Occult Impaction damage being double as high as it should be
- In renewal, the skill ratio is now applied to the piercing effect
(If a skill deals 400% damage, the piercing effect will now also be 4 times more effective.)
2016-10-22 12:32:26 +02:00
Akkarinage
d20cbcae48 Removed use of petheal command from pet_db.txt in both PRE and RE modes. (#1648)
Removed use of petheal command from pet_db.txt in both PRE and RE modes.
* Changed documentation to show deprecation more prominently.
* Closes #1576.
* Removed script command petheal.

Signed-off-by: Akkarinage <akkarin@rathena.org>
2016-10-21 15:25:32 -04:00
Lemongrass3110
40430d6cb5 Fixing buildbots(for real)
Sorry guys this should not have landed in master...
2016-10-20 00:27:53 +02:00
Lemongrass3110
7d0931a45d Follow up 3108bb1
Fixed a typo with configure call
2016-10-20 00:14:02 +02:00
Lemongrass3110
ed53167bc8 Follow up abd9809
appveyor lost the quotes
2016-10-20 00:11:52 +02:00
Lemongrass3110
abd98090d1 Follow up to dd55592 2016-10-20 00:01:03 +02:00
Lemongrass3110
dd555926a0 Reenabled buildbot defines
Now builds will fail if any warnings or errors occur.

Removed duplicated "matrix" keyword I added accidentally in 3108bb1.
Removed a default warning in run once mode in the character server. Follow up to a0b3e51
2016-10-19 23:58:29 +02:00
Lemongrass3110
3108bb1265 Added a configure option for vip features
Added the new option to the CI matrix
2016-10-19 23:15:13 +02:00
Lemongrass3110
15b40509d6 Added a -D equivalent for msbuild
Fixes appveyor not building in pre-renewal mode
2016-10-19 23:14:44 +02:00
Lemongrass3110
4db687c7a4 Fixed unknown state handling in mob skills 2016-10-19 14:46:11 +02:00
Lemongrass3110
b2f0ffb947 Fixed a potential server crash in mob_chat_db
Fixes #1635
Thanks to @Temtaime
2016-10-19 12:24:46 +02:00
Lemongrass3110
3ad16f04fb Merge pull request #1634 from Temtaime/patch-1
Fix type in warning message

Thanks to @Temtaime
2016-10-19 12:18:32 +02:00
Temtaime
655d6f56e7 Fix type in warning message 2016-10-19 12:35:12 +03:00
Aleos
e93c8880b3 Updated Manhole skill behavior (#1617)
* Updated Manhole skill behavior
* Fixes #1601
* GvG and Battleground monster objects are not able to be targeted by Manhole.
* Removed the usage of Strip Accessory on targets who are affected by Manhole.
Thanks to @ignizh!
2016-10-18 17:59:32 -04:00
Lemongrass3110
73eb96f358 Introducing charpointer macros for fifo/buffers (#1624)
* Introducing charpointer macros for fifo/buffers
2016-10-18 23:35:21 +02:00
Lemongrass3110
56c9765fe0 Fixed a wrong close in the eye of hellion quest
Merges HerculesWS/Hercules@d8441a3
Thanks to @Ridley8819
2016-10-18 22:49:18 +02:00
aleos89
031adff925 Updated Ranger Traps behavior
* Fixes #1611.
* Magenta, Cobalt, Maize, and Verdure Traps should permanently change the element of the target.
2016-10-18 21:54:46 +02:00
Lemongrass3110
55c5627eef Fixed compilation warning in pre-re
Fixes #1627
Thanks to @keitenai
2016-10-17 13:53:04 +02:00
rAthenaAPI
a0c7d6e2fe SQL synchronization 2016-10-16 23:07:52 +02:00
Lemongrass3110
568262faf4 Added latest npc constants
Also added some mob placeholders
2016-10-16 23:07:28 +02:00
Lemongrass3110
57131f286c Fixed some compile warnings
Fixes #1623
Thanks to @lelouch22
2016-10-16 14:20:17 +02:00
Lemongrass3110
48c43cf92f Refactored clif_charnameack
Added support for ZC_ACK_REQNAMEALL2 which is used from 2015-05-13 and higher
Added packet documentation for ZC_ACCEPT_ENTER3
Fixed some visual effects not being resent when using `@refresh`. Thanks to @Grantea
2016-10-16 12:58:03 +02:00
aleos89
7e2efec61b Moved some inventory checks
* Resolved item bonuses not properly being given that get applied before the player's inventory is received.
* Resolved rental items that have Status Changes attached to them not getting removed if the timer expired when the player logs in.
* Removed an extra call for player's with item sets.
Thanks to @Tokeiburu!
2016-10-14 12:50:06 -04:00
Jittapan Pluemsumran
09cb81d98e Added a sample for utilizing the random option system. 2016-10-14 19:38:15 +07:00
Lemongrass3110
2bde36fb9d Merge pull request #1563 from rathena/cleanup/npc_name_length
Expand NPC Name Length to 50

Thanks to @cydh!
2016-10-14 09:37:36 +02:00
Lemongrass3110
6a8985531b Fixed NPC markets
Fixed signedness warnings for the sanity zero-terminations
2016-10-14 09:14:22 +02:00
Lemongrass3110
e443f846c6 Increased EVENT_NAME_LENGTH and some more cleanups
Fixed an invalid reference in clif.c(follow up to 008be23)
Moved the OnWhisperGlobal name definition to the other special event name declarations
Increased EVENT_NAME_LENGTH from 51 to 77 characters because it uses NPCs exname which can be up to 50 characters now
Added a warning when an NPCs exname is too long for an OnWhisperEvent
2016-10-14 09:13:53 +02:00
Lemongrass3110
b60f74c3df Sanity zero-termination for NAME_LENGTH usages 2016-10-14 09:13:21 +02:00
Lemongrass3110
4d71a12d00 Fixed a few EVENT_NAME_LENGTH usages 2016-10-14 09:11:28 +02:00
Cydh Ramdh
d3077435e8 Expand NPC Name Length to 50
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-10-14 09:11:28 +02:00
Cydh Ramdh
748035141b Merge branch 'master' into cleanup/storages_optimization 2016-10-14 06:12:52 +07:00
Cydh Ramdh
b2c4178209 Corrected 'VIP' personal info notification (#1613)
* Only displayed when map-server is changed or when changing map that has different base rate with previous map's rate, should not when map changed/warped.
* Updated some packet that related with VIP and its doc.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-10-14 06:04:09 +07:00
Lemongrass3110
768d801f3d Merged storage loading into a single function
Follow up to 800714a forgot to eliminate TABLE_CART_ completely.
2016-10-14 00:41:15 +02:00
aleos89
a8c8cbd498 Small cleanups
* Corrected the spacing to tabs in a few locations.
* Corrected a variable typo.
2016-10-13 18:06:58 -04:00
Lemongrass3110
800714abfe Reverted a lot of e8f4500
Wasted 11 bytes of network traffic to keep the code clean.

Process:
1) A player tries to open a vending store and is now in the pre-vend state.
2) If all items in the cart are saved then he can proceed to opening the store.
3) If not a request to save the cart data is sent to the inter server.
4) If the acknowledgment packet from the inter server is received then check if the player is still online and in pre-vend state and open the vending dialog
2016-10-13 23:53:34 +02:00
Cydh Ramdh
8f3599b0e3 Fixed VIP char selection window (#1598)
* Char selection window went crazy when `VIP_ENABLE` is defined
* Fixed #628

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-10-12 06:26:30 +07:00
aleos89
6663df344b Corrected script command statusup2 documentation (fixes #1612)
* Corrected the documentation referencing the wrong script command.
* Removed some trailing white spaces.
* Prettified some text.
Thanks to @lucasoli!
2016-10-11 14:23:15 -04:00
Jittapan Pluemsumran
f51a1c74ba Removed additional clif_maptypeproperty2 calls 2016-10-11 08:45:03 +02:00
Lemongrass3110
940c473c88 Cleaned up map property sending functions
Implemented ZC_MAPPROPERTY_R2 properly
2016-10-11 08:45:03 +02:00
Lemongrass3110
ce9e623e47 Added a configuration for deletion restriction
Additionally added the checks to char_delete_char_sql so it is triggered on deletion itself and from older packets(chclif_parse_delchar) too.
2016-10-11 08:41:06 +02:00
Cem YILMAZ
5ea873b8b2 Added guild/party checks for character deletion process #1480 2016-10-11 08:41:06 +02:00
Cydh Ramdh
3e4d2b86c2 Merge pull request #1089 from Baalberith6/autotrade
Fixing @at venders being stuck when map->char connection gets reset.
2016-10-11 12:38:14 +07:00
Lemongrass3110
103ee947ff Follow up to f0dd764
Fixed compile/merge errors from 5a56210
2016-10-10 13:13:23 +02:00
Lemongrass3110
f0dd764095 Merge branch 'master' into cleanup/storages_optimization
# Conflicts:
#	src/map/script.c
2016-10-10 13:06:52 +02:00
Jittapan Pluemsumran
10946dd891 Removed README.txt
README.md in its text form is already human-readable.
2016-10-09 09:12:34 +07:00
Cydh Ramdh
19d620575a Fixed #1575, cart cannot be changed.
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-10-09 08:29:16 +07:00
Cydh Ramdh
cd0b2b2974 Follow up 9a52768f6f (#1595)
* Fixed #1594, compile warning

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-10-08 06:01:00 +07:00
Cydh Ramdh
9a52768f6f Cleanup party withdraw (#1585)
* Added enum for withdraw result in mmo.h.
* Added name of kicked player and changed `sd` init from `account_id` to `char_id`.
* Fixed party list window isn't updated when member kicked.
* Updated packet documentation.
* Thanks to @aleos89 @Lemongrass3110

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-10-06 10:58:05 +07:00
Jittapan Pluemsumran
01b1052570 Merge pull request #1589 from rathena/hotfix/issue1587
Fixed random options being removed on card removal
2016-10-03 21:50:08 +07:00
Lemongrass3110
5a5621073f Fixed random options being removed on cardremoval
Fixes #1587
2016-10-03 13:31:20 +02:00
Jittapan Pluemsumran
6510d414fa Merged warp and warpchar into a single function (#1584)
* the warp command now allows you to warp other players
* the warpchar script command is still usable but not recommended
* removed warpchar documentation from script_commands.txt to let it fade from people's memory
2016-10-02 23:25:03 +02:00
Atemo
6216bfbbfd Fixed Kafra length name follow up 7a011ecd34 2016-10-01 22:14:14 +02:00
rAthenaAPI
963cfa5771 SQL synchronization 2016-10-01 16:54:54 +02:00
Jittapan Pluemsumran
7a011ecd34 Merge pull request #981 from rathena/woe_te-restrictions
WoE:Training Edition implementation
* Added a new version of WoE, WoE:TE which forbids 3rd class and 2nd expanded class from joining.
  - 10 new WoE castles.
  - New zone for job_noenter_map.txt
  - Various items are restricted.
* New monsters for the guild dungeon.
2016-10-01 21:54:44 +07:00
aleos89
42ce38c286 Renamed WoE:TE directory and files
* Now matches WoE:FE and WoE:SE format
* Now reflects respective script commands.
2016-10-01 10:17:21 -04:00
Lemongrass3110
3b09de10e9 Fixed random options with MAX_ITEM_RDM_OPT < 5 (#1580)
* Fixed random options with MAX_ITEM_RDM_OPT < 5

Fixed a possible issue on 2015 clients with random options, if you define an amount less than 5, because the client expects that much.

* Fixed a copy-paste mistake

Follow up to 6a01375
Thanks to @secretdataz
2016-09-30 22:26:37 +07:00
aleos89
01e5fbe0b7 Fixed an ambiguous if statement (fixes #1581)
* Resolves a compile warning for a multi-line define.
2016-09-30 10:16:16 -04:00
Atemo
14628e2d4d Corrected function name in the comment 2016-09-29 20:15:30 +02:00
aleos89
fed68141fa Cleaned up the WoE:TE NPC dialogues 2016-09-29 13:09:41 -04:00
Lemongrass3110
30647011e2 Small cleanups 2016-09-29 15:04:35 +02:00
Jittapan Pluemsumran
228f0c5e3b Export some more constant for multiple purposes
- MAX_* for iteration purpose
- INT_MIN and INT_MAX for sanity check
- NAME_LENGTH / PASSWD_LENGTH for in-game account manipulation
2016-09-29 18:28:24 +07:00
Lemongrass3110
2661b7a23d Added missing script changelog entries 2016-09-29 09:41:51 +02:00
Lemongrass3110
9e176ce8d1 Whitespace cleanup from merging
Follow up to 644e294.
Sorry somehow tortoise git always screws up with those lines...
2016-09-29 08:19:26 +02:00
Lemongrass3110
644e294699 Merge branch 'master' into woe_te-restrictions
# Conflicts:
#	npc/re/mapflag/nobranch.txt
#	npc/re/mapflag/nomemo.txt
#	npc/re/mapflag/noteleport.txt
#	npc/re/scripts_athena.conf
#	src/map/atcommand.c
#	src/map/map.h
#	src/map/script.c
#	src/map/script_constants.h
2016-09-29 08:13:31 +02:00
Cydh Ramdh
6d31591258 Updated Monster Skills. Thanks to @aleos89 !
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-09-29 08:23:39 +07:00
aleos89
f4f4367c52 Corrected Eleanor's Eternal Quick Combo behavior (fixes #1568)
* Adjusted skill type to misc.
* Added missing damage calculation.
* Corrected the Equipment ATK reduction.
* Moved the Stun addition and Tinder Breaker removal to skill_additional_effect.
2016-09-28 13:59:40 -04:00
aleos89
7be38fa70f Enabled Warlock for atcommand bodystyle 2016-09-28 12:43:39 -04:00
Lemongrass3110
8e3da7ffed Changed mob parsing order (#1573)
Fixes #1572
2016-09-27 19:28:05 +02:00
Lemongrass3110
0c07b660b9 Updated buyingstore list (#1570)
* Updated renewal buyingstore list
* Updated some older/commented entries in renewal
* Updated pre-renewal buyingstore list
2016-09-27 19:12:31 +02:00
Jittapan Pluemsumran
90539f48b3 Added English comments in nullpo.h (#1556)
* Added English comments in nullpo.h
* Updated comment formatting
* Added _f functions for Visual Studio
2016-09-23 16:34:55 +02:00
Cydh Ramdh
79b39e5a1d Exports constants
* `SI_MERMAID_LONGING`
* `SI_MAGICAL_FEATHER`

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-09-21 19:35:59 +07:00
Playtester
0e4d6a4f24 Monster Storm Gust and Sightrasher (fixes #1562)
- Storm Gust and Sightrasher Level 10 when used by monsters will now deal the same damage as when used by a player
2016-09-19 18:23:13 +02:00
rAthenaAPI
e820ef9090 SQL synchronization 2016-09-17 04:29:31 +02:00
Jittapan Pluemsumran
c1b455235b Merge pull request #1559 from Jeybla/FixQuadrille2
[Fix] Quadrille [2] (16024) Jobmask
2016-09-17 09:29:25 +07:00
Jey
9425f54904 [Fix] Quadrille [2] (16024) Jobmask 2016-09-17 04:17:20 +02:00
rAthenaAPI
5f20c0ce0c SQL synchronization 2016-09-16 04:48:05 +02:00
Cydh Ramdh
0fc59c7c8a Item DB Updates
* Added missing job, upper, and gender values
* Added new items
* Added new packages (IG_Ink_Ball and IG_Something_Candy_Holder credits to Divine-Pride.net)

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-09-16 09:36:55 +07:00
Lemongrass3110
0c903a0771 Added AL_HEAL to power skill list
Thanks to @Playtester
2016-09-15 08:31:28 +02:00
Cydh Ramdh
7d72a70c5c Follow up 61a57668ed
* Missing semicolon

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-09-15 09:38:19 +07:00
rAthenaAPI
328ef187a6 SQL synchronization 2016-09-14 08:19:18 +02:00
Lemongrass3110
61a57668ed Nightmare Glastheim (#1541)
Originally released by @Ridley8819 on HerculesWS/Hercules@114767c

Additions:
Added drops for Baphomet and Chimera
Removed duplicated champion monsters

@aleos89 cleaned up NPC dialogue and some of the grammar.
2016-09-14 08:19:14 +02:00
rAthenaAPI
2c0cf04ebe SQL synchronization 2016-09-14 07:38:40 +02:00
Jittapan Pluemsumran
633934bbac Merge pull request #1555 from zackdreaver/master
Renewal item_db update
2016-09-14 12:38:34 +07:00
zackdreaver
17eab30242 Renewal item_db update:
- Add new costumes

Signed-off-by: zackdreaver <zackdreaver@gmail.com>
2016-09-13 19:07:06 +07:00
zackdreaver
ef113cebf0 Renewal item_db update
- Fix mdef of shadow handicraft (itemID 5750)
- Add new gears

Signed-off-by: zackdreaver <zackdreaver@gmail.com>
2016-09-13 15:10:26 +07:00
aleos89
391f0d68fd Fixed map-server errors from Cloud Kill (fixes #1553)
* Resolves the Cloud Kill status trying to add a timer to a dead target.
2016-09-12 11:04:01 -04:00
Jittapan Pluemsumran
64e15932aa Cleaned up Dimensional Gap NPCs 2016-09-12 20:55:43 +07:00
Jittapan Pluemsumran
ddac48d5dd Adjusted minimum vit_penalty_num config to 1 to avoid potential crash
* To disable this feature, just set vit_penalty_type to 0 is enough!
2016-09-12 18:26:45 +07:00
Cydh Ramdh
6aed7e0245 Added WOE TE monsters and spawn
* Monsters for Godly Quest, Guild Dungeons, missions, and treasure
* Thanks to http://Divine-Pride.net and @aleos89

NOTES:
* Monster English names following db.irowiki.org
* Need official name for monsters 2428 ~ 2440
* Monster modes are from various informations

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-09-12 14:23:42 +07:00
Jittapan Pluemsumran
33cda97717 Battleground script command expansion (#1534)
* Implemented 2 new battleground commands. Closes #1531.
* bg_join - join battleground without npc chat room
* bg_create - create a battle group without npc chat room
* Made events for bg_create and waitingroom2bg optional
* Made map,x,y parameters on waitingroom2bg_single optional

Thanks to @Lemongrass3110 and @cydh for code reviews
Thanks to @aleos89 for documentation cleanup
2016-09-12 13:30:50 +07:00
Cydh Ramdh
dc8471d77e Fixed Cart is not shown after relog (#1472)
* Fixed #1391
* Clean up `clif_status_change`

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-09-11 06:45:56 +07:00
Cydh Ramdh
17946ea286 Fixed Cart save issue for vending (#1551)
* Added check if cart need to be saved first or not before vending
* Removed `id` from item struct when new item added to cart.
  * The `id` value from inventory is never be used, on relog, `id`s for cart are always use 'real' value from table.
  * 0-ing the value also prevent wrong `id` number while inserting records to `vending_items`.
* Ordered by `id` whiel loading cart items from table.
* Initialize `sd->inventory`,  `sd->inventory`, and `sd->storage` to 0 on `pc_authok`

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-09-11 06:40:03 +07:00
Jittapan Pluemsumran
4ef35f4d1f Added missing close; in Ayothaya shaman 2016-09-09 16:58:15 +07:00
Jittapan Pluemsumran
bc7f2037ca Fixed Bakonawa spawn coordinate. Fixes #1544.
* Thanks to @Indigo000
2016-09-09 09:22:55 +07:00
Jittapan Pluemsumran
8d60ed2205 Adjusted Nightmare Clock Tower warper to use scope variable instead of temporary char variable 2016-09-09 08:46:31 +07:00
rAthenaAPI
6fddd9caac SQL synchronization 2016-09-09 00:54:29 +02:00
Cydh Ramdh
b46e4332df Item Updates and New Status Changes (#1539)
* Item Updates
* Added new Status Changes
* Implemented effect for respective items
  * 12874,Frost_Giant_Blood: SC_GVG_GIANT
  * 12875,Golem_Stone: SC_GVG_GOLEM
  * 12876,Elf_Tear_Stun: SC_GVG_STUN
  * 12877,Elf_Tear_Stone_Curse: SC_GVG_STONE
  * 12878,Elf_Tear_Freezing: SC_GVG_FREEZ
  * 12879,Elf_Tear_Sleep: SC_GVG_SLEEP
  * 12880,Elf_Tear_Curse: SC_GVG_CURSE
  * 12881,Elf_Tear_Silence: SC_GVG_SILENCE
  * 12882,Elf_Tear_Blind: SC_GVG_BLIND
* Thanks Divine-Pride.net

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

* Follow up 9267a32d8c
* Updated Status Change doc
2016-09-09 05:54:22 +07:00
RagnarokNova
7d0c7d8b24 Initial Release of Dimensional Gap (dali) NPCs 2016-09-08 22:54:15 +07:00
Jittapan Pluemsumran
d074cf67a7 Revert "Corrected Mora Daily Quest Job EXP formula"
This reverts commit 3607efd5c6.
2016-09-08 13:18:52 +07:00
Atemo
d62f422e3d Corrected OnTouch/OnTouch_ in NPC script (#1548)
Some leftover from aegis convertion..

Skipped pre-re folder, I don't have old data.
2016-09-07 21:35:14 +02:00
rAthenaAPI
18a8c735c5 SQL synchronization 2016-09-07 09:20:39 +02:00
Lemongrass3110
aaa2ca86e4 Fixed ATK2 values for nightmare clock tower 2016-09-07 09:20:08 +02:00
aleos89
cb252ded85 Storage types optimization clean ups
* Removed char_inventory_to_sql and merged differences with char_memitemdata_to_sql.
Thanks to @Jeybla's suggestion!
2016-09-06 14:43:52 -04:00
aleos89
7a05b59dd1 Merge branch 'master' into cleanup/storages_optimization 2016-09-06 13:40:01 -04:00
aleos89
c3a308ffdb Storage types optimization fixes
* Fixed guild storage getting reset on server restart.
* Adjusted a guild bound item acknowledgment attempting to create guild storage data if not found.
* Added expire_time to guild storage data.
* Added some missing random option item checks.
Thanks to @Jeybla!
2016-09-06 13:16:14 -04:00
aleos89
adbabeeef5 Fixed guild storage item transfers
* Fixed items not getting removed from inventory/cart when transferring to guild storage.
Thanks to @Jeybla!
2016-09-06 11:18:33 -04:00
rAthenaAPI
538f44fd15 SQL synchronization 2016-09-06 14:36:16 +02:00
LiMoon
71c8cc3006 Corrected weight for item 19033 and 22826
* Merges #1500.
2016-09-06 19:35:34 +07:00
Atemo
23b271c958 Initial release of nocostume map flag (#1137)
* Initial release of `nocostume` map flag to follow official `DISABLE_COSTUMEITEM` map property.
* Added map flag `nocostume`, current confirmed maps are TE Castles and Guild Dungeons.
* Fixed #815.
* Stores `setlook` values so it won't be removed on `nocostume` mapflag

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-09-06 11:34:36 +02:00
Atemo
bbb2945858 The mobs shouldn't be killed when the emperium is broken. Thanks @cydh 2016-09-05 16:15:55 +02:00
Atemo
2995ba0908 Mapflag:
- added monster_noteleport in TE castle (need official info)
Missions:
- corrected playtime check value
God quest TE:
- Changed $@2012_tegod_kafra -> $2012_tegod_kafra ; $@2012_tegod_gloria -> $2012_tegod_gloria as it should be
- Corrected lowest economy set to 1
- Minor debug and standardise script
WOE main script:
- Added a condition for mobs spawn (case guildbreak)
2016-09-02 01:36:16 +02:00
aleos89
7ffb943343 Storage optimization clean ups
* Cleaned up some of the script command documentation.
* Adjusted some checks to use constants.
2016-08-31 19:55:19 -04:00
Atemo
58c0920e5d Applied new npctalk syntax to the existing scripts 2016-08-31 19:12:12 +02:00
Atemo
55b30623fc Fix a small typo 2016-08-31 19:02:09 +02:00
Cydh Ramdh
0df1ba0a20 TE Updates
* Implemented `job_noenter_map.txt` for TE maps.
* Added job list that cannot enter TE Castles and Guild Dungeons.
* Replaced `getpermissionwoete` with `jobcanentermap`.
* Added missing quest `7516`.
* Fixed typo in TE Mission NPC.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-08-31 14:42:49 +07:00
Cydh Ramdh
65a90ff84c Merge branch 'master' into woe_te-restrictions 2016-08-31 08:03:34 +07:00
aleos89
ab7324c84c Resolved some compile warnings
* Removed an unused variable.
* Resolved an uninitialized variable issue.
2016-08-30 20:58:40 -04:00
aleos89
bd36b294ad Merge branch 'master' into cleanup/storages_optimization 2016-08-30 19:40:36 -04:00
Cydh Ramdh
fa16e30593 TE updates:
* Change God Item final broadcast from `mapannounce` to `announce`.
* Fixed variable typo in `#tequest_master_prt01` NPC. `$@2012_tegod_kafra` to `$@2012_tegod_gloria`
* Missing `OnMyMobDead` label in `#tequest_master_prt01` NPC.
* Corrected the castle Economy and Defense lowest level is 1, not 0.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-08-30 19:36:13 +07:00
Atemo
b83bfd06f5 Rental merchant:
- shouldn't count equipped item (allowing to rent multiple item)
2016-08-28 22:36:58 +02:00
Atemo
e0550db4d8 Changed maprespawnguildid flag on emperium broken.
All monsters were removed, now don't remove monsters.
2016-08-28 17:50:18 +02:00
Cydh Ramdh
c5e9ce0931 * Added 'dummy' Monsters: WOE TE Treasure Chests, Thief Poring and Suspicious Baby for TE mission. Credits to http://Divine-Pride.net
* Reverted changes of Hervor Avtir against master branch

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-08-27 08:46:31 +07:00
Cydh Ramdh
8805e7e1d8 Merge branch 'master' into woe_te-restrictions 2016-08-27 07:04:41 +07:00
Cydh Ramdh
682f9184ac Follow up e6f3bf2035
* Revert removed `noequip` flags
* Typo fix

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-08-27 06:21:43 +07:00
aleos89
eeccb70050 Merge branch 'master' into cleanup/storages_optimization
Conflicts:
	doc/script_commands.txt
	src/map/pc.c
	src/map/script.c
2016-06-01 13:24:27 -04:00
Florian Wilkemeyer
1f34a8cd10 Re-Added PostBuild Step to map-server VCProject which copies the corresponding conf/import-tmpl to conf/import if they do'nt exist.
Note:
this build-step has been taken from the old VCProject file.
A cleaner way would be a separate POST_BUILD Dummy-Project which executes a batch file which would perform these actions. (So it's subject-to-change :))
2016-04-25 12:56:44 +02:00
Florian Wilkemeyer
4f47f1fab0 Added Visual Studio 2013 Solution && Clean Project Files with proper dependencies
- x64/AMD64 Support prepared (will be added in a followup commit, it needs some changes in 3rdpary libs)
2016-04-25 12:49:35 +02:00
Florian Wilkemeyer
5052751f83 Removed old VS9-15 Solutions && VC-Project files. 2016-04-25 11:47:13 +02:00
aleos89
09dd7bd77f Fixed players getting stuck in storage
* Resolves an issue when the server saves character data and the character is in their storage resulting in the storage_flag being removed too early.
Thanks to @stealth62!
2016-04-07 11:04:22 -04:00
aleos89
cedc56f74a Resolved compile errors for 2015 clients
* Refactored some missing inventory checks from recent updates.
2016-04-07 10:01:13 -04:00
Atemo
2b7861531b Kvm items usable (tested with Tasty White Ration) 2016-04-04 21:20:16 +02:00
Atemo
e6f3bf2035 Added some mapflag and removed phen card & co. since map_flag_gvg already block bNoCastCancel in unit.c (and the other effect of the items sholdn't be removed) 2016-04-04 20:58:08 +02:00
Atemo
3a558ff83b Rename canParticipateSiegeTE into getpermissionwoete 2016-04-04 20:35:58 +02:00
Atemo
b3d150c3a5 Merge branch 'master' into woe_te-restrictions 2016-04-04 20:22:25 +02:00
Atemo
5f46a5c1f7 Items and skills restrictions 2016-04-04 03:36:39 +02:00
aleos89
d88a6aca45 Optimized Inventory, Cart Inventory, and Storage usage
* These storage types now mimic Guild Storage and can be loaded/saved whenever needed.
* Relieves mmo_charstatus from having to send storage types and lets the char-server handle it.
* All storage types now have an increased max amount.
* Fixes #441 - Players will no longer be required to log out to resync cart item data before opening a Vending Store.
* Refactored player weight and cart weight calculations into their own functions.
* Added script commands guildstoragecountitem[2] and guildstoragedelitem[2].
* Refactored several function return types as well as documentation.
Thanks to @lighta and @cydh for their help with it!
2016-03-29 13:30:27 -04:00
Matej Pristak
df1108923a Fixing venders being stuck when map->char connection gets reset. 2016-03-22 20:55:34 +01:00
Atemo
bb66035048 Removed duplicate of canParticipateSiegeTE
Added some mapflag
Corrected typo in god quest
2016-03-12 16:27:47 +01:00
Atemo
d072a80ac5 Merge branch 'woe_te-restrictions' of https://github.com/rathena/rathena into woe_te-restrictions 2016-03-12 16:24:40 +01:00
Cydh Ramdh
292098d911 Documentation update for
* `canParticipateSiegeTE` script

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-03-12 06:29:30 +07:00
Atemo
38aaba07ca Corrected typo
Thanks @aleos89
2016-03-01 01:56:57 +01:00
Atemo
afb740442e Typo 2016-02-29 20:18:53 +01:00
Atemo
db53e580af Typo update 2016-02-29 20:06:24 +01:00
Cydh Ramdh
ccf52095a3 Follow up 26dcf345fe
* Added necessary mapflags.
* Corrected documentation.
* Fixed some typos.
* Thanks to @Atemo

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-02-28 18:17:49 +07:00
Atemo
c094314b66 Merge branch 'woe_te' into woe_te-restrictions
Signed-off-by: Atemo <capucrath@gmail.com>
2016-02-24 16:44:36 +01:00
Atemo
883b5cc919 Little update 2016-02-24 04:45:47 +01:00
Cydh Ramdh
26dcf345fe Added WOE:TE Restrictions
* Added mapflag `gvg_te`, `gvg_te_castle`, this is will be activated during WOE:TE sessions. These changes are needed because of:
  * If `gvgon` is used, TE castles become `gvg`, it makes the restriction failure. Items that are supposed to only can be used/equipped in TE Castles, also affected in 'normal' GVG/WOE maps.
  * These flags used form `item_noequip`, `skill_nocast`, and `status_disabled` flag 16. (If just assume TE Castles are Restricted Zone 8, the failure will occurs as point 1 above).
* Added Restricted Zone 8 for TE Guild Dungeons, to prevent marriage skills can be casted there.
* Added command `gvgon3` to set GVG for WOE:TE Castles.
* Added command `canParticipateSiegeTE` is 'hardcoded' function to check player's job that can participate in WOE:TE.
  * Current usages in `GD_EMERGENCYCALL` and replace the in-script function.
* Changed default config `allow_consume_restricted_item` to 'no'. All restricted usable/consumable/healing items are always failed to be used.
* Changed the GVG items/skills restriction check. "Item cannot be equipped in GVG maps" are supposed to ignore the agit flag statuses, as long as the map is GVG flagged, items/skills are always restricted and otherwise.
* Moved previous entries of `skill_nocast` flag 16 as hardcode (for now).

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2016-02-20 09:33:07 +07:00
Atemo
adc8c46b4f Follow up de44eb1938 2016-02-05 15:52:04 +01:00
Atemo
9373c697b5 Added some source part. Thanks @aleos89 / @Cydh
Some debug thanks @Cydh
2016-02-05 15:48:26 +01:00
Atemo
de44eb1938 Added God items script TE Hervor and Jormungand.
Todo:
    Review the unittalk part (only the message should be displayed)
      - unittalk display the npc hidden name
      - npctalk display the visible name and don't have parameter to call another npc
2016-02-04 03:27:05 +01:00
Atemo
eec366f3ad Clean a redundant/ugly part 2016-02-03 02:48:43 +01:00
Atemo
14f09ca2bb Added unversioned files 2016-02-01 20:47:29 +01:00
Atemo
06db9fe81f TODO:
Check for maprespawnguildid parameter value (should remove monster?) Manager_TE npc in main_TE.txt
	Change in the folder:
		agitcheck -> agitcheck3
		OnAgitStart -> OnAgitStart3
		OnAgitInit -> OnAgitInit3
		OnAgitEnd -> OnAgitEnd3
	Add:
		OnAgitStart3
		OnAgitInit3
		OnAgitEnd3
		mob into mob_db.txt
		item_db restricted
	Convert:
		CheckSiegeTime 3 -> agitcheck3
		OpenHour_SiegeMode 3 3600 (seems to return 1 if woe start in less than 3600 secs)
		IsAllianceGuild
		ResetBuffLowLevelSiege
	Maybe move:
		te_merchant in merchant folder
		CanEnterwoeTE function into global function
	Search:
		hour start/end woe TE
		CanParticipatewoeTE function should include rebellion?
2016-02-01 20:44:16 +01:00
1459 changed files with 214626 additions and 89353 deletions

24
.editorconfig Normal file
View File

@@ -0,0 +1,24 @@
# rAthena EditorConfig file
# EditorConfig is awesome: https://EditorConfig.org
# This file should be encoded in UTF-8 with CRLF or LF line endings.
root = true
# Add a blank newline to the end of every file after saving
# Trim trailing whitespace
[*]
insert_final_newline = true
trim_trailing_whitespace = true
# YAML does not support hard tabs.
[*.{yml,yaml}]
indent_style = space
indent_size = 4
# Use tabs in Makefiles
[Makefile*]
indent_style = tab
# Scripts should use hard tabs to prevent script header goofs.
[npc/**.txt]
indent_style = tab

1
.gitattributes vendored
View File

@@ -5,6 +5,7 @@
*.vcxproj merge=union
*.sln text eol=crlf
*.bat text eol=crlf
athena-start text eol=lf
configure text eol=lf
configure.in text eol=lf
Makefile text eol=lf

175
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,175 @@
# Contributing to rAthena
Table of Contents
-----------------
* [Reporting Bugs](#reporting-bugs)
* [Suggesting Enhancements](#suggesting-enhancements)
* [Issue Labels](#issue-labels)
* [Become a Team Member](#become-a-team-member)
Reporting Bugs
--------------
This bit of information is here to guide you through the process of creating a bug report for rAthena! Issues cannot only be used for developers to track bugs, but they can also track enhancements and tasks. The more detailed your report is, the easier it is for developers to reproduce and resolve the bug!
### Did you find a bug? :bug:
* **Ensure the bug is not coming from a customization** within your files!
* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/rathena/rathena/issues). If the same issue exists, feel free to leave a comment and tell us you are experiencing the issue as well and if possible add some additional or missing information!
* If you are unable to find an open issue addressing the problem, [open a new one](#submit-a-bug-report)!
#### Submit A Bug Report :inbox_tray:
There are several things that go into making a bug report a good bug report!
This is a breakdown of a generic Issue:
* **Title** should give some general insight as to what the bug is about.
* **Description** should give greater detail of the bug that cannot be explained in the **Title**.
* **Labels** are colored to represent a category they fall into.
* **Milestones** are what developers use to group tasks together and quickly evaluate how close the project deliverable is near completion.
* **Assignees** are developers who are directly linked to resolve the issue.
* **Comments** allow other members to give feedback on the issue.
#### What are some good details to provide in a bug report? :pencil2:
When describing your Issue through the **Description** area, it is recommended that you provide as much information as possible to resolve the Issue as fast as possible. Keep in mind that you can tag people within the **Description** area through the `@mention` feature. You can also tag other Issues or Pull Requests by typing `#` which will pull up a list of issues. You can find a markdown guide at [Mastering Markdown](https://guides.github.com/features/mastering-markdown/).
Some information to keep in mind while creating an Issue:
* **GitHub Hash**: The hash is a 40 alpha-numeric string (which can be broken down to the first 7 characters) which states the version you are at. (**If you are using SVN instead of Git:** Please also put the change date and first line of the commit message beside the revision number, or we will not be able to look up the corresponding Git hash).
* **Client Date**: The client date provides specific details depending on the issue. The main detail is that it helps narrow down issues that are related to a packet problem.
* **Modifications that may affect results**: It is always best to try to reproduce your issue on a clean rAthena if you have lots of modifications.
* **Description of Issue**: Describe your issue in detail! Screenshots and videos help a lot! Please also provide crash dumps if one of the servers is crashing.
* **How to Reproduce Issue**: Describe how to reproduce your issue in detail! The more the merrier!
* **Official Info**: Provide creditable sources to state why it is a bug! Please do not provide an iRO Wiki link as there is a high chance it does not match kRO behavior.
#### Be wary of the `@mention` feature! :warning:
Since rAthena uses custom `@commands`, when describing an issue that deals with these commands please keep in mind that this does clash with the `@mention` system for GitHub! Always quote the text when mentioning an ``` `@command` ```(like this) so that you do not tag uninvolved GitHub users!
Suggesting Enhancements
-----------------------
### Did you write a patch that fixes a bug? :bookmark_tabs:
* Open a new GitHub Pull Request with the patch.
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
### Do you intend to add a new feature or change an existing one? :bulb:
* Open a new GitHub Pull Request with the feature addition or changes.
* Ensure the PR description clearly describes what the addition or changes are for. Include the relevant issue number if applicable.
#### How to create Pull Requests :pencil:
1. Make sure you have a [GitHub account](https://github.com/signup/free).
2. Next, you will need to [fork rAthena](https://help.github.com/articles/fork-a-repo/#fork-an-example-repository) to your account.
3. Before making changes, make sure you [create a new branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) for your working tree.
4. After completing your changes, commit and push it to your branch.
5. Now you are ready to [create a Pull Request](https://help.github.com/articles/creating-a-pull-request/) for rAthena!
* Upon creating the Pull Request, make sure you follow our [template](https://github.com/rathena/rathena/blob/master/.github/PULL_REQUEST_TEMPLATE.md) and provide the required information.
* **OPTIONAL**: We would greatly appreciate those that check the box to [allow edits by maintainers](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/), so we can apply small cleanups or additions to your changes before merging them!
Issue Labels
------------
For the most part you as a user will have no reason to worry about the **Milestone** or **Assignee** parts of an Issue. The different **Labels** of an Issue allow developers to quickly understand the issue and also allows for fast searching or sorting.
:bangbang: Users should be aware of the 'Mode' and 'Status' Type **Labels** as these sometimes require feedback! :bangbang:
#### Component
| Label Name | Search Link | Description |
| --- | --- | --- |
| `component:core` | [search][search-rathena-label-componentcore] | A fault that lies within the main framework of rAthena. |
| `component:database` | [search][search-rathena-label-componentdatabase] | A fault that lies within the database of rAthena. |
| `component:documentation` | [search][search-rathena-label-componentdocumentation] | A fault that lies within the documentation of rAthena. |
| `component:script` | [search][search-rathena-label-componentscript] | A fault that lies within the scripts of rAthena. |
| `component:skill` | [search][search-rathena-label-componentskill] | A fault that deals specifically with a skill. |
| `component:tool` | [search][search-rathena-label-componenttool] | A fault that lies within a tool of rAthena. |
#### Missing
| Label Name | Search Link | Description |
| --- | --- | --- |
| `missing:clientdate` | [search][search-rathena-label-missingclientdate] | Issue **Title** or **Description** does not state the client date used to create the bug. |
| `missing:mode` | [search][search-rathena-label-missingmode] | Issue **Title** or **Description** does not state pre-renewal or renewal mode. |
| `missing:revision` | [search][search-rathena-label-missingrevision] | Issue **Description** does not state the revision of rAthena used when the bug occurred. |
#### Mode
| Label Name | Search Link | Description |
| --- | --- | --- |
| `mode:prerenewal` | [search][search-rathena-label-modeprerenewal] | A fault that exists within the pre-renewal mode. |
| `mode:renewal` | [search][search-rathena-label-moderenewal] | A fault that exists within the renewal mode. |
#### Priority
| Label Name | Search Link | Description |
| --- | --- | --- |
| `priority:high` | [search][search-rathena-label-priorityhigh] | A fault that makes rAthena unstable or unusable. |
| `priority:medium` | [search][search-rathena-label-prioritymedium] | A fault that makes rAthena have significant repercussions but does not render rAthena unusable. |
| `priority:low` | [search][search-rathena-label-prioritylow] | A fault that affects rAthena in one piece of functionality and is self-contained. |
#### Status
| Label Name | Search Link | Description |
| --- | --- | --- |
| `status:code-review` | [search][search-rathena-label-statuscodereview] | Pull Request that requires reviewing from other developers before being pushed to master. |
| `status:confirmed` | [search][search-rathena-label-statusconfirmed] | Issue that has been validated by a developer to affect rAthena. |
| `status:duplicate` | [search][search-rathena-label-statusduplicate] | Issue that has been reported before. |
| `status:inprogress` | [search][search-rathena-label-statusinprogress] | Issue that has begun resolution by a developer. |
| `status:invalid` | [search][search-rathena-label-statusinvalid] | Issue that is either not official or is not related to rAthena. |
| `status:need more info` | [search][search-rathena-label-statusneedmoreinfo] | Issue that needs more information from a creditable source. |
| `status:need user input` | [search][search-rathena-label-statusneeduserinput] | Issue that needs more information from the issue creator. |
| `status:outdated emulator` | [search][search-rathena-label-statusoutdatedemulator] | Issue that requires the creator's local files to be updated to be resolved. |
| `status:unable to reproduce` | [search][search-rathena-label-statusunabletoreproduce] | Issue that was unable to be reproduced on rAthena. |
| `status:wontfix` | [search][search-rathena-label-statuswontfix] | Issue that cannot be fixed through some limitation or is intended behavior. |
#### Type
| Label Name | Search Link | Description |
| --- | --- | --- |
| `type:bug` | [search][search-rathena-label-typebug] | Issue that is a bug within rAthena. |
| `type:enhancement` | [search][search-rathena-label-typeenhancement] | Issue that is an enhancement to rAthena. |
| `type:maintenance` | [search][search-rathena-label-typemaintenance] | Issue for refactoring rAthena. |
| `type:question` | [search][search-rathena-label-typequestion] | Issue that is a question for rAthena. |
[search-rathena-label-componentcore]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Acomponent%3Acore
[search-rathena-label-componentdatabase]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Acomponent%3Adatabase
[search-rathena-label-componentdocumentation]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Acomponent%3Adocumentation
[search-rathena-label-componentscript]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Acomponent%3Ascript
[search-rathena-label-componentskill]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Acomponent%3Askill
[search-rathena-label-componenttool]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Acomponent%3Atool
[search-rathena-label-missingclientdate]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Amissing%3Aclientdate
[search-rathena-label-missingmode]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Amissing%3Amode
[search-rathena-label-missingrevision]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Amissing%3Arevision
[search-rathena-label-modeprerenewal]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Amode%3Aprerenewal
[search-rathena-label-moderenewal]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Amode%3Arenewal
[search-rathena-label-priorityhigh]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Apriority%3Ahigh
[search-rathena-label-prioritymedium]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Apriority%3Amedium
[search-rathena-label-prioritylow]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Apriority%3Alow
[search-rathena-label-statuscodereview]: https://github.com/rathena/rathena/pulls?q=is%3Apr+is%3Aopen+label%3Astatus%3Acode-review
[search-rathena-label-statusconfirmed]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Astatus%3Aconfirmed
[search-rathena-label-statusduplicate]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Astatus%3Aduplicate
[search-rathena-label-statusinprogress]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Astatus%3Ainprogress
[search-rathena-label-statusinvalid]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Astatus%3Ainvalid
[search-rathena-label-statusneedmoreinfo]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3A"status%3Aneed+more+info"
[search-rathena-label-statusneeduserinput]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3A"status%3Aneed+user+input"
[search-rathena-label-statusoutdatedemulator]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3A"status%3Aoutdated+emulator"
[search-rathena-label-statusunabletoreproduce]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3A"status%3Aunable+to+reproduce"
[search-rathena-label-statuswontfix]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Astatus%3Awontfix
[search-rathena-label-typebug]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Atype%3Abug
[search-rathena-label-typeenhancement]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Atype%3Aenhancement
[search-rathena-label-typemaintenance]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Atype%3Amaintenance
[search-rathena-label-typequestion]: https://github.com/rathena/rathena/issues?q=is%3Aissue+is%3Aopen+label%3Atype%3Aquestion
Become a Team Member
--------------------
1. Before you send in a staff application, make sure you have an [rAthena account](https://rathena.org/board/register/).
* If you are new to the community, go ahead and [introduce yourself](https://rathena.org/board/forum/89-introductions/)!
2. Please fill out the [Staff Application](https://rathena.org/board/staffapplications/) and you will be notified shortly.
The rAthena team is comprised of all volunteers ([AUTHORS](https://github.com/rathena/rathena/blob/master/AUTHORS)). We encourage you to pitch in and submit bug reports or Pull Requests!
Thanks!
rAthena Team

29
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,29 @@
<!-- NOTE: Anything within these brackets will be hidden on the preview of the Issue. -->
* **rAthena Hash**:
<!-- Please specify the rAthena [GitHub hash](https://help.github.com/articles/autolinked-references-and-urls/#commit-shas) on which you encountered this issue.
How to get your GitHub Hash:
1. cd your/rAthena/directory/
2. git rev-parse --short HEAD
3. Copy the resulting hash.
-->
* **Client Date**:
<!-- Please specify the client date you used. -->
* **Server Mode**:
<!-- Which mode does your server use: Pre-Renewal or Renewal? -->
* **Description of Issue**:
* Result: <!-- Describe the issue that you experienced in detail. -->
* Expected Result: <!-- Describe what you would expect to happen in detail. -->
* How to Reproduce: <!-- If you have not stated in the description of the result already, please give us a short guide how we can reproduce your issue. -->
* Official Information:<!-- If possible, provide information from official servers (kRO or other sources) which prove that the result is wrong. Please take into account that iRO (especially iRO Wiki) is not always the same as kRO. -->
<!-- * _NOTE: Make sure you quote ``` `@atcommands` ``` just like this so that you do not tag uninvolved GitHub users!_ -->
* **Modifications that may affect results**:
<!-- * Please provide any information that could influence the expected result. -->
<!-- * This can be either configurations you changed, database values you changed, or even external source modifications. -->

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,16 @@
<!-- NOTE: Anything within these brackets will be hidden on the preview of the Pull Request. -->
* **Addressed Issue(s)**:
<!--
Please specify the rAthena [GitHub issue(s)](https://help.github.com/articles/autolinked-references-and-urls/#issues-and-pull-requests) this pull request amends.
If no issue exists yet, please [create one](https://github.com/rathena/rathena/issues/new) first and then link your pull request to the amendment!
-->
* **Server Mode**:
<!-- Which mode does this pull request apply to: Pre-Renewal, Renewal, or Both? -->
* **Description of Pull Request**:
<!-- Describe how this pull request will resolve the issue(s) listed above. -->

65
.gitignore vendored
View File

@@ -14,6 +14,8 @@ Thumbs.db
/*.exe
/*.exe.*
/*.ilk
/*.iobj
/*.ipdb
/*.log
/*.ncb
/*.opensdf
@@ -25,11 +27,12 @@ Thumbs.db
/*.suo
*.o
*.a
*.yml
*.vcxproj.user
/char-server
/config.log
/config.status
/core
/enc_temp_folder
/ipch
/login-server
/Makefile
@@ -43,9 +46,8 @@ Thumbs.db
/3rdparty/libconfig/*.o
/3rdparty/libconfig/obj
# /3rdparty/mt19937ar/
/3rdparty/mt19937ar/Makefile
/3rdparty/mt19937ar/*.o
# /3rdparty/yaml-cpp/
/3rdparty/yaml-cpp/Makefile
# /db/
/db/import
@@ -54,8 +56,8 @@ Thumbs.db
/conf/import
/conf/msg_conf/import
# /doc/
/doc/doxygen
# /lib
/lib
# /log/
/log/*.log
@@ -83,10 +85,6 @@ Thumbs.db
/src/map/obj_sql
/src/map/pcre.h
# /src/test/
/src/test/Makefile
/src/test/obj
# /src/tool/
/src/tool/Makefile
/src/tool/obj_all
@@ -98,43 +96,11 @@ Thumbs.db
/tools/*.ilk
/tools/*.pdb
# /vcproj-14/
# Visual Studio
.vs
*.VC.db
*.VC.opendb
/vcproj-14/char-server
/vcproj-14/login-server
/vcproj-14/mapcache
/vcproj-14/map-server
/vcproj-14/*.user
# /vcproj-13/
/vcproj-13/char-server
/vcproj-13/login-server
/vcproj-13/mapcache
/vcproj-13/map-server
/vcproj-13/*.user
# /vcproj-12/
/vcproj-12/char-server
/vcproj-12/login-server
/vcproj-12/mapcache
/vcproj-12/map-server
/vcproj-12/*.user
# /vcproj-10/
/vcproj-10/char-server
/vcproj-10/login-server
/vcproj-10/mapcache
/vcproj-10/map-server
/vcproj-10/*.user
# /vcproj-9/
/vcproj-9/*.user
/vcproj-9/char-server
/vcproj-9/login-server
/vcproj-9/map-server
/vcproj-9/mapcache
/.idea/.name
/.idea/misc.xml
/.idea/modules.xml
@@ -142,4 +108,17 @@ Thumbs.db
/.idea/vcs.xml
/.idea/workspace.xml
/build/
/cbuild/
# bat tools
/charserv.bat
/logserv.bat
/mapcache.bat
/mapserv.bat
/runserver.bat
/serv.bat
# dlls
/libmysql.dll
/pcre8.dll
/zlib.dll

197
.mailmap Normal file
View File

@@ -0,0 +1,197 @@
##################################################################
# This maps commits from different aliases to the same account #
# #
# Always try to map to the GitHub username and try to use the #
# @users.noreply.github.com mail addresses where possible. #
# The entries are sorted ascending by the username. #
# #
# If you want to have your mail changed feel free to contact us. #
# #
# If you know any of the missing commiters please also let us #
# know. #
# You can generate the list of commiters with: #
# git shortlog -sne #
##################################################################
##################################################################
# SVN Users #
##################################################################
ai4rei <ai4rei@users.noreply.github.com> <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Akinari1087 <tagraskemper@hotmail.com> <akinari1087@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Akkarinage <akkarin@rathena.org> <thatakkarin@54d463be-8e91-2dee-dedb-b68131a5f0ec>
aleos89 <aleos89@users.noreply.github.com> <aleos@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Baalberith6 <matej.pristak@gmail.com> <baalberith@54d463be-8e91-2dee-dedb-b68131a5f0ec>
brianluau <brianluau@users.noreply.github.com> <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>
cydh <cydh@users.noreply.github.com> <cydh@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Daegaladh <Daegaladh@users.noreply.github.com> <daegaladh@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Deadly Silence <mail@deadly-silence.de> <deadlysilence@54d463be-8e91-2dee-dedb-b68131a5f0ec>
euphyy <euphy.raliel@rathena.org> <euphyy@54d463be-8e91-2dee-dedb-b68131a5f0ec>
flaviojs <flaviojs2005@gmail.com> <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>
flaviojs <flaviojs2005@gmail.com> <flaviojs2005@54d463be-8e91-2dee-dedb-b68131a5f0ec>
functor-x <piotr.halaczkiewicz@gmail.com> <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>
functor-x <piotr.halaczkiewicz@gmail.com> <Gepard@54d463be-8e91-2dee-dedb-b68131a5f0ec>
greenboxal <greenboxal@gmail.com> <greenboxal2@54d463be-8e91-2dee-dedb-b68131a5f0ec>
jguy1987 <jmish1987@gmail.com> <jmanfffreak@54d463be-8e91-2dee-dedb-b68131a5f0ec>
jTynne <decadenthearts06@gmail.com> <jtynne@54d463be-8e91-2dee-dedb-b68131a5f0ec>
j-tkay <joseph.tk.ea@gmail.com> <j-tkay@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Kenpachi2k13 <Kenpachi.Developer@gmx.de> <kenpachi2k11@54d463be-8e91-2dee-dedb-b68131a5f0ec>
kisuka <kisuka@kisuka.com> <Kisuka@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Lemongrass3110 <lemongrass@kstp.at> <lemongrass3110@54d463be-8e91-2dee-dedb-b68131a5f0ec>
lnkfish <lnkfish@hotmail.com> <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Locien <masterofmuppets89@gmail.com> <MasterOfMuppets@54d463be-8e91-2dee-dedb-b68131a5f0ec>
lighta <lighta@users.noreply.github.com> <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Masao87 <masao@gmx.ch> <masao87@54d463be-8e91-2dee-dedb-b68131a5f0ec>
missxantara <missxantara@gmail.com> <xantara@54d463be-8e91-2dee-dedb-b68131a5f0ec>
macabu <macabu@users.noreply.github.com> <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Paradox924X <paradox924x@gmail.com> <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Paradox924X <paradox924x@gmail.com> <Paradox924x@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Playtester <Kenji.Ito@gmx.de> <Playtester@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Playtester <Kenji.Ito@gmx.de> <playtester@54d463be-8e91-2dee-dedb-b68131a5f0ec>
rAthenaAPI <administrator@rathena.org> <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec>
rAthenaAPI <administrator@rathena.org> <rathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec>
SeoRoman <RomanL0927@gmail.com> <script-Z3R0@54d463be-8e91-2dee-dedb-b68131a5f0ec>
SeoRoman <RomanL0927@gmail.com> <script-z3r0@54d463be-8e91-2dee-dedb-b68131a5f0ec>
shennetsind <ind@henn.et> <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>
theultramage <umage@netvor.sk> <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>
trojal <trojal@gmail.com> <trojal@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Valaris <2738218+valaris@users.noreply.github.com> <valaris@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Valaris <2738218+valaris@users.noreply.github.com> <Valaris@54d463be-8e91-2dee-dedb-b68131a5f0ec>
wilkemeyer <fw@f-ws.de> <blacksirius@54d463be-8e91-2dee-dedb-b68131a5f0ec>
Yommy <yomanda@gmail.com> <Yommy@54d463be-8e91-2dee-dedb-b68131a5f0ec>
##################################################################
# Git Aliases #
##################################################################
aleos89 <aleos89@users.noreply.github.com> <aleos89@users.noreply.github.com>
aleos89 <aleos89@users.noreply.github.com> <jarajabi@msn.com>
Akkarinage <akkarin@rathena.org> <mike.langford@live.co.uk>
Baalberith6 <matej.pristak@gmail.com> <matej.pristak@gmail.com>
brianluau <brianluau@users.noreply.github.com> <brianluau@gmail.com>
brianluau <brianluau@users.noreply.github.com> <brianluau@users.noreply.github.com>
Atemo <Atemo@users.noreply.github.com> <capucrath@gmail.com>
Atemo <Atemo@users.noreply.github.com> <Capuche@users.noreply.github.com>
cydh <cydh@users.noreply.github.com> <cydh@users.noreply.github.com>
cydh <cydh@users.noreply.github.com> <cydh@pservero.com>
cydh <cydh@users.noreply.github.com> <house.bad@gmail.com>
Daegaladh <Daegaladh@users.noreply.github.com> <daegaladh@shadowgames.es>
dentongrills <sketchyphoenix@gmail.com> <sketchyphoenix@54d463be-8e91-2dee-dedb-b68131a5f0ec>
dentongrills <sketchyphoenix@gmail.com> <SketchyPhoenix@54d463be-8e91-2dee-dedb-b68131a5f0ec>
euphyy <euphy.raliel@rathena.org> <euphy@rathena.org>
icxbb-xx <arokaice@live.com> <arokaice@live.com>
Jeybla <jey@bjx-studios.de> <jey@toto-ro.de>
Jeybla <jey@bjx-studios.de> <jey@bjx-studios.de>
Jeybla <jey@bjx-studios.de> <jey@toto-ro.de>
GodLesZ <godlesz@hotmail.de> <GodLesZ@54d463be-8e91-2dee-dedb-b68131a5f0ec>
lighta <lighta@users.noreply.github.com> <lightaisme@gmail.com>
lighta <lighta@users.noreply.github.com> <lighta@lighta-fedora20.localdomain>
lighta <lighta@users.noreply.github.com> <lighta@lighta-VPCW12M1E>
lighta <lighta@users.noreply.github.com> <lighta>
lighta <lighta@users.noreply.github.com> <lighta@lighta-VPCW12M1E.(none)>
lighta <lighta@users.noreply.github.com> <lightaisme>
Lilith- <amurov.ro@gmail.com> <amurov.ro@gmail.com>
macabu <macabu@users.noreply.github.com> <macabu.matheus@gmail.com>
macabu <macabu@users.noreply.github.com> <mkbu95@users.noreply.github.com>
rAthenaAPI <administrator@rathena.org> <rAthenaAPI>
secretdataz <secretdataz@users.noreply.github.com> <foreverfk@stephack.com>
secretdataz <secretdataz@users.noreply.github.com> <nightsheep@outlook.com>
secretdataz <secretdataz@users.noreply.github.com> <secret@ahri.in.th>
Stolao <Stolao@users.noreply.github.com> <Taingram11@gmail.com>
tr0n93 <tr0n.developer@gmail.com> <tr0n93@54d463be-8e91-2dee-dedb-b68131a5f0ec>
wilkemeyer <fw@f-ws.de> <fw@f-ws.de>
vstumpf <vincents.995@gmail.com> <vincents.995@gmail.com>
zackdreaver <zackdreaver@users.noreply.github.com> <zackdreaver@gmail.com>
##################################################################
# Unconfirmed ones #
# missing github username #
##################################################################
calciumkid <harrison@isabarwon.com> <calciumkid@54d463be-8e91-2dee-dedb-b68131a5f0ec>
skotlex <skotlex@mailforce.net> <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>
skotlex <skotlex@mailforce.net> <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>
##################################################################
# TODO #
# #
# If you know the GitHub account and/or mail address of any of #
# these please let us know. #
##################################################################
# L0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Lupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# toms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# shadowlady <shadowlady@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# codemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# rud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Vicious <Vicious@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# samuray22 <samuray22@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Kevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# shadow <shadow@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# mc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# evera <evera@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# SinSloth <SinSloth@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# epoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# DracoRPG <DracoRPG@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# littlewolf <littlewolf@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# eaac <eaac@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# ajarn <ajarn@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# wizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Nasedo <Nasedo@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# blackhole89 <blackhole89@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# protimus <protimus@54d463be-8e91-2dee-dedb-b68131a5f0ec> https://github.com/protimus
# Komurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Poki#3 <Poki#3@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# cookiecrumbs <cookiecrumbs@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Zido <Zido@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# akrus <akrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# markzd <markzd@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# xazax-hun <xazax-hun@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# flaid <flaid@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# lordttseven <lordttseven@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# musashiden <musashiden@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Aria <Aria@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# og2 <og2@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# reddozen <reddozen@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# KarLaeda <KarLaeda@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Zephiris <Zephiris@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# DZeroX <DZeroX@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# ignizh <ignizh@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# kobra_k88 <kobra_k88@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# shinomori <shinomori@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# LuzZza <LuzZza@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# spre123 <spre123@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Chilly0123 <Chilly0123@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# ediejohnny <ediejohnny@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# hipsterfont <hipsterfont@54d463be-8e91-2dee-dedb-b68131a5f0ec> https://github.com/hipsterfont
# nsstrunks <nsstrunks@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# shadoweathena <shadoweathena@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# technote24 <technote24@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# mandark022 <mandark022@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Kargha <Kargha@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Mass <Mass@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Sara <Sara@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# nana <nana@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# veider <veider@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Shinigami <Shinigami@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# mercurial123 <mercurial123@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# arcshiru <arcshiru@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# davidsiaw <davidsiaw@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# foruken <foruken@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# sirius <sirius@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Euph <Euph@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Kayla <Kayla@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# rikimaru17 <rikimaru17@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Evera <Evera@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# L0neW0lf.eAthena <L0neW0lf.eAthena@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# cleaverbeaver <cleaverbeaver@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# killercube <killercube@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# salepate <salepate@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# spira <spira@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# CIA-2 <CIA-2@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# Protimus <Protimus@54d463be-8e91-2dee-dedb-b68131a5f0ec> https://github.com/protimus
# lmaatl <lmaatl@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# zapbomb <zapbomb@54d463be-8e91-2dee-dedb-b68131a5f0ec>
# zido <zido@54d463be-8e91-2dee-dedb-b68131a5f0ec>

View File

@@ -1,35 +1,189 @@
language: c
compiler:
- clang
- gcc
language: cpp
dist: trusty
sudo: false
matrix:
include:
# First check if all our options are good
# Renewal without VIP
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes"
# Renewal with VIP
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- CONFIGURE_FLAGS="--enable-prere=yes --enable-vip=no --enable-buildbot=yes"
# Pre-Renewal without VIP
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=yes --enable-buildbot=yes"
# Pre-Renewal with VIP
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- CONFIGURE_FLAGS="--enable-prere=yes --enable-vip=yes --enable-buildbot=yes"
# After that check all different compilers and compiler versions
# GCC
# Version 6
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes"
# Version 7
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes"
# Version 8
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-8
env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes"
# Clang
# Version 3.9
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-3.9
packages:
- clang-3.9
env:
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes"
# Version 4
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
env:
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes"
# Version 5
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
env:
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes"
# LLVM on OSX
# - os: osx
# osx_image: xcode9.2
# install:
# - brew update
# - brew install mysql
# - brew tap homebrew/services
# - brew services start mysql
## MySQL takes a while to start...
# - brew services list
# - launchctl list | grep mysql
# before_install: false
# env:
# - CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes --enable-lto=no"
# script:
# - ./configure $CONFIGURE_FLAGS
## MacOS default MySQL configuration does not like our card seller(only full group by)
# - ./tools/ci/npc.sh
# - make clean
# - make server
# - ./login-server --run-once
# - ./char-server --run-once
# - ./map-server --run-once
# CMake
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
script:
- mkdir cbuild
- cd cbuild
- cmake -G "Unix Makefiles" ..
- make || travis_terminate 1
# MariaDB
- os: linux
addons:
mariadb: '10.0'
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- libmariadbclient-dev
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- CONFIGURE_FLAGS="--enable-prere=no --enable-vip=no --enable-buildbot=yes"
before_install:
- eval "${MATRIX_EVAL}"
before_script:
- uname -a
- mysql -u $DB_ROOT -e "CREATE DATABASE $DB_NAME;" || aborterror "Unable to create database."
- mysql -u $DB_ROOT $DB_NAME < sql-files/main.sql || aborterror "Unable to import main database."
- mysql -u $DB_ROOT $DB_NAME < sql-files/logs.sql || aborterror "Unable to import logs database."
- mysql -u $DB_ROOT $DB_NAME < sql-files/item_cash_db.sql || aborterror "Unable to import cash item table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/item_cash_db2.sql || aborterror "Unable to import cash item 2 table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/item_db.sql || aborterror "Unable to import pre-renewal item table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/item_db2.sql || aborterror "Unable to import pre-renewal item 2 table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re.sql || aborterror "Unable to import renewal item table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/item_db2_re.sql || aborterror "Unable to import renewal item 2 table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db.sql || aborterror "Unable to import pre-renewal monster table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db2.sql || aborterror "Unable to import pre-renewal monster 2 table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db_re.sql || aborterror "Unable to import renewal monster table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db2_re.sql || aborterror "Unable to import renewal monster 2 table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db.sql || aborterror "Unable to import pre-renewal monster skill table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db2.sql || aborterror "Unable to import pre-renewal monster skill 2 table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db_re.sql || aborterror "Unable to import renewal monster skill table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/mob_skill_db2_re.sql || aborterror "Unable to import renewal monster skill 2 table."
- mysql -u $DB_ROOT $DB_NAME < sql-files/roulette_default_data.sql || aborterror "Unable to import roulette table."
- mysql -u $DB_ROOT -e "GRANT ALL ON *.* TO '$DB_USER'@'$DB_HOST' IDENTIFIED BY '$DB_PASS';"
- ./tools/ci/sql.sh
script:
- ./configure $CONFIGURE_FLAGS
- make clean
- make server
- 'echo packet_db_ver: $PACKETDBVER >> db/import/packet_db.txt'
- ./configure $CONFIGURE_FLAGS || travis_terminate 1
- ./tools/ci/npc.sh
- make clean || travis_terminate 1
- make server || travis_terminate 1
- ./login-server --run-once
- ./char-server --run-once
- ./map-server --run-once
env:
@@ -39,10 +193,6 @@ env:
- DB_NAME="ragnarok"
- DB_USER="ragnarok"
- DB_PASS="ragnarok"
- PACKETDBVER=45
matrix:
- CONFIGURE_FLAGS="--enable-prere=no"
- CONFIGURE_FLAGS="--enable-prere=yes"
notifications:
email: false

View File

@@ -48,8 +48,7 @@ endmacro( CONFIGURE_WITH_LOCAL_OR_SYSTEM )
add_subdirectory( libconfig )
add_subdirectory( msinttypes )
add_subdirectory( mt19937ar )
add_subdirectory( mysql )
add_subdirectory( pcre )
add_subdirectory( zlib )
add_subdirectory( yaml-cpp )

2
3rdparty/README.txt vendored
View File

@@ -2,8 +2,6 @@ This folder contains everything related to 3rdparty code or tools.
cmake - scripts for the cmake build system (http://www.cmake.org)
libconfig - library for processing structured configuration files (http://www.hyperrealm.com/libconfig/)
msinttypes - standard headers missing from Microsoft Visual Studio (http://code.google.com/p/msinttypes)
mt19937ar - code for Mersenne Twister pseudorandom number generator
mysql - library for MySQL Community Server (http://www.mysql.com)
pcre - library for Perl Compatible Regular Expressions (http://www.pcre.org)
zlib - library for DEFLATE lossless compression algorithm (http://www.zlib.net)

54
3rdparty/cmake/GetGitVersion.cmake vendored Normal file
View File

@@ -0,0 +1,54 @@
# - Returns a version string from Git tags
#
# This function inspects the annotated git tags for the project and returns a string
# into a CMake variable
# higly adapted from https://raw.githubusercontent.com/google/benchmark/master/cmake/GetGitVersion.cmake
# lighta
#
# get_git_version()
#
# - Example
#
# include(GetGitVersion)
# get_git_version(GIT_VERSION)
# return
# - GIT_VERSION : remote tracking sha of master
# - GIT_HEAD_VERSION : current sha of current branch
#
# Requires CMake 2.8.11+
find_package(Git)
if(__get_git_version)
return()
endif()
set(__get_git_version INCLUDED)
function(get_git_version)
if(GIT_EXECUTABLE)
#determine remote tracking master sha
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse origin/master
RESULT_VARIABLE status
OUTPUT_VARIABLE GIT_VERSION
ERROR_QUIET)
if(${status})
set(GIT_VERSION "unknow")
else()
string(STRIP ${GIT_VERSION} GIT_VERSION)
endif()
#determine current head sha
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --verify HEAD
RESULT_VARIABLE status
OUTPUT_VARIABLE GIT_HEAD_VERSION
ERROR_QUIET)
if(${status})
set(GIT_HEAD_VERSION "unknow")
else()
string(STRIP ${GIT_HEAD_VERSION} GIT_HEAD_VERSION)
endif()
endif()
message("-- git Version: ${GIT_VERSION}, ${GIT_HEAD_VERSION}")
set(GIT_VERSION ${GIT_VERSION} PARENT_SCOPE)
set(GIT_HEAD_VERSION ${GIT_HEAD_VERSION} PARENT_SCOPE)
endfunction()

44
3rdparty/cmake/GetSvnVersion.cmake vendored Normal file
View File

@@ -0,0 +1,44 @@
#
# Find svnversion
#
function(get_svn_version)
message( STATUS "Detecting svnversion" )
find_program( SVNVERSION_EXECUTABLE svnversion )
mark_as_advanced( SVNVERSION_EXECUTABLE )
if( SVNVERSION_EXECUTABLE )
message( STATUS "Found svnversion: ${SVNVERSION_EXECUTABLE}" )
endif()
message( STATUS "Detecting svnversion - done" )
#
# Find Subversion
#
message( STATUS "Detecting Subversion" )
find_package( Subversion )
message( STATUS "Detecting Subversion - done" )
#
# SVNVERSION
#
if( SVNVERSION_EXECUTABLE )
message( STATUS "Getting svn version" )
execute_process( COMMAND ${SVNVERSION_EXECUTABLE} ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE SVNVERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
if( SVNVERSION MATCHES "^Unversioned" )
set( SVNVERSION )
endif()
string( REGEX REPLACE "[^1234567890MSexported]" "_" SVNVERSION "${SVNVERSION}" )
message( STATUS "Found SVNversion: ${SVNVERSION}" )
message( STATUS "Getting svn version - done" )
endif()
if( Subversion_FOUND AND SVNVERSION )
message( STATUS "Getting svn branch" )
Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} rAthena )
if( rAthena_WC_URL )
string( REGEX MATCH "[^/]+$" BRANCH ${rAthena_WC_URL} )
set( SVNVERSION "${BRANCH}-${SVNVERSION}" )
message( STATUS "Found branch: ${BRANCH}" )
endif()
message( STATUS "Getting svn branch - done" )
endif()
set(SVNVERSION ${SVNVERSION} PARENT_SCOPE)
endfunction()

6
3rdparty/cmake/tests/HAVE_TLS.c vendored Normal file
View File

@@ -0,0 +1,6 @@
__thread int tls;
int main(int argc, char** argv)
{
return 0;
}

View File

@@ -1,4 +1,4 @@
#pragma once
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C
@@ -32,7 +32,10 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -109,5 +112,7 @@ typedef union YYSTYPE
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -20,6 +20,8 @@
----------------------------------------------------------------------------
*/
#pragma once
#ifndef __libconfig_h
#define __libconfig_h

170
3rdparty/libconfig/libconfig.vcxproj vendored Normal file
View File

@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="grammar.h" />
<ClInclude Include="libconfig.h" />
<ClInclude Include="parsectx.h" />
<ClInclude Include="scanctx.h" />
<ClInclude Include="scanner.h" />
<ClInclude Include="strbuf.h" />
<ClInclude Include="wincompat.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="grammar.c" />
<ClCompile Include="libconfig.c" />
<ClCompile Include="scanctx.c" />
<ClCompile Include="scanner.c" />
<ClCompile Include="strbuf.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libconfig</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir).vs\build\</OutDir>
<IntDir>$(SolutionDir).vs\build\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir).vs\build\</OutDir>
<IntDir>$(SolutionDir).vs\build\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir).vs\build\</OutDir>
<IntDir>$(SolutionDir).vs\build\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir).vs\build\</OutDir>
<IntDir>$(SolutionDir).vs\build\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>YY_USE_CONST;LIBCONFIG_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>YY_USE_CONST;LIBCONFIG_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>YY_USE_CONST;LIBCONFIG_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>YY_USE_CONST;LIBCONFIG_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="grammar.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="libconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="parsectx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="scanctx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="scanner.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="strbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="wincompat.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="grammar.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="libconfig.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="scanctx.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="scanner.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="strbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,3 +1,5 @@
#pragma once
/* ----------------------------------------------------------------------------
libconfig - A library for processing structured configuration files
Copyright (C) 2005-2010 Mark A Lindner

View File

@@ -1,3 +1,5 @@
#pragma once
/* ----------------------------------------------------------------------------
libconfig - A library for processing structured configuration files
Copyright (C) 2005-2010 Mark A Lindner
@@ -31,6 +33,10 @@
#define MAX_INCLUDE_DEPTH 10
#ifdef __cplusplus
extern "C" {
#endif
struct scan_context
{
config_t *config;
@@ -59,4 +65,8 @@ extern char *scanctx_take_string(struct scan_context *ctx);
extern const char *scanctx_current_filename(struct scan_context *ctx);
#ifdef __cplusplus
}
#endif
#endif /* __libconfig_scanctx_h */

View File

@@ -1,3 +1,5 @@
#pragma once
#ifndef libconfig_yyHEADER_H
#define libconfig_yyHEADER_H 1
#define libconfig_yyIN_HEADER 1

View File

@@ -1,3 +1,5 @@
#pragma once
/* ----------------------------------------------------------------------------
libconfig - A library for processing structured configuration files
Copyright (C) 2005-2010 Mark A Lindner
@@ -26,6 +28,10 @@
#include <string.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
char *string;
@@ -37,4 +43,8 @@ char *strbuf_release(strbuf_t *buf);
void strbuf_append(strbuf_t *buf, const char *text);
#ifdef __cplusplus
}
#endif
#endif /* __libconfig_strbuf_h */

View File

@@ -1,3 +1,5 @@
#pragma once
/* ----------------------------------------------------------------------------
libconfig - A library for processing structured configuration files
Copyright (C) 2005-2010 Mark A Lindner

View File

@@ -1,9 +0,0 @@
if( MSVC )
find_path( MSINTTYPES_INCLUDE_DIRS "inttypes.h"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/include"
NO_DEFAULT_PATH )
mark_as_advanced( MSINTTYPES_INCLUDE_DIRS )
message( STATUS "Adding global include directory: ${MSINTTYPES_INCLUDE_DIRS}" )
set_property( CACHE GLOBAL_INCLUDE_DIRS PROPERTY VALUE ${GLOBAL_INCLUDE_DIRS} ${MSINTTYPES_INCLUDE_DIRS} )
endif()

View File

@@ -1,305 +0,0 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_INTTYPES_H_ // [
#define _MSC_INTTYPES_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include "stdint.h"
// 7.8 Format conversion of integer types
typedef struct {
intmax_t quot;
intmax_t rem;
} imaxdiv_t;
// 7.8.1 Macros for format specifiers
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
// The fprintf macros for signed integers are:
#define PRId8 "d"
#define PRIi8 "i"
#define PRIdLEAST8 "d"
#define PRIiLEAST8 "i"
#define PRIdFAST8 "d"
#define PRIiFAST8 "i"
#define PRId16 "hd"
#define PRIi16 "hi"
#define PRIdLEAST16 "hd"
#define PRIiLEAST16 "hi"
#define PRIdFAST16 "hd"
#define PRIiFAST16 "hi"
#define PRId32 "I32d"
#define PRIi32 "I32i"
#define PRIdLEAST32 "I32d"
#define PRIiLEAST32 "I32i"
#define PRIdFAST32 "I32d"
#define PRIiFAST32 "I32i"
#define PRId64 "I64d"
#define PRIi64 "I64i"
#define PRIdLEAST64 "I64d"
#define PRIiLEAST64 "I64i"
#define PRIdFAST64 "I64d"
#define PRIiFAST64 "I64i"
#define PRIdMAX "I64d"
#define PRIiMAX "I64i"
#define PRIdPTR "Id"
#define PRIiPTR "Ii"
// The fprintf macros for unsigned integers are:
#define PRIo8 "o"
#define PRIu8 "u"
#define PRIx8 "x"
#define PRIX8 "X"
#define PRIoLEAST8 "o"
#define PRIuLEAST8 "u"
#define PRIxLEAST8 "x"
#define PRIXLEAST8 "X"
#define PRIoFAST8 "o"
#define PRIuFAST8 "u"
#define PRIxFAST8 "x"
#define PRIXFAST8 "X"
#define PRIo16 "ho"
#define PRIu16 "hu"
#define PRIx16 "hx"
#define PRIX16 "hX"
#define PRIoLEAST16 "ho"
#define PRIuLEAST16 "hu"
#define PRIxLEAST16 "hx"
#define PRIXLEAST16 "hX"
#define PRIoFAST16 "ho"
#define PRIuFAST16 "hu"
#define PRIxFAST16 "hx"
#define PRIXFAST16 "hX"
#define PRIo32 "I32o"
#define PRIu32 "I32u"
#define PRIx32 "I32x"
#define PRIX32 "I32X"
#define PRIoLEAST32 "I32o"
#define PRIuLEAST32 "I32u"
#define PRIxLEAST32 "I32x"
#define PRIXLEAST32 "I32X"
#define PRIoFAST32 "I32o"
#define PRIuFAST32 "I32u"
#define PRIxFAST32 "I32x"
#define PRIXFAST32 "I32X"
#define PRIo64 "I64o"
#define PRIu64 "I64u"
#define PRIx64 "I64x"
#define PRIX64 "I64X"
#define PRIoLEAST64 "I64o"
#define PRIuLEAST64 "I64u"
#define PRIxLEAST64 "I64x"
#define PRIXLEAST64 "I64X"
#define PRIoFAST64 "I64o"
#define PRIuFAST64 "I64u"
#define PRIxFAST64 "I64x"
#define PRIXFAST64 "I64X"
#define PRIoMAX "I64o"
#define PRIuMAX "I64u"
#define PRIxMAX "I64x"
#define PRIXMAX "I64X"
#define PRIoPTR "Io"
#define PRIuPTR "Iu"
#define PRIxPTR "Ix"
#define PRIXPTR "IX"
// The fscanf macros for signed integers are:
#define SCNd8 "d"
#define SCNi8 "i"
#define SCNdLEAST8 "d"
#define SCNiLEAST8 "i"
#define SCNdFAST8 "d"
#define SCNiFAST8 "i"
#define SCNd16 "hd"
#define SCNi16 "hi"
#define SCNdLEAST16 "hd"
#define SCNiLEAST16 "hi"
#define SCNdFAST16 "hd"
#define SCNiFAST16 "hi"
#define SCNd32 "ld"
#define SCNi32 "li"
#define SCNdLEAST32 "ld"
#define SCNiLEAST32 "li"
#define SCNdFAST32 "ld"
#define SCNiFAST32 "li"
#define SCNd64 "I64d"
#define SCNi64 "I64i"
#define SCNdLEAST64 "I64d"
#define SCNiLEAST64 "I64i"
#define SCNdFAST64 "I64d"
#define SCNiFAST64 "I64i"
#define SCNdMAX "I64d"
#define SCNiMAX "I64i"
#ifdef _WIN64 // [
# define SCNdPTR "I64d"
# define SCNiPTR "I64i"
#else // _WIN64 ][
# define SCNdPTR "ld"
# define SCNiPTR "li"
#endif // _WIN64 ]
// The fscanf macros for unsigned integers are:
#define SCNo8 "o"
#define SCNu8 "u"
#define SCNx8 "x"
#define SCNX8 "X"
#define SCNoLEAST8 "o"
#define SCNuLEAST8 "u"
#define SCNxLEAST8 "x"
#define SCNXLEAST8 "X"
#define SCNoFAST8 "o"
#define SCNuFAST8 "u"
#define SCNxFAST8 "x"
#define SCNXFAST8 "X"
#define SCNo16 "ho"
#define SCNu16 "hu"
#define SCNx16 "hx"
#define SCNX16 "hX"
#define SCNoLEAST16 "ho"
#define SCNuLEAST16 "hu"
#define SCNxLEAST16 "hx"
#define SCNXLEAST16 "hX"
#define SCNoFAST16 "ho"
#define SCNuFAST16 "hu"
#define SCNxFAST16 "hx"
#define SCNXFAST16 "hX"
#define SCNo32 "lo"
#define SCNu32 "lu"
#define SCNx32 "lx"
#define SCNX32 "lX"
#define SCNoLEAST32 "lo"
#define SCNuLEAST32 "lu"
#define SCNxLEAST32 "lx"
#define SCNXLEAST32 "lX"
#define SCNoFAST32 "lo"
#define SCNuFAST32 "lu"
#define SCNxFAST32 "lx"
#define SCNXFAST32 "lX"
#define SCNo64 "I64o"
#define SCNu64 "I64u"
#define SCNx64 "I64x"
#define SCNX64 "I64X"
#define SCNoLEAST64 "I64o"
#define SCNuLEAST64 "I64u"
#define SCNxLEAST64 "I64x"
#define SCNXLEAST64 "I64X"
#define SCNoFAST64 "I64o"
#define SCNuFAST64 "I64u"
#define SCNxFAST64 "I64x"
#define SCNXFAST64 "I64X"
#define SCNoMAX "I64o"
#define SCNuMAX "I64u"
#define SCNxMAX "I64x"
#define SCNXMAX "I64X"
#ifdef _WIN64 // [
# define SCNoPTR "I64o"
# define SCNuPTR "I64u"
# define SCNxPTR "I64x"
# define SCNXPTR "I64X"
#else // _WIN64 ][
# define SCNoPTR "lo"
# define SCNuPTR "lu"
# define SCNxPTR "lx"
# define SCNXPTR "lX"
#endif // _WIN64 ]
#endif // __STDC_FORMAT_MACROS ]
// 7.8.2 Functions for greatest-width integer types
// 7.8.2.1 The imaxabs function
#define imaxabs _abs64
// 7.8.2.2 The imaxdiv function
// This is modified version of div() function from Microsoft's div.c found
// in %MSVC.NET%\crt\src\div.c
#ifdef STATIC_IMAXDIV // [
static
#else // STATIC_IMAXDIV ][
_inline
#endif // STATIC_IMAXDIV ]
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
{
imaxdiv_t result;
result.quot = numer / denom;
result.rem = numer % denom;
if (numer < 0 && result.rem > 0) {
// did division wrong; must fix up
++result.quot;
result.rem -= denom;
}
return result;
}
// 7.8.2.3 The strtoimax and strtoumax functions
#define strtoimax _strtoi64
#define strtoumax _strtoui64
// 7.8.2.4 The wcstoimax and wcstoumax functions
#define wcstoimax _wcstoi64
#define wcstoumax _wcstoui64
#endif // _MSC_INTTYPES_H_ ]

View File

@@ -1,251 +0,0 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006-2008 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_STDINT_H_ // [
#define _MSC_STDINT_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include <limits.h>
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
// or compiler give many errors like this:
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
#ifdef __cplusplus
#if _MSC_VER < 1300
extern "C++" {
#else
extern "C" {
#endif
#endif
# include <wchar.h>
#ifdef __cplusplus
}
#endif
// Define _W64 macros to mark types changing their size, like intptr_t.
#ifndef _W64
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
# define _W64 __w64
# else
# define _W64
# endif
#endif
// 7.18.1 Integer types
// 7.18.1.1 Exact-width integer types
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
// realize that, e.g. char has the same size as __int8
// so we give up on __intX for them.
#if (_MSC_VER < 1300)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#else
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#endif
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
// 7.18.1.2 Minimum-width integer types
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
// 7.18.1.3 Fastest minimum-width integer types
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
typedef signed __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
typedef _W64 signed int intptr_t;
typedef _W64 unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
// 7.18.2 Limits of specified-width integer types
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
// 7.18.2.1 Limits of exact-width integer types
#define INT8_MIN ((int8_t)_I8_MIN)
#define INT8_MAX _I8_MAX
#define INT16_MIN ((int16_t)_I16_MIN)
#define INT16_MAX _I16_MAX
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
#define UINT8_MAX _UI8_MAX
#define UINT16_MAX _UI16_MAX
#define UINT32_MAX _UI32_MAX
#define UINT64_MAX _UI64_MAX
// 7.18.2.2 Limits of minimum-width integer types
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
// 7.18.2.3 Limits of fastest minimum-width integer types
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
// 7.18.2.4 Limits of integer types capable of holding object pointers
#ifdef _WIN64 // [
# define INTPTR_MIN INT64_MIN
# define INTPTR_MAX INT64_MAX
# define UINTPTR_MAX UINT64_MAX
#else // _WIN64 ][
# define INTPTR_MIN INT32_MIN
# define INTPTR_MAX INT32_MAX
# define UINTPTR_MAX UINT32_MAX
#endif // _WIN64 ]
// 7.18.2.5 Limits of greatest-width integer types
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
// 7.18.3 Limits of other integer types
#ifdef _WIN64 // [
# define PTRDIFF_MIN _I64_MIN
# define PTRDIFF_MAX _I64_MAX
#else // _WIN64 ][
# define PTRDIFF_MIN _I32_MIN
# define PTRDIFF_MAX _I32_MAX
#endif // _WIN64 ]
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
#ifndef SIZE_MAX // [
# ifdef _WIN64 // [
# define SIZE_MAX _UI64_MAX
# else // _WIN64 ][
# define SIZE_MAX _UI32_MAX
# endif // _WIN64 ]
#endif // SIZE_MAX ]
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
#ifndef WCHAR_MIN // [
# define WCHAR_MIN 0
#endif // WCHAR_MIN ]
#ifndef WCHAR_MAX // [
# define WCHAR_MAX _UI16_MAX
#endif // WCHAR_MAX ]
#define WINT_MIN 0
#define WINT_MAX _UI16_MAX
#endif // __STDC_LIMIT_MACROS ]
// 7.18.4 Limits of other integer types
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
// 7.18.4.1 Macros for minimum-width integer constants
#define INT8_C(val) val##i8
#define INT16_C(val) val##i16
#define INT32_C(val) val##i32
#define INT64_C(val) val##i64
#define UINT8_C(val) val##ui8
#define UINT16_C(val) val##ui16
#define UINT32_C(val) val##ui32
#define UINT64_C(val) val##ui64
// 7.18.4.2 Macros for greatest-width integer constants
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
#endif // __STDC_CONSTANT_MACROS ]
#endif // _MSC_STDINT_H_ ]

View File

@@ -1,16 +0,0 @@
find_path( MT19937AR_INCLUDE_DIRS "mt19937ar.h"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}"
NO_DEFAULT_PATH )
find_path( MT19937AR_SOURCE_DIR "mt19937ar.c"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}"
NO_DEFAULT_PATH )
mark_as_advanced( MT19937AR_INCLUDE_DIRS )
mark_as_advanced( MT19937AR_SOURCE_DIR )
set( MT19937AR_HEADERS
"${CMAKE_CURRENT_SOURCE_DIR}/mt19937ar.h"
CACHE INTERNAL "mt19937ar headers" )
set( MT19937AR_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/mt19937ar.c"
CACHE INTERNAL "mt19937ar sources" )

View File

@@ -1,26 +0,0 @@
MT19937AR_OBJ = mt19937ar.o
MT19937AR_H = mt19937ar.h
@SET_MAKE@
#####################################################################
.PHONY : all clean help
all: $(MT19937AR_OBJ)
clean:
@echo " CLEAN mt19937ar"
@rm -rf *.o
help:
@echo "possible targets are 'all' 'clean' 'help'"
@echo "'all' - builds $(MT19937AR_OBJ)"
@echo "'clean' - deletes $(MT19937AR_OBJ)"
@echo "'help' - outputs this message"
#####################################################################
%.o: %.c $(MT19937AR_H)
@echo " CC $<"
@@CC@ @CFLAGS_AR@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<

View File

@@ -1,175 +0,0 @@
/*
A C-program for MT19937, with initialization improved 2002/1/26.
Coded by Takuji Nishimura and Makoto Matsumoto.
Before using, initialize the state by using init_genrand(seed)
or init_by_array(init_key, key_length).
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Copyright (C) 2005, Mutsuo Saito,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Any feedback is very welcome.
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
*/
#include <stdio.h>
#include "mt19937ar.h"
/* Period parameters */
#define N 624
#define M 397
#define MATRIX_A 0x9908b0dfUL /* constant vector a */
#define UPPER_MASK 0x80000000UL /* most significant w-r bits */
#define LOWER_MASK 0x7fffffffUL /* least significant r bits */
static unsigned long mt[N]; /* the array for the state vector */
static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */
/* initializes mt[N] with a seed */
void init_genrand(unsigned long s)
{
mt[0]= s & 0xffffffffUL;
for (mti=1; mti<N; mti++) {
mt[mti] =
(1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti);
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
/* In the previous versions, MSBs of the seed affect */
/* only MSBs of the array mt[]. */
/* 2002/01/09 modified by Makoto Matsumoto */
mt[mti] &= 0xffffffffUL;
/* for >32 bit machines */
}
}
/* initialize by an array with array-length */
/* init_key is the array for initializing keys */
/* key_length is its length */
/* slight change for C++, 2004/2/26 */
void init_by_array(unsigned long init_key[], int key_length)
{
int i, j, k;
init_genrand(19650218UL);
i=1; j=0;
k = (N>key_length ? N : key_length);
for (; k; k--) {
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL))
+ init_key[j] + j; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++; j++;
if (i>=N) { mt[0] = mt[N-1]; i=1; }
if (j>=key_length) j=0;
}
for (k=N-1; k; k--) {
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL))
- i; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
if (i>=N) { mt[0] = mt[N-1]; i=1; }
}
mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
}
/* generates a random number on [0,0xffffffff]-interval */
unsigned long genrand_int32(void)
{
unsigned long y;
static unsigned long mag01[2]={0x0UL, MATRIX_A};
/* mag01[x] = x * MATRIX_A for x=0,1 */
if (mti >= N) { /* generate N words at one time */
int kk;
if (mti == N+1) /* if init_genrand() has not been called, */
init_genrand(5489UL); /* a default initial seed is used */
for (kk=0;kk<N-M;kk++) {
y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1UL];
}
for (;kk<N-1;kk++) {
y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
}
y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL];
mti = 0;
}
y = mt[mti++];
/* Tempering */
y ^= (y >> 11);
y ^= (y << 7) & 0x9d2c5680UL;
y ^= (y << 15) & 0xefc60000UL;
y ^= (y >> 18);
return y;
}
/* generates a random number on [0,0x7fffffff]-interval */
long genrand_int31(void)
{
return (long)(genrand_int32()>>1);
}
/* generates a random number on [0,1]-real-interval */
double genrand_real1(void)
{
return genrand_int32()*(1.0/4294967295.0);
/* divided by 2^32-1 */
}
/* generates a random number on [0,1)-real-interval */
double genrand_real2(void)
{
return genrand_int32()*(1.0/4294967296.0);
/* divided by 2^32 */
}
/* generates a random number on (0,1)-real-interval */
double genrand_real3(void)
{
return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0);
/* divided by 2^32 */
}
/* generates a random number on [0,1) with 53-bit resolution*/
double genrand_res53(void)
{
unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6;
return(a*67108864.0+b)*(1.0/9007199254740992.0);
}
/* These real versions are due to Isaku Wada, 2002/01/09 added */

View File

@@ -1,72 +0,0 @@
/*
A C-program for MT19937, with initialization improved 2002/1/26.
Coded by Takuji Nishimura and Makoto Matsumoto.
Before using, initialize the state by using init_genrand(seed)
or init_by_array(init_key, key_length).
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Copyright (C) 2005, Mutsuo Saito
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Any feedback is very welcome.
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
*/
/* initializes mt[N] with a seed */
void init_genrand(unsigned long s);
/* initialize by an array with array-length */
/* init_key is the array for initializing keys */
/* key_length is its length */
/* slight change for C++, 2004/2/26 */
void init_by_array(unsigned long init_key[], int key_length);
/* generates a random number on [0,0xffffffff]-interval */
unsigned long genrand_int32(void);
/* generates a random number on [0,0x7fffffff]-interval */
long genrand_int31(void);
/* These real versions are due to Isaku Wada, 2002/01/09 added */
/* generates a random number on [0,1]-real-interval */
double genrand_real1(void);
/* generates a random number on [0,1)-real-interval */
double genrand_real2(void);
/* generates a random number on (0,1)-real-interval */
double genrand_real3(void);
/* generates a random number on [0,1) with 53-bit resolution*/
double genrand_res53(void);

View File

@@ -1,403 +0,0 @@
1000 outputs of genrand_int32()
1067595299 955945823 477289528 4107218783 4228976476
3344332714 3355579695 227628506 810200273 2591290167
2560260675 3242736208 646746669 1479517882 4245472273
1143372638 3863670494 3221021970 1773610557 1138697238
1421897700 1269916527 2859934041 1764463362 3874892047
3965319921 72549643 2383988930 2600218693 3237492380
2792901476 725331109 605841842 271258942 715137098
3297999536 1322965544 4229579109 1395091102 3735697720
2101727825 3730287744 2950434330 1661921839 2895579582
2370511479 1004092106 2247096681 2111242379 3237345263
4082424759 219785033 2454039889 3709582971 835606218
2411949883 2735205030 756421180 2175209704 1873865952
2762534237 4161807854 3351099340 181129879 3269891896
776029799 2218161979 3001745796 1866825872 2133627728
34862734 1191934573 3102311354 2916517763 1012402762
2184831317 4257399449 2899497138 3818095062 3030756734
1282161629 420003642 2326421477 2741455717 1278020671
3744179621 271777016 2626330018 2560563991 3055977700
4233527566 1228397661 3595579322 1077915006 2395931898
1851927286 3013683506 1999971931 3006888962 1049781534
1488758959 3491776230 104418065 2448267297 3075614115
3872332600 891912190 3936547759 2269180963 2633455084
1047636807 2604612377 2709305729 1952216715 207593580
2849898034 670771757 2210471108 467711165 263046873
3569667915 1042291111 3863517079 1464270005 2758321352
3790799816 2301278724 3106281430 7974801 2792461636
555991332 621766759 1322453093 853629228 686962251
1455120532 957753161 1802033300 1021534190 3486047311
1902128914 3701138056 4176424663 1795608698 560858864
3737752754 3141170998 1553553385 3367807274 711546358
2475125503 262969859 251416325 2980076994 1806565895
969527843 3529327173 2736343040 2987196734 1649016367
2206175811 3048174801 3662503553 3138851612 2660143804
1663017612 1816683231 411916003 3887461314 2347044079
1015311755 1203592432 2170947766 2569420716 813872093
1105387678 1431142475 220570551 4243632715 4179591855
2607469131 3090613241 282341803 1734241730 1391822177
1001254810 827927915 1886687171 3935097347 2631788714
3905163266 110554195 2447955646 3717202975 3304793075
3739614479 3059127468 953919171 2590123714 1132511021
3795593679 2788030429 982155079 3472349556 859942552
2681007391 2299624053 647443547 233600422 608168955
3689327453 1849778220 1608438222 3968158357 2692977776
2851872572 246750393 3582818628 3329652309 4036366910
1012970930 950780808 3959768744 2538550045 191422718
2658142375 3276369011 2927737484 1234200027 1920815603
3536074689 1535612501 2184142071 3276955054 428488088
2378411984 4059769550 3913744741 2732139246 64369859
3755670074 842839565 2819894466 2414718973 1010060670
1839715346 2410311136 152774329 3485009480 4102101512
2852724304 879944024 1785007662 2748284463 1354768064
3267784736 2269127717 3001240761 3179796763 895723219
865924942 4291570937 89355264 1471026971 4114180745
3201939751 2867476999 2460866060 3603874571 2238880432
3308416168 2072246611 2755653839 3773737248 1709066580
4282731467 2746170170 2832568330 433439009 3175778732
26248366 2551382801 183214346 3893339516 1928168445
1337157619 3429096554 3275170900 1782047316 4264403756
1876594403 4289659572 3223834894 1728705513 4068244734
2867840287 1147798696 302879820 1730407747 1923824407
1180597908 1569786639 198796327 560793173 2107345620
2705990316 3448772106 3678374155 758635715 884524671
486356516 1774865603 3881226226 2635213607 1181121587
1508809820 3178988241 1594193633 1235154121 326117244
2304031425 937054774 2687415945 3192389340 2003740439
1823766188 2759543402 10067710 1533252662 4132494984
82378136 420615890 3467563163 541562091 3535949864
2277319197 3330822853 3215654174 4113831979 4204996991
2162248333 3255093522 2219088909 2978279037 255818579
2859348628 3097280311 2569721123 1861951120 2907080079
2719467166 998319094 2521935127 2404125338 259456032
2086860995 1839848496 1893547357 2527997525 1489393124
2860855349 76448234 2264934035 744914583 2586791259
1385380501 66529922 1819103258 1899300332 2098173828
1793831094 276463159 360132945 4178212058 595015228
177071838 2800080290 1573557746 1548998935 378454223
1460534296 1116274283 3112385063 3709761796 827999348
3580042847 1913901014 614021289 4278528023 1905177404
45407939 3298183234 1184848810 3644926330 3923635459
1627046213 3677876759 969772772 1160524753 1522441192
452369933 1527502551 832490847 1003299676 1071381111
2891255476 973747308 4086897108 1847554542 3895651598
2227820339 1621250941 2881344691 3583565821 3510404498
849362119 862871471 797858058 2867774932 2821282612
3272403146 3997979905 209178708 1805135652 6783381
2823361423 792580494 4263749770 776439581 3798193823
2853444094 2729507474 1071873341 1329010206 1289336450
3327680758 2011491779 80157208 922428856 1158943220
1667230961 2461022820 2608845159 387516115 3345351910
1495629111 4098154157 3156649613 3525698599 4134908037
446713264 2137537399 3617403512 813966752 1157943946
3734692965 1680301658 3180398473 3509854711 2228114612
1008102291 486805123 863791847 3189125290 1050308116
3777341526 4291726501 844061465 1347461791 2826481581
745465012 2055805750 4260209475 2386693097 2980646741
447229436 2077782664 1232942813 4023002732 1399011509
3140569849 2579909222 3794857471 900758066 2887199683
1720257997 3367494931 2668921229 955539029 3818726432
1105704962 3889207255 2277369307 2746484505 1761846513
2413916784 2685127085 4240257943 1166726899 4215215715
3082092067 3960461946 1663304043 2087473241 4162589986
2507310778 1579665506 767234210 970676017 492207530
1441679602 1314785090 3262202570 3417091742 1561989210
3011406780 1146609202 3262321040 1374872171 1634688712
1280458888 2230023982 419323804 3262899800 39783310
1641619040 1700368658 2207946628 2571300939 2424079766
780290914 2715195096 3390957695 163151474 2309534542
1860018424 555755123 280320104 1604831083 2713022383
1728987441 3639955502 623065489 3828630947 4275479050
3516347383 2343951195 2430677756 635534992 3868699749
808442435 3070644069 4282166003 2093181383 2023555632
1568662086 3422372620 4134522350 3016979543 3259320234
2888030729 3185253876 4258779643 1267304371 1022517473
815943045 929020012 2995251018 3371283296 3608029049
2018485115 122123397 2810669150 1411365618 1238391329
1186786476 3155969091 2242941310 1765554882 279121160
4279838515 1641578514 3796324015 13351065 103516986
1609694427 551411743 2493771609 1316337047 3932650856
4189700203 463397996 2937735066 1855616529 2626847990
55091862 3823351211 753448970 4045045500 1274127772
1124182256 92039808 2126345552 425973257 386287896
2589870191 1987762798 4084826973 2172456685 3366583455
3602966653 2378803535 2901764433 3716929006 3710159000
2653449155 3469742630 3096444476 3932564653 2595257433
318974657 3146202484 853571438 144400272 3768408841
782634401 2161109003 570039522 1886241521 14249488
2230804228 1604941699 3928713335 3921942509 2155806892
134366254 430507376 1924011722 276713377 196481886
3614810992 1610021185 1785757066 851346168 3761148643
2918835642 3364422385 3012284466 3735958851 2643153892
3778608231 1164289832 205853021 2876112231 3503398282
3078397001 3472037921 1748894853 2740861475 316056182
1660426908 168885906 956005527 3984354789 566521563
1001109523 1216710575 2952284757 3834433081 3842608301
2467352408 3974441264 3256601745 1409353924 1329904859
2307560293 3125217879 3622920184 3832785684 3882365951
2308537115 2659155028 1450441945 3532257603 3186324194
1225603425 1124246549 175808705 3009142319 2796710159
3651990107 160762750 1902254979 1698648476 1134980669
497144426 3302689335 4057485630 3603530763 4087252587
427812652 286876201 823134128 1627554964 3745564327
2589226092 4202024494 62878473 3275585894 3987124064
2791777159 1916869511 2585861905 1375038919 1403421920
60249114 3811870450 3021498009 2612993202 528933105
2757361321 3341402964 2621861700 273128190 4015252178
3094781002 1621621288 2337611177 1796718448 1258965619
4241913140 2138560392 3022190223 4174180924 450094611
3274724580 617150026 2704660665 1469700689 1341616587
356715071 1188789960 2278869135 1766569160 2795896635
57824704 2893496380 1235723989 1630694347 3927960522
428891364 1814070806 2287999787 4125941184 3968103889
3548724050 1025597707 1404281500 2002212197 92429143
2313943944 2403086080 3006180634 3561981764 1671860914
1768520622 1803542985 844848113 3006139921 1410888995
1157749833 2125704913 1789979528 1799263423 741157179
2405862309 767040434 2655241390 3663420179 2172009096
2511931187 1680542666 231857466 1154981000 157168255
1454112128 3505872099 1929775046 2309422350 2143329496
2960716902 407610648 2938108129 2581749599 538837155
2342628867 430543915 740188568 1937713272 3315215132
2085587024 4030765687 766054429 3517641839 689721775
1294158986 1753287754 4202601348 1974852792 33459103
3568087535 3144677435 1686130825 4134943013 3005738435
3599293386 426570142 754104406 3660892564 1964545167
829466833 821587464 1746693036 1006492428 1595312919
1256599985 1024482560 1897312280 2902903201 691790057
1037515867 3176831208 1968401055 2173506824 1089055278
1748401123 2941380082 968412354 1818753861 2973200866
3875951774 1119354008 3988604139 1647155589 2232450826
3486058011 3655784043 3759258462 847163678 1082052057
989516446 2871541755 3196311070 3929963078 658187585
3664944641 2175149170 2203709147 2756014689 2456473919
3890267390 1293787864 2830347984 3059280931 4158802520
1561677400 2586570938 783570352 1355506163 31495586
3789437343 3340549429 2092501630 896419368 671715824
3530450081 3603554138 1055991716 3442308219 1499434728
3130288473 3639507000 17769680 2259741420 487032199
4227143402 3693771256 1880482820 3924810796 381462353
4017855991 2452034943 2736680833 2209866385 2128986379
437874044 595759426 641721026 1636065708 3899136933
629879088 3591174506 351984326 2638783544 2348444281
2341604660 2123933692 143443325 1525942256 364660499
599149312 939093251 1523003209 106601097 376589484
1346282236 1297387043 764598052 3741218111 933457002
1886424424 3219631016 525405256 3014235619 323149677
2038881721 4100129043 2851715101 2984028078 1888574695
2014194741 3515193880 4180573530 3461824363 2641995497
3179230245 2902294983 2217320456 4040852155 1784656905
3311906931 87498458 2752971818 2635474297 2831215366
3682231106 2920043893 3772929704 2816374944 309949752
2383758854 154870719 385111597 1191604312 1840700563
872191186 2925548701 1310412747 2102066999 1504727249
3574298750 1191230036 3330575266 3180292097 3539347721
681369118 3305125752 3648233597 950049240 4173257693
1760124957 512151405 681175196 580563018 1169662867
4015033554 2687781101 699691603 2673494188 1137221356
123599888 472658308 1053598179 1012713758 3481064843
3759461013 3981457956 3830587662 1877191791 3650996736
988064871 3515461600 4089077232 2225147448 1249609188
2643151863 3896204135 2416995901 1397735321 3460025646
1000 outputs of genrand_real2()
0.76275443 0.99000644 0.98670464 0.10143112 0.27933125
0.69867227 0.94218740 0.03427201 0.78842173 0.28180608
0.92179002 0.20785655 0.54534773 0.69644020 0.38107718
0.23978165 0.65286910 0.07514568 0.22765211 0.94872929
0.74557914 0.62664415 0.54708246 0.90959343 0.42043116
0.86334511 0.19189126 0.14718544 0.70259889 0.63426346
0.77408121 0.04531601 0.04605807 0.88595519 0.69398270
0.05377184 0.61711170 0.05565708 0.10133577 0.41500776
0.91810699 0.22320679 0.23353705 0.92871862 0.98897234
0.19786706 0.80558809 0.06961067 0.55840445 0.90479405
0.63288060 0.95009721 0.54948447 0.20645042 0.45000959
0.87050869 0.70806991 0.19406895 0.79286390 0.49332866
0.78483914 0.75145146 0.12341941 0.42030252 0.16728160
0.59906494 0.37575460 0.97815160 0.39815952 0.43595080
0.04952478 0.33917805 0.76509902 0.61034321 0.90654701
0.92915732 0.85365931 0.18812377 0.65913428 0.28814566
0.59476081 0.27835931 0.60722542 0.68310435 0.69387186
0.03699800 0.65897714 0.17527003 0.02889304 0.86777366
0.12352068 0.91439461 0.32022990 0.44445731 0.34903686
0.74639273 0.65918367 0.92492794 0.31872642 0.77749724
0.85413832 0.76385624 0.32744211 0.91326300 0.27458185
0.22190155 0.19865383 0.31227402 0.85321225 0.84243342
0.78544200 0.71854080 0.92503892 0.82703064 0.88306297
0.47284073 0.70059042 0.48003761 0.38671694 0.60465770
0.41747204 0.47163243 0.72750808 0.65830223 0.10955369
0.64215401 0.23456345 0.95944940 0.72822249 0.40888451
0.69980355 0.26677428 0.57333635 0.39791582 0.85377858
0.76962816 0.72004885 0.90903087 0.51376506 0.37732665
0.12691640 0.71249738 0.81217908 0.37037313 0.32772374
0.14238259 0.05614811 0.74363008 0.39773267 0.94859135
0.31452454 0.11730313 0.62962618 0.33334237 0.45547255
0.10089665 0.56550662 0.60539371 0.16027624 0.13245301
0.60959939 0.04671662 0.99356286 0.57660859 0.40269560
0.45274629 0.06699735 0.85064246 0.87742744 0.54508392
0.87242982 0.29321385 0.67660627 0.68230715 0.79052073
0.48592054 0.25186266 0.93769755 0.28565487 0.47219067
0.99054882 0.13155240 0.47110470 0.98556600 0.84397623
0.12875246 0.90953202 0.49129015 0.23792727 0.79481194
0.44337770 0.96564297 0.67749118 0.55684872 0.27286897
0.79538393 0.61965356 0.22487929 0.02226018 0.49248200
0.42247006 0.91797788 0.99250134 0.23449967 0.52531508
0.10246337 0.78685622 0.34310922 0.89892996 0.40454552
0.68608407 0.30752487 0.83601319 0.54956031 0.63777550
0.82199797 0.24890696 0.48801123 0.48661910 0.51223987
0.32969635 0.31075073 0.21393155 0.73453207 0.15565705
0.58584522 0.28976728 0.97621478 0.61498701 0.23891470
0.28518540 0.46809591 0.18371914 0.37597910 0.13492176
0.66849449 0.82811466 0.56240330 0.37548956 0.27562998
0.27521910 0.74096121 0.77176757 0.13748143 0.99747138
0.92504502 0.09175241 0.21389176 0.21766512 0.31183245
0.23271221 0.21207367 0.57903312 0.77523344 0.13242613
0.31037988 0.01204835 0.71652949 0.84487594 0.14982178
0.57423142 0.45677888 0.48420169 0.53465428 0.52667473
0.46880526 0.49849733 0.05670710 0.79022476 0.03872047
0.21697212 0.20443086 0.28949326 0.81678186 0.87629474
0.92297064 0.27373097 0.84625273 0.51505586 0.00582792
0.33295971 0.91848412 0.92537226 0.91760033 0.07541125
0.71745848 0.61158698 0.00941650 0.03135554 0.71527471
0.24821915 0.63636652 0.86159918 0.26450229 0.60160194
0.35557725 0.24477500 0.07186456 0.51757096 0.62120362
0.97981062 0.69954667 0.21065616 0.13382753 0.27693186
0.59644095 0.71500764 0.04110751 0.95730081 0.91600724
0.47704678 0.26183479 0.34706971 0.07545431 0.29398385
0.93236070 0.60486023 0.48015011 0.08870451 0.45548581
0.91872718 0.38142712 0.10668643 0.01397541 0.04520355
0.93822273 0.18011940 0.57577277 0.91427606 0.30911399
0.95853475 0.23611214 0.69619891 0.69601980 0.76765372
0.58515930 0.49479057 0.11288752 0.97187699 0.32095365
0.57563608 0.40760618 0.78703383 0.43261152 0.90877651
0.84686346 0.10599030 0.72872803 0.19315490 0.66152912
0.10210518 0.06257876 0.47950688 0.47062066 0.72701157
0.48915116 0.66110261 0.60170685 0.24516994 0.12726050
0.03451185 0.90864994 0.83494878 0.94800035 0.91035206
0.14480751 0.88458997 0.53498312 0.15963215 0.55378627
0.35171349 0.28719791 0.09097957 0.00667896 0.32309622
0.87561479 0.42534520 0.91748977 0.73908457 0.41793223
0.99279792 0.87908370 0.28458072 0.59132853 0.98672190
0.28547393 0.09452165 0.89910674 0.53681109 0.37931425
0.62683489 0.56609740 0.24801549 0.52948179 0.98328855
0.66403523 0.55523786 0.75886666 0.84784685 0.86829981
0.71448906 0.84670080 0.43922919 0.20771016 0.64157936
0.25664246 0.73055695 0.86395782 0.65852932 0.99061803
0.40280575 0.39146298 0.07291005 0.97200603 0.20555729
0.59616495 0.08138254 0.45796388 0.33681125 0.33989127
0.18717090 0.53545811 0.60550838 0.86520709 0.34290701
0.72743276 0.73023855 0.34195926 0.65019733 0.02765254
0.72575740 0.32709576 0.03420866 0.26061893 0.56997511
0.28439072 0.84422744 0.77637570 0.55982168 0.06720327
0.58449067 0.71657369 0.15819609 0.58042821 0.07947911
0.40193792 0.11376012 0.88762938 0.67532159 0.71223735
0.27829114 0.04806073 0.21144026 0.58830274 0.04140071
0.43215628 0.12952729 0.94668759 0.87391019 0.98382450
0.27750768 0.90849647 0.90962737 0.59269720 0.96102026
0.49544979 0.32007095 0.62585546 0.03119821 0.85953001
0.22017528 0.05834068 0.80731217 0.53799961 0.74166948
0.77426600 0.43938444 0.54862081 0.58575513 0.15886492
0.73214332 0.11649057 0.77463977 0.85788827 0.17061997
0.66838056 0.96076133 0.07949296 0.68521946 0.89986254
0.05667410 0.12741385 0.83470977 0.63969104 0.46612929
0.10200126 0.01194925 0.10476340 0.90285217 0.31221221
0.32980614 0.46041971 0.52024973 0.05425470 0.28330912
0.60426543 0.00598243 0.97244013 0.21135841 0.78561597
0.78428734 0.63422849 0.32909934 0.44771136 0.27380750
0.14966697 0.18156268 0.65686758 0.28726350 0.97074787
0.63676171 0.96649494 0.24526295 0.08297372 0.54257548
0.03166785 0.33735355 0.15946671 0.02102971 0.46228045
0.11892296 0.33408336 0.29875681 0.29847692 0.73767569
0.02080745 0.62980060 0.08082293 0.22993106 0.25031439
0.87787525 0.45150053 0.13673441 0.63407612 0.97907688
0.52241942 0.50580158 0.06273902 0.05270283 0.77031811
0.05113352 0.24393329 0.75036441 0.37436336 0.22877652
0.59975358 0.85707591 0.88691457 0.85547165 0.36641027
0.58720133 0.45462835 0.09243817 0.32981586 0.07820411
0.25421519 0.36004706 0.60092307 0.46192412 0.36758683
0.98424170 0.08019934 0.68594024 0.45826386 0.29962317
0.79365413 0.89231296 0.49478547 0.87645944 0.23590734
0.28106737 0.75026285 0.08136314 0.79582424 0.76010628
0.82792971 0.27947652 0.72482861 0.82191216 0.46171689
0.79189752 0.96043686 0.51609668 0.88995725 0.28998963
0.55191845 0.03934737 0.83033700 0.49553013 0.98009549
0.19017594 0.98347750 0.33452066 0.87144372 0.72106301
0.71272114 0.71465963 0.88361677 0.85571283 0.73782329
0.20920458 0.34855153 0.46766817 0.02780062 0.74898344
0.03680650 0.44866557 0.77426312 0.91025891 0.25195236
0.87319953 0.63265037 0.25552148 0.27422476 0.95217406
0.39281839 0.66441573 0.09158900 0.94515992 0.07800798
0.02507888 0.39901462 0.17382573 0.12141278 0.85502334
0.19902911 0.02160210 0.44460522 0.14688742 0.68020336
0.71323733 0.60922473 0.95400380 0.99611159 0.90897777
0.41073520 0.66206647 0.32064685 0.62805003 0.50677209
0.52690101 0.87473387 0.73918362 0.39826974 0.43683919
0.80459118 0.32422684 0.01958019 0.95319576 0.98326137
0.83931735 0.69060863 0.33671416 0.68062550 0.65152380
0.33392969 0.03451730 0.95227244 0.68200635 0.85074171
0.64721009 0.51234433 0.73402047 0.00969637 0.93835057
0.80803854 0.31485260 0.20089527 0.01323282 0.59933780
0.31584602 0.20209563 0.33754800 0.68604181 0.24443049
0.19952227 0.78162632 0.10336988 0.11360736 0.23536740
0.23262256 0.67803776 0.48749791 0.74658435 0.92156640
0.56706407 0.36683221 0.99157136 0.23421374 0.45183767
0.91609720 0.85573315 0.37706276 0.77042618 0.30891908
0.40709595 0.06944866 0.61342849 0.88817388 0.58734506
0.98711323 0.14744128 0.63242656 0.87704136 0.68347125
0.84446569 0.43265239 0.25146321 0.04130111 0.34259839
0.92697368 0.40878778 0.56990338 0.76204273 0.19820348
0.66314909 0.02482844 0.06669207 0.50205581 0.26084093
0.65139159 0.41650223 0.09733904 0.56344203 0.62651696
0.67332139 0.58037374 0.47258086 0.21010758 0.05713135
0.89390629 0.10781246 0.32037450 0.07628388 0.34227964
0.42190597 0.58201860 0.77363549 0.49595133 0.86031236
0.83906769 0.81098161 0.26694195 0.14215941 0.88210306
0.53634237 0.12090720 0.82480459 0.75930318 0.31847147
0.92768077 0.01037616 0.56201727 0.88107122 0.35925856
0.85860762 0.61109408 0.70408301 0.58434977 0.92192494
0.62667915 0.75988365 0.06858761 0.36156496 0.58057195
0.13636150 0.57719713 0.59340255 0.63530602 0.22976282
0.71915530 0.41162531 0.63979565 0.09931342 0.79344045
0.10893790 0.84450224 0.23122236 0.99485593 0.73637397
0.17276368 0.13357764 0.74965804 0.64991737 0.61990341
0.41523170 0.05878239 0.05687301 0.05497131 0.42868366
0.42571090 0.25810502 0.89642955 0.30439758 0.39310223
0.11357431 0.04288255 0.23397550 0.11200634 0.85621396
0.89733974 0.37508865 0.42077265 0.68597384 0.72781399
0.19296476 0.61699087 0.31667128 0.67756410 0.00177323
0.05725176 0.79474693 0.18885238 0.06724856 0.68193156
0.42202167 0.22082041 0.28554673 0.64995708 0.87851940
0.29124547 0.61009521 0.87374537 0.05743712 0.69902994
0.81925115 0.45653873 0.37236821 0.31118709 0.52734307
0.39672836 0.38185294 0.30163915 0.17374510 0.04913278
0.90404879 0.25742801 0.58266467 0.97663209 0.79823377
0.36437958 0.15206043 0.26529938 0.22690047 0.05839021
0.84721160 0.18622435 0.37809403 0.55706977 0.49828704
0.47659049 0.24289680 0.88477595 0.07807463 0.56245739
0.73490635 0.21099431 0.13164942 0.75840044 0.66877037
0.28988183 0.44046090 0.24967434 0.80048356 0.26029740
0.30416821 0.64151867 0.52067892 0.12880774 0.85465381
0.02690525 0.19149288 0.49630295 0.79682619 0.43566145
0.00288078 0.81484193 0.03763639 0.68529083 0.01339574
0.38405386 0.30537067 0.22994703 0.44000045 0.27217985
0.53831243 0.02870435 0.86282045 0.61831306 0.09164956
0.25609707 0.07445781 0.72185784 0.90058883 0.30070608
0.94476583 0.56822213 0.21933909 0.96772793 0.80063440
0.26307906 0.31183306 0.16501252 0.55436179 0.68562285
0.23829083 0.86511559 0.57868991 0.81888344 0.20126869
0.93172350 0.66028129 0.21786948 0.78515828 0.10262106
0.35390326 0.79303876 0.63427924 0.90479631 0.31024934
0.60635447 0.56198079 0.63573813 0.91854197 0.99701497
0.83085849 0.31692291 0.01925964 0.97446405 0.98751283
0.60944293 0.13751018 0.69519957 0.68956636 0.56969015
0.46440193 0.88341765 0.36754434 0.89223647 0.39786427
0.85055280 0.12749961 0.79452122 0.89449784 0.14567830
0.45716830 0.74822309 0.28200437 0.42546044 0.17464886
0.68308746 0.65496587 0.52935411 0.12736159 0.61523955
0.81590528 0.63107864 0.39786553 0.20102294 0.53292914
0.75485590 0.59847044 0.32861691 0.12125866 0.58917183
0.07638293 0.86845380 0.29192617 0.03989733 0.52180460
0.32503407 0.64071852 0.69516575 0.74254998 0.54587026
0.48713246 0.32920155 0.08719954 0.63497059 0.54328459
0.64178757 0.45583809 0.70694291 0.85212760 0.86074305
0.33163422 0.85739792 0.59908488 0.74566046 0.72157152

View File

@@ -1,65 +0,0 @@
/*
A C-program for MT19937, with initialization improved 2002/1/26.
Coded by Takuji Nishimura and Makoto Matsumoto.
Before using, initialize the state by using init_genrand(seed)
or init_by_array(init_key, key_length).
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Copyright (C) 2005, Mutsuo Saito,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Any feedback is very welcome.
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
*/
#include <stdio.h>
#include "mt19937ar.h"
int main(void)
{
int i;
unsigned long init[4]={0x123, 0x234, 0x345, 0x456}, length=4;
init_by_array(init, length);
printf("1000 outputs of genrand_int32()\n");
for (i=0; i<1000; i++) {
printf("%10lu ", genrand_int32());
if (i%5==4) printf("\n");
}
printf("\n1000 outputs of genrand_real2()\n");
for (i=0; i<1000; i++) {
printf("%10.8f ", genrand_real2());
if (i%5==4) printf("\n");
}
return 0;
}

View File

@@ -1,79 +0,0 @@
This is a Mersenne Twister pseudorandom number generator
with period 2^19937-1 with improved initialization scheme,
modified on 2002/1/26 by Takuji Nishimura and Makoto Matsumoto.
modified on 2005/4/26 by Mutsuo Saito
Contents of this tar ball:
readme-mt.txt this file
mt19937ar.c the C source (ar: initialize by ARray)
mt19937ar.h the C header file for mt19937ar
mtTest.c the C test main program of mt19937ar.c
mt19937ar.out Test outputs of six types generators. 1000 for each
1. Initialization
The initialization scheme for the previous versions of MT
(e.g. 1999/10/28 version or earlier) has a tiny problem, that
the most significant bits of the seed is not well reflected
to the state vector of MT.
This version (2002/1/26) has two initialization schemes:
init_genrand(seed) and init_by_array(init_key, key_length).
init_genrand(seed) initializes the state vector by using
one unsigned 32-bit integer "seed", which may be zero.
init_by_array(init_key, key_length) initializes the state vector
by using an array init_key[] of unsigned 32-bit integers
of length key_kength. If key_length is smaller than 624,
then each array of 32-bit integers gives distinct initial
state vector. This is useful if you want a larger seed space
than 32-bit word.
2. Generation
After initialization, the following type of pseudorandom numbers
are available.
genrand_int32() generates unsigned 32-bit integers.
genrand_int31() generates unsigned 31-bit integers.
genrand_real1() generates uniform real in [0,1] (32-bit resolution).
genrand_real2() generates uniform real in [0,1) (32-bit resolution).
genrand_real3() generates uniform real in (0,1) (32-bit resolution).
genrand_res53() generates uniform real in [0,1) with 53-bit resolution.
Note: the last five functions call the first one.
if you need more speed for these five functions, you may
suppress the function call by copying genrand_int32() and
replacing the last return(), following to these five functions.
3. main()
main() is an example to initialize with an array of length 4,
then 1000 outputs of unsigned 32-bit integers,
then 1000 outputs of real [0,1) numbers.
4. The outputs
The output of the mt19937ar.c is in the file mt19937ar.out.
If you revise or translate the code, check the output
by using this file.
5. Cryptography
This generator is not cryptoraphically secure.
You need to use a one-way (or hash) function to obtain
a secure random sequence.
6. Correspondence
See:
URL http://www.math.keio.ac.jp/matumoto/emt.html
email matumoto@math.keio.ac.jp, nisimura@sci.kj.yamagata-u.ac.jp
7. Reference
M. Matsumoto and T. Nishimura,
"Mersenne Twister: A 623-Dimensionally Equidistributed Uniform
Pseudo-Random Number Generator",
ACM Transactions on Modeling and Computer Simulation,
Vol. 8, No. 1, January 1998, pp 3--30.
-------
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Copyright (C) 2005, Mutsuo Saito
All rights reserved.

View File

@@ -7,10 +7,17 @@ message( STATUS "Detecting local MYSQL" )
find_path( MYSQL_LOCAL_INCLUDE_DIRS "mysql.h"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/include"
NO_DEFAULT_PATH )
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
find_library( MYSQL_LOCAL_LIBRARIES
NAMES libmysql
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/lib"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/lib/Win32"
NO_DEFAULT_PATH )
else()
find_library( MYSQL_LOCAL_LIBRARIES
NAMES libmysql
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/lib/x64"
NO_DEFAULT_PATH )
endif()
mark_as_advanced( MYSQL_LOCAL_LIBRARIES )
mark_as_advanced( MYSQL_LOCAL_INCLUDE_DIRS )

114
3rdparty/mysql/include/big_endian.h vendored Normal file
View File

@@ -0,0 +1,114 @@
/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <string.h>
/*
Data in big-endian format.
*/
static inline void float4store(uchar *T, float A)
{ *(T)= ((uchar *) &A)[3];
*((T)+1)=(char) ((uchar *) &A)[2];
*((T)+2)=(char) ((uchar *) &A)[1];
*((T)+3)=(char) ((uchar *) &A)[0]; }
static inline void float4get (float *V, const uchar *M)
{ float def_temp;
((uchar*) &def_temp)[0]=(M)[3];
((uchar*) &def_temp)[1]=(M)[2];
((uchar*) &def_temp)[2]=(M)[1];
((uchar*) &def_temp)[3]=(M)[0];
(*V)=def_temp; }
static inline void float8store(uchar *T, double V)
{ *(T)= ((uchar *) &V)[7];
*((T)+1)=(char) ((uchar *) &V)[6];
*((T)+2)=(char) ((uchar *) &V)[5];
*((T)+3)=(char) ((uchar *) &V)[4];
*((T)+4)=(char) ((uchar *) &V)[3];
*((T)+5)=(char) ((uchar *) &V)[2];
*((T)+6)=(char) ((uchar *) &V)[1];
*((T)+7)=(char) ((uchar *) &V)[0]; }
static inline void float8get (double *V, const uchar *M)
{ double def_temp;
((uchar*) &def_temp)[0]=(M)[7];
((uchar*) &def_temp)[1]=(M)[6];
((uchar*) &def_temp)[2]=(M)[5];
((uchar*) &def_temp)[3]=(M)[4];
((uchar*) &def_temp)[4]=(M)[3];
((uchar*) &def_temp)[5]=(M)[2];
((uchar*) &def_temp)[6]=(M)[1];
((uchar*) &def_temp)[7]=(M)[0];
(*V) = def_temp; }
static inline void ushortget(uint16 *V, const uchar *pM)
{ *V = (uint16) (((uint16) ((uchar) (pM)[1]))+
((uint16) ((uint16) (pM)[0]) << 8)); }
static inline void shortget (int16 *V, const uchar *pM)
{ *V = (short) (((short) ((uchar) (pM)[1]))+
((short) ((short) (pM)[0]) << 8)); }
static inline void longget (int32 *V, const uchar *pM)
{ int32 def_temp;
((uchar*) &def_temp)[0]=(pM)[0];
((uchar*) &def_temp)[1]=(pM)[1];
((uchar*) &def_temp)[2]=(pM)[2];
((uchar*) &def_temp)[3]=(pM)[3];
(*V)=def_temp; }
static inline void ulongget (uint32 *V, const uchar *pM)
{ uint32 def_temp;
((uchar*) &def_temp)[0]=(pM)[0];
((uchar*) &def_temp)[1]=(pM)[1];
((uchar*) &def_temp)[2]=(pM)[2];
((uchar*) &def_temp)[3]=(pM)[3];
(*V)=def_temp; }
static inline void shortstore(uchar *T, int16 A)
{ uint def_temp=(uint) (A) ;
*(((char*)T)+1)=(char)(def_temp);
*(((char*)T)+0)=(char)(def_temp >> 8); }
static inline void longstore (uchar *T, int32 A)
{ *(((char*)T)+3)=((A));
*(((char*)T)+2)=(((A) >> 8));
*(((char*)T)+1)=(((A) >> 16));
*(((char*)T)+0)=(((A) >> 24)); }
static inline void floatget(float *V, const uchar *M)
{
memcpy(V, (M), sizeof(float));
}
static inline void floatstore(uchar *T, float V)
{
memcpy((T), (&V), sizeof(float));
}
static inline void doubleget(double *V, const uchar *M)
{
memcpy(V, (M), sizeof(double));
}
static inline void doublestore(uchar *T, double V)
{
memcpy((T), &V, sizeof(double));
}
static inline void longlongget(longlong *V, const uchar *M)
{
memcpy(V, (M), sizeof(ulonglong));
}
static inline void longlongstore(uchar *T, longlong V)
{
memcpy((T), &V, sizeof(ulonglong));
}

View File

@@ -0,0 +1,70 @@
/* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file binary_log_types.h
@brief This file contains the field type.
@note This file can be imported both from C and C++ code, so the
definitions have to be constructed to support this.
*/
#ifndef BINARY_LOG_TYPES_INCLUDED
#define BINARY_LOG_TYPES_INCLUDED
#ifdef __cplusplus
extern "C"
{
#endif
/*
* Constants exported from this package.
*/
typedef enum enum_field_types {
MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
MYSQL_TYPE_TIMESTAMP2,
MYSQL_TYPE_DATETIME2,
MYSQL_TYPE_TIME2,
MYSQL_TYPE_JSON=245,
MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
MYSQL_TYPE_TINY_BLOB=249,
MYSQL_TYPE_MEDIUM_BLOB=250,
MYSQL_TYPE_LONG_BLOB=251,
MYSQL_TYPE_BLOB=252,
MYSQL_TYPE_VAR_STRING=253,
MYSQL_TYPE_STRING=254,
MYSQL_TYPE_GEOMETRY=255
} enum_field_types;
#define DATETIME_MAX_DECIMALS 6
#ifdef __cplusplus
}
#endif // __cplusplus
#endif /* BINARY_LOG_TYPES_INCLUDED */

View File

@@ -0,0 +1,97 @@
/* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Endianness-independent definitions for architectures other
than the x86 architecture.
*/
static inline int16 sint2korr(const uchar *A)
{
return
(int16) (((int16) (A[0])) +
((int16) (A[1]) << 8))
;
}
static inline int32 sint4korr(const uchar *A)
{
return
(int32) (((int32) (A[0])) +
(((int32) (A[1]) << 8)) +
(((int32) (A[2]) << 16)) +
(((int32) (A[3]) << 24)))
;
}
static inline uint16 uint2korr(const uchar *A)
{
return
(uint16) (((uint16) (A[0])) +
((uint16) (A[1]) << 8))
;
}
static inline uint32 uint4korr(const uchar *A)
{
return
(uint32) (((uint32) (A[0])) +
(((uint32) (A[1])) << 8) +
(((uint32) (A[2])) << 16) +
(((uint32) (A[3])) << 24))
;
}
static inline ulonglong uint8korr(const uchar *A)
{
return
((ulonglong)(((uint32) (A[0])) +
(((uint32) (A[1])) << 8) +
(((uint32) (A[2])) << 16) +
(((uint32) (A[3])) << 24)) +
(((ulonglong) (((uint32) (A[4])) +
(((uint32) (A[5])) << 8) +
(((uint32) (A[6])) << 16) +
(((uint32) (A[7])) << 24))) <<
32))
;
}
static inline longlong sint8korr(const uchar *A)
{
return (longlong) uint8korr(A);
}
static inline void int2store(uchar *T, uint16 A)
{
uint def_temp= A ;
*(T)= (uchar)(def_temp);
*(T+1)= (uchar)(def_temp >> 8);
}
static inline void int4store(uchar *T, uint32 A)
{
*(T)= (uchar) (A);
*(T+1)=(uchar) (A >> 8);
*(T+2)=(uchar) (A >> 16);
*(T+3)=(uchar) (A >> 24);
}
static inline void int8store(uchar *T, ulonglong A)
{
uint def_temp= (uint) A,
def_temp2= (uint) (A >> 32);
int4store(T, def_temp);
int4store(T+4,def_temp2);
}

View File

@@ -0,0 +1,56 @@
/* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Optimized functions for the x86 architecture (_WIN32 included).
x86 handles misaligned reads and writes just fine, so suppress
UBSAN warnings for these functions.
*/
static inline int16 sint2korr(const uchar *A) SUPPRESS_UBSAN;
static inline int16 sint2korr(const uchar *A) { return *((int16*) A); }
static inline int32 sint4korr(const uchar *A) SUPPRESS_UBSAN;
static inline int32 sint4korr(const uchar *A) { return *((int32*) A); }
static inline uint16 uint2korr(const uchar *A) SUPPRESS_UBSAN;
static inline uint16 uint2korr(const uchar *A) { return *((uint16*) A); }
static inline uint32 uint4korr(const uchar *A) SUPPRESS_UBSAN;
static inline uint32 uint4korr(const uchar *A) { return *((uint32*) A); }
static inline ulonglong uint8korr(const uchar *A) SUPPRESS_UBSAN;
static inline ulonglong uint8korr(const uchar *A) { return *((ulonglong*) A);}
static inline longlong sint8korr(const uchar *A) SUPPRESS_UBSAN;
static inline longlong sint8korr(const uchar *A) { return *((longlong*) A); }
static inline void int2store(uchar *T, uint16 A) SUPPRESS_UBSAN;
static inline void int2store(uchar *T, uint16 A)
{
*((uint16*) T)= A;
}
static inline void int4store(uchar *T, uint32 A) SUPPRESS_UBSAN;
static inline void int4store(uchar *T, uint32 A)
{
*((uint32*) T)= A;
}
static inline void int8store(uchar *T, ulonglong A) SUPPRESS_UBSAN;
static inline void int8store(uchar *T, ulonglong A)
{
*((ulonglong*) T)= A;
}

View File

@@ -1,470 +0,0 @@
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Defines for Win32 to make it compatible for MySQL */
#ifdef __WIN2000__
/* We have to do this define before including windows.h to get the AWE API
functions */
#define _WIN32_WINNT 0x0500
#endif
#if defined(_MSC_VER) && _MSC_VER >= 1400
/* Avoid endless warnings about sprintf() etc. being unsafe. */
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
#include <sys/locking.h>
#include <windows.h>
#include <math.h> /* Because of rint() */
#include <fcntl.h>
#include <io.h>
#include <malloc.h>
#define HAVE_SMEM 1
#if defined(_WIN64) || defined(WIN64)
#define SYSTEM_TYPE "Win64"
#elif defined(_WIN32) || defined(WIN32)
#define SYSTEM_TYPE "Win32"
#else
#define SYSTEM_TYPE "Windows"
#endif
#if defined(_M_IA64)
#define MACHINE_TYPE "ia64"
#elif defined(_M_IX86)
#define MACHINE_TYPE "ia32"
#elif defined(_M_ALPHA)
#define MACHINE_TYPE "axp"
#else
#define MACHINE_TYPE "unknown" /* Define to machine type name */
#endif
#if !(defined(_WIN64) || defined(WIN64))
#ifndef _WIN32
#define _WIN32 /* Compatible with old source */
#endif
#ifndef __WIN32__
#define __WIN32__
#endif
#endif /* _WIN64 */
#ifndef __WIN__
#define __WIN__ /* To make it easier in VC++ */
#endif
#ifndef MAX_INDEXES
#define MAX_INDEXES 64
#endif
/* File and lock constants */
#define O_SHARE 0x1000 /* Open file in sharing mode */
#ifdef __BORLANDC__
#define F_RDLCK LK_NBLCK /* read lock */
#define F_WRLCK LK_NBRLCK /* write lock */
#define F_UNLCK LK_UNLCK /* remove lock(s) */
#else
#define F_RDLCK _LK_NBLCK /* read lock */
#define F_WRLCK _LK_NBRLCK /* write lock */
#define F_UNLCK _LK_UNLCK /* remove lock(s) */
#endif
#define F_EXCLUSIVE 1 /* We have only exclusive locking */
#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */
#define F_OK 0 /* parameter to access() */
#define W_OK 2
#define S_IROTH S_IREAD /* for my_lib */
#ifdef __BORLANDC__
#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
#define O_TEMPORARY 0
#define O_SHORT_LIVED 0
#define SH_DENYNO _SH_DENYNO
#else
#define O_BINARY _O_BINARY /* compability with MSDOS */
#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */
#define O_TEMPORARY _O_TEMPORARY
#define O_SHORT_LIVED _O_SHORT_LIVED
#define SH_DENYNO _SH_DENYNO
#endif
#define NO_OPEN_3 /* For my_create() */
#define SIGQUIT SIGTERM /* No SIGQUIT */
#undef _REENTRANT /* Crashes something for win32 */
#undef SAFE_MUTEX /* Can't be used on windows */
#if defined(_MSC_VER) && _MSC_VER >= 1310
#define LL(A) A##ll
#define ULL(A) A##ull
#else
#define LL(A) ((__int64) A)
#define ULL(A) ((unsigned __int64) A)
#endif
#define LONGLONG_MIN LL(0x8000000000000000)
#define LONGLONG_MAX LL(0x7FFFFFFFFFFFFFFF)
#define ULONGLONG_MAX ULL(0xFFFFFFFFFFFFFFFF)
/* Type information */
#if defined(__EMX__) || !defined(HAVE_UINT)
#undef HAVE_UINT
#define HAVE_UINT
typedef unsigned short ushort;
typedef unsigned int uint;
#endif /* defined(__EMX__) || !defined(HAVE_UINT) */
typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */
typedef __int64 longlong;
#ifndef HAVE_SIGSET_T
typedef int sigset_t;
#endif
#define longlong_defined
/*
off_t should not be __int64 because of conflicts in header files;
Use my_off_t or os_off_t instead
*/
#ifndef HAVE_OFF_T
typedef long off_t;
#endif
typedef __int64 os_off_t;
#ifdef _WIN64
typedef UINT_PTR rf_SetTimer;
#else
#ifndef HAVE_SIZE_T
typedef unsigned int size_t;
#endif
typedef uint rf_SetTimer;
#endif
#define Socket_defined
#define my_socket SOCKET
#define bool BOOL
#define SIGPIPE SIGINT
#define RETQSORTTYPE void
#define QSORT_TYPE_IS_VOID
#define RETSIGTYPE void
#define SOCKET_SIZE_TYPE int
#define my_socket_defined
#define bool_defined
#define byte_defined
#define HUGE_PTR
#define STDCALL __stdcall /* Used by libmysql.dll */
#define isnan(X) _isnan(X)
#define finite(X) _finite(X)
#ifndef UNDEF_THREAD_HACK
#define THREAD
#endif
#define VOID_SIGHANDLER
#define SIZEOF_CHAR 1
#define SIZEOF_LONG 4
#define SIZEOF_LONG_LONG 8
#define SIZEOF_OFF_T 8
#ifdef _WIN64
#define SIZEOF_CHARP 8
#else
#define SIZEOF_CHARP 4
#endif
#define HAVE_BROKEN_NETINET_INCLUDES
#ifdef __NT__
#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
#endif
/* ERROR is defined in wingdi.h */
#undef ERROR
/* We need to close files to break connections on shutdown */
#ifndef SIGNAL_WITH_VIO_CLOSE
#define SIGNAL_WITH_VIO_CLOSE
#endif
/* Use all character sets in MySQL */
#define USE_MB 1
#define USE_MB_IDENT 1
#define USE_STRCOLL 1
/* All windows servers should support .sym files */
#undef USE_SYMDIR
#define USE_SYMDIR
/* If LOAD DATA LOCAL INFILE should be enabled by default */
#define ENABLED_LOCAL_INFILE 1
/* Convert some simple functions to Posix */
#define my_sigset(A,B) signal((A),(B))
#define finite(A) _finite(A)
#define sleep(A) Sleep((A)*1000)
#define popen(A,B) _popen((A),(B))
#define pclose(A) _pclose(A)
#ifndef __BORLANDC__
#define access(A,B) _access(A,B)
#endif
#if !defined(__cplusplus)
#define inline __inline
#endif /* __cplusplus */
inline double rint(double nr)
{
double f = floor(nr);
double c = ceil(nr);
return (((c-nr) >= (nr-f)) ? f :c);
}
#ifdef _WIN64
#define ulonglong2double(A) ((double) (ulonglong) (A))
#define my_off_t2double(A) ((double) (my_off_t) (A))
#else
inline double ulonglong2double(ulonglong value)
{
longlong nr=(longlong) value;
if (nr >= 0)
return (double) nr;
return (18446744073709551616.0 + (double) nr);
}
#define my_off_t2double(A) ulonglong2double(A)
#endif /* _WIN64 */
#if SIZEOF_OFF_T > 4
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
#define tell(A) _telli64(A)
#endif
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
#define STACK_DIRECTION -1
/* Optimized store functions for Intel x86 */
#ifndef _WIN64
#define sint2korr(A) (*((int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \
(((uint32) (uchar) (A)[2]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \
((uint32) (uchar) (A)[0])) : \
(((uint32) (uchar) (A)[2]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \
((uint32) (uchar) (A)[0])))
#define sint4korr(A) (*((long *) (A)))
#define uint2korr(A) (*((uint16 *) (A)))
/*
ATTENTION !
Please, note, uint3korr reads 4 bytes (not 3) !
It means, that you have to provide enough allocated space !
*/
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
#define uint4korr(A) (*((unsigned long *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16) +\
(((uint32) ((uchar) (A)[3])) << 24)) +\
(((ulonglong) ((uchar) (A)[4])) << 32))
#define uint8korr(A) (*((ulonglong *) (A)))
#define sint8korr(A) (*((longlong *) (A)))
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
#define int3store(T,A) { *(T)= (uchar) ((A));\
*(T+1)=(uchar) (((uint) (A) >> 8));\
*(T+2)=(uchar) (((A) >> 16)); }
#define int4store(T,A) *((long *) (T))= (long) (A)
#define int5store(T,A) { *(T)= (uchar)((A));\
*((T)+1)=(uchar) (((A) >> 8));\
*((T)+2)=(uchar) (((A) >> 16));\
*((T)+3)=(uchar) (((A) >> 24)); \
*((T)+4)=(uchar) (((A) >> 32)); }
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
#define doubleget(V,M) do { *((long *) &V) = *((long*) M); \
*(((long *) &V)+1) = *(((long*) M)+1); } while(0)
#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \
*(((long *) T)+1) = *(((long*) &V)+1); } while(0)
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float))
#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#endif /* _WIN64 */
#define HAVE_PERROR
#define HAVE_VFPRINT
#define HAVE_RENAME /* Have rename() as function */
#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */
#define HAVE_LONG_JMP /* Have long jump function */
#define HAVE_LOCKING /* have locking() call */
#define HAVE_ERRNO_AS_DEFINE /* errno is a define */
#define HAVE_STDLIB /* everything is include in this file */
#define HAVE_MEMCPY
#define HAVE_MEMMOVE
#define HAVE_GETCWD
#define HAVE_TELL
#define HAVE_TZNAME
#define HAVE_PUTENV
#define HAVE_SELECT
#define HAVE_SETLOCALE
#define HAVE_SOCKET /* Giangi */
#define HAVE_FLOAT_H
#define HAVE_LIMITS_H
#define HAVE_STDDEF_H
#define HAVE_RINT /* defined in this file */
#define NO_FCNTL_NONBLOCK /* No FCNTL */
#define HAVE_ALLOCA
#define HAVE_STRPBRK
#define HAVE_STRSTR
#define HAVE_COMPRESS
#define HAVE_CREATESEMAPHORE
#define HAVE_ISNAN
#define HAVE_FINITE
#define HAVE_QUERY_CACHE
#define SPRINTF_RETURNS_INT
#define HAVE_SETFILEPOINTER
#define HAVE_VIO_READ_BUFF
#define HAVE_STRNLEN
#ifndef __NT__
#undef FILE_SHARE_DELETE
#define FILE_SHARE_DELETE 0 /* Not implemented on Win 98/ME */
#endif
#ifdef NOT_USED
#define HAVE_SNPRINTF /* Gave link error */
#define _snprintf snprintf
#endif
#ifdef _MSC_VER
#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */
#define HAVE_ANSI_INCLUDE
#define HAVE_SYS_UTIME_H
#define HAVE_STRTOUL
#endif
#define my_reinterpret_cast(A) reinterpret_cast <A>
#define my_const_cast(A) const_cast<A>
/* MYSQL OPTIONS */
#ifdef _CUSTOMCONFIG_
#include <custom_conf.h>
#else
#define DEFAULT_MYSQL_HOME "c:\\mysql"
#define PACKAGE "mysql"
#define DEFAULT_BASEDIR "C:\\"
#define SHAREDIR "share"
#define DEFAULT_CHARSET_HOME "C:/mysql/"
#endif
#ifndef DEFAULT_HOME_ENV
#define DEFAULT_HOME_ENV MYSQL_HOME
#endif
#ifndef DEFAULT_GROUP_SUFFIX_ENV
#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX
#endif
/* File name handling */
#define FN_LIBCHAR '\\'
#define FN_ROOTDIR "\\"
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
#define OS_FILE_LIMIT 2048
#define DO_NOT_REMOVE_THREAD_WRAPPERS
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
/* The following is only used for statistics, so it should be good enough */
#ifdef __NT__ /* This should also work on Win98 but .. */
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
#else
#define thread_safe_add(V,C,L) \
pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L));
#define thread_safe_sub(V,C,L) \
pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L));
#define statistic_add(V,C,L) (V)+=(C)
#endif
#define statistic_increment(V,L) thread_safe_increment((V),(L))
#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
#define shared_memory_buffer_length 16000
#define default_shared_memory_base_name "MYSQL"
#ifdef CYBOZU
#define MYSQL_DEFAULT_CHARSET_NAME "utf8"
#define MYSQL_DEFAULT_COLLATION_NAME "utf8_general_cs"
#define HAVE_UTF8_GENERAL_CS 1
#else
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
#endif
#define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1
#define HAVE_OPENSSL 1
#define HAVE_YASSL 1
/* Define charsets you want */
/* #undef HAVE_CHARSET_armscii8 */
/* #undef HAVE_CHARSET_ascii */
#ifndef CYBOZU
#define HAVE_CHARSET_big5 1
#define HAVE_CHARSET_cp1250 1
#endif
/* #undef HAVE_CHARSET_cp1251 */
/* #undef HAVE_CHARSET_cp1256 */
/* #undef HAVE_CHARSET_cp1257 */
/* #undef HAVE_CHARSET_cp850 */
/* #undef HAVE_CHARSET_cp852 */
/* #undef HAVE_CHARSET_cp866 */
#define HAVE_CHARSET_cp932 1
/* #undef HAVE_CHARSET_dec8 */
#ifndef CYBOZU
#define HAVE_CHARSET_eucjpms 1
#define HAVE_CHARSET_euckr 1
#define HAVE_CHARSET_gb2312 1
#define HAVE_CHARSET_gbk 1
#endif
/* #undef HAVE_CHARSET_greek */
/* #undef HAVE_CHARSET_hebrew */
/* #undef HAVE_CHARSET_hp8 */
/* #undef HAVE_CHARSET_keybcs2 */
/* #undef HAVE_CHARSET_koi8r */
/* #undef HAVE_CHARSET_koi8u */
#ifndef CYBOZU
#define HAVE_CHARSET_latin1 1
#define HAVE_CHARSET_latin2 1
#endif
/* #undef HAVE_CHARSET_latin5 */
/* #undef HAVE_CHARSET_latin7 */
/* #undef HAVE_CHARSET_macce */
/* #undef HAVE_CHARSET_macroman */
#define HAVE_CHARSET_sjis 1
/* #undef HAVE_CHARSET_swe7 */
#ifndef CYBOZU
#define HAVE_CHARSET_tis620 1
#define HAVE_CHARSET_ucs2 1
#define HAVE_CHARSET_ujis 1
#endif
#define HAVE_CHARSET_utf8 1
#define HAVE_UCA_COLLATIONS 1

137
3rdparty/mysql/include/decimal.h vendored Normal file
View File

@@ -0,0 +1,137 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef DECIMAL_INCLUDED
#define DECIMAL_INCLUDED
typedef enum
{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
decimal_round_mode;
typedef int32 decimal_digit_t;
/**
intg is the number of *decimal* digits (NOT number of decimal_digit_t's !)
before the point
frac is the number of decimal digits after the point
len is the length of buf (length of allocated space) in decimal_digit_t's,
not in bytes
sign false means positive, true means negative
buf is an array of decimal_digit_t's
*/
typedef struct st_decimal_t {
int intg, frac, len;
my_bool sign;
decimal_digit_t *buf;
} decimal_t;
#ifndef MYSQL_ABI_CHECK
int internal_str2dec(const char *from, decimal_t *to, char **end,
my_bool fixed);
int decimal2string(const decimal_t *from, char *to, int *to_len,
int fixed_precision, int fixed_decimals,
char filler);
int decimal2ulonglong(decimal_t *from, ulonglong *to);
int ulonglong2decimal(ulonglong from, decimal_t *to);
int decimal2longlong(decimal_t *from, longlong *to);
int longlong2decimal(longlong from, decimal_t *to);
int decimal2double(const decimal_t *from, double *to);
int double2decimal(double from, decimal_t *to);
int decimal_actual_fraction(decimal_t *from);
int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);
/**
Convert decimal to lldiv_t.
The integer part is stored in to->quot.
The fractional part is multiplied to 10^9 and stored to to->rem.
@param from Decimal value
@param to lldiv_t value
@retval 0 on success
@retval !0 in error
*/
int decimal2lldiv_t(const decimal_t *from, lldiv_t *to);
/**
Convert doube to lldiv_t.
The integer part is stored in to->quot.
The fractional part is multiplied to 10^9 and stored to to->rem.
@param from Decimal value
@param to lldiv_t value
@retval 0 on success
@retval !0 in error
*/
int double2lldiv_t(double from, lldiv_t *to);
int decimal_size(int precision, int scale);
int decimal_bin_size(int precision, int scale);
int decimal_result_size(decimal_t *from1, decimal_t *from2, char op,
int param);
int decimal_intg(const decimal_t *from);
int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
int decimal_cmp(const decimal_t *from1, const decimal_t *from2);
int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to,
int scale_incr);
int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
int decimal_round(const decimal_t *from, decimal_t *to, int new_scale,
decimal_round_mode mode);
int decimal_is_zero(const decimal_t *from);
void max_decimal(int precision, int frac, decimal_t *to);
#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1)
/* set a decimal_t to zero */
#define decimal_make_zero(dec) do { \
(dec)->buf[0]=0; \
(dec)->intg=1; \
(dec)->frac=0; \
(dec)->sign=0; \
} while(0)
/*
returns the length of the buffer to hold string representation
of the decimal (including decimal dot, possible sign and \0)
*/
#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \
(dec)->frac + ((dec)->frac > 0) + 2)
/*
conventions:
decimal_smth() == 0 -- everything's ok
decimal_smth() <= 1 -- result is usable, but precision loss is possible
decimal_smth() <= 2 -- result can be unusable, most significant digits
could've been lost
decimal_smth() > 2 -- no result was generated
*/
#define E_DEC_OK 0
#define E_DEC_TRUNCATED 1
#define E_DEC_OVERFLOW 2
#define E_DEC_DIV_ZERO 4
#define E_DEC_BAD_NUM 8
#define E_DEC_OOM 16
#define E_DEC_ERROR 31
#define E_DEC_FATAL_ERROR 30
#endif // !MYSQL_ABI_CHECK
#endif

113
3rdparty/mysql/include/errmsg.h vendored Normal file
View File

@@ -0,0 +1,113 @@
#ifndef ERRMSG_INCLUDED
#define ERRMSG_INCLUDED
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Error messages for MySQL clients */
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
#ifdef __cplusplus
extern "C" {
#endif
void init_client_errs(void);
void finish_client_errs(void);
extern const char *client_errors[]; /* Error messages */
#ifdef __cplusplus
}
#endif
#define CR_MIN_ERROR 2000 /* For easier client code */
#define CR_MAX_ERROR 2999
#if !defined(ER)
#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \
client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR])
#endif
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
/* Do not add error numbers before CR_ERROR_FIRST. */
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
#define CR_UNKNOWN_ERROR 2000
#define CR_SOCKET_CREATE_ERROR 2001
#define CR_CONNECTION_ERROR 2002
#define CR_CONN_HOST_ERROR 2003
#define CR_IPSOCK_ERROR 2004
#define CR_UNKNOWN_HOST 2005
#define CR_SERVER_GONE_ERROR 2006
#define CR_VERSION_ERROR 2007
#define CR_OUT_OF_MEMORY 2008
#define CR_WRONG_HOST_INFO 2009
#define CR_LOCALHOST_CONNECTION 2010
#define CR_TCP_CONNECTION 2011
#define CR_SERVER_HANDSHAKE_ERR 2012
#define CR_SERVER_LOST 2013
#define CR_COMMANDS_OUT_OF_SYNC 2014
#define CR_NAMEDPIPE_CONNECTION 2015
#define CR_NAMEDPIPEWAIT_ERROR 2016
#define CR_NAMEDPIPEOPEN_ERROR 2017
#define CR_NAMEDPIPESETSTATE_ERROR 2018
#define CR_CANT_READ_CHARSET 2019
#define CR_NET_PACKET_TOO_LARGE 2020
#define CR_EMBEDDED_CONNECTION 2021
#define CR_PROBE_SLAVE_STATUS 2022
#define CR_PROBE_SLAVE_HOSTS 2023
#define CR_PROBE_SLAVE_CONNECT 2024
#define CR_PROBE_MASTER_CONNECT 2025
#define CR_SSL_CONNECTION_ERROR 2026
#define CR_MALFORMED_PACKET 2027
#define CR_WRONG_LICENSE 2028
/* new 4.1 error codes */
#define CR_NULL_POINTER 2029
#define CR_NO_PREPARE_STMT 2030
#define CR_PARAMS_NOT_BOUND 2031
#define CR_DATA_TRUNCATED 2032
#define CR_NO_PARAMETERS_EXISTS 2033
#define CR_INVALID_PARAMETER_NO 2034
#define CR_INVALID_BUFFER_USE 2035
#define CR_UNSUPPORTED_PARAM_TYPE 2036
#define CR_SHARED_MEMORY_CONNECTION 2037
#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
#define CR_SHARED_MEMORY_MAP_ERROR 2043
#define CR_SHARED_MEMORY_EVENT_ERROR 2044
#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
#define CR_CONN_UNKNOW_PROTOCOL 2047
#define CR_INVALID_CONN_HANDLE 2048
#define CR_UNUSED_1 2049
#define CR_FETCH_CANCELED 2050
#define CR_NO_DATA 2051
#define CR_NO_STMT_METADATA 2052
#define CR_NO_RESULT_SET 2053
#define CR_NOT_IMPLEMENTED 2054
#define CR_SERVER_LOST_EXTENDED 2055
#define CR_STMT_CLOSED 2056
#define CR_NEW_STMT_METADATA 2057
#define CR_ALREADY_CONNECTED 2058
#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
#define CR_DUPLICATE_CONNECTION_ATTR 2060
#define CR_AUTH_PLUGIN_ERR 2061
#define CR_INSECURE_API_ERR 2062
#define CR_ERROR_LAST /*Copy last error nr:*/ 2062
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
#endif /* ERRMSG_INCLUDED */

156
3rdparty/mysql/include/keycache.h vendored Normal file
View File

@@ -0,0 +1,156 @@
/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Key cache variable structures */
#ifndef _keycache_h
#define _keycache_h
#include "my_sys.h" /* flush_type */
C_MODE_START
/* declare structures that is used by st_key_cache */
struct st_block_link;
typedef struct st_block_link BLOCK_LINK;
struct st_hash_link;
typedef struct st_hash_link HASH_LINK;
/* Thread specific variables */
typedef struct st_keycache_thread_var
{
mysql_cond_t suspend;
struct st_keycache_thread_var *next,**prev;
void *opt_info;
} st_keycache_thread_var;
/* info about requests in a waiting queue */
typedef struct st_keycache_wqueue
{
st_keycache_thread_var *last_thread; /* circular list of waiting threads */
} KEYCACHE_WQUEUE;
#define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */
/*
The key cache structure
It also contains read-only statistics parameters.
*/
typedef struct st_key_cache
{
my_bool key_cache_inited;
my_bool in_resize; /* true during resize operation */
my_bool resize_in_flush; /* true during flush of resize operation */
my_bool can_be_used; /* usage of cache for read/write is allowed */
size_t key_cache_mem_size; /* specified size of the cache memory */
uint key_cache_block_size; /* size of the page buffer of a cache block */
ulonglong min_warm_blocks; /* min number of warm blocks; */
ulonglong age_threshold; /* age threshold for hot blocks */
ulonglong keycache_time; /* total number of block link operations */
uint hash_entries; /* max number of entries in the hash table */
int hash_links; /* max number of hash links */
int hash_links_used; /* number of hash links currently used */
int disk_blocks; /* max number of blocks in the cache */
ulong blocks_used; /* maximum number of concurrently used blocks */
ulong blocks_unused; /* number of currently unused blocks */
ulong blocks_changed; /* number of currently dirty blocks */
ulong warm_blocks; /* number of blocks in warm sub-chain */
ulong cnt_for_resize_op; /* counter to block resize operation */
long blocks_available; /* number of blocks available in the LRU chain */
HASH_LINK **hash_root; /* arr. of entries into hash table buckets */
HASH_LINK *hash_link_root; /* memory for hash table links */
HASH_LINK *free_hash_list; /* list of free hash links */
BLOCK_LINK *free_block_list; /* list of free blocks */
BLOCK_LINK *block_root; /* memory for block links */
uchar *block_mem; /* memory for block buffers */
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
mysql_mutex_t cache_lock; /* to lock access to the cache structure */
KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
/*
Waiting for a zero resize count. Using a queue for symmetry though
only one thread can wait here.
*/
KEYCACHE_WQUEUE waiting_for_resize_cnt;
KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */
KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free block */
BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file bl.*/
BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash for other file bl.*/
/*
The following variables are and variables used to hold parameters for
initializing the key cache.
*/
ulonglong param_buff_size; /* size the memory allocated for the cache */
ulonglong param_block_size; /* size of the blocks in the key cache */
ulonglong param_division_limit; /* min. percentage of warm blocks */
ulonglong param_age_threshold; /* determines when hot block is downgraded */
/* Statistics variables. These are reset in reset_key_cache_counters(). */
ulong global_blocks_changed; /* number of currently dirty blocks */
ulonglong global_cache_w_requests;/* number of write requests (write hits) */
ulonglong global_cache_write; /* number of writes from cache to files */
ulonglong global_cache_r_requests;/* number of read requests (read hits) */
ulonglong global_cache_read; /* number of reads from files to cache */
int blocks; /* max number of blocks in the cache */
my_bool in_init; /* Set to 1 in MySQL during init/resize */
} KEY_CACHE;
/* The default key cache */
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
extern int init_key_cache(KEY_CACHE *keycache, ulonglong key_cache_block_size,
size_t use_mem, ulonglong division_limit,
ulonglong age_threshold);
extern int resize_key_cache(KEY_CACHE *keycache,
st_keycache_thread_var *thread_var,
ulonglong key_cache_block_size,
size_t use_mem, ulonglong division_limit,
ulonglong age_threshold);
extern uchar *key_cache_read(KEY_CACHE *keycache,
st_keycache_thread_var *thread_var,
File file, my_off_t filepos, int level,
uchar *buff, uint length,
uint block_length,int return_buffer);
extern int key_cache_insert(KEY_CACHE *keycache,
st_keycache_thread_var *thread_var,
File file, my_off_t filepos, int level,
uchar *buff, uint length);
extern int key_cache_write(KEY_CACHE *keycache,
st_keycache_thread_var *thread_var,
File file, my_off_t filepos, int level,
uchar *buff, uint length,
uint block_length,int force_write);
extern int flush_key_blocks(KEY_CACHE *keycache,
st_keycache_thread_var *thread_var,
int file, enum flush_type type);
extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
/* Functions to handle multiple key caches */
extern my_bool multi_keycache_init(void);
extern void multi_keycache_free(void);
extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length);
extern my_bool multi_key_cache_set(const uchar *key, uint length,
KEY_CACHE *key_cache);
extern void multi_key_cache_change(KEY_CACHE *old_data,
KEY_CACHE *new_data);
extern int reset_key_cache_counters(const char *name,
KEY_CACHE *key_cache);
C_MODE_END
#endif /* _keycache_h */

93
3rdparty/mysql/include/little_endian.h vendored Normal file
View File

@@ -0,0 +1,93 @@
#ifndef LITTLE_ENDIAN_INCLUDED
#define LITTLE_ENDIAN_INCLUDED
/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Data in little-endian format.
*/
#include <string.h>
static inline void float4get (float *V, const uchar *M)
{
memcpy(V, (M), sizeof(float));
}
static inline void float4store(uchar *V, float M)
{
memcpy(V, (&M), sizeof(float));
}
static inline void float8get (double *V, const uchar *M)
{
memcpy(V, M, sizeof(double));
}
static inline void float8store(uchar *V, double M)
{
memcpy(V, &M, sizeof(double));
}
static inline void floatget (float *V, const uchar *M) { float4get(V, M); }
static inline void floatstore (uchar *V, float M) { float4store(V, M); }
/* Bi-endian hardware.... */
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
static inline void doublestore(uchar *T, double V)
{ *(((char*)T)+0)=(char) ((uchar *) &V)[4];
*(((char*)T)+1)=(char) ((uchar *) &V)[5];
*(((char*)T)+2)=(char) ((uchar *) &V)[6];
*(((char*)T)+3)=(char) ((uchar *) &V)[7];
*(((char*)T)+4)=(char) ((uchar *) &V)[0];
*(((char*)T)+5)=(char) ((uchar *) &V)[1];
*(((char*)T)+6)=(char) ((uchar *) &V)[2];
*(((char*)T)+7)=(char) ((uchar *) &V)[3]; }
static inline void doubleget(double *V, const uchar *M)
{ double def_temp;
((uchar*) &def_temp)[0]=(M)[4];
((uchar*) &def_temp)[1]=(M)[5];
((uchar*) &def_temp)[2]=(M)[6];
((uchar*) &def_temp)[3]=(M)[7];
((uchar*) &def_temp)[4]=(M)[0];
((uchar*) &def_temp)[5]=(M)[1];
((uchar*) &def_temp)[6]=(M)[2];
((uchar*) &def_temp)[7]=(M)[3];
(*V) = def_temp; }
#else /* Bi-endian hardware.... */
static inline void doublestore(uchar *T, double V) { memcpy(T, &V, sizeof(double)); }
static inline void doubleget (double *V, const uchar *M) { memcpy(V, M, sizeof(double)); }
#endif /* Bi-endian hardware.... */
static inline void ushortget(uint16 *V, const uchar *pM) { *V= uint2korr(pM); }
static inline void shortget (int16 *V, const uchar *pM) { *V= sint2korr(pM); }
static inline void longget (int32 *V, const uchar *pM) { *V= sint4korr(pM); }
static inline void ulongget (uint32 *V, const uchar *pM) { *V= uint4korr(pM); }
static inline void shortstore(uchar *T, int16 V) { int2store(T, V); }
static inline void longstore (uchar *T, int32 V) { int4store(T, V); }
static inline void longlongget(longlong *V, const uchar *M)
{
memcpy(V, (M), sizeof(ulonglong));
}
static inline void longlongstore(uchar *T, longlong V)
{
memcpy((T), &V, sizeof(ulonglong));
}
#endif /* LITTLE_ENDIAN_INCLUDED */

View File

@@ -1,9 +1,8 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,16 +11,17 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
A better inplementation of the UNIX ctype(3) library.
Notes: my_global.h should be included before ctype.h
*/
#ifndef _m_ctype_h
#define _m_ctype_h
#include "my_global.h" /* uint16, uchar */
#ifdef __cplusplus
extern "C" {
#endif
@@ -37,17 +37,113 @@ extern "C" {
#define my_wc_t ulong
#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD
/*
On i386 we store Unicode->CS conversion tables for
some character sets using Big-endian order,
to copy two bytes at onces.
This gives some performance improvement.
*/
#ifdef __i386__
#define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8))
#define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); }
#else
#define MB2(x) (x)
#define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; }
#endif
typedef struct unicase_info_char_st
{
uint32 toupper;
uint32 tolower;
uint32 sort;
} MY_UNICASE_CHARACTER;
typedef struct unicase_info_st
{
uint16 toupper;
uint16 tolower;
uint16 sort;
my_wc_t maxchar;
const MY_UNICASE_CHARACTER **page;
} MY_UNICASE_INFO;
extern MY_UNICASE_INFO *my_unicase_default[256];
extern MY_UNICASE_INFO *my_unicase_turkish[256];
extern MY_UNICASE_INFO my_unicase_default;
extern MY_UNICASE_INFO my_unicase_turkish;
extern MY_UNICASE_INFO my_unicase_mysql500;
extern MY_UNICASE_INFO my_unicase_unicode520;
#define MY_UCA_MAX_CONTRACTION 6
#define MY_UCA_MAX_WEIGHT_SIZE 8
#define MY_UCA_WEIGHT_LEVELS 1
typedef struct my_contraction_t
{
my_wc_t ch[MY_UCA_MAX_CONTRACTION]; /* Character sequence */
uint16 weight[MY_UCA_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated */
my_bool with_context;
} MY_CONTRACTION;
typedef struct my_contraction_list_t
{
size_t nitems; /* Number of items in the list */
MY_CONTRACTION *item; /* List of contractions */
char *flags; /* Character flags, e.g. "is contraction head") */
} MY_CONTRACTIONS;
my_bool my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc);
my_bool my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc);
uint16 *my_uca_contraction2_weight(const MY_CONTRACTIONS *c,
my_wc_t wc1, my_wc_t wc2);
/* Collation weights on a single level (e.g. primary, secondary, tertiarty) */
typedef struct my_uca_level_info_st
{
my_wc_t maxchar;
uchar *lengths;
uint16 **weights;
MY_CONTRACTIONS contractions;
} MY_UCA_WEIGHT_LEVEL;
typedef struct uca_info_st
{
MY_UCA_WEIGHT_LEVEL level[MY_UCA_WEIGHT_LEVELS];
/* Logical positions */
my_wc_t first_non_ignorable;
my_wc_t last_non_ignorable;
my_wc_t first_primary_ignorable;
my_wc_t last_primary_ignorable;
my_wc_t first_secondary_ignorable;
my_wc_t last_secondary_ignorable;
my_wc_t first_tertiary_ignorable;
my_wc_t last_tertiary_ignorable;
my_wc_t first_trailing;
my_wc_t last_trailing;
my_wc_t first_variable;
my_wc_t last_variable;
} MY_UCA_INFO;
extern MY_UCA_INFO my_uca_v400;
typedef struct uni_ctype_st
{
uchar pctype;
uchar *ctype;
} MY_UNI_CTYPE;
extern MY_UNI_CTYPE my_uni_ctype[256];
/* wm_wc and wc_mb return codes */
#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */
@@ -73,79 +169,123 @@ extern MY_UNICASE_INFO *my_unicase_turkish[256];
#define MY_CS_BINSORT 16 /* if binary sort order */
#define MY_CS_PRIMARY 32 /* if primary collation */
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
#define MY_CS_UNICODE 128 /* is a charset is full unicode */
#define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */
#define MY_CS_READY 256 /* if a charset is initialized */
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
#define MY_CS_HIDDEN 2048 /* don't display in SHOW */
#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */
#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */
#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
#define MY_CS_LOWER_SORT 32768 /* If use lower case as weight */
#define MY_CHARSET_UNDEFINED 0
/* Character repertoire flags */
#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */
#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
/* Flags for strxfrm */
#define MY_STRXFRM_LEVEL1 0x00000001 /* for primary weights */
#define MY_STRXFRM_LEVEL2 0x00000002 /* for secondary weights */
#define MY_STRXFRM_LEVEL3 0x00000004 /* for tertiary weights */
#define MY_STRXFRM_LEVEL4 0x00000008 /* fourth level weights */
#define MY_STRXFRM_LEVEL5 0x00000010 /* fifth level weights */
#define MY_STRXFRM_LEVEL6 0x00000020 /* sixth level weights */
#define MY_STRXFRM_LEVEL_ALL 0x0000003F /* Bit OR for the above six */
#define MY_STRXFRM_NLEVELS 6 /* Number of possible levels*/
#define MY_STRXFRM_PAD_WITH_SPACE 0x00000040 /* if pad result with spaces */
#define MY_STRXFRM_PAD_TO_MAXLEN 0x00000080 /* if pad tail(for filesort) */
#define MY_STRXFRM_DESC_LEVEL1 0x00000100 /* if desc order for level1 */
#define MY_STRXFRM_DESC_LEVEL2 0x00000200 /* if desc order for level2 */
#define MY_STRXFRM_DESC_LEVEL3 0x00000300 /* if desc order for level3 */
#define MY_STRXFRM_DESC_LEVEL4 0x00000800 /* if desc order for level4 */
#define MY_STRXFRM_DESC_LEVEL5 0x00001000 /* if desc order for level5 */
#define MY_STRXFRM_DESC_LEVEL6 0x00002000 /* if desc order for level6 */
#define MY_STRXFRM_DESC_SHIFT 8
#define MY_STRXFRM_UNUSED_00004000 0x00004000 /* for future extensions */
#define MY_STRXFRM_UNUSED_00008000 0x00008000 /* for future extensions */
#define MY_STRXFRM_REVERSE_LEVEL1 0x00010000 /* if reverse order for level1 */
#define MY_STRXFRM_REVERSE_LEVEL2 0x00020000 /* if reverse order for level2 */
#define MY_STRXFRM_REVERSE_LEVEL3 0x00040000 /* if reverse order for level3 */
#define MY_STRXFRM_REVERSE_LEVEL4 0x00080000 /* if reverse order for level4 */
#define MY_STRXFRM_REVERSE_LEVEL5 0x00100000 /* if reverse order for level5 */
#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */
#define MY_STRXFRM_REVERSE_SHIFT 16
typedef struct my_uni_idx_st
{
uint16 from;
uint16 to;
uchar *tab;
uint16 from;
uint16 to;
const uchar *tab;
} MY_UNI_IDX;
typedef struct
{
uint beg;
uint end;
uint mblen;
uint mb_len;
} my_match_t;
enum my_lex_states
{
MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT,
MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER,
MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE,
MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON,
MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
MY_LEX_IDENT_OR_KEYWORD,
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
MY_LEX_STRING_OR_DELIMITER
};
struct charset_info_st;
typedef struct my_charset_loader_st
{
char error[128];
void *(*once_alloc)(size_t);
void *(*mem_malloc)(size_t);
void *(*mem_realloc)(void *, size_t);
void (*mem_free)(void *);
void (*reporter)(enum loglevel, const char *format, ...);
int (*add_collation)(struct charset_info_st *cs);
} MY_CHARSET_LOADER;
extern int (*my_string_stack_guard)(int);
/* See strings/CHARSET_INFO.txt for information about this structure */
typedef struct my_collation_handler_st
{
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *);
/* Collation routines */
int (*strnncoll)(struct charset_info_st *,
const uchar *, uint, const uchar *, uint, my_bool);
int (*strnncollsp)(struct charset_info_st *,
const uchar *, uint, const uchar *, uint,
int (*strnncoll)(const struct charset_info_st *,
const uchar *, size_t, const uchar *, size_t, my_bool);
int (*strnncollsp)(const struct charset_info_st *,
const uchar *, size_t, const uchar *, size_t,
my_bool diff_if_only_endspace_difference);
int (*strnxfrm)(struct charset_info_st *,
uchar *, uint, const uchar *, uint);
uint (*strnxfrmlen)(struct charset_info_st *, uint);
my_bool (*like_range)(struct charset_info_st *,
const char *s, uint s_length,
size_t (*strnxfrm)(const struct charset_info_st *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
size_t (*strnxfrmlen)(const struct charset_info_st *, size_t);
my_bool (*like_range)(const struct charset_info_st *,
const char *s, size_t s_length,
pchar w_prefix, pchar w_one, pchar w_many,
uint res_length,
size_t res_length,
char *min_str, char *max_str,
uint *min_len, uint *max_len);
int (*wildcmp)(struct charset_info_st *,
size_t *min_len, size_t *max_len);
int (*wildcmp)(const struct charset_info_st *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape,int w_one, int w_many);
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
int (*strcasecmp)(const struct charset_info_st *, const char *,
const char *);
uint (*instr)(struct charset_info_st *,
const char *b, uint b_length,
const char *s, uint s_length,
uint (*instr)(const struct charset_info_st *,
const char *b, size_t b_length,
const char *s, size_t s_length,
my_match_t *match, uint nmatch);
/* Hash calculation */
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
ulong *nr1, ulong *nr2);
my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len);
void (*hash_sort)(const struct charset_info_st *cs, const uchar *key,
size_t len, ulong *nr1, ulong *nr2);
my_bool (*propagate)(const struct charset_info_st *cs, const uchar *str,
size_t len);
} MY_COLLATION_HANDLER;
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
@@ -153,66 +293,95 @@ extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
/* Some typedef to make it easy for C++ to make function pointers */
typedef int (*my_charset_conv_mb_wc)(const struct charset_info_st *,
my_wc_t *, const uchar *, const uchar *);
typedef int (*my_charset_conv_wc_mb)(const struct charset_info_st *, my_wc_t,
uchar *, uchar *);
typedef size_t (*my_charset_conv_case)(const struct charset_info_st *,
char *, size_t, char *, size_t);
/* See strings/CHARSET_INFO.txt about information on this structure */
typedef struct my_charset_handler_st
{
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *loader);
/* Multibyte routines */
int (*ismbchar)(struct charset_info_st *, const char *, const char *);
int (*mbcharlen)(struct charset_info_st *, uint);
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
uint (*well_formed_len)(struct charset_info_st *,
uint (*ismbchar)(const struct charset_info_st *, const char *,
const char *);
uint (*mbcharlen)(const struct charset_info_st *, uint c);
size_t (*numchars)(const struct charset_info_st *, const char *b,
const char *e);
size_t (*charpos)(const struct charset_info_st *, const char *b,
const char *e, size_t pos);
size_t (*well_formed_len)(const struct charset_info_st *,
const char *b,const char *e,
uint nchars, int *error);
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
size_t nchars, int *error);
size_t (*lengthsp)(const struct charset_info_st *, const char *ptr,
size_t length);
size_t (*numcells)(const struct charset_info_st *, const char *b,
const char *e);
/* Unicode convertion */
int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
const unsigned char *s,const unsigned char *e);
int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
unsigned char *s,unsigned char *e);
/* Functions for case and sort convertion */
void (*caseup_str)(struct charset_info_st *, char *);
void (*casedn_str)(struct charset_info_st *, char *);
uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
char *dst, uint dstlen);
uint (*casedn)(struct charset_info_st *, char *src, uint srclen,
char *dst, uint dstlen);
/* Unicode conversion */
my_charset_conv_mb_wc mb_wc;
my_charset_conv_wc_mb wc_mb;
/* CTYPE scanner */
int (*ctype)(const struct charset_info_st *cs, int *ctype,
const uchar *s, const uchar *e);
/* Functions for case and sort conversion */
size_t (*caseup_str)(const struct charset_info_st *, char *);
size_t (*casedn_str)(const struct charset_info_st *, char *);
my_charset_conv_case caseup;
my_charset_conv_case casedn;
/* Charset dependant snprintf() */
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
...);
int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix,
long int val);
int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
int radix, longlong val);
size_t (*snprintf)(const struct charset_info_st *, char *to, size_t n,
const char *fmt,
...) MY_ATTRIBUTE((format(printf, 4, 5)));
size_t (*long10_to_str)(const struct charset_info_st *, char *to, size_t n,
int radix, long int val);
size_t (*longlong10_to_str)(const struct charset_info_st *, char *to,
size_t n, int radix, longlong val);
void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
void (*fill)(const struct charset_info_st *, char *to, size_t len,
int fill);
/* String-to-number convertion routines */
long (*strntol)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
longlong (*strntoll)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
int *err);
longlong (*strtoll10)(struct charset_info_st *cs,
/* String-to-number conversion routines */
long (*strntol)(const struct charset_info_st *, const char *s,
size_t l, int base, char **e, int *err);
ulong (*strntoul)(const struct charset_info_st *, const char *s,
size_t l, int base, char **e, int *err);
longlong (*strntoll)(const struct charset_info_st *, const char *s,
size_t l, int base, char **e, int *err);
ulonglong (*strntoull)(const struct charset_info_st *, const char *s,
size_t l, int base, char **e, int *err);
double (*strntod)(const struct charset_info_st *, char *s,
size_t l, char **e, int *err);
longlong (*strtoll10)(const struct charset_info_st *cs,
const char *nptr, char **endptr, int *error);
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
int sq);
ulonglong (*strntoull10rnd)(const struct charset_info_st *cs,
const char *str, size_t length,
int unsigned_fl,
char **endptr, int *error);
size_t (*scan)(const struct charset_info_st *, const char *b,
const char *e, int sq);
} MY_CHARSET_HANDLER;
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
extern MY_CHARSET_HANDLER my_charset_ascii_handler;
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
/*
We define this CHARSET_INFO_DEFINED here to prevent a repeat of the
typedef in hash.c, which will cause a compiler error.
*/
#define CHARSET_INFO_DEFINED
/* See strings/CHARSET_INFO.txt about information on this structure */
typedef struct charset_info_st
{
uint number;
@@ -223,38 +392,45 @@ typedef struct charset_info_st
const char *name;
const char *comment;
const char *tailoring;
uchar *ctype;
uchar *to_lower;
uchar *to_upper;
uchar *sort_order;
uint16 *contractions;
uint16 **sort_order_big;
uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
MY_UNICASE_INFO **caseinfo;
uchar *state_map;
uchar *ident_map;
const uchar *ctype;
const uchar *to_lower;
const uchar *to_upper;
const uchar *sort_order;
MY_UCA_INFO *uca; /* This can be changed in apply_one_rule() */
const uint16 *tab_to_uni;
const MY_UNI_IDX *tab_from_uni;
const MY_UNICASE_INFO *caseinfo;
const struct lex_state_maps_st *state_maps; /* parser internal data */
const uchar *ident_map; /* parser internal data */
uint strxfrm_multiply;
uchar caseup_multiply;
uchar casedn_multiply;
uint mbminlen;
uint mbmaxlen;
uint16 min_sort_char;
uint16 max_sort_char; /* For LIKE optimization */
uint mbmaxlenlen;
my_wc_t min_sort_char;
my_wc_t max_sort_char; /* For LIKE optimization */
uchar pad_char;
my_bool escape_with_backslash_is_dangerous;
uchar levels_for_compare;
uchar levels_for_order;
MY_CHARSET_HANDLER *cset;
MY_COLLATION_HANDLER *coll;
} CHARSET_INFO;
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
extern CHARSET_INFO my_charset_bin;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
extern CHARSET_INFO my_charset_big5_chinese_ci;
extern CHARSET_INFO my_charset_big5_bin;
extern CHARSET_INFO my_charset_cp932_japanese_ci;
extern CHARSET_INFO my_charset_cp932_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci;
extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
extern CHARSET_INFO my_charset_eucjpms_bin;
extern CHARSET_INFO my_charset_euckr_korean_ci;
@@ -263,7 +439,8 @@ extern CHARSET_INFO my_charset_gb2312_chinese_ci;
extern CHARSET_INFO my_charset_gb2312_bin;
extern CHARSET_INFO my_charset_gbk_chinese_ci;
extern CHARSET_INFO my_charset_gbk_bin;
extern CHARSET_INFO my_charset_latin1;
extern CHARSET_INFO my_charset_gb18030_chinese_ci;
extern CHARSET_INFO my_charset_gb18030_bin;
extern CHARSET_INFO my_charset_latin1_german2_ci;
extern CHARSET_INFO my_charset_latin1_bin;
extern CHARSET_INFO my_charset_latin2_czech_ci;
@@ -273,152 +450,267 @@ extern CHARSET_INFO my_charset_tis620_thai_ci;
extern CHARSET_INFO my_charset_tis620_bin;
extern CHARSET_INFO my_charset_ucs2_general_ci;
extern CHARSET_INFO my_charset_ucs2_bin;
extern CHARSET_INFO my_charset_ucs2_general_uca;
extern CHARSET_INFO my_charset_ucs2_unicode_ci;
extern CHARSET_INFO my_charset_ucs2_general_mysql500_ci;
extern CHARSET_INFO my_charset_ujis_japanese_ci;
extern CHARSET_INFO my_charset_ujis_bin;
extern CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf16_bin;
extern CHARSET_INFO my_charset_utf16_general_ci;
extern CHARSET_INFO my_charset_utf16_unicode_ci;
extern CHARSET_INFO my_charset_utf16le_bin;
extern CHARSET_INFO my_charset_utf16le_general_ci;
extern CHARSET_INFO my_charset_utf32_bin;
extern CHARSET_INFO my_charset_utf32_general_ci;
extern CHARSET_INFO my_charset_utf32_unicode_ci;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf8_tolower_ci;
extern CHARSET_INFO my_charset_utf8_unicode_ci;
extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci;
extern CHARSET_INFO my_charset_utf8_general_mysql500_ci;
extern CHARSET_INFO my_charset_utf8mb4_bin;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_general_ci;
extern CHARSET_INFO my_charset_utf8mb4_unicode_ci;
#define MY_UTF8MB3 "utf8"
#define MY_UTF8MB4 "utf8mb4"
/* declarations for simple charsets */
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
uint);
uint my_strnxfrmlen_simple(CHARSET_INFO *, uint);
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint, my_bool);
extern size_t my_strnxfrm_simple(const CHARSET_INFO *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
size_t my_strnxfrmlen_simple(const CHARSET_INFO *, size_t);
extern int my_strnncoll_simple(const CHARSET_INFO *, const uchar *, size_t,
const uchar *, size_t, my_bool);
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint,
extern int my_strnncollsp_simple(const CHARSET_INFO *, const uchar *, size_t,
const uchar *, size_t,
my_bool diff_if_only_endspace_difference);
extern void my_hash_sort_simple(CHARSET_INFO *cs,
const uchar *key, uint len,
extern void my_hash_sort_simple(const CHARSET_INFO *cs,
const uchar *key, size_t len,
ulong *nr1, ulong *nr2);
extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length);
extern size_t my_lengthsp_8bit(const CHARSET_INFO *cs, const char *ptr,
size_t length);
extern uint my_instr_simple(struct charset_info_st *,
const char *b, uint b_length,
const char *s, uint s_length,
extern uint my_instr_simple(const struct charset_info_st *,
const char *b, size_t b_length,
const char *s, size_t s_length,
my_match_t *match, uint nmatch);
/* Functions for 8bit */
extern void my_caseup_str_8bit(CHARSET_INFO *, char *);
extern void my_casedn_str_8bit(CHARSET_INFO *, char *);
extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen,
char *dst, uint dstlen);
extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen,
char *dst, uint dstlen);
extern size_t my_caseup_str_8bit(const CHARSET_INFO *, char *);
extern size_t my_casedn_str_8bit(const CHARSET_INFO *, char *);
extern size_t my_caseup_8bit(const CHARSET_INFO *, char *src, size_t srclen,
char *dst, size_t dstlen);
extern size_t my_casedn_8bit(const CHARSET_INFO *, char *src, size_t srclen,
char *dst, size_t dstlen);
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
extern int my_strcasecmp_8bit(const CHARSET_INFO * cs, const char *,
const char *);
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
int my_mb_wc_8bit(const CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,
const uchar *e);
int my_wc_mb_8bit(const CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
int my_mb_ctype_8bit(const CHARSET_INFO *,int *, const uchar *,const uchar *);
int my_mb_ctype_mb(const CHARSET_INFO *,int *, const uchar *,const uchar *);
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
const char *fmt, ...);
size_t my_scan_8bit(const CHARSET_INFO *cs, const char *b, const char *e,
int sq);
long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
size_t my_snprintf_8bit(const struct charset_info_st *, char *to, size_t n,
const char *fmt, ...)
MY_ATTRIBUTE((format(printf, 4, 5)));
long my_strntol_8bit(const CHARSET_INFO *, const char *s, size_t l,
int base, char **e, int *err);
ulong my_strntoul_8bit(const CHARSET_INFO *, const char *s, size_t l,
int base, char **e, int *err);
longlong my_strntoll_8bit(const CHARSET_INFO *, const char *s, size_t l,
int base, char **e, int *err);
ulonglong my_strntoull_8bit(const CHARSET_INFO *, const char *s, size_t l,
int base, char **e, int *err);
double my_strntod_8bit(const CHARSET_INFO *, char *s, size_t l, char **e,
int *err);
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
long int val);
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
longlong val);
size_t my_long10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
int radix, long int val);
size_t my_longlong10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
int radix, longlong val);
longlong my_strtoll10_8bit(CHARSET_INFO *cs,
longlong my_strtoll10_8bit(const CHARSET_INFO *cs,
const char *nptr, char **endptr, int *error);
longlong my_strtoll10_ucs2(CHARSET_INFO *cs,
longlong my_strtoll10_ucs2(const CHARSET_INFO *cs,
const char *nptr, char **endptr, int *error);
void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
ulonglong my_strntoull10rnd_8bit(const CHARSET_INFO *cs,
const char *str, size_t length, int
unsigned_fl, char **endptr, int *error);
ulonglong my_strntoull10rnd_ucs2(const CHARSET_INFO *cs,
const char *str, size_t length,
int unsigned_fl, char **endptr, int *error);
my_bool my_like_range_simple(CHARSET_INFO *cs,
const char *ptr, uint ptr_length,
void my_fill_8bit(const CHARSET_INFO *cs, char* to, size_t l, int fill);
/* For 8-bit character set */
my_bool my_like_range_simple(const CHARSET_INFO *cs,
const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
uint res_length,
size_t res_length,
char *min_str, char *max_str,
uint *min_length, uint *max_length);
size_t *min_length, size_t *max_length);
my_bool my_like_range_mb(CHARSET_INFO *cs,
const char *ptr, uint ptr_length,
/* For ASCII-based multi-byte character sets with mbminlen=1 */
my_bool my_like_range_mb(const CHARSET_INFO *cs,
const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
uint res_length,
size_t res_length,
char *min_str, char *max_str,
uint *min_length, uint *max_length);
size_t *min_length, size_t *max_length);
my_bool my_like_range_ucs2(CHARSET_INFO *cs,
const char *ptr, uint ptr_length,
pbool escape, pbool w_one, pbool w_many,
uint res_length,
char *min_str, char *max_str,
uint *min_length, uint *max_length);
/* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */
my_bool my_like_range_generic(const CHARSET_INFO *cs,
const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
size_t res_length,
char *min_str, char *max_str,
size_t *min_length, size_t *max_length);
int my_wildcmp_8bit(CHARSET_INFO *,
int my_wildcmp_8bit(const CHARSET_INFO *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
int my_wildcmp_bin(CHARSET_INFO *,
int my_wildcmp_bin(const CHARSET_INFO *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
uint pos, int *error);
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
size_t my_numchars_8bit(const CHARSET_INFO *, const char *b, const char *e);
size_t my_numcells_8bit(const CHARSET_INFO *, const char *b, const char *e);
size_t my_charpos_8bit(const CHARSET_INFO *, const char *b, const char *e,
size_t pos);
size_t my_well_formed_len_8bit(const CHARSET_INFO *, const char *b,
const char *e, size_t pos, int *error);
uint my_mbcharlen_8bit(const CHARSET_INFO *, uint c);
/* Functions for multibyte charsets */
extern void my_caseup_str_mb(CHARSET_INFO *, char *);
extern void my_casedn_str_mb(CHARSET_INFO *, char *);
extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen,
char *dst, uint dstlen);
extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen,
char *dst, uint dstlen);
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
extern size_t my_caseup_str_mb(const CHARSET_INFO *, char *);
extern size_t my_casedn_str_mb(const CHARSET_INFO *, char *);
extern size_t my_caseup_mb(const CHARSET_INFO *, char *src, size_t srclen,
char *dst, size_t dstlen);
extern size_t my_casedn_mb(const CHARSET_INFO *, char *src, size_t srclen,
char *dst, size_t dstlen);
extern size_t my_caseup_mb_varlen(const CHARSET_INFO *, char *src,
size_t srclen, char *dst, size_t dstlen);
extern size_t my_casedn_mb_varlen(const CHARSET_INFO *, char *src,
size_t srclen, char *dst, size_t dstlen);
extern size_t my_caseup_ujis(const CHARSET_INFO *, char *src, size_t srclen,
char *dst, size_t dstlen);
extern size_t my_casedn_ujis(const CHARSET_INFO *, char *src, size_t srclen,
char *dst, size_t dstlen);
extern int my_strcasecmp_mb(const CHARSET_INFO * cs,const char *,
const char *);
int my_wildcmp_mb(CHARSET_INFO *,
int my_wildcmp_mb(const CHARSET_INFO *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
uint pos, int *error);
uint my_instr_mb(struct charset_info_st *,
const char *b, uint b_length,
const char *s, uint s_length,
size_t my_numchars_mb(const CHARSET_INFO *, const char *b, const char *e);
size_t my_numcells_mb(const CHARSET_INFO *, const char *b, const char *e);
size_t my_charpos_mb(const CHARSET_INFO *, const char *b, const char *e,
size_t pos);
size_t my_well_formed_len_mb(const CHARSET_INFO *, const char *b,
const char *e, size_t pos, int *error);
uint my_instr_mb(const struct charset_info_st *,
const char *b, size_t b_length,
const char *s, size_t s_length,
my_match_t *match, uint nmatch);
int my_wildcmp_unicode(CHARSET_INFO *cs,
int my_strnncoll_mb_bin(const CHARSET_INFO * cs,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix);
int my_strnncollsp_mb_bin(const CHARSET_INFO *cs,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference);
int my_wildcmp_mb_bin(const CHARSET_INFO *cs,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
int my_strcasecmp_mb_bin(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
const char *s, const char *t);
void my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2);
size_t my_strnxfrm_mb(const CHARSET_INFO *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
size_t my_strnxfrm_unicode(const CHARSET_INFO *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
size_t my_strnxfrm_unicode_full_bin(const CHARSET_INFO *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
size_t my_strnxfrmlen_unicode_full_bin(const CHARSET_INFO *, size_t);
int my_wildcmp_unicode(const CHARSET_INFO *cs,
const char *str, const char *str_end,
const char *wildstr, const char *wildend,
int escape, int w_one, int w_many,
MY_UNICASE_INFO **weights);
const MY_UNICASE_INFO *weights);
extern my_bool my_parse_charset_xml(const char *bug, uint len,
int (*add)(CHARSET_INFO *cs));
extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader,
const char *buf, size_t buflen);
extern char *my_strchr(const CHARSET_INFO *cs, const char *str,
const char *end, pchar c);
extern size_t my_strcspn(const CHARSET_INFO *cs, const char *str,
const char *end, const char *reject,
size_t reject_length);
my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, uint len);
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);
my_bool my_propagate_simple(const CHARSET_INFO *cs, const uchar *str,
size_t len);
my_bool my_propagate_complex(const CHARSET_INFO *cs, const uchar *str,
size_t len);
uint my_string_repertoire(const CHARSET_INFO *cs, const char *str, size_t len);
my_bool my_charset_is_ascii_based(const CHARSET_INFO *cs);
my_bool my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs);
uint my_charset_repertoire(const CHARSET_INFO *cs);
uint my_strxfrm_flag_normalize(uint flags, uint nlevels);
void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend,
uint flags, uint level);
size_t my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO *cs,
uchar *str, uchar *frmend, uchar *strend,
uint nweights, uint flags, uint level);
my_bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs);
const MY_CONTRACTIONS *my_charset_get_contractions(const CHARSET_INFO *cs,
int level);
extern size_t my_vsnprintf_ex(const CHARSET_INFO *cs, char *to, size_t n,
const char* fmt, va_list ap);
size_t my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs,
const char *from, size_t from_length,
const CHARSET_INFO *from_cs, uint *errors);
uint my_mbcharlen_ptr(const CHARSET_INFO *cs, const char *s, const char *e);
#define _MY_U 01 /* Upper case */
#define _MY_L 02 /* Lower case */
#define _MY_NMR 04 /* Numeral (digit) */
@@ -453,7 +745,8 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
#define my_strnxfrm(cs, d, dl, s, sl) \
((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), MY_STRXFRM_PAD_WITH_SPACE))
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
@@ -464,11 +757,39 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);
#define use_mb(s) ((s)->cset->ismbchar != NULL)
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
#ifdef USE_MB
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
#else
#define my_mbcharlen(s, a) 1
#endif
/**
Get the length of gb18030 code by the given two leading bytes
@param[in] s charset_info
@param[in] a first byte of gb18030 code
@param[in] b second byte of gb18030 code
@return the length of gb18030 code starting with given two bytes,
the length would be 2 or 4 for valid gb18030 code,
or 0 for invalid gb18030 code
*/
#define my_mbcharlen_2(s, a, b) ((s)->cset->mbcharlen((s),((((a) & 0xFF) << 8) + ((b) & 0xFF))))
/**
Get the maximum length of leading bytes needed to determine the length of a
multi-byte gb18030 code
@param[in] s charset_info
@return number of leading bytes we need, would be 2 for gb18030
and 1 for all other charsets
*/
#define my_mbmaxlenlen(s) ((s)->mbmaxlenlen)
/**
Judge if the given byte is a possible leading byte for a charset.
For gb18030 whose mbmaxlenlen is 2, we can't determine the length of
a multi-byte character by looking at the first byte only
@param[in] s charset_info
@param[in] i possible leading byte
@return true if it is, otherwise false
*/
#define my_ismb1st(s, i) \
(my_mbcharlen((s), (i)) > 1 || \
(my_mbmaxlenlen((s)) == 2 && my_mbcharlen((s), (i)) == 0))
#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
@@ -478,14 +799,6 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);
#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
/* XXX: still need to take care of this one */
#ifdef MY_CHARSET_TIS620
#error The TIS620 charset is broken at the moment. Tell tim to fix it.
#define USE_TIS620
#include "t_ctype.h"
#endif
#ifdef __cplusplus
}
#endif

344
3rdparty/mysql/include/m_string.h vendored Normal file
View File

@@ -0,0 +1,344 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _m_string_h
#define _m_string_h
#include "my_global.h" /* HAVE_* */
#include <string.h>
#define bfill please_use_memset_rather_than_bfill
#define bzero please_use_memset_rather_than_bzero
#define bmove please_use_memmove_rather_than_bmove
#define strmov please_use_my_stpcpy_or_my_stpmov_rather_than_strmov
#define strnmov please_use_my_stpncpy_or_my_stpnmov_rather_than_strnmov
#include "mysql/service_my_snprintf.h"
#if defined(__cplusplus)
extern "C" {
#endif
/*
my_str_malloc(), my_str_realloc() and my_str_free() are assigned to
implementations in strings/alloc.c, but can be overridden in
the calling program.
*/
extern void *(*my_str_malloc)(size_t);
extern void *(*my_str_realloc)(void *, size_t);
extern void (*my_str_free)(void *);
/* Declared in int2str() */
extern char _dig_vec_upper[];
extern char _dig_vec_lower[];
/* Prototypes for string functions */
extern void bchange(uchar *dst,size_t old_len,const uchar *src,
size_t new_len,size_t tot_len);
extern void strappend(char *s,size_t len,pchar fill);
extern char *strend(const char *s);
extern char *strcend(const char *, pchar);
extern char *strfill(char * s,size_t len,pchar fill);
extern char *strmake(char *dst,const char *src,size_t length);
extern char *my_stpmov(char *dst,const char *src);
extern char *my_stpnmov(char *dst, const char *src, size_t n);
extern char *strcont(const char *src, const char *set);
extern char *strxmov(char *dst, const char *src, ...);
extern char *strxnmov(char *dst, size_t len, const char *src, ...);
/**
Copy a string from src to dst until (and including) terminating null byte.
@param dst Destination
@param src Source
@note src and dst cannot overlap.
Use my_stpmov() if src and dst overlaps.
@note Unsafe, consider using my_stpnpy() instead.
@return pointer to terminating null byte.
*/
static inline char *my_stpcpy(char *dst, const char *src)
{
#if defined(HAVE_BUILTIN_STPCPY)
return __builtin_stpcpy(dst, src);
#elif defined(HAVE_STPCPY)
return stpcpy(dst, src);
#else
/* Fallback to implementation supporting overlap. */
return my_stpmov(dst, src);
#endif
}
/**
Copy fixed-size string from src to dst.
@param dst Destination
@param src Source
@param n Maximum number of characters to copy.
@note src and dst cannot overlap
Use my_stpnmov() if src and dst overlaps.
@return pointer to terminating null byte.
*/
static inline char *my_stpncpy(char *dst, const char *src, size_t n)
{
#if defined(HAVE_STPNCPY)
return stpncpy(dst, src, n);
#else
/* Fallback to implementation supporting overlap. */
return my_stpnmov(dst, src, n);
#endif
}
static inline longlong my_strtoll(const char *nptr, char **endptr, int base)
{
#if defined _WIN32
return _strtoi64(nptr, endptr, base);
#else
return strtoll(nptr, endptr, base);
#endif
}
static inline ulonglong my_strtoull(const char *nptr, char **endptr, int base)
{
#if defined _WIN32
return _strtoui64(nptr, endptr, base);
#else
return strtoull(nptr, endptr, base);
#endif
}
static inline char *my_strtok_r(char *str, const char *delim, char **saveptr)
{
#if defined _WIN32
return strtok_s(str, delim, saveptr);
#else
return strtok_r(str, delim, saveptr);
#endif
}
/* native_ rather than my_ since my_strcasecmp already exists */
static inline int native_strcasecmp(const char *s1, const char *s2)
{
#if defined _WIN32
return _stricmp(s1, s2);
#else
return strcasecmp(s1, s2);
#endif
}
/* native_ rather than my_ for consistency with native_strcasecmp */
static inline int native_strncasecmp(const char *s1, const char *s2, size_t n)
{
#if defined _WIN32
return _strnicmp(s1, s2, n);
#else
return strncasecmp(s1, s2, n);
#endif
}
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
/* Prototypes of normal stringfunctions (with may ours) */
#ifndef HAVE_STRNLEN
extern size_t strnlen(const char *s, size_t n);
#endif
extern int is_prefix(const char *, const char *);
/* Conversion routines */
typedef enum {
MY_GCVT_ARG_FLOAT,
MY_GCVT_ARG_DOUBLE
} my_gcvt_arg_type;
double my_strtod(const char *str, char **end, int *error);
double my_atof(const char *nptr);
size_t my_fcvt(double x, int precision, char *to, my_bool *error);
size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
my_bool *error);
#define NOT_FIXED_DEC 31
/*
The longest string my_fcvt can return is 311 + "precision" bytes.
Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC
(+ 1 byte for the terminating '\0').
*/
#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC)
/*
We want to use the 'e' format in some cases even if we have enough space
for the 'f' one just to mimic sprintf("%.15g") behavior for large integers,
and to improve it for numbers < 10^(-4).
That is, for |x| < 1 we require |x| >= 10^(-15), and for |x| > 1 we require
it to be integer and be <= 10^DBL_DIG for the 'f' format to be used.
We don't lose precision, but make cases like "1e200" or "0.00001" look nicer.
*/
#define MAX_DECPT_FOR_F_FORMAT DBL_DIG
/*
The maximum possible field width for my_gcvt() conversion.
(DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or
MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used).
*/
#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + MY_MAX(5, MAX_DECPT_FOR_F_FORMAT)) \
extern char *llstr(longlong value,char *buff);
extern char *ullstr(longlong value,char *buff);
extern char *int2str(long val, char *dst, int radix, int upcase);
extern char *int10_to_str(long val,char *dst,int radix);
extern char *str2int(const char *src,int radix,long lower,long upper,
long *val);
longlong my_strtoll10(const char *nptr, char **endptr, int *error);
#if SIZEOF_LONG == SIZEOF_LONG_LONG
#define ll2str(A,B,C,D) int2str((A),(B),(C),(D))
#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
#undef strtoll
#define strtoll(A,B,C) strtol((A),(B),(C))
#define strtoull(A,B,C) strtoul((A),(B),(C))
#else
extern char *ll2str(longlong val,char *dst,int radix, int upcase);
extern char *longlong10_to_str(longlong val,char *dst,int radix);
#endif
#define longlong2str(A,B,C) ll2str((A),(B),(C),1)
#if defined(__cplusplus)
}
#endif
/*
LEX_STRING -- a pair of a C-string and its length.
(it's part of the plugin API as a MYSQL_LEX_STRING)
Ditto LEX_CSTRING/MYSQL_LEX_CSTRING.
*/
#include <mysql/mysql_lex_string.h>
typedef struct st_mysql_lex_string LEX_STRING;
typedef struct st_mysql_const_lex_string LEX_CSTRING;
#define STRING_WITH_LEN(X) (X), ((sizeof(X) - 1))
#define USTRING_WITH_LEN(X) ((uchar*) X), ((sizeof(X) - 1))
#define C_STRING_WITH_LEN(X) ((char *) (X)), ((sizeof(X) - 1))
/**
Skip trailing space.
On most systems reading memory in larger chunks (ideally equal to the size of
the chinks that the machine physically reads from memory) causes fewer memory
access loops and hence increased performance.
This is why the 'int' type is used : it's closest to that (according to how
it's defined in C).
So when we determine the amount of whitespace at the end of a string we do
the following :
1. We divide the string into 3 zones :
a) from the start of the string (__start) to the first multiple
of sizeof(int) (__start_words)
b) from the end of the string (__end) to the last multiple of sizeof(int)
(__end_words)
c) a zone that is aligned to sizeof(int) and can be safely accessed
through an int *
2. We start comparing backwards from (c) char-by-char. If all we find is
space then we continue
3. If there are elements in zone (b) we compare them as unsigned ints to a
int mask (SPACE_INT) consisting of all spaces
4. Finally we compare the remaining part (a) of the string char by char.
This covers for the last non-space unsigned int from 3. (if any)
This algorithm works well for relatively larger strings, but it will slow
the things down for smaller strings (because of the additional calculations
and checks compared to the naive method). Thus the barrier of length 20
is added.
@param ptr pointer to the input string
@param len the length of the string
@return the last non-space character
*/
#if defined(__sparc) || defined(__sparcv9)
static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
{
/* SPACE_INT is a word that contains only spaces */
#if SIZEOF_INT == 4
const unsigned SPACE_INT= 0x20202020U;
#elif SIZEOF_INT == 8
const unsigned SPACE_INT= 0x2020202020202020ULL;
#else
#error define the appropriate constant for a word full of spaces
#endif
const uchar *end= ptr + len;
if (len > 20)
{
const uchar *end_words= (const uchar *)(intptr)
(((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT);
const uchar *start_words= (const uchar *)(intptr)
((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT);
DBUG_ASSERT(end_words > ptr);
while (end > end_words && end[-1] == 0x20)
end--;
if (end[-1] == 0x20 && start_words < end_words)
while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT)
end -= SIZEOF_INT;
}
while (end > ptr && end[-1] == 0x20)
end--;
return (end);
}
#else
/*
Reads 8 bytes at a time, ignoring alignment.
We use uint8korr, which is fast (it simply reads a *ulonglong)
on all platforms, except sparc.
*/
static inline const uchar *skip_trailing_space(const uchar *ptr, size_t len)
{
const uchar *end= ptr + len;
while (end - ptr >= 8)
{
if (uint8korr(end-8) != 0x2020202020202020ULL)
break;
end-= 8;
}
while (end > ptr && end[-1] == 0x20)
end--;
return (end);
}
#endif
static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
{
lex_str->str= (char *) c_str;
lex_str->length= strlen(c_str);
}
static inline void lex_cstring_set(LEX_CSTRING *lex_str, const char *c_str)
{
lex_str->str= c_str;
lex_str->length= strlen(c_str);
}
#endif

View File

@@ -1,9 +1,8 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,9 +11,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
/*
Data structures for mysys/my_alloc.c (root memory allocator)
*/
@@ -24,6 +23,13 @@
#define ALLOC_MAX_BLOCK_TO_DROP 4096
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
/* PSI_memory_key */
#include "mysql/psi/psi_memory.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct st_used_mem
{ /* struct for once_alloc (block) */
struct st_used_mem *next; /* Next block in use */
@@ -38,15 +44,22 @@ typedef struct st_mem_root
USED_MEM *used; /* blocks almost without free memory */
USED_MEM *pre_alloc; /* preallocated block */
/* if block have less memory it will be put in 'used' list */
unsigned int min_malloc;
unsigned int block_size; /* initial block size */
size_t min_malloc;
size_t block_size; /* initial block size */
unsigned int block_num; /* allocated blocks counter */
/*
first free block in queue test counter (if it exceed
/*
first free block in queue test counter (if it exceed
MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
*/
unsigned int first_block_usage;
void (*error_handler)(void);
PSI_memory_key m_psi_key;
} MEM_ROOT;
#ifdef __cplusplus
}
#endif
#endif

213
3rdparty/mysql/include/my_byteorder.h vendored Normal file
View File

@@ -0,0 +1,213 @@
#ifndef MY_BYTEORDER_INCLUDED
#define MY_BYTEORDER_INCLUDED
/* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions for reading and storing in machine independent
format (low byte first). There are 'korr' (assume 'corrector') variants
for integer types, but 'get' (assume 'getter') for floating point types.
*/
#if defined(__i386__) || defined(_WIN32) || defined(__x86_64__)
#include "byte_order_generic_x86.h"
#else
#include "byte_order_generic.h"
#endif
static inline int32 sint3korr(const uchar *A)
{
return
((int32) (((A[2]) & 128) ?
(((uint32) 255L << 24) |
(((uint32) A[2]) << 16) |
(((uint32) A[1]) << 8) |
((uint32) A[0])) :
(((uint32) A[2]) << 16) |
(((uint32) A[1]) << 8) |
((uint32) A[0])))
;
}
static inline uint32 uint3korr(const uchar *A)
{
return
(uint32) (((uint32) (A[0])) +
(((uint32) (A[1])) << 8) +
(((uint32) (A[2])) << 16))
;
}
static inline ulonglong uint5korr(const uchar *A)
{
return
((ulonglong)(((uint32) (A[0])) +
(((uint32) (A[1])) << 8) +
(((uint32) (A[2])) << 16) +
(((uint32) (A[3])) << 24)) +
(((ulonglong) (A[4])) << 32))
;
}
static inline ulonglong uint6korr(const uchar *A)
{
return
((ulonglong)(((uint32) (A[0])) +
(((uint32) (A[1])) << 8) +
(((uint32) (A[2])) << 16) +
(((uint32) (A[3])) << 24)) +
(((ulonglong) (A[4])) << 32) +
(((ulonglong) (A[5])) << 40))
;
}
static inline void int3store(uchar *T, uint A)
{
*(T)= (uchar) (A);
*(T+1)= (uchar) (A >> 8);
*(T+2)= (uchar) (A >> 16);
}
static inline void int5store(uchar *T, ulonglong A)
{
*(T)= (uchar) (A);
*(T+1)= (uchar) (A >> 8);
*(T+2)= (uchar) (A >> 16);
*(T+3)= (uchar) (A >> 24);
*(T+4)= (uchar) (A >> 32);
}
static inline void int6store(uchar *T, ulonglong A)
{
*(T)= (uchar) (A);
*(T+1)= (uchar) (A >> 8);
*(T+2)= (uchar) (A >> 16);
*(T+3)= (uchar) (A >> 24);
*(T+4)= (uchar) (A >> 32);
*(T+5)= (uchar) (A >> 40);
}
#ifdef __cplusplus
static inline int16 sint2korr(const char *pT)
{
return sint2korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline uint16 uint2korr(const char *pT)
{
return uint2korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline uint32 uint3korr(const char *pT)
{
return uint3korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline int32 sint3korr(const char *pT)
{
return sint3korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline uint32 uint4korr(const char *pT)
{
return uint4korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline int32 sint4korr(const char *pT)
{
return sint4korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline ulonglong uint6korr(const char *pT)
{
return uint6korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline ulonglong uint8korr(const char *pT)
{
return uint8korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline longlong sint8korr(const char *pT)
{
return sint8korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
}
static inline void int2store(char *pT, uint16 A)
{
int2store(static_cast<uchar*>(static_cast<void*>(pT)), A);
}
static inline void int3store(char *pT, uint A)
{
int3store(static_cast<uchar*>(static_cast<void*>(pT)), A);
}
static inline void int4store(char *pT, uint32 A)
{
int4store(static_cast<uchar*>(static_cast<void*>(pT)), A);
}
static inline void int5store(char *pT, ulonglong A)
{
int5store(static_cast<uchar*>(static_cast<void*>(pT)), A);
}
static inline void int6store(char *pT, ulonglong A)
{
int6store(static_cast<uchar*>(static_cast<void*>(pT)), A);
}
static inline void int8store(char *pT, ulonglong A)
{
int8store(static_cast<uchar*>(static_cast<void*>(pT)), A);
}
#endif /* __cplusplus */
/*
Functions for reading and storing in machine format from/to
short/long to/from some place in memory V should be a variable
and M a pointer to byte.
*/
#ifdef WORDS_BIGENDIAN
#include "big_endian.h"
#else
#include "little_endian.h"
#endif
#ifdef __cplusplus
static inline void float4store(char *V, float M)
{
float4store(static_cast<uchar*>(static_cast<void*>(V)), M);
}
static inline void float8get(double *V, const char *M)
{
float8get(V, static_cast<const uchar*>(static_cast<const void*>(M)));
}
static inline void float8store(char *V, double M)
{
float8store(static_cast<uchar*>(static_cast<void*>(V)), M);
}
#endif /* __cplusplus */
#endif /* MY_BYTEORDER_INCLUDED */

64
3rdparty/mysql/include/my_command.h vendored Normal file
View File

@@ -0,0 +1,64 @@
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _mysql_command_h
#define _mysql_command_h
/**
@enum enum_server_command
@brief You should add new commands to the end of this list, otherwise old
servers won't be able to handle them as 'unsupported'.
*/
enum enum_server_command
{
COM_SLEEP,
COM_QUIT,
COM_INIT_DB,
COM_QUERY,
COM_FIELD_LIST,
COM_CREATE_DB,
COM_DROP_DB,
COM_REFRESH,
COM_SHUTDOWN,
COM_STATISTICS,
COM_PROCESS_INFO,
COM_CONNECT,
COM_PROCESS_KILL,
COM_DEBUG,
COM_PING,
COM_TIME,
COM_DELAYED_INSERT,
COM_CHANGE_USER,
COM_BINLOG_DUMP,
COM_TABLE_DUMP,
COM_CONNECT_OUT,
COM_REGISTER_SLAVE,
COM_STMT_PREPARE,
COM_STMT_EXECUTE,
COM_STMT_SEND_LONG_DATA,
COM_STMT_CLOSE,
COM_STMT_RESET,
COM_SET_OPTION,
COM_STMT_FETCH,
COM_DAEMON,
COM_BINLOG_DUMP_GTID,
COM_RESET_CONNECTION,
/* don't forget to update const char *command_name[] in sql_parse.cc */
/* Must be last */
COM_END
};
#endif /* _mysql_command_h */

178
3rdparty/mysql/include/my_compiler.h vendored Normal file
View File

@@ -0,0 +1,178 @@
#ifndef MY_COMPILER_INCLUDED
#define MY_COMPILER_INCLUDED
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
Header for compiler-dependent features.
Intended to contain a set of reusable wrappers for preprocessor
macros, attributes, pragmas, and any other features that are
specific to a target compiler.
*/
#include <stddef.h> /* size_t */
#if defined __GNUC__
/*
Convenience macro to test the minimum required GCC version.
These should be used with care as Clang also sets __GNUC__ and
__GNUC_MINOR__ (currently to 4.2). Prefer using feature specific
CMake checks in configure.cmake instead.
*/
# define MY_GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#else
# define MY_GNUC_PREREQ(maj, min) (0)
#endif
/*
The macros below are borrowed from include/linux/compiler.h in the
Linux kernel. Use them to indicate the likelyhood of the truthfulness
of a condition. This serves two purposes - newer versions of gcc will be
able to optimize for branch predication, which could yield siginficant
performance gains in frequently executed sections of the code, and the
other reason to use them is for documentation
*/
#ifdef HAVE_BUILTIN_EXPECT
// likely/unlikely are likely to clash with other symbols, do not #define
#if defined(__cplusplus)
inline bool likely(bool expr)
{
return __builtin_expect(expr, true);
}
inline bool unlikely(bool expr)
{
return __builtin_expect(expr, false);
}
#else
# define likely(x) __builtin_expect((x),1)
# define unlikely(x) __builtin_expect((x),0)
#endif
#else /* HAVE_BUILTIN_EXPECT */
#if defined(__cplusplus)
inline bool likely(bool expr)
{
return expr;
}
inline bool unlikely(bool expr)
{
return expr;
}
#else
# define likely(x) (x)
# define unlikely(x) (x)
#endif
#endif /* HAVE_BUILTIN_EXPECT */
/* Comunicate to the compiler the unreachability of the code. */
#ifdef HAVE_BUILTIN_UNREACHABLE
# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
#else
# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0)
#endif
#if defined __GNUC__ || defined __SUNPRO_C || defined __SUNPRO_CC
/* Specifies the minimum alignment of a type. */
# define MY_ALIGNOF(type) __alignof__(type)
/* Determine the alignment requirement of a type. */
# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
/* Microsoft Visual C++ */
#elif defined _MSC_VER
# define MY_ALIGNOF(type) __alignof(type)
# define MY_ALIGNED(n) __declspec(align(n))
#else /* Make sure they are defined for other compilers. */
# define MY_ALIGNOF(type)
# define MY_ALIGNED(size)
#endif
/* Visual Studio requires '__inline' for C code */
#if !defined(__cplusplus) && defined(_MSC_VER)
# define inline __inline
#endif
/* Provide __func__ macro definition for Visual Studio. */
#if defined(_MSC_VER)
# define __func__ __FUNCTION__
#endif
/**
C++ Type Traits
*/
#ifdef __cplusplus
/**
Opaque storage with a particular alignment.
Partial specialization used due to MSVC++.
*/
template<size_t alignment> struct my_alignment_imp;
template<> struct MY_ALIGNED(1) my_alignment_imp<1> {};
template<> struct MY_ALIGNED(2) my_alignment_imp<2> {};
template<> struct MY_ALIGNED(4) my_alignment_imp<4> {};
template<> struct MY_ALIGNED(8) my_alignment_imp<8> {};
template<> struct MY_ALIGNED(16) my_alignment_imp<16> {};
/**
A POD type with a given size and alignment.
@remark If the compiler does not support a alignment attribute
(MY_ALIGN macro), the default alignment of a double is
used instead.
@tparam size The minimum size.
@tparam alignment The desired alignment: 1, 2, 4, 8 or 16.
*/
template <size_t size, size_t alignment>
struct my_aligned_storage
{
union
{
char data[size];
my_alignment_imp<alignment> align;
};
};
#endif /* __cplusplus */
/*
Disable MY_ATTRIBUTE for Sun Studio and Visual Studio.
Note that Sun Studio supports some __attribute__ variants,
but not format or unused which we use quite a lot.
*/
#ifndef MY_ATTRIBUTE
#if defined(__GNUC__)
# define MY_ATTRIBUTE(A) __attribute__(A)
#else
# define MY_ATTRIBUTE(A)
#endif
#endif
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif
#if __has_attribute(no_sanitize_undefined)
# define SUPPRESS_UBSAN __attribute__((no_sanitize_undefined))
#else
# define SUPPRESS_UBSAN
#endif
#endif /* MY_COMPILER_INCLUDED */

454
3rdparty/mysql/include/my_config.h vendored Normal file
View File

@@ -0,0 +1,454 @@
/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MY_CONFIG_H
#define MY_CONFIG_H
/*
* From configure.cmake, in order of appearance
*/
/* #undef HAVE_LLVM_LIBCPP */
#define _LARGEFILE_SOURCE 1
/* Libraries */
/* #undef HAVE_LIBM */
/* #undef HAVE_LIBNSL */
/* #undef HAVE_LIBCRYPT */
/* #undef HAVE_LIBSOCKET */
/* #undef HAVE_LIBDL */
/* #undef HAVE_LIBRT */
/* #undef HAVE_LIBWRAP */
/* Header files */
/* #undef HAVE_ALLOCA_H */
/* #undef HAVE_ARPA_INET_H */
/* #undef HAVE_DIRENT_H */
/* #undef HAVE_DLFCN_H */
/* #undef HAVE_EXECINFO_H */
/* #undef HAVE_FPU_CONTROL_H */
/* #undef HAVE_GRP_H */
/* #undef HAVE_IEEEFP_H */
/* #undef HAVE_LANGINFO_H */
#define HAVE_MALLOC_H 1
/* #undef HAVE_NETINET_IN_H */
/* #undef HAVE_POLL_H */
/* #undef HAVE_PWD_H */
/* #undef HAVE_STRINGS_H */
/* #undef HAVE_SYS_CDEFS_H */
/* #undef HAVE_SYS_IOCTL_H */
/* #undef HAVE_SYS_MMAN_H */
/* #undef HAVE_SYS_RESOURCE_H */
/* #undef HAVE_SYS_SELECT_H */
/* #undef HAVE_SYS_SOCKET_H */
/* #undef HAVE_TERM_H */
/* #undef HAVE_TERMIOS_H */
/* #undef HAVE_TERMIO_H */
/* #undef HAVE_UNISTD_H */
/* #undef HAVE_SYS_WAIT_H */
/* #undef HAVE_SYS_PARAM_H */
/* #undef HAVE_FNMATCH_H */
/* #undef HAVE_SYS_UN_H */
/* #undef HAVE_VIS_H */
/* #undef HAVE_SASL_SASL_H */
/* Libevent */
/* #undef HAVE_DEVPOLL */
/* #undef HAVE_SYS_DEVPOLL_H */
/* #undef HAVE_SYS_EPOLL_H */
/* #undef HAVE_TAILQFOREACH */
/* Functions */
#define HAVE_ALIGNED_MALLOC 1
/* #undef HAVE_BACKTRACE */
/* #undef HAVE_PRINTSTACK */
/* #undef HAVE_INDEX */
/* #undef HAVE_CLOCK_GETTIME */
/* #undef HAVE_CUSERID */
/* #undef HAVE_DIRECTIO */
/* #undef HAVE_FTRUNCATE */
#define HAVE_COMPRESS 1
/* #undef HAVE_CRYPT */
/* #undef HAVE_DLOPEN */
/* #undef HAVE_FCHMOD */
/* #undef HAVE_FCNTL */
/* #undef HAVE_FDATASYNC */
/* #undef HAVE_DECL_FDATASYNC */
/* #undef HAVE_FEDISABLEEXCEPT */
/* #undef HAVE_FSEEKO */
/* #undef HAVE_FSYNC */
/* #undef HAVE_GETHOSTBYADDR_R */
/* #undef HAVE_GETHRTIME */
#define HAVE_GETNAMEINFO 1
/* #undef HAVE_GETPASS */
/* #undef HAVE_GETPASSPHRASE */
/* #undef HAVE_GETPWNAM */
/* #undef HAVE_GETPWUID */
/* #undef HAVE_GETRLIMIT */
/* #undef HAVE_GETRUSAGE */
/* #undef HAVE_INITGROUPS */
/* #undef HAVE_ISSETUGID */
/* #undef HAVE_GETUID */
/* #undef HAVE_GETEUID */
/* #undef HAVE_GETGID */
/* #undef HAVE_GETEGID */
/* #undef HAVE_LSTAT */
/* #undef HAVE_MADVISE */
/* #undef HAVE_MALLOC_INFO */
/* #undef HAVE_MEMRCHR */
/* #undef HAVE_MLOCK */
/* #undef HAVE_MLOCKALL */
/* #undef HAVE_MMAP64 */
/* #undef HAVE_POLL */
/* #undef HAVE_POSIX_FALLOCATE */
/* #undef HAVE_POSIX_MEMALIGN */
/* #undef HAVE_PREAD */
/* #undef HAVE_PTHREAD_CONDATTR_SETCLOCK */
/* #undef HAVE_PTHREAD_SIGMASK */
/* #undef HAVE_READDIR_R */
/* #undef HAVE_READLINK */
/* #undef HAVE_REALPATH */
/* #undef HAVE_SETFD */
/* #undef HAVE_SIGACTION */
/* #undef HAVE_SLEEP */
/* #undef HAVE_STPCPY */
/* #undef HAVE_STPNCPY */
/* #undef HAVE_STRLCPY */
#define HAVE_STRNLEN 1
/* #undef HAVE_STRLCAT */
/* #undef HAVE_STRSIGNAL */
/* #undef HAVE_FGETLN */
/* #undef HAVE_STRSEP */
#define HAVE_TELL 1
/* #undef HAVE_VASPRINTF */
/* #undef HAVE_MEMALIGN */
/* #undef HAVE_NL_LANGINFO */
/* #undef HAVE_HTONLL */
/* #undef DNS_USE_CPU_CLOCK_FOR_ID */
/* #undef HAVE_EPOLL */
/* #undef HAVE_EVENT_PORTS */
#define HAVE_INET_NTOP 1
/* #undef HAVE_WORKING_KQUEUE */
/* #undef HAVE_TIMERADD */
/* #undef HAVE_TIMERCLEAR */
/* #undef HAVE_TIMERCMP */
/* #undef HAVE_TIMERISSET */
/* WL2373 */
/* #undef HAVE_SYS_TIME_H */
/* #undef HAVE_SYS_TIMES_H */
/* #undef HAVE_TIMES */
/* #undef HAVE_GETTIMEOFDAY */
/* Symbols */
/* #undef HAVE_LRAND48 */
/* #undef GWINSZ_IN_SYS_IOCTL */
/* #undef FIONREAD_IN_SYS_IOCTL */
/* #undef FIONREAD_IN_SYS_FILIO */
/* #undef HAVE_SIGEV_THREAD_ID */
/* #undef HAVE_SIGEV_PORT */
#define HAVE_LOG2 1
#define HAVE_ISINF 1
/* #undef HAVE_KQUEUE_TIMERS */
/* #undef HAVE_POSIX_TIMERS */
/* Endianess */
/* #undef WORDS_BIGENDIAN */
/* Type sizes */
#define SIZEOF_VOIDP 8
#define SIZEOF_CHARP 8
#define SIZEOF_LONG 4
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#define SIZEOF_LONG_LONG 8
#define SIZEOF_OFF_T 4
#define SIZEOF_TIME_T 8
/* #undef HAVE_UINT */
/* #undef HAVE_ULONG */
/* #undef HAVE_U_INT32_T */
#define HAVE_STRUCT_TIMESPEC
/* Support for tagging symbols with __attribute__((visibility("hidden"))) */
/* #undef HAVE_VISIBILITY_HIDDEN */
/* Code tests*/
#define STACK_DIRECTION -1
/* #undef TIME_WITH_SYS_TIME */
#define NO_FCNTL_NONBLOCK 1
/* #undef HAVE_PAUSE_INSTRUCTION */
/* #undef HAVE_FAKE_PAUSE_INSTRUCTION */
/* #undef HAVE_HMT_PRIORITY_INSTRUCTION */
/* #undef HAVE_ABI_CXA_DEMANGLE */
/* #undef HAVE_BSS_START */
/* #undef HAVE_BUILTIN_UNREACHABLE */
/* #undef HAVE_BUILTIN_EXPECT */
/* #undef HAVE_BUILTIN_STPCPY */
/* #undef HAVE_GCC_ATOMIC_BUILTINS */
/* #undef HAVE_GCC_SYNC_BUILTINS */
/* #undef HAVE_VALGRIND */
/* IPV6 */
/* #undef HAVE_NETINET_IN6_H */
#define HAVE_STRUCT_SOCKADDR_IN6 1
#define HAVE_STRUCT_IN6_ADDR 1
#define HAVE_IPV6 1
/* #undef ss_family */
/* #undef HAVE_SOCKADDR_IN_SIN_LEN */
/* #undef HAVE_SOCKADDR_IN6_SIN6_LEN */
/*
* Platform specific CMake files
*/
#define MACHINE_TYPE "x86_64"
/* #undef HAVE_LINUX_LARGE_PAGES */
/* #undef HAVE_SOLARIS_LARGE_PAGES */
/* #undef HAVE_SOLARIS_ATOMIC */
/* #undef HAVE_SOLARIS_STYLE_GETHOST */
#define SYSTEM_TYPE "Win64"
/* Windows stuff, mostly functions, that have Posix analogs but named differently */
/* #undef IPPROTO_IPV6 */
/* #undef IPV6_V6ONLY */
/* This should mean case insensitive file system */
#define FN_NO_CASE_SENSE 1
/*
* From main CMakeLists.txt
*/
#define MAX_INDEXES 64U
/* #undef WITH_INNODB_MEMCACHED */
/* #undef ENABLE_MEMCACHED_SASL */
/* #undef ENABLE_MEMCACHED_SASL_PWDB */
#define ENABLED_PROFILING 1
/* #undef HAVE_ASAN */
#define ENABLED_LOCAL_INFILE 1
/* #undef OPTIMIZER_TRACE */
#define DEFAULT_MYSQL_HOME "C:/Program Files/MySQL/MySQL Server 6.1"
#define SHAREDIR "share"
#define DEFAULT_BASEDIR "C:/Program Files/MySQL/MySQL Server 6.1"
#define MYSQL_DATADIR "C:/Program Files/MySQL/MySQL Server 6.1/data"
#define MYSQL_KEYRINGDIR "C:/Program Files/MySQL/MySQL Server 6.1/keyring"
#define DEFAULT_CHARSET_HOME "C:/Program Files/MySQL/MySQL Server 6.1"
#define PLUGINDIR "C:/Program Files/MySQL/MySQL Server 6.1/lib/plugin"
/* #undef DEFAULT_SYSCONFDIR */
#define DEFAULT_TMPDIR ""
#define INSTALL_SBINDIR "/bin"
#define INSTALL_BINDIR "/bin"
#define INSTALL_MYSQLSHAREDIR "/share"
#define INSTALL_SHAREDIR "/share"
#define INSTALL_PLUGINDIR "/lib/plugin"
#define INSTALL_INCLUDEDIR "/include"
#define INSTALL_SCRIPTDIR "/scripts"
#define INSTALL_MYSQLDATADIR "/data"
#define INSTALL_MYSQLKEYRINGDIR "/keyring"
/* #undef INSTALL_PLUGINTESTDIR */
#define INSTALL_INFODIR "/docs"
#define INSTALL_MYSQLTESTDIR "/mysql-test"
#define INSTALL_DOCREADMEDIR "/."
#define INSTALL_DOCDIR "/docs"
#define INSTALL_MANDIR "/man"
#define INSTALL_SUPPORTFILESDIR "/support-files"
#define INSTALL_LIBDIR "/lib"
/*
* Readline
*/
/* #undef HAVE_MBSTATE_T */
/* #undef HAVE_LANGINFO_CODESET */
/* #undef HAVE_WCSDUP */
/* #undef HAVE_WCHAR_T */
/* #undef HAVE_WINT_T */
/* #undef HAVE_CURSES_H */
/* #undef HAVE_NCURSES_H */
/* #undef USE_LIBEDIT_INTERFACE */
/* #undef HAVE_HIST_ENTRY */
/* #undef USE_NEW_EDITLINE_INTERFACE */
/*
* Libedit
*/
/* #undef HAVE_DECL_TGOTO */
/*
* DTrace
*/
/* #undef HAVE_DTRACE */
/*
* Character sets
*/
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
#define HAVE_CHARSET_armscii8 1
#define HAVE_CHARSET_ascii 1
#define HAVE_CHARSET_big5 1
#define HAVE_CHARSET_cp1250 1
#define HAVE_CHARSET_cp1251 1
#define HAVE_CHARSET_cp1256 1
#define HAVE_CHARSET_cp1257 1
#define HAVE_CHARSET_cp850 1
#define HAVE_CHARSET_cp852 1
#define HAVE_CHARSET_cp866 1
#define HAVE_CHARSET_cp932 1
#define HAVE_CHARSET_dec8 1
#define HAVE_CHARSET_eucjpms 1
#define HAVE_CHARSET_euckr 1
#define HAVE_CHARSET_gb2312 1
#define HAVE_CHARSET_gbk 1
#define HAVE_CHARSET_gb18030 1
#define HAVE_CHARSET_geostd8 1
#define HAVE_CHARSET_greek 1
#define HAVE_CHARSET_hebrew 1
#define HAVE_CHARSET_hp8 1
#define HAVE_CHARSET_keybcs2 1
#define HAVE_CHARSET_koi8r 1
#define HAVE_CHARSET_koi8u 1
#define HAVE_CHARSET_latin1 1
#define HAVE_CHARSET_latin2 1
#define HAVE_CHARSET_latin5 1
#define HAVE_CHARSET_latin7 1
#define HAVE_CHARSET_macce 1
#define HAVE_CHARSET_macroman 1
#define HAVE_CHARSET_sjis 1
#define HAVE_CHARSET_swe7 1
#define HAVE_CHARSET_tis620 1
#define HAVE_CHARSET_ucs2 1
#define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8mb4 1
/* #undef HAVE_CHARSET_utf8mb3 */
#define HAVE_CHARSET_utf8 1
#define HAVE_CHARSET_utf16 1
#define HAVE_CHARSET_utf32 1
#define HAVE_UCA_COLLATIONS 1
/*
* Feature set
*/
#define WITH_PARTITION_STORAGE_ENGINE 1
/*
* Performance schema
*/
/* #undef WITH_PERFSCHEMA_STORAGE_ENGINE */
/* #undef DISABLE_PSI_THREAD */
/* #undef DISABLE_PSI_MUTEX */
/* #undef DISABLE_PSI_RWLOCK */
/* #undef DISABLE_PSI_COND */
/* #undef DISABLE_PSI_FILE */
/* #undef DISABLE_PSI_TABLE */
/* #undef DISABLE_PSI_SOCKET */
/* #undef DISABLE_PSI_STAGE */
/* #undef DISABLE_PSI_STATEMENT */
/* #undef DISABLE_PSI_SP */
/* #undef DISABLE_PSI_PS */
/* #undef DISABLE_PSI_IDLE */
/* #undef DISABLE_PSI_STATEMENT_DIGEST */
/* #undef DISABLE_PSI_METADATA */
/* #undef DISABLE_PSI_MEMORY */
/* #undef DISABLE_PSI_TRANSACTION */
/*
* syscall
*/
/* #undef HAVE_SYS_THREAD_SELFID */
/* #undef HAVE_SYS_GETTID */
/* #undef HAVE_PTHREAD_GETTHREADID_NP */
/* #undef HAVE_PTHREAD_SETNAME_NP */
/* #undef HAVE_INTEGER_PTHREAD_SELF */
/* Platform-specific C++ compiler behaviors we rely upon */
/*
This macro defines whether the compiler in use needs a 'typename' keyword
to access the types defined inside a class template, such types are called
dependent types. Some compilers require it, some others forbid it, and some
others may work with or without it. For example, GCC requires the 'typename'
keyword whenever needing to access a type inside a template, but msvc
forbids it.
*/
#define HAVE_IMPLICIT_DEPENDENT_NAME_TYPING 1
/*
* MySQL version
*/
#define DOT_FRM_VERSION 6
#define MYSQL_VERSION_MAJOR 6
#define MYSQL_VERSION_MINOR 1
#define MYSQL_VERSION_PATCH 9
#define MYSQL_VERSION_EXTRA ""
#define PACKAGE "mysql"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "MySQL Server"
#define PACKAGE_STRING "MySQL Server 6.1.9"
#define PACKAGE_TARNAME "mysql"
#define PACKAGE_VERSION "6.1.9"
#define VERSION "6.1.9"
#define PROTOCOL_VERSION 10
/*
* CPU info
*/
#define CPU_LEVEL1_DCACHE_LINESIZE 64
/*
* NDB
*/
/* #undef WITH_NDBCLUSTER_STORAGE_ENGINE */
/* #undef HAVE_PTHREAD_SETSCHEDPARAM */
/*
* Other
*/
/* #undef EXTRA_DEBUG */
/* #undef HAVE_CHOWN */
/*
* Hardcoded values needed by libevent/NDB/memcached
*/
#define HAVE_FCNTL_H 1
#define HAVE_GETADDRINFO 1
#define HAVE_INTTYPES_H 1
/* libevent's select.c is not Windows compatible */
#ifndef _WIN32
#define HAVE_SELECT 1
#endif
#define HAVE_SIGNAL_H 1
#define HAVE_STDARG_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRDUP 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOLL 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define SIZEOF_CHAR 1
/*
* Needed by libevent
*/
/* #undef HAVE_SOCKLEN_T */
/* For --secure-file-priv */
#define DEFAULT_SECURE_FILE_PRIV_DIR "NULL"
#define DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR "NULL"
/* #undef HAVE_LIBNUMA */
/* For default value of --early_plugin_load */
/* #undef DEFAULT_EARLY_PLUGIN_LOAD */
#endif

View File

@@ -1,9 +1,8 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,90 +11,235 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _dbug_h
#define _dbug_h
#ifndef MY_DBUG_INCLUDED
#define MY_DBUG_INCLUDED
#ifdef __cplusplus
#include "my_global.h" /* MYSQL_PLUGIN_IMPORT */
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(DBUG_OFF) && !defined(_lint)
extern int _db_on_,_no_db_;
extern FILE *_db_fp_;
extern char *_db_process_;
extern int _db_keyword_(const char *keyword);
extern int _db_strict_keyword_(const char *keyword);
extern void _db_setjmp_(void);
extern void _db_longjmp_(void);
extern void _db_push_(const char *control);
extern void _db_pop_(void);
extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
const char **_sfunc_,const char **_sfile_,
uint *_slevel_, char ***);
extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
uint *_slevel_);
extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ _VARARGS((const char *format,...));
extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
uint length);
extern void _db_output_(uint flag);
extern void _db_lock_file(void);
extern void _db_unlock_file(void);
#if !defined(DBUG_OFF)
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
char **_db_framep_; \
_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
&_db_framep_)
#define DBUG_LEAVE \
(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
#define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
struct _db_stack_frame_ {
const char *func; /* function name of the previous stack frame */
const char *file; /* filename of the function of previous frame */
uint level; /* this nesting level, highest bit enables tracing */
struct _db_stack_frame_ *prev; /* pointer to the previous frame */
};
struct _db_code_state_;
extern MYSQL_PLUGIN_IMPORT my_bool _dbug_on_;
extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int);
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
extern int _db_explain_init_(char *buf, size_t len);
extern int _db_is_pushed_(void);
extern void _db_setjmp_(void);
extern void _db_longjmp_(void);
extern void _db_process_(const char *name);
extern void _db_push_(const char *control);
extern void _db_pop_(void);
extern void _db_set_(const char *control);
extern void _db_set_init_(const char *control);
extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
struct _db_stack_frame_ *_stack_frame_);
extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_);
extern void _db_pargs_(uint _line_,const char *keyword);
extern int _db_enabled_();
extern void _db_doprnt_(const char *format,...)
MY_ATTRIBUTE((format(printf, 1, 2)));
extern void _db_doputs_(const char *log);
extern void _db_dump_(uint _line_,const char *keyword,
const unsigned char *memory, size_t length);
extern void _db_end_(void);
extern void _db_lock_file_(void);
extern void _db_unlock_file_(void);
extern FILE *_db_fp_(void);
extern void _db_flush_();
extern const char* _db_get_func_(void);
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \
_db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
#define DBUG_LEAVE _db_return_ (__LINE__, &_db_stack_frame_)
#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
#define DBUG_EXECUTE(keyword,a1) \
{if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0)
#define DBUG_EXECUTE_IF(keyword,a1) \
do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0)
#define DBUG_EVALUATE(keyword,a1,a2) \
(_db_keyword_(0,(keyword), 0) ? (a1) : (a2))
#define DBUG_EVALUATE_IF(keyword,a1,a2) \
(_db_keyword_(0,(keyword), 1) ? (a1) : (a2))
#define DBUG_PRINT(keyword,arglist) \
{if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
do \
{ \
if (_dbug_on_) \
{ \
_db_pargs_(__LINE__,keyword); \
if (_db_enabled_()) \
{ \
_db_doprnt_ arglist; \
} \
} \
} while(0)
/*
An alternate to DBUG_PRINT() macro, which takes a single string
as the second argument.
*/
#define DBUG_PUTS(keyword,arg) \
do \
{ \
if (_dbug_on_) \
{ \
_db_pargs_(__LINE__,keyword); \
if (_db_enabled_()) \
{ \
_db_doputs_(arg); \
} \
} \
} while(0)
#define DBUG_PUSH(a1) _db_push_ (a1)
#define DBUG_POP() _db_pop_ ()
#define DBUG_PROCESS(a1) (_db_process_ = a1)
#define DBUG_FILE (_db_fp_)
#define DBUG_SET(a1) _db_set_ (a1)
#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
#define DBUG_PROCESS(a1) _db_process_(a1)
#define DBUG_FILE _db_fp_()
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
#define DBUG_DUMP(keyword,a1,a2)\
{if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
#define DEBUGGER_OFF _no_db_=1;_db_on_=0;
#define DEBUGGER_ON _no_db_=0
#define DBUG_LOCK_FILE { _db_lock_file(); }
#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
#define DBUG_OUTPUT(A) { _db_output_(A); }
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
#define DBUG_END() _db_end_ ()
#define DBUG_LOCK_FILE _db_lock_file_()
#define DBUG_UNLOCK_FILE _db_unlock_file_()
#define DBUG_ASSERT(A) assert(A)
#define DBUG_EXECUTE_IF(keyword,a1) \
{if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}}
#else /* No debugger */
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
#ifndef _WIN32
#define DBUG_ABORT() (_db_flush_(), abort())
#else
/*
Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
call abort() instead of _exit(2) (now it would cause a "test signal" popup).
*/
#include <crtdbg.h>
#define DBUG_ABORT() (_db_flush_(),\
(void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
(void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
_exit(2))
#endif
#define DBUG_CHECK_CRASH(func, op) \
do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \
DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0)
#define DBUG_CRASH_ENTER(func) \
DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter")
#define DBUG_CRASH_RETURN(val) \
DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return")
#define DBUG_CRASH_VOID_RETURN \
DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return")
/*
Make the program fail, without creating a core file.
abort() will send SIGABRT which (most likely) generates core.
Use SIGKILL instead, which cannot be caught.
We also pause the current thread, until the signal is actually delivered.
An alternative would be to use _exit(EXIT_FAILURE),
but then valgrind would report lots of memory leaks.
*/
#ifdef _WIN32
#define DBUG_SUICIDE() DBUG_ABORT()
#else
extern void _db_suicide_();
extern void _db_flush_gcov_();
#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
#endif
#else /* No debugger */
#define DBUG_ENTER(a1)
#define DBUG_RETURN(a1) return(a1)
#define DBUG_VOID_RETURN return
#define DBUG_EXECUTE(keyword,a1) {}
#define DBUG_EXECUTE_IF(keyword,a1) {}
#define DBUG_PRINT(keyword,arglist) {}
#define DBUG_PUSH(a1) {}
#define DBUG_POP() {}
#define DBUG_PROCESS(a1) {}
#define DBUG_LEAVE
#define DBUG_RETURN(a1) do { return(a1); } while(0)
#define DBUG_VOID_RETURN do { return; } while(0)
#define DBUG_EXECUTE(keyword,a1) do { } while(0)
#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
#define DBUG_EVALUATE(keyword,a1,a2) (a2)
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
#define DBUG_PRINT(keyword,arglist) do { } while(0)
#define DBUG_PUTS(keyword,arg) do { } while(0)
#define DBUG_LOG(keyword,arglist) do { } while(0)
#define DBUG_PUSH(a1) do { } while(0)
#define DBUG_SET(a1) do { } while(0)
#define DBUG_SET_INITIAL(a1) do { } while(0)
#define DBUG_POP() do { } while(0)
#define DBUG_PROCESS(a1) do { } while(0)
#define DBUG_SETJMP(a1) setjmp(a1)
#define DBUG_LONGJMP(a1) longjmp(a1)
#define DBUG_DUMP(keyword,a1,a2) do { } while(0)
#define DBUG_END() do { } while(0)
#define DBUG_ASSERT(A) do { } while(0)
#define DBUG_LOCK_FILE do { } while(0)
#define DBUG_FILE (stderr)
#define DBUG_SETJMP setjmp
#define DBUG_LONGJMP longjmp
#define DBUG_DUMP(keyword,a1,a2) {}
#define DBUG_IN_USE 0
#define DEBUGGER_OFF
#define DEBUGGER_ON
#define DBUG_LOCK_FILE
#define DBUG_UNLOCK_FILE
#define DBUG_OUTPUT(A)
#define DBUG_ASSERT(A) {}
#define DBUG_UNLOCK_FILE do { } while(0)
#define DBUG_EXPLAIN(buf,len)
#define DBUG_EXPLAIN_INITIAL(buf,len)
#define DEBUGGER_OFF do { } while(0)
#define DEBUGGER_ON do { } while(0)
#define DBUG_ABORT() do { } while(0)
#define DBUG_CRASH_ENTER(func)
#define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
#define DBUG_SUICIDE() do { } while(0)
#endif
#ifdef EXTRA_DEBUG
/**
Sync points allow us to force the server to reach a certain line of code
and block there until the client tells the server it is ok to go on.
The client tells the server to block with SELECT GET_LOCK()
and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
concurrency problems
*/
#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
debug_sync_point(lock_name,lock_timeout)
void debug_sync_point(const char* lock_name, uint lock_timeout);
#else
#define DBUG_SYNC_POINT(lock_name,lock_timeout)
#endif /* EXTRA_DEBUG */
#ifdef __cplusplus
}
#endif
#endif
#ifdef __cplusplus
#if !defined(DBUG_OFF)
#include <sstream>
/*
A C++ interface to the DBUG_PUTS macro. The DBUG_LOG macro also
takes two arguments. The first argument is the keyword, as that of the
DBUG_PRINT. The 2nd argument 'v' will be passed to a C++ output stream.
This enables the use of C++ style output stream operator. In the code, it
will be used as follows:
DBUG_LOG("blob", "space: " << space_id);
Note: DBUG_PRINT() has a limitation of 1024 bytes for a single
print out. This limitation is not there for DBUG_PUTS and DBUG_LOG
macros.
*/
#define DBUG_LOG(keyword, v) do { \
std::ostringstream sout; \
sout << v; \
DBUG_PUTS(keyword, sout.str().c_str()); \
} while(0)
#endif /* DBUG_OFF */
#endif /* __cplusplus */
#endif /* MY_DBUG_INCLUDED */

93
3rdparty/mysql/include/my_dir.h vendored Normal file
View File

@@ -0,0 +1,93 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MY_DIR_H
#define MY_DIR_H
#include "my_global.h"
#include <sys/stat.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Defines for my_dir and my_stat */
#ifdef _WIN32
#define S_IROTH _S_IREAD
#define S_IFIFO _S_IFIFO
#endif
#define MY_S_IFMT S_IFMT /* type of file */
#define MY_S_IFDIR S_IFDIR /* directory */
#define MY_S_IFCHR S_IFCHR /* character special */
#define MY_S_IFBLK S_IFBLK /* block special */
#define MY_S_IFREG S_IFREG /* regular */
#define MY_S_IFIFO S_IFIFO /* fifo */
#define MY_S_ISUID S_ISUID /* set user id on execution */
#define MY_S_ISGID S_ISGID /* set group id on execution */
#define MY_S_ISVTX S_ISVTX /* save swapped text even after use */
#define MY_S_IREAD S_IREAD /* read permission, owner */
#define MY_S_IWRITE S_IWRITE /* write permission, owner */
#define MY_S_IEXEC S_IEXEC /* execute/search permission, owner */
#define MY_S_ISDIR(m) (((m) & MY_S_IFMT) == MY_S_IFDIR)
#define MY_S_ISCHR(m) (((m) & MY_S_IFMT) == MY_S_IFCHR)
#define MY_S_ISBLK(m) (((m) & MY_S_IFMT) == MY_S_IFBLK)
#define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG)
#define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO)
#define MY_DONT_SORT 512 /* my_lib; Don't sort files */
#define MY_WANT_STAT 1024 /* my_lib; stat files */
/* typedefs for my_dir & my_stat */
#if(_MSC_VER)
#define MY_STAT struct _stati64 /* 64 bit file size */
#else
#define MY_STAT struct stat /* Orginal struct have what we need */
#endif
/* Struct describing one file returned from my_dir */
typedef struct fileinfo
{
char *name;
MY_STAT *mystat;
} FILEINFO;
typedef struct st_my_dir /* Struct returned from my_dir */
{
/*
These members are just copies of parts of DYNAMIC_ARRAY structure,
which is allocated right after the end of MY_DIR structure (MEM_ROOT
for storing names is also resides there). We've left them here because
we don't want to change code that uses my_dir.
*/
struct fileinfo *dir_entry;
uint number_off_files;
} MY_DIR;
extern MY_DIR *my_dir(const char *path,myf MyFlags);
extern void my_dirend(MY_DIR *buffer);
extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags);
extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags);
#ifdef __cplusplus
}
#endif
#endif /* MY_DIR_H */

149
3rdparty/mysql/include/my_getopt.h vendored Normal file
View File

@@ -0,0 +1,149 @@
/*
Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _my_getopt_h
#define _my_getopt_h
#include "my_sys.h" /* loglevel */
C_MODE_START
#define GET_NO_ARG 1
#define GET_BOOL 2
#define GET_INT 3
#define GET_UINT 4
#define GET_LONG 5
#define GET_ULONG 6
#define GET_LL 7
#define GET_ULL 8
#define GET_STR 9
#define GET_STR_ALLOC 10
#define GET_DISABLED 11
#define GET_ENUM 12
#define GET_SET 13
#define GET_DOUBLE 14
#define GET_FLAGSET 15
#define GET_PASSWORD 16
#if SIZEOF_INT == 4
#define GET_INT32 GET_INT
#define GET_UINT32 GET_UINT
#elif SIZEOF_LONG == 4
#define GET_INT32 GET_LONG
#define GET_UINT32 GET_ULONG
#else
#error Neither int or long is of 4 bytes width
#endif
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
/**
Enumeration of the my_option::arg_type attributes.
It should be noted that for historical reasons variables with the combination
arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts
arguments. This is someone counter intuitive and care should be taken
if the code is refactored.
*/
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
struct st_typelib;
struct my_option
{
const char *name; /**< Name of the option. name=NULL
marks the end of the my_option[]
array.
*/
int id; /**< For 0<id<=255 it's means one
character for a short option
(like -A), if >255 no short option
is created, but a long option still
can be identified uniquely in the
my_get_one_option() callback.
If an opton needs neither special
treatment in the my_get_one_option()
nor one-letter short equivalent
use id=0.
id=-1 is a special case and is used
to generate deprecation warnings for
plugin options. It should not be
used for anything else.
*/
const char *comment; /**< option comment, for autom. --help.
if it's NULL the option is not
visible in --help.
*/
void *value; /**< A pointer to the variable value */
void *u_max_value; /**< The user def. max variable value */
struct st_typelib *typelib; /**< Pointer to possible values */
ulong var_type; /**< GET_BOOL, GET_ULL, etc */
enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */
longlong def_value; /**< Default value */
longlong min_value; /**< Min allowed value (for numbers) */
ulonglong max_value; /**< Max allowed value (for numbers) */
longlong sub_size; /**< Unused */
long block_size; /**< Value should be a mult. of this (for numbers) */
void *app_type; /**< To be used by an application */
};
typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
/**
Used to retrieve a reference to the object (variable) that holds the value
for the given option. For example, if var_type is GET_UINT, the function
must return a pointer to a variable of type uint. A argument is stored in
the location pointed to by the returned pointer.
*/
typedef void *(*my_getopt_value)(const char *, size_t, const struct my_option *,
int *);
extern char *disabled_my_option;
extern my_bool my_getopt_print_errors;
extern my_bool my_getopt_skip_unknown;
extern my_error_reporter my_getopt_error_reporter;
extern int handle_options (int *argc, char ***argv,
const struct my_option *longopts, my_get_one_option);
extern int my_handle_options (int *argc, char ***argv,
const struct my_option *longopts,
my_get_one_option,
const char **command_list, my_bool ignore_unknown_option);
extern void print_cmdline_password_warning();
extern void my_cleanup_options(const struct my_option *options);
extern void my_cleanup_options(const struct my_option *options);
extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options);
extern void my_print_variables_ex(const struct my_option *options, FILE* file);
extern void my_getopt_register_get_addr(my_getopt_value);
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
my_bool *fix);
longlong getopt_ll_limit_value(longlong, const struct my_option *,
my_bool *fix);
double getopt_double_limit_value(double num, const struct my_option *optp,
my_bool *fix);
my_bool getopt_compare_strings(const char *s, const char *t, uint length);
ulonglong max_of_int_range(int var_type);
ulonglong getopt_double2ulonglong(double);
double getopt_ulonglong2double(ulonglong);
C_MODE_END
#endif /* _my_getopt_h */

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,8 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _list_h_
#define _list_h_
@@ -34,11 +33,11 @@ extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *);
extern int list_walk(LIST *,list_walk_action action,gptr argument);
extern int list_walk(LIST *,list_walk_action action,unsigned char * argument);
#define list_rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a))
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); }
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); }
#ifdef __cplusplus
}

View File

@@ -1,717 +0,0 @@
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Defines to make different thread packages compatible */
#ifndef _my_pthread_h
#define _my_pthread_h
#include <errno.h>
#ifndef ETIME
#define ETIME ETIMEDOUT /* For FreeBSD */
#endif
#ifdef __cplusplus
#define EXTERNC extern "C"
extern "C" {
#else
#define EXTERNC
#endif /* __cplusplus */
#if defined(__WIN__) || defined(OS2)
#ifdef OS2
typedef ULONG HANDLE;
typedef ULONG DWORD;
typedef int sigset_t;
#endif
#ifdef OS2
typedef HMTX pthread_mutex_t;
#else
typedef CRITICAL_SECTION pthread_mutex_t;
#endif
typedef HANDLE pthread_t;
typedef struct thread_attr {
DWORD dwStackSize ;
DWORD dwCreatingFlag ;
int priority ;
} pthread_attr_t ;
typedef struct { int dummy; } pthread_condattr_t;
/* Implementation of posix conditions */
typedef struct st_pthread_link {
DWORD thread_id;
struct st_pthread_link *next;
} pthread_link;
typedef struct {
uint32 waiting;
#ifdef OS2
HEV semaphore;
#else
HANDLE semaphore;
#endif
} pthread_cond_t;
#ifndef OS2
struct timespec { /* For pthread_cond_timedwait() */
time_t tv_sec;
long tv_nsec;
};
#endif
typedef int pthread_mutexattr_t;
#define win_pthread_self my_thread_var->pthread_self
#ifdef OS2
#define pthread_handler_t EXTERNC void * _Optlink
typedef void * (_Optlink *pthread_handler)(void *);
#else
#define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
#endif
void win_pthread_init(void);
int win_pthread_setspecific(void *A,void *B,uint length);
int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *);
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime);
int pthread_cond_signal(pthread_cond_t *cond);
int pthread_cond_broadcast(pthread_cond_t *cond);
int pthread_cond_destroy(pthread_cond_t *cond);
int pthread_attr_init(pthread_attr_t *connect_att);
int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack);
int pthread_attr_setprio(pthread_attr_t *connect_att,int priority);
int pthread_attr_destroy(pthread_attr_t *connect_att);
struct tm *localtime_r(const time_t *timep,struct tm *tmp);
struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#ifndef OS2
#define ETIMEDOUT 145 /* Win32 doesn't have this */
#define getpid() GetCurrentThreadId()
#endif
#define pthread_self() win_pthread_self
#define HAVE_LOCALTIME_R 1
#define _REENTRANT 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#ifdef USE_TLS /* For LIBMYSQL.DLL */
#undef SAFE_MUTEX /* This will cause conflicts */
#define pthread_key(T,V) DWORD V
#define pthread_key_create(A,B) ((*A=TlsAlloc())==0xFFFFFFFF)
#define pthread_key_delete(A) TlsFree(A)
#define pthread_getspecific(A) (TlsGetValue(A))
#define my_pthread_getspecific(T,A) ((T) TlsGetValue(A))
#define my_pthread_getspecific_ptr(T,V) ((T) TlsGetValue(V))
#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V)))
#define pthread_setspecific(A,B) (!TlsSetValue((A),(B)))
#else
#define pthread_key(T,V) __declspec(thread) T V
#define pthread_key_create(A,B) pthread_dummy(0)
#define pthread_key_delete(A) pthread_dummy(0)
#define pthread_getspecific(A) (&(A))
#define my_pthread_getspecific(T,A) (&(A))
#define my_pthread_getspecific_ptr(T,V) (V)
#define my_pthread_setspecific_ptr(T,V) ((T)=(V),0)
#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))
#endif /* USE_TLS */
#define pthread_equal(A,B) ((A) == (B))
#ifdef OS2
extern int pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *);
extern int pthread_mutex_lock (pthread_mutex_t *);
extern int pthread_mutex_unlock (pthread_mutex_t *);
extern int pthread_mutex_destroy (pthread_mutex_t *);
#define my_pthread_setprio(A,B) DosSetPriority(PRTYS_THREAD,PRTYC_NOCHANGE, B, A)
#define pthread_kill(A,B) raise(B)
#define pthread_exit(A) pthread_dummy()
#else
#define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0)
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
#define pthread_mutex_trylock(A) (WaitForSingleObject((A), 0) == WAIT_TIMEOUT)
#define pthread_mutex_unlock(A) LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
#define pthread_kill(A,B) pthread_dummy(0)
#endif /* OS2 */
/* Dummy defines for easier code */
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B)
#define pthread_attr_setscope(A,B)
#define pthread_detach_this_thread()
#define pthread_condattr_init(A)
#define pthread_condattr_destroy(A)
/*Irena: compiler does not like this: */
/*#define my_pthread_getprio(pthread_t thread_id) pthread_dummy(0) */
#define my_pthread_getprio(thread_id) pthread_dummy(0)
#elif defined(HAVE_UNIXWARE7_THREADS)
#include <thread.h>
#include <synch.h>
#ifndef _REENTRANT
#define _REENTRANT
#endif
#define HAVE_NONPOSIX_SIGWAIT
#define pthread_t thread_t
#define pthread_cond_t cond_t
#define pthread_mutex_t mutex_t
#define pthread_key_t thread_key_t
typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */
#define pthread_key_create(A,B) thr_keycreate((A),(B))
#define pthread_key_delete(A) thr_keydelete(A)
#define pthread_handler_t EXTERNC void *
#define pthread_key(T,V) pthread_key_t V
void * my_pthread_getspecific_imp(pthread_key_t key);
#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,V)
#define pthread_setspecific(A,B) thr_setspecific(A,B)
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,V)
#define pthread_create(A,B,C,D) thr_create(NULL,65536L,(C),(D),THR_DETACHED,(A))
#define pthread_cond_init(a,b) cond_init((a),USYNC_THREAD,NULL)
#define pthread_cond_destroy(a) cond_destroy(a)
#define pthread_cond_signal(a) cond_signal(a)
#define pthread_cond_wait(a,b) cond_wait((a),(b))
#define pthread_cond_timedwait(a,b,c) cond_timedwait((a),(b),(c))
#define pthread_cond_broadcast(a) cond_broadcast(a)
#define pthread_mutex_init(a,b) mutex_init((a),USYNC_THREAD,NULL)
#define pthread_mutex_lock(a) mutex_lock(a)
#define pthread_mutex_unlock(a) mutex_unlock(a)
#define pthread_mutex_destroy(a) mutex_destroy(a)
#define pthread_self() thr_self()
#define pthread_exit(A) thr_exit(A)
#define pthread_equal(A,B) (((A) == (B)) ? 1 : 0)
#define pthread_kill(A,B) thr_kill((A),(B))
#define HAVE_PTHREAD_KILL
#define pthread_sigmask(A,B,C) thr_sigsetmask((A),(B),(C))
extern int my_sigwait(const sigset_t *set,int *sig);
#define pthread_detach_this_thread() pthread_dummy(0)
#define pthread_attr_init(A) pthread_dummy(0)
#define pthread_attr_destroy(A) pthread_dummy(0)
#define pthread_attr_setscope(A,B) pthread_dummy(0)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define my_pthread_setprio(A,B) pthread_dummy (0)
#define my_pthread_getprio(A) pthread_dummy (0)
#define my_pthread_attr_setprio(A,B) pthread_dummy(0)
#else /* Normal threads */
#ifdef HAVE_rts_threads
#define sigwait org_sigwait
#include <signal.h>
#undef sigwait
#endif
#include <pthread.h>
#ifndef _REENTRANT
#define _REENTRANT
#endif
#ifdef HAVE_THR_SETCONCURRENCY
#include <thread.h> /* Probably solaris */
#endif
#ifdef HAVE_SCHED_H
#include <sched.h>
#endif
#ifdef HAVE_SYNCH_H
#include <synch.h>
#endif
#if defined(__EMX__) && (!defined(EMX_PTHREAD_REV) || (EMX_PTHREAD_REV < 2))
#error Requires at least rev 2 of EMX pthreads library.
#endif
#ifdef __NETWARE__
void my_pthread_exit(void *status);
#define pthread_exit(A) my_pthread_exit(A)
#endif
extern int my_pthread_getprio(pthread_t thread_id);
#define pthread_key(T,V) pthread_key_t V
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
#define pthread_detach_this_thread()
#define pthread_handler_t EXTERNC void *
typedef void *(* pthread_handler)(void *);
/* Test first for RTS or FSU threads */
#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM)
#define HAVE_rts_threads
extern int my_pthread_create_detached;
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define PTHREAD_CREATE_DETACHED &my_pthread_create_detached
#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL
#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_LOCAL
#define USE_ALARM_THREAD
#elif defined(HAVE_mit_thread)
#define USE_ALARM_THREAD
#undef HAVE_LOCALTIME_R
#define HAVE_LOCALTIME_R
#undef HAVE_GMTIME_R
#define HAVE_GMTIME_R
#undef HAVE_PTHREAD_ATTR_SETSCOPE
#define HAVE_PTHREAD_ATTR_SETSCOPE
#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE /* If we are running linux */
#undef HAVE_RWLOCK_T
#undef HAVE_RWLOCK_INIT
#undef HAVE_PTHREAD_RWLOCK_RDLOCK
#undef HAVE_SNPRINTF
#define my_pthread_attr_setprio(A,B)
#endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */
#if defined(_BSDI_VERSION) && _BSDI_VERSION < 199910
int sigwait(sigset_t *set, int *sig);
#endif
#ifndef HAVE_NONPOSIX_SIGWAIT
#define my_sigwait(A,B) sigwait((A),(B))
#else
int my_sigwait(const sigset_t *set,int *sig);
#endif
#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
#ifndef SAFE_MUTEX
#define pthread_mutex_init(a,b) my_pthread_mutex_init((a),(b))
extern int my_pthread_mutex_init(pthread_mutex_t *mp,
const pthread_mutexattr_t *attr);
#endif /* SAFE_MUTEX */
#define pthread_cond_init(a,b) my_pthread_cond_init((a),(b))
extern int my_pthread_cond_init(pthread_cond_t *mp,
const pthread_condattr_t *attr);
#endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
#if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK)
#define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C))
#endif
#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX)
int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#endif
/*
We define my_sigset() and use that instead of the system sigset() so that
we can favor an implementation based on sigaction(). On some systems, such
as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
we want to make sure that no such flags are set.
*/
#if defined(HAVE_SIGACTION) && !defined(my_sigset)
#define my_sigset(A,B) do { struct sigaction s; sigset_t set; \
sigemptyset(&set); \
s.sa_handler = (B); \
s.sa_mask = set; \
s.sa_flags = 0; \
sigaction((A), &s, (struct sigaction *) NULL); \
} while (0)
#elif defined(HAVE_SIGSET) && !defined(my_sigset)
#define my_sigset(A,B) sigset((A),(B))
#elif !defined(my_sigset)
#define my_sigset(A,B) signal((A),(B))
#endif
#ifndef my_pthread_setprio
#if defined(HAVE_PTHREAD_SETPRIO_NP) /* FSU threads */
#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B))
#elif defined(HAVE_PTHREAD_SETPRIO)
#define my_pthread_setprio(A,B) pthread_setprio((A),(B))
#else
extern void my_pthread_setprio(pthread_t thread_id,int prior);
#endif
#endif
#ifndef my_pthread_attr_setprio
#ifdef HAVE_PTHREAD_ATTR_SETPRIO
#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B))
#else
extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority);
#endif
#endif
#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS)
#define pthread_attr_setscope(A,B)
#undef HAVE_GETHOSTBYADDR_R /* No definition */
#endif
#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) && !defined(SAFE_MUTEX)
extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
pthread_mutex_t *mutex,
struct timespec *abstime);
#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
#endif
#if defined(OS2)
#define my_pthread_getspecific(T,A) ((T) &(A))
#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))
#elif !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B))
#else
#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
void *my_pthread_getspecific_imp(pthread_key_t key);
#endif /* OS2 */
#ifndef HAVE_LOCALTIME_R
struct tm *localtime_r(const time_t *clock, struct tm *res);
#endif
#ifndef HAVE_GMTIME_R
struct tm *gmtime_r(const time_t *clock, struct tm *res);
#endif
#ifdef HAVE_PTHREAD_CONDATTR_CREATE
/* DCE threads on HPUX 10.20 */
#define pthread_condattr_init pthread_condattr_create
#define pthread_condattr_destroy pthread_condattr_delete
#endif
/* FSU THREADS */
#if !defined(HAVE_PTHREAD_KEY_DELETE) && !defined(pthread_key_delete)
#define pthread_key_delete(A) pthread_dummy(0)
#endif
#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */
#define pthread_cond_destroy(A) pthread_dummy(0)
#define pthread_mutex_destroy(A) pthread_dummy(0)
#define pthread_attr_delete(A) pthread_dummy(0)
#define pthread_condattr_delete(A) pthread_dummy(0)
#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
#define pthread_equal(A,B) ((A) == (B))
#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b))
#define pthread_attr_init(A) pthread_attr_create(A)
#define pthread_attr_destroy(A) pthread_attr_delete(A)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy(0)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#endif
#ifdef HAVE_DARWIN5_THREADS
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy(0)
#define pthread_condattr_init(A) pthread_dummy(0)
#define pthread_condattr_destroy(A) pthread_dummy(0)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
#endif
#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */
#define pthread_key_create(A,B) \
pthread_keycreate(A,(B) ?\
(pthread_destructor_t) (B) :\
(pthread_destructor_t) pthread_dummy)
#define pthread_attr_init(A) pthread_attr_create(A)
#define pthread_attr_destroy(A) pthread_attr_delete(A)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#ifndef pthread_sigmask
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#endif
#define pthread_kill(A,B) pthread_dummy(0)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#define HAVE_PTHREAD_KILL
#endif
#endif /* defined(__WIN__) */
#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#undef pthread_cond_timedwait
#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c))
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime);
#endif
#if defined(HPUX10)
#define pthread_attr_getstacksize(A,B) my_pthread_attr_getstacksize(A,B)
void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
#endif
#if defined(HAVE_POSIX1003_4a_MUTEX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#undef pthread_mutex_trylock
#define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a))
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
/* safe_mutex adds checking to mutex for easier debugging */
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
#define SAFE_MUTEX_DETECT_DESTROY
#endif
typedef struct st_safe_mutex_t
{
pthread_mutex_t global,mutex;
const char *file;
uint line,count;
pthread_t thread;
#ifdef SAFE_MUTEX_DETECT_DESTROY
struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */
#endif
} safe_mutex_t;
#ifdef SAFE_MUTEX_DETECT_DESTROY
/*
Used to track the destroying of mutexes. This needs to be a seperate
structure because the safe_mutex_t structure could be freed before
the mutexes are destroyed.
*/
typedef struct st_safe_mutex_info_t
{
struct st_safe_mutex_info_t *next;
struct st_safe_mutex_info_t *prev;
const char *init_file;
uint32 init_line;
} safe_mutex_info_t;
#endif /* SAFE_MUTEX_DETECT_DESTROY */
int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
const char *file, uint line);
int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
uint line);
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
struct timespec *abstime, const char *file, uint line);
void safe_mutex_global_init(void);
void safe_mutex_end(FILE *file);
/* Wrappers if safe mutex is actually used */
#ifdef SAFE_MUTEX
#undef pthread_mutex_init
#undef pthread_mutex_lock
#undef pthread_mutex_unlock
#undef pthread_mutex_destroy
#undef pthread_mutex_wait
#undef pthread_mutex_timedwait
#undef pthread_mutex_t
#undef pthread_cond_wait
#undef pthread_cond_timedwait
#undef pthread_mutex_trylock
#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__)
#define pthread_mutex_lock(A) safe_mutex_lock((A),__FILE__,__LINE__)
#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__)
#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__)
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
#define pthread_mutex_trylock(A) pthread_mutex_lock(A)
#define pthread_mutex_t safe_mutex_t
#define safe_mutex_assert_owner(mp) \
DBUG_ASSERT((mp)->count > 0 && \
pthread_equal(pthread_self(), (mp)->thread))
#define safe_mutex_assert_not_owner(mp) \
DBUG_ASSERT(! (mp)->count || \
! pthread_equal(pthread_self(), (mp)->thread))
#else
#define safe_mutex_assert_owner(mp)
#define safe_mutex_assert_not_owner(mp)
#endif /* SAFE_MUTEX */
/* READ-WRITE thread locking */
#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */
#undef HAVE_PTHREAD_RWLOCK_RDLOCK
#undef HAVE_RWLOCK_INIT
#undef HAVE_RWLOCK_T
#endif
#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS)
/* use these defs for simple mutex locking */
#define rw_lock_t pthread_mutex_t
#define my_rwlock_init(A,B) pthread_mutex_init((A),(B))
#define rw_rdlock(A) pthread_mutex_lock((A))
#define rw_wrlock(A) pthread_mutex_lock((A))
#define rw_tryrdlock(A) pthread_mutex_trylock((A))
#define rw_trywrlock(A) pthread_mutex_trylock((A))
#define rw_unlock(A) pthread_mutex_unlock((A))
#define rwlock_destroy(A) pthread_mutex_destroy((A))
#elif defined(HAVE_PTHREAD_RWLOCK_RDLOCK)
#define rw_lock_t pthread_rwlock_t
#define my_rwlock_init(A,B) pthread_rwlock_init((A),(B))
#define rw_rdlock(A) pthread_rwlock_rdlock(A)
#define rw_wrlock(A) pthread_rwlock_wrlock(A)
#define rw_tryrdlock(A) pthread_rwlock_tryrdlock((A))
#define rw_trywrlock(A) pthread_rwlock_trywrlock((A))
#define rw_unlock(A) pthread_rwlock_unlock(A)
#define rwlock_destroy(A) pthread_rwlock_destroy(A)
#elif defined(HAVE_RWLOCK_INIT)
#ifdef HAVE_RWLOCK_T /* For example Solaris 2.6-> */
#define rw_lock_t rwlock_t
#endif
#define my_rwlock_init(A,B) rwlock_init((A),USYNC_THREAD,0)
#else
/* Use our own version of read/write locks */
typedef struct _my_rw_lock_t {
pthread_mutex_t lock; /* lock for structure */
pthread_cond_t readers; /* waiting readers */
pthread_cond_t writers; /* waiting writers */
int state; /* -1:writer,0:free,>0:readers */
int waiters; /* number of waiting writers */
} my_rw_lock_t;
#define rw_lock_t my_rw_lock_t
#define rw_rdlock(A) my_rw_rdlock((A))
#define rw_wrlock(A) my_rw_wrlock((A))
#define rw_tryrdlock(A) my_rw_tryrdlock((A))
#define rw_trywrlock(A) my_rw_trywrlock((A))
#define rw_unlock(A) my_rw_unlock((A))
#define rwlock_destroy(A) my_rwlock_destroy((A))
extern int my_rwlock_init(my_rw_lock_t *, void *);
extern int my_rwlock_destroy(my_rw_lock_t *);
extern int my_rw_rdlock(my_rw_lock_t *);
extern int my_rw_wrlock(my_rw_lock_t *);
extern int my_rw_unlock(my_rw_lock_t *);
extern int my_rw_tryrdlock(my_rw_lock_t *);
extern int my_rw_trywrlock(my_rw_lock_t *);
#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */
#define GETHOSTBYADDR_BUFF_SIZE 2048
#ifndef HAVE_THR_SETCONCURRENCY
#define thr_setconcurrency(A) pthread_dummy(0)
#endif
#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_setstacksize)
#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
#endif
/* Define mutex types, see my_thr_init.c */
#define MY_MUTEX_INIT_SLOW NULL
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
extern pthread_mutexattr_t my_fast_mutexattr;
#define MY_MUTEX_INIT_FAST &my_fast_mutexattr
#else
#define MY_MUTEX_INIT_FAST NULL
#endif
#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
extern pthread_mutexattr_t my_errorcheck_mutexattr;
#define MY_MUTEX_INIT_ERRCHK &my_errorcheck_mutexattr
#else
#define MY_MUTEX_INIT_ERRCHK NULL
#endif
extern my_bool my_thread_global_init(void);
extern void my_thread_global_end(void);
extern my_bool my_thread_init(void);
extern void my_thread_end(void);
extern const char *my_thread_name(void);
extern long my_thread_id(void);
extern int pthread_no_free(void *);
extern int pthread_dummy(int);
/* All thread specific variables are in the following struct */
#define THREAD_NAME_SIZE 10
#ifndef DEFAULT_THREAD_STACK
#if SIZEOF_CHARP > 4
/*
MySQL can survive with 32K, but some glibc libraries require > 128K stack
To resolve hostnames. Also recursive stored procedures needs stack.
*/
#define DEFAULT_THREAD_STACK (256*1024L)
#else
#define DEFAULT_THREAD_STACK (192*1024)
#endif
#endif
struct st_my_thread_var
{
int thr_errno;
pthread_cond_t suspend;
pthread_mutex_t mutex;
pthread_mutex_t * volatile current_mutex;
pthread_cond_t * volatile current_cond;
pthread_t pthread_self;
long id;
int cmp_length;
int volatile abort;
my_bool init;
struct st_my_thread_var *next,**prev;
void *opt_info;
#ifndef DBUG_OFF
gptr dbug;
char name[THREAD_NAME_SIZE+1];
#endif
};
extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
#define my_thread_var (_my_thread_var())
#define my_errno my_thread_var->thr_errno
/*
Keep track of shutdown,signal, and main threads so that my_end() will not
report errors with them
*/
extern pthread_t shutdown_th, main_th, signal_th;
/* statistics_xxx functions are for not essential statistic */
#ifndef thread_safe_increment
#ifdef HAVE_ATOMIC_ADD
#define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V)
#define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V)
#define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V)
#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V)
#else
#define thread_safe_increment(V,L) \
(pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L)))
#define thread_safe_decrement(V,L) \
(pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L)))
#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
#define thread_safe_sub(V,C,L) \
(pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
#endif /* HAVE_ATOMIC_ADD */
#ifdef SAFE_STATISTICS
#define statistic_increment(V,L) thread_safe_increment((V),(L))
#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
#else
#define statistic_decrement(V,L) (V)--
#define statistic_increment(V,L) (V)++
#define statistic_add(V,C,L) (V)+=(C)
#endif /* SAFE_STATISTICS */
#endif /* thread_safe_increment */
#ifdef __cplusplus
}
#endif
#endif /* _my_ptread_h */

File diff suppressed because it is too large Load Diff

186
3rdparty/mysql/include/my_thread.h vendored Normal file
View File

@@ -0,0 +1,186 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/* Defines to make different thread packages compatible */
#ifndef MY_THREAD_INCLUDED
#define MY_THREAD_INCLUDED
#include "my_global.h" /* my_bool */
#if !defined(_WIN32)
#include <pthread.h>
#endif
#ifndef ETIME
#define ETIME ETIMEDOUT /* For FreeBSD */
#endif
#ifndef ETIMEDOUT
#define ETIMEDOUT 145 /* Win32 doesn't have this */
#endif
/*
MySQL can survive with 32K, but some glibc libraries require > 128K stack
To resolve hostnames. Also recursive stored procedures needs stack.
*/
#if SIZEOF_CHARP > 4
#define DEFAULT_THREAD_STACK (256*1024L)
#else
#define DEFAULT_THREAD_STACK (192*1024)
#endif
#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif
C_MODE_START
#ifdef _WIN32
typedef volatile LONG my_thread_once_t;
typedef DWORD my_thread_t;
typedef struct thread_attr
{
DWORD dwStackSize;
int detachstate;
} my_thread_attr_t;
#define MY_THREAD_CREATE_JOINABLE 0
#define MY_THREAD_CREATE_DETACHED 1
typedef void * (__cdecl *my_start_routine)(void *);
#define MY_THREAD_ONCE_INIT 0
#define MY_THREAD_ONCE_INPROGRESS 1
#define MY_THREAD_ONCE_DONE 2
#else
typedef pthread_once_t my_thread_once_t;
typedef pthread_t my_thread_t;
typedef pthread_attr_t my_thread_attr_t;
#define MY_THREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE
#define MY_THREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED
typedef void *(* my_start_routine)(void *);
#define MY_THREAD_ONCE_INIT PTHREAD_ONCE_INIT
#endif
typedef struct st_my_thread_handle
{
my_thread_t thread;
#ifdef _WIN32
HANDLE handle;
#endif
} my_thread_handle;
int my_thread_once(my_thread_once_t *once_control, void (*init_routine)(void));
static inline my_thread_t my_thread_self()
{
#ifdef _WIN32
return GetCurrentThreadId();
#else
return pthread_self();
#endif
}
static inline int my_thread_equal(my_thread_t t1, my_thread_t t2)
{
#ifdef _WIN32
return t1 == t2;
#else
return pthread_equal(t1, t2);
#endif
}
static inline int my_thread_attr_init(my_thread_attr_t *attr)
{
#ifdef _WIN32
attr->dwStackSize= 0;
/* Set to joinable by default to match Linux */
attr->detachstate= MY_THREAD_CREATE_JOINABLE;
return 0;
#else
return pthread_attr_init(attr);
#endif
}
static inline int my_thread_attr_destroy(my_thread_attr_t *attr)
{
#ifdef _WIN32
attr->dwStackSize= 0;
/* Set to joinable by default to match Linux */
attr->detachstate= MY_THREAD_CREATE_JOINABLE;
return 0;
#else
return pthread_attr_destroy(attr);
#endif
}
static inline int my_thread_attr_setstacksize(my_thread_attr_t *attr,
size_t stacksize)
{
#ifdef _WIN32
attr->dwStackSize= (DWORD)stacksize;
return 0;
#else
return pthread_attr_setstacksize(attr, stacksize);
#endif
}
static inline int my_thread_attr_setdetachstate(my_thread_attr_t *attr,
int detachstate)
{
#ifdef _WIN32
attr->detachstate= detachstate;
return 0;
#else
return pthread_attr_setdetachstate(attr, detachstate);
#endif
}
static inline int my_thread_attr_getstacksize(my_thread_attr_t *attr,
size_t *stacksize)
{
#ifdef _WIN32
*stacksize= (size_t)attr->dwStackSize;
return 0;
#else
return pthread_attr_getstacksize(attr, stacksize);
#endif
}
static inline void my_thread_yield()
{
#ifdef _WIN32
SwitchToThread();
#else
sched_yield();
#endif
}
int my_thread_create(my_thread_handle *thread, const my_thread_attr_t *attr,
my_start_routine func, void *arg);
int my_thread_join(my_thread_handle *thread, void **value_ptr);
int my_thread_cancel(my_thread_handle *thread);
void my_thread_exit(void *value_ptr);
extern my_bool my_thread_global_init();
extern void my_thread_global_reinit();
extern void my_thread_global_end();
extern my_bool my_thread_init();
extern void my_thread_end();
C_MODE_END
#endif /* MY_THREAD_INCLUDED */

107
3rdparty/mysql/include/my_thread_local.h vendored Normal file
View File

@@ -0,0 +1,107 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef MY_THREAD_LOCAL_INCLUDED
#define MY_THREAD_LOCAL_INCLUDED
#ifndef _WIN32
#include <pthread.h>
#endif
struct _db_code_state_;
typedef uint32 my_thread_id;
C_MODE_START
#ifdef _WIN32
typedef DWORD thread_local_key_t;
#else
typedef pthread_key_t thread_local_key_t;
#endif
static inline int my_create_thread_local_key(thread_local_key_t *key,
void (*destructor)(void *))
{
#ifdef _WIN32
*key= TlsAlloc();
return (*key == TLS_OUT_OF_INDEXES);
#else
return pthread_key_create(key, destructor);
#endif
}
static inline int my_delete_thread_local_key(thread_local_key_t key)
{
#ifdef _WIN32
return !TlsFree(key);
#else
return pthread_key_delete(key);
#endif
}
static inline void* my_get_thread_local(thread_local_key_t key)
{
#ifdef _WIN32
return TlsGetValue(key);
#else
return pthread_getspecific(key);
#endif
}
static inline int my_set_thread_local(thread_local_key_t key,
void *value)
{
#ifdef _WIN32
return !TlsSetValue(key, value);
#else
return pthread_setspecific(key, value);
#endif
}
/**
Retrieve the MySQL thread-local storage variant of errno.
*/
int my_errno();
/**
Set the MySQL thread-local storage variant of errno.
*/
void set_my_errno(int my_errno);
#ifdef _WIN32
/*
thr_winerr is used for returning the original OS error-code in Windows,
my_osmaperr() returns EINVAL for all unknown Windows errors, hence we
preserve the original Windows Error code in thr_winerr.
*/
int thr_winerr();
void set_thr_winerr(int winerr);
#endif
#ifndef DBUG_OFF
/* Return pointer to DBUG for holding current state */
struct _db_code_state_ **my_thread_var_dbug();
my_thread_id my_thread_var_id();
void set_my_thread_var_id(my_thread_id id);
#endif
C_MODE_END
#endif // MY_THREAD_LOCAL_INCLUDED

96
3rdparty/mysql/include/my_xml.h vendored Normal file
View File

@@ -0,0 +1,96 @@
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef _my_xml_h
#define _my_xml_h
#ifdef __cplusplus
extern "C" {
#endif
#define MY_XML_OK 0
#define MY_XML_ERROR 1
/*
A flag whether to use absolute tag names in call-back functions,
like "a", "a.b" and "a.b.c" (used in character set file parser),
or relative names like "a", "b" and "c".
*/
#define MY_XML_FLAG_RELATIVE_NAMES 1
/*
A flag whether to skip normilization of text values before calling
call-back functions: i.e. skip leading/trailing spaces,
\r, \n, \t characters.
*/
#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2
enum my_xml_node_type
{
MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */
MY_XML_NODE_ATTR, /* can have TEXT children */
MY_XML_NODE_TEXT /* cannot have children */
};
typedef struct xml_stack_st
{
int flags;
enum my_xml_node_type current_node_type;
char errstr[128];
struct {
char static_buffer[128];
char *buffer;
size_t buffer_size;
char *start;
char *end;
} attr;
const char *beg;
const char *cur;
const char *end;
void *user_data;
int (*enter)(struct xml_stack_st *st,const char *val, size_t len);
int (*value)(struct xml_stack_st *st,const char *val, size_t len);
int (*leave_xml)(struct xml_stack_st *st,const char *val, size_t len);
} MY_XML_PARSER;
void my_xml_parser_create(MY_XML_PARSER *st);
void my_xml_parser_free(MY_XML_PARSER *st);
int my_xml_parse(MY_XML_PARSER *st,const char *str, size_t len);
void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
const char *,
size_t len));
void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
const char *,
size_t len));
void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
const char *,
size_t len));
void my_xml_set_user_data(MY_XML_PARSER *st, void *);
size_t my_xml_error_pos(MY_XML_PARSER *st);
uint my_xml_error_lineno(MY_XML_PARSER *st);
const char *my_xml_error_string(MY_XML_PARSER *st);
#ifdef __cplusplus
}
#endif
#endif /* _my_xml_h */

View File

@@ -1,9 +1,8 @@
/* Copyright (C) 2000-2003 MySQL AB
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,71 +11,80 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This file defines the client API to MySQL and also the ABI of the
dynamically linked libmysqlclient.
The ABI should never be changed in a released product of MySQL,
thus you need to take great care when changing the file. In case
the file is changed so the ABI is broken, you must also update
the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake
*/
#ifndef _mysql_h
#define _mysql_h
#ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */
#undef WIN
#undef _WIN
#undef _WIN32
#undef _WIN64
#undef __WIN__
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _global_h /* If not standard header */
#ifndef MY_GLOBAL_INCLUDED /* If not standard header */
#ifndef MYSQL_ABI_CHECK
#include <sys/types.h>
#ifdef __LCC__
#include <winsock.h> /* For windows */
#endif
typedef char my_bool;
#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__)
#define __WIN__
#endif
#if !defined(__WIN__)
#if !defined(_WIN32)
#define STDCALL
#else
#define STDCALL __stdcall
#endif
typedef char * gptr;
#ifndef my_socket_defined
#ifdef __WIN__
#ifdef _WIN32
#include <windows.h>
#ifdef WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#endif
#define my_socket SOCKET
#else
typedef int my_socket;
#endif /* __WIN__ */
#endif /* _WIN32 */
#endif /* my_socket_defined */
#endif /* _global_h */
#endif /* MY_GLOBAL_INCLUDED */
#include "mysql_version.h"
#include "mysql_com.h"
#include "mysql_time.h"
#include "mysql_version.h"
#include "typelib.h"
#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
/* Include declarations of plug-in API */
#include "mysql/client_plugin.h"
/*
Declare my_init() here because it is a documented C API function exported
from the client library. No need to include whole my_sys.h, however.
*/
my_bool my_init(void);
extern unsigned int mysql_port;
extern char *mysql_unix_port;
#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
#ifdef __NETWARE__
#pragma pack(push, 8) /* 8 byte alignment */
#endif
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR || (t) == FIELD_TYPE_NEWDECIMAL)
#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == FIELD_TYPE_YEAR)
/**
Returns true if the value is a number which does not need quotes for
the sql_lex.cc parser to parse correctly.
*/
#define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING)
typedef struct st_mysql_field {
@@ -100,21 +108,22 @@ typedef struct st_mysql_field {
unsigned int decimals; /* Number of decimals in field */
unsigned int charsetnr; /* Character set */
enum enum_field_types type; /* Type of field. See mysql_com.h for types */
void *extension;
} MYSQL_FIELD;
typedef char **MYSQL_ROW; /* return data as array of strings */
typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
#ifndef _global_h
#if defined(NO_CLIENT_LONG_LONG)
typedef unsigned long my_ulonglong;
#elif defined (__WIN__)
#ifndef MY_GLOBAL_INCLUDED
#if defined (_WIN32)
typedef unsigned __int64 my_ulonglong;
#else
typedef unsigned long long my_ulonglong;
#endif
#endif
#include "typelib.h"
#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0)
/* backward compatibility define - to be removed eventually */
@@ -132,15 +141,16 @@ typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
typedef struct st_mysql_data {
MYSQL_ROWS *data;
struct embedded_query_result *embedded_info;
MEM_ROOT alloc;
my_ulonglong rows;
unsigned int fields;
MYSQL_ROWS *data;
MEM_ROOT alloc;
/* extra info for embedded library */
struct embedded_query_result *embedded_info;
void *extension;
} MYSQL_DATA;
enum mysql_option
enum mysql_option
{
MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
@@ -149,9 +159,29 @@ enum mysql_option
MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
MYSQL_OPT_BIND,
MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT,
MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER,
MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH,
MYSQL_OPT_CONNECT_ATTR_RESET, MYSQL_OPT_CONNECT_ATTR_ADD,
MYSQL_OPT_CONNECT_ATTR_DELETE,
MYSQL_SERVER_PUBLIC_KEY,
MYSQL_ENABLE_CLEARTEXT_PLUGIN,
MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
MYSQL_OPT_SSL_ENFORCE,
MYSQL_OPT_MAX_ALLOWED_PACKET, MYSQL_OPT_NET_BUFFER_LENGTH,
MYSQL_OPT_TLS_VERSION,
MYSQL_OPT_SSL_MODE
};
/**
@todo remove the "extension", move st_mysql_options completely
out of mysql.h
*/
struct st_mysql_options_extention;
struct st_mysql_options {
unsigned int connect_timeout, read_timeout, write_timeout;
unsigned int port, protocol;
@@ -166,30 +196,28 @@ struct st_mysql_options {
char *ssl_cipher; /* cipher to use */
char *shared_memory_base_name;
unsigned long max_allowed_packet;
my_bool use_ssl; /* if to use SSL or not */
my_bool use_ssl; /* Deprecated ! Former use_ssl */
my_bool compress,named_pipe;
/*
On connect, find out the replication role of the server, and
establish connections to all the peers
*/
my_bool rpl_probe;
/*
Each call to mysql_real_query() will parse it to tell if it is a read
or a write, and direct it to the slave or the master
*/
my_bool rpl_parse;
/*
If set, never read from a master, only from slave, when doing
a read that is replication-aware
*/
my_bool no_master_reads;
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
my_bool separate_thread;
#endif
my_bool unused1;
my_bool unused2;
my_bool unused3;
my_bool unused4;
enum mysql_option methods_to_use;
char *client_ip;
/* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
my_bool secure_auth;
union {
/*
The ip/hostname to use when authenticating
client against embedded server built with
grant tables - only used in embedded server
*/
char *client_ip;
/*
The local address to bind when connecting to
remote server - not used in embedded server
*/
char *bind_address;
} ci;
my_bool unused5;
/* 0 - never report, 1 - always report (default) */
my_bool report_data_truncation;
@@ -199,26 +227,25 @@ struct st_mysql_options {
void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, unsigned int);
void *local_infile_userdata;
struct st_mysql_options_extention *extension;
};
enum mysql_status
enum mysql_status
{
MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT
MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT,
MYSQL_STATUS_STATEMENT_GET_RESULT
};
enum mysql_protocol_type
enum mysql_protocol_type
{
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
/*
There are three types of queries - the ones that have to go to
the master, the ones that go to a slave, and the adminstrative
type which must happen on the pivot connectioin
*/
enum mysql_rpl_type
enum mysql_ssl_mode
{
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
SSL_MODE_DISABLED= 1, SSL_MODE_PREFERRED, SSL_MODE_REQUIRED,
SSL_MODE_VERIFY_CA, SSL_MODE_VERIFY_IDENTITY
};
typedef struct character_set
@@ -234,13 +261,14 @@ typedef struct character_set
} MY_CHARSET_INFO;
struct st_mysql_methods;
struct st_mysql_stmt;
typedef struct st_mysql
{
NET net; /* Communication parameters */
gptr connector_fd; /* ConnectorFd for SSL */
char *host,*user,*passwd,*unix_socket,*server_version,*host_info,*info;
char *db;
unsigned char *connector_fd; /* ConnectorFd for SSL */
char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
char *info, *db;
struct charset_info_st *charset;
MYSQL_FIELD *fields;
MEM_ROOT field_alloc;
@@ -263,85 +291,57 @@ typedef struct st_mysql
/* session-wide random string */
char scramble[SCRAMBLE_LENGTH+1];
/*
Set if this is the original connection, not a master or a slave we have
added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave()
*/
my_bool rpl_pivot;
/*
Pointers to the master, and the next slave connections, points to
itself if lone connection.
*/
struct st_mysql* master, *next_slave;
struct st_mysql* last_used_slave; /* needed for round-robin slave pick */
/* needed for send/read/store/use result to work correctly with replication */
struct st_mysql* last_used_con;
my_bool unused1;
void *unused2, *unused3, *unused4, *unused5;
LIST *stmts; /* list of all statements */
const struct st_mysql_methods *methods;
void *thd;
/*
Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag
Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag
from mysql_stmt_close if close had to cancel result set of this object.
*/
my_bool *unbuffered_fetch_owner;
#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100
/* needed for embedded server - no net buffer to store the 'info' */
char *info_buffer;
#endif
void *extension;
} MYSQL;
typedef struct st_mysql_res {
my_ulonglong row_count;
my_ulonglong row_count;
MYSQL_FIELD *fields;
MYSQL_DATA *data;
MYSQL_ROWS *data_cursor;
unsigned long *lengths; /* column lengths of current row */
MYSQL *handle; /* for unbuffered reads */
MEM_ROOT field_alloc;
unsigned int field_count, current_field;
const struct st_mysql_methods *methods;
MYSQL_ROW row; /* If unbuffered read */
MYSQL_ROW current_row; /* buffer to current row */
MEM_ROOT field_alloc;
unsigned int field_count, current_field;
my_bool eof; /* Used by mysql_fetch_row */
/* mysql_stmt_close() had to cancel this result */
my_bool unbuffered_fetch_cancelled;
const struct st_mysql_methods *methods;
my_bool unbuffered_fetch_cancelled;
void *extension;
} MYSQL_RES;
#define MAX_MYSQL_MANAGER_ERR 256
#define MAX_MYSQL_MANAGER_MSG 256
#define MANAGER_OK 200
#define MANAGER_INFO 250
#define MANAGER_ACCESS 401
#define MANAGER_CLIENT_ERR 450
#define MANAGER_INTERNAL_ERR 500
#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT)
#define MYSQL_CLIENT
#endif
typedef struct st_mysql_manager
{
NET net;
char *host,*user,*passwd;
unsigned int port;
my_bool free_me;
my_bool eof;
int cmd_status;
int last_errno;
char* net_buf,*net_buf_pos,*net_data_end;
int net_buf_size;
char last_error[MAX_MYSQL_MANAGER_ERR];
} MYSQL_MANAGER;
/*
Note: MYSQL_PARAMETERS and mysql_get_parameters() have been removed
in server 5.7. But we keep them here to not break compatibility in
Con/C 6.1 series.
*/
typedef struct st_mysql_parameters
{
unsigned long *p_max_allowed_packet;
unsigned long *p_net_buffer_length;
void *extension;
} MYSQL_PARAMETERS;
#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
@@ -349,6 +349,8 @@ typedef struct st_mysql_parameters
#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length)
#endif
MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);
/*
Set up and bring down the server; to ensure that applications will
work when linked against either the standard client library or the
@@ -356,6 +358,7 @@ typedef struct st_mysql_parameters
*/
int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void);
/*
mysql_server_init/end need to be called when using libmysqld or
libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
@@ -368,7 +371,6 @@ void STDCALL mysql_server_end(void);
#define mysql_library_init mysql_server_init
#define mysql_library_end mysql_server_end
MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);
/*
Set up and bring down a thread; these function should be called
@@ -409,7 +411,8 @@ MYSQL * STDCALL mysql_init(MYSQL *mysql);
my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql);
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
const char *passwd, const char *db);
MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
const char *user,
@@ -427,19 +430,17 @@ int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
/* perform query on master */
my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q,
unsigned long length);
my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
unsigned long length);
/* perform query on slave */
my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
unsigned long length);
my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
unsigned long length);
void STDCALL mysql_get_character_set_info(MYSQL *mysql,
MY_CHARSET_INFO *charset);
int STDCALL mysql_session_track_get_first(MYSQL *mysql,
enum enum_session_state_type type,
const char **data,
size_t *length);
int STDCALL mysql_session_track_get_next(MYSQL *mysql,
enum enum_session_state_type type,
const char **data,
size_t *length);
/* local infile support */
#define LOCAL_INFILE_ERROR_LEN 512
@@ -458,37 +459,6 @@ mysql_set_local_infile_handler(MYSQL *mysql,
void
mysql_set_local_infile_default(MYSQL *mysql);
/*
enable/disable parsing of all queries to decide if they go on master or
slave
*/
void STDCALL mysql_enable_rpl_parse(MYSQL* mysql);
void STDCALL mysql_disable_rpl_parse(MYSQL* mysql);
/* get the value of the parse flag */
int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql);
/* enable/disable reads from master */
void STDCALL mysql_enable_reads_from_master(MYSQL* mysql);
void STDCALL mysql_disable_reads_from_master(MYSQL* mysql);
/* get the value of the master read flag */
my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql);
enum mysql_rpl_type STDCALL mysql_rpl_query_type(const char* q, int len);
/* discover the master and its slaves */
my_bool STDCALL mysql_rpl_probe(MYSQL* mysql);
/* set the master, close/free the old one, if it is not a pivot */
int STDCALL mysql_set_master(MYSQL* mysql, const char* host,
unsigned int port,
const char* user,
const char* passwd);
int STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
unsigned int port,
const char* user,
const char* passwd);
int STDCALL mysql_shutdown(MYSQL *mysql,
enum mysql_enum_shutdown_level
shutdown_level);
@@ -511,7 +481,11 @@ MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);
int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
const char *arg);
const void *arg);
int STDCALL mysql_options4(MYSQL *mysql,enum mysql_option option,
const void *arg1, const void *arg2);
int STDCALL mysql_get_option(MYSQL *mysql, enum mysql_option option,
const void *arg);
void STDCALL mysql_free_result(MYSQL_RES *result);
void STDCALL mysql_data_seek(MYSQL_RES *result,
my_ulonglong offset);
@@ -531,37 +505,18 @@ unsigned long STDCALL mysql_hex_string(char *to,const char *from,
unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
char *to,const char *from,
unsigned long length);
void STDCALL mysql_debug(const char *debug);
char * STDCALL mysql_odbc_escape_string(MYSQL *mysql,
char *to,
unsigned long to_length,
const char *from,
unsigned long from_length,
void *param,
char *
(*extend_buffer)
(void *, char *to,
unsigned long *length));
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int STDCALL mysql_thread_safe(void);
my_bool STDCALL mysql_embedded(void);
MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con);
MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
const char* host,
const char* user,
const char* passwd,
unsigned int port);
void STDCALL mysql_manager_close(MYSQL_MANAGER* con);
int STDCALL mysql_manager_command(MYSQL_MANAGER* con,
const char* cmd, int cmd_len);
int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con,
char* res_buf,
int res_buf_size);
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
unsigned long STDCALL mysql_real_escape_string_quote(MYSQL *mysql,
char *to, const char *from,
unsigned long length, char quote);
void STDCALL mysql_debug(const char *debug);
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int STDCALL mysql_thread_safe(void);
my_bool STDCALL mysql_embedded(void);
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
int STDCALL mysql_reset_connection(MYSQL *mysql);
/*
The following definitions are added for the enhanced
The following definitions are added for the enhanced
client-server protocol
*/
@@ -643,26 +598,29 @@ typedef struct st_mysql_bind
void *buffer; /* buffer to get/put data */
/* set this if you want to track data truncations happened during fetch */
my_bool *error;
enum enum_field_types buffer_type; /* buffer type */
/* output buffer length, must be set when fetching str/binary */
unsigned long buffer_length;
unsigned char *row_ptr; /* for the current data position */
unsigned long offset; /* offset position for char/binary fetch */
unsigned long length_value; /* Used if length is 0 */
unsigned int param_number; /* For null count and error messages */
unsigned int pack_length; /* Internal length for packed data */
my_bool error_value; /* used if error is 0 */
my_bool is_unsigned; /* set if integer type is unsigned */
my_bool long_data_used; /* If used with mysql_send_long_data */
my_bool is_null_value; /* Used if is_null is 0 */
void (*store_param_func)(NET *net, struct st_mysql_bind *param);
void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
unsigned char **row);
void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
unsigned char **row);
/* output buffer length, must be set when fetching str/binary */
unsigned long buffer_length;
unsigned long offset; /* offset position for char/binary fetch */
unsigned long length_value; /* Used if length is 0 */
unsigned int param_number; /* For null count and error messages */
unsigned int pack_length; /* Internal length for packed data */
enum enum_field_types buffer_type; /* buffer type */
my_bool error_value; /* used if error is 0 */
my_bool is_unsigned; /* set if integer type is unsigned */
my_bool long_data_used; /* If used with mysql_send_long_data */
my_bool is_null_value; /* Used if is_null is 0 */
void *extension;
} MYSQL_BIND;
struct st_mysql_stmt_extension;
/* statement handler */
typedef struct st_mysql_stmt
{
@@ -674,15 +632,15 @@ typedef struct st_mysql_stmt
MYSQL_FIELD *fields; /* result set metadata */
MYSQL_DATA result; /* cached result set */
MYSQL_ROWS *data_cursor; /* current row in cached result */
/* copy of mysql->affected_rows after statement execution */
my_ulonglong affected_rows;
my_ulonglong insert_id; /* copy of mysql->insert_id */
/*
mysql_stmt_fetch() calls this function to fetch one row (it's different
for buffered, unbuffered and cursor fetch).
*/
int (*read_row_func)(struct st_mysql_stmt *stmt,
int (*read_row_func)(struct st_mysql_stmt *stmt,
unsigned char **row);
/* copy of mysql->affected_rows after statement execution */
my_ulonglong affected_rows;
my_ulonglong insert_id; /* copy of mysql->insert_id */
unsigned long stmt_id; /* Id for prepared statement */
unsigned long flags; /* i.e. type of cursor to open */
unsigned long prefetch_rows; /* number of rows per one COM_FETCH */
@@ -702,19 +660,20 @@ typedef struct st_mysql_stmt
my_bool bind_param_done; /* input buffers were supplied */
unsigned char bind_result_done; /* output buffers were supplied */
/* mysql_stmt_close() had to cancel this result */
my_bool unbuffered_fetch_cancelled;
my_bool unbuffered_fetch_cancelled;
/*
Is set to true if we need to calculate field->max_length for
Is set to true if we need to calculate field->max_length for
metadata fields when doing mysql_stmt_store_result.
*/
my_bool update_max_length;
my_bool update_max_length;
struct st_mysql_stmt_extension *extension;
} MYSQL_STMT;
enum enum_stmt_attr_type
{
/*
When doing mysql_stmt_store_result calculate max_length attribute
of statement metadata. This is to be consistent with the old API,
of statement metadata. This is to be consistent with the old API,
where this was done automatically.
In the new API we do that only by request because it slows down
mysql_stmt_store_result sufficiently.
@@ -733,43 +692,12 @@ enum enum_stmt_attr_type
};
typedef struct st_mysql_methods
{
my_bool (*read_query_result)(MYSQL *mysql);
my_bool (*advanced_command)(MYSQL *mysql,
enum enum_server_command command,
const char *header,
unsigned long header_length,
const char *arg,
unsigned long arg_length,
my_bool skip_check);
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
unsigned int fields);
MYSQL_RES * (*use_result)(MYSQL *mysql);
void (*fetch_lengths)(unsigned long *to,
MYSQL_ROW column, unsigned int field_count);
void (*flush_use_result)(MYSQL *mysql);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt);
int (*read_binary_rows)(MYSQL_STMT *stmt);
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
void (*free_embedded_thd)(MYSQL *mysql);
const char *(*read_statistics)(MYSQL *mysql);
my_bool (*next_result)(MYSQL *mysql);
int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
#endif
} MYSQL_METHODS;
MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
unsigned long length);
int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg,
unsigned int column,
unsigned long offset);
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
@@ -785,16 +713,16 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt);
my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt,
my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt,
unsigned int param_number,
const char *data,
const char *data,
unsigned long length);
MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt);
MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt);
unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt);
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt,
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt,
MYSQL_ROW_OFFSET offset);
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt);
void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset);
@@ -808,6 +736,7 @@ my_bool STDCALL mysql_rollback(MYSQL * mysql);
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
my_bool STDCALL mysql_more_results(MYSQL *mysql);
int STDCALL mysql_next_result(MYSQL *mysql);
int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt);
void STDCALL mysql_close(MYSQL *sock);
@@ -817,29 +746,8 @@ void STDCALL mysql_close(MYSQL *sock);
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
#ifdef USE_OLD_FUNCTIONS
MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host,
const char *user, const char *passwd);
int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
#endif
#define HAVE_MYSQL_REAL_CONNECT
/*
The following functions are mainly exported because of mysqlbinlog;
They are not for general usage
*/
#define simple_command(mysql, command, arg, length, skip_check) \
(*(mysql)->methods->advanced_command)(mysql, command, \
NullS, 0, arg, length, skip_check)
unsigned long net_safe_read(MYSQL* mysql);
#ifdef __NETWARE__
#pragma pack(pop) /* restore alignment */
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,28 @@
/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef CLIENT_AUTHENTICATION_H
#define CLIENT_AUTHENTICATION_H
#include <my_global.h>
#include "mysql.h"
#include "mysql/client_plugin.h"
C_MODE_START
int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
int sha256_password_init(char *, size_t, int, va_list);
int sha256_password_deinit(void);
C_MODE_END
#endif

View File

@@ -0,0 +1,202 @@
#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
MySQL Client Plugin API
This file defines the API for plugins that work on the client side
*/
#define MYSQL_CLIENT_PLUGIN_INCLUDED
#ifndef MYSQL_ABI_CHECK
#include <stdarg.h>
#include <stdlib.h>
#endif
/*
On Windows, exports from DLL need to be declared.
Also, plugin needs to be declared as extern "C" because MSVC
unlike other compilers, uses C++ mangling for variables not only
for functions.
*/
#undef MYSQL_PLUGIN_EXPORT
#if defined(_MSC_VER)
#if defined(MYSQL_DYNAMIC_PLUGIN)
#ifdef __cplusplus
#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
#else
#define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
#endif
#else /* MYSQL_DYNAMIC_PLUGIN */
#ifdef __cplusplus
#define MYSQL_PLUGIN_EXPORT extern "C"
#else
#define MYSQL_PLUGIN_EXPORT
#endif
#endif /*MYSQL_DYNAMIC_PLUGIN */
#else /*_MSC_VER */
#define MYSQL_PLUGIN_EXPORT
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* known plugin types */
#define MYSQL_CLIENT_reserved1 0
#define MYSQL_CLIENT_reserved2 1
#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2
#define MYSQL_CLIENT_TRACE_PLUGIN 3
#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100
#define MYSQL_CLIENT_TRACE_PLUGIN_INTERFACE_VERSION 0x0100
#define MYSQL_CLIENT_MAX_PLUGINS 4
#define mysql_declare_client_plugin(X) \
MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \
_mysql_client_plugin_declaration_ = { \
MYSQL_CLIENT_ ## X ## _PLUGIN, \
MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION,
#define mysql_end_client_plugin }
/* generic plugin header structure */
#define MYSQL_CLIENT_PLUGIN_HEADER \
int type; \
unsigned int interface_version; \
const char *name; \
const char *author; \
const char *desc; \
unsigned int version[3]; \
const char *license; \
void *mysql_api; \
int (*init)(char *, size_t, int, va_list); \
int (*deinit)(void); \
int (*options)(const char *option, const void *);
struct st_mysql_client_plugin
{
MYSQL_CLIENT_PLUGIN_HEADER
};
struct st_mysql;
/******** authentication plugin specific declarations *********/
#include "plugin_auth_common.h"
struct st_mysql_client_plugin_AUTHENTICATION
{
MYSQL_CLIENT_PLUGIN_HEADER
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
};
/******** using plugins ************/
/**
loads a plugin and initializes it
@param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded, -1 to disable type check
@param argc number of arguments to pass to the plugin initialization
function
@param ... arguments for the plugin initialization function
@retval
a pointer to the loaded plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
int argc, ...);
/**
loads a plugin and initializes it, taking va_list as an argument
This is the same as mysql_load_plugin, but take va_list instead of
a list of arguments.
@param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded, -1 to disable type check
@param argc number of arguments to pass to the plugin initialization
function
@param args arguments for the plugin initialization function
@retval
a pointer to the loaded plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
int argc, va_list args);
/**
finds an already loaded plugin by name, or loads it, if necessary
@param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded
@retval
a pointer to the plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
/**
adds a plugin structure to the list of loaded plugins
This is useful if an application has the necessary functionality
(for example, a special load data handler) statically linked into
the application binary. It can use this function to register the plugin
directly, avoiding the need to factor it out into a shared object.
@param mysql MYSQL structure. It is only used for error reporting
@param plugin an st_mysql_client_plugin structure to register
@retval
a pointer to the plugin, or NULL in case of a failure
*/
struct st_mysql_client_plugin *
mysql_client_register_plugin(struct st_mysql *mysql,
struct st_mysql_client_plugin *plugin);
/**
set plugin options
Can be used to set extra options and affect behavior for a plugin.
This function may be called multiple times to set several options
@param plugin an st_mysql_client_plugin structure
@param option a string which specifies the option to set
@param value value for the option.
@retval 0 on success, 1 in case of failure
**/
int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
const char *option, const void *value);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,39 @@
struct st_mysql_client_plugin
{
int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(void); int (*options)(const char *option, const void *);
};
struct st_mysql;
#include "plugin_auth_common.h"
typedef struct st_plugin_vio_info
{
enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
int socket;
} MYSQL_PLUGIN_VIO_INFO;
typedef struct st_plugin_vio
{
int (*read_packet)(struct st_plugin_vio *vio,
unsigned char **buf);
int (*write_packet)(struct st_plugin_vio *vio,
const unsigned char *packet,
int packet_len);
void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
} MYSQL_PLUGIN_VIO;
struct st_mysql_client_plugin_AUTHENTICATION
{
int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(void); int (*options)(const char *option, const void *);
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
};
struct st_mysql_client_plugin *
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
int argc, ...);
struct st_mysql_client_plugin *
mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
int argc, va_list args);
struct st_mysql_client_plugin *
mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
struct st_mysql_client_plugin *
mysql_client_register_plugin(struct st_mysql *mysql,
struct st_mysql_client_plugin *plugin);
int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
const char *option, const void *value);

View File

@@ -0,0 +1,36 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
** Ask for a password from tty
** This is an own file to avoid conflicts with curses
*/
#ifndef MYSQL_GET_PASSWORD_H_INCLUDED
#define MYSQL_GET_PASSWORD_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
typedef char *(* strdup_handler_t)(const char *, int);
char *get_tty_password_ext(const char *opt_message,
strdup_handler_t strdup_function);
#ifdef __cplusplus
}
#endif
#endif /* ! MYSQL_GET_PASSWORD_H_INCLUDED */

View File

@@ -0,0 +1,33 @@
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MYSQL_LEX_STRING_INCLUDED
#define MYSQL_LEX_STRING_INCLUDED
struct st_mysql_lex_string
{
char *str;
size_t length;
};
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
struct st_mysql_const_lex_string
{
const char *str;
size_t length;
};
typedef struct st_mysql_const_lex_string MYSQL_LEX_CSTRING;
#endif // MYSQL_LEX_STRING_INCLUDED

View File

@@ -0,0 +1,143 @@
#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
This file defines constants and data structures that are the same for
both client- and server-side authentication plugins.
*/
#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
/** the max allowed length for a user name */
#define MYSQL_USERNAME_LENGTH 96
/**
return values of the plugin authenticate_user() method.
*/
/**
Authentication failed, plugin internal error.
An error occurred in the authentication plugin itself.
These errors are reported in table performance_schema.host_cache,
column COUNT_AUTH_PLUGIN_ERRORS.
*/
#define CR_AUTH_PLUGIN_ERROR 3
/**
Authentication failed, client server handshake.
An error occurred during the client server handshake.
These errors are reported in table performance_schema.host_cache,
column COUNT_HANDSHAKE_ERRORS.
*/
#define CR_AUTH_HANDSHAKE 2
/**
Authentication failed, user credentials.
For example, wrong passwords.
These errors are reported in table performance_schema.host_cache,
column COUNT_AUTHENTICATION_ERRORS.
*/
#define CR_AUTH_USER_CREDENTIALS 1
/**
Authentication failed. Additionally, all other CR_xxx values
(libmysql error code) can be used too.
The client plugin may set the error code and the error message directly
in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error
code was returned, an error message in the MYSQL structure will be
overwritten. If CR_ERROR is returned without setting the error in MYSQL,
CR_UNKNOWN_ERROR will be user.
*/
#define CR_ERROR 0
/**
Authentication (client part) was successful. It does not mean that the
authentication as a whole was successful, usually it only means
that the client was able to send the user name and the password to the
server. If CR_OK is returned, the libmysql reads the next packet expecting
it to be one of OK, ERROR, or CHANGE_PLUGIN packets.
*/
#define CR_OK -1
/**
Authentication was successful.
It means that the client has done its part successfully and also that
a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN).
In this case, libmysql will not read a packet from the server,
but it will use the data at mysql->net.read_pos.
A plugin may return this value if the number of roundtrips in the
authentication protocol is not known in advance, and the client plugin
needs to read one packet more to determine if the authentication is finished
or not.
*/
#define CR_OK_HANDSHAKE_COMPLETE -2
/**
Flag to be passed back to server from authentication plugins via
authenticated_as when proxy mapping should be done by the server.
*/
#define PROXY_FLAG 0
/*
We need HANDLE definition if on Windows. Define WIN32_LEAN_AND_MEAN (if
not already done) to minimize amount of imported declarations.
*/
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif
typedef struct st_plugin_vio_info
{
enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
int socket; /**< it's set, if the protocol is SOCKET or TCP */
#ifdef _WIN32
HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */
#endif
} MYSQL_PLUGIN_VIO_INFO;
/**
Provides plugin access to communication channel
*/
typedef struct st_plugin_vio
{
/**
Plugin provides a pointer reference and this function sets it to the
contents of any incoming packet. Returns the packet length, or -1 if
the plugin should terminate.
*/
int (*read_packet)(struct st_plugin_vio *vio,
unsigned char **buf);
/**
Plugin provides a buffer with data and the length and this
function sends it as a packet. Returns 0 on success, 1 on failure.
*/
int (*write_packet)(struct st_plugin_vio *vio,
const unsigned char *packet,
int packet_len);
/**
Fills in a st_plugin_vio_info structure, providing the information
about the connection.
*/
void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
} MYSQL_PLUGIN_VIO;
#endif

View File

@@ -0,0 +1,349 @@
/* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef PLUGIN_TRACE_INCLUDED
#define PLUGIN_TRACE_INCLUDED
/**
@file
========================================================================
Declarations for client-side plugins of type MYSQL_CLIENT_TRACE_PLUGIN
========================================================================
See libmysql/mysql_trace.c for a brief description of the client-side
protocol tracing infrastructure.
*/
#include <mysql/client_plugin.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
Lists of protocol stages and trace events
=========================================
These lists are defined with PROTOCOL_STAGE_LIST() and TRACE_EVENT_LIST(),
respectively. Macros accept a disposition name as an argument.
For example, to process list of protocol stages using disposition "foo",
define protocol_stage_foo(Stage) macro and then put
PROTOCOL_STAGE_LIST(foo)
in your code. This will expand to sequence of protocol_stage_foo(X)
macros where X ranges over the list of protocol stages, and these macros
should generate the actual code. See below how this technique is used
to generate protocol_stage and trace_events enums.
*/
/**
Protocol stages
---------------
A client following the MySQL protocol goes through several stages of it. Each
stage determines what packets can be expected from the server or can be send
by the client.
Upon receiving each trace event, trace plugin will be notified of the current
protocol stage so that it can correctly interpret the event.
These are the possible protocol stages and the transitions between them.
.. digraph:: protocol_stages
CONNECTING -> WAIT_FOR_INIT_PACKET;
CONNECTING -> DISCONNECTED [ label = "failed connection" ];
WAIT_FOR_INIT_PACKET -> AUTHENTICATE;
WAIT_FOR_INIT_PACKET -> SSL_NEGOTIATION -> AUTHENTICATE;
AUTHENTICATE -> READY_FOR_COMMAND [ label = "accepted" ];
AUTHENTICATE -> DISCONNECTED [ label = "rejected" ];
READY_FOR_COMMAND -> DISCONNECTED [ label = "COM_QUIT" ];
READY_FOR_COMMAND -> AUTHENTICATE [ label="after change user" ];
READY_FOR_COMMAND -> WAIT_FOR_PACKET
[ label="wait for a single packet after, e.g., COM_STATISTICS" ];
READY_FOR_COMMAND -> WAIT_FOR_RESULT;
READY_FOR_COMMAND -> WAIT_FOR_PS_DESCRIPTION
[ label="after prepare command" ];
WAIT_FOR_PACKET -> READY_FOR_COMAND;
WAIT_FOR_RESULT -> READY_FOR_COMMAND [ label="simple reply" ];
WAIT_FOR_RESULT -> WAIT_FOR_FIELD_DEF;
WAIT_FOR_RESULT -> FILE_REQUEST;
WAIT_FOR_FIELD_DEF -> WAIT_FOR_ROW [ label="in a resultset" ];
WAIT_FOR_FIELD_DEF -> READY_FOR_COMMAND
[ label="after describe table or prepare command" ];
WAIT_FOR_ROW -> READY_FOR_COMMAND;
WAIT_FOR_ROW -> WAIT_FOR_RESULT [ label="multi-resultset" ];
WAIT_FOR_PS_DESCRIPTION -> WAIT_FOR_PARAM_DEF;
WAIT_FOR_PS_DESCRIPTION -> READY_FOR_COMMAND
[ label="no params and result" ];
WAIT_FOR_PS_DESCRIPTION -> WAIT_FOR_FIELD_DEF [ label="no params" ];
WAIT_FOR_PARAM_DEF -> WAIT_FOR_FIELD_DEF;
WAIT_FOR_PARAM_DEF -> READY_FOR_COMMAND [ label="no result" ];
FILE_REQUEST -> WAIT_FOR_RESULT [label="when whole file sent"];
*/
#define PROTOCOL_STAGE_LIST(X) \
protocol_stage_ ## X(CONNECTING) \
protocol_stage_ ## X(WAIT_FOR_INIT_PACKET) \
protocol_stage_ ## X(AUTHENTICATE) \
protocol_stage_ ## X(SSL_NEGOTIATION) \
protocol_stage_ ## X(READY_FOR_COMMAND) \
protocol_stage_ ## X(WAIT_FOR_PACKET) \
protocol_stage_ ## X(WAIT_FOR_RESULT) \
protocol_stage_ ## X(WAIT_FOR_FIELD_DEF) \
protocol_stage_ ## X(WAIT_FOR_ROW) \
protocol_stage_ ## X(FILE_REQUEST) \
protocol_stage_ ## X(WAIT_FOR_PS_DESCRIPTION) \
protocol_stage_ ## X(WAIT_FOR_PARAM_DEF) \
protocol_stage_ ## X(DISCONNECTED)
/**
Trace events
------------
The following events are generated during the various stages of the
client-server conversation.
---------------------- -----------------------------------------------------
Connection events
---------------------- -----------------------------------------------------
CONNECTING Client is connecting to the server.
CONNECTED Physical connection has been established.
DISCONNECTED Connection with server was broken.
---------------------- -----------------------------------------------------
SSL events
---------------------- -----------------------------------------------------
SEND_SSL_REQUEST Client is sending SSL connection request.
SSL_CONNECT Client is initiating SSL handshake.
SSL_CONNECTED SSL connection has been established.
---------------------- -----------------------------------------------------
Authentication events
---------------------- -----------------------------------------------------
CHALLENGE_RECEIVED Client received authentication challenge.
AUTH_PLUGIN Client selects an authentication plugin to be used
in the following authentication exchange.
SEND_AUTH_RESPONSE Client sends response to the authentication
challenge.
SEND_AUTH_DATA Client sends extra authentication data packet.
AUTHENTICATED Server has accepted connection.
---------------------- -----------------------------------------------------
Command phase events
---------------------- -----------------------------------------------------
SEND_COMMAND Client is sending a command to the server.
SEND_FILE Client is sending local file contents to the server.
---------------------- -----------------------------------------------------
General events
---------------------- -----------------------------------------------------
READ_PACKET Client starts waiting for a packet from server.
PACKET_RECEIVED A packet from server has been received.
PACKET_SENT After successful sending of a packet to the server.
ERROR Client detected an error.
---------------------- -----------------------------------------------------
*/
#define TRACE_EVENT_LIST(X) \
trace_event_ ## X(ERROR) \
trace_event_ ## X(CONNECTING) \
trace_event_ ## X(CONNECTED) \
trace_event_ ## X(DISCONNECTED) \
trace_event_ ## X(SEND_SSL_REQUEST) \
trace_event_ ## X(SSL_CONNECT) \
trace_event_ ## X(SSL_CONNECTED) \
trace_event_ ## X(INIT_PACKET_RECEIVED) \
trace_event_ ## X(AUTH_PLUGIN) \
trace_event_ ## X(SEND_AUTH_RESPONSE) \
trace_event_ ## X(SEND_AUTH_DATA) \
trace_event_ ## X(AUTHENTICATED) \
trace_event_ ## X(SEND_COMMAND) \
trace_event_ ## X(SEND_FILE) \
trace_event_ ## X(READ_PACKET) \
trace_event_ ## X(PACKET_RECEIVED) \
trace_event_ ## X(PACKET_SENT)
/**
Some trace events have additional arguments. These are stored in
st_trace_event_args structure. Various events store their arguments in the
structure as follows. Unused members are set to 0/NULL.
AUTH_PLUGIN
------------- ----------------------------------
plugin_name the name of the plugin
------------- ----------------------------------
SEND_COMMAND
------------- ----------------------------------
cmd the command code
hdr pointer to command packet header
hdr_len length of the header
pkt pointer to command arguments
pkt_len length of arguments
------------- ----------------------------------
Other SEND_* and *_RECEIVED events
------------- ----------------------------------
pkt the data sent or received
pkt_len length of the data
------------- ----------------------------------
PACKET_SENT
------------- ----------------------------------
pkt_len number of bytes sent
------------- ----------------------------------
*/
struct st_trace_event_args
{
const char *plugin_name;
int cmd;
const unsigned char *hdr;
size_t hdr_len;
const unsigned char *pkt;
size_t pkt_len;
};
/* Definitions of protocol_stage and trace_event enums. */
#define protocol_stage_enum(X) PROTOCOL_STAGE_ ## X,
enum protocol_stage {
PROTOCOL_STAGE_LIST(enum)
PROTOCOL_STAGE_LAST
};
#define trace_event_enum(X) TRACE_EVENT_ ## X,
enum trace_event {
TRACE_EVENT_LIST(enum)
TRACE_EVENT_LAST
};
/*
Trace plugin methods
====================
*/
struct st_mysql_client_plugin_TRACE;
struct st_mysql;
/**
Trace plugin tracing_start() method.
Called when tracing with this plugin starts on a connection. A trace
plugin might want to maintain per-connection information. It can
return a pointer to memory area holding such information. It will be
stored in a connection handle and passed to other plugin methods.
@param self pointer to the plugin instance
@param connection_handle
@param stage protocol stage in which tracing has started - currently
it is always CONNECTING stage.
@return A pointer to plugin-specific, per-connection data if any.
*/
typedef
void* (tracing_start_callback)(struct st_mysql_client_plugin_TRACE *self,
struct st_mysql *connection_handle,
enum protocol_stage stage);
/**
Trace plugin tracing_stop() method.
Called when tracing of the connection has ended. If a plugin
allocated any per-connection resources, it should de-allocate them
here.
@param self pointer to the plugin instance
@param connection_handle
@param plugin_data pointer to plugin's per-connection data.
*/
typedef
void (tracing_stop_callback)(struct st_mysql_client_plugin_TRACE *self,
struct st_mysql *connection_handle,
void *plugin_data);
/**
Trace plugin trace_event() method.
Called when a trace event occurs. Plugin can decide to stop tracing
this connection by returning non-zero value.
@param self pointer to the plugin instance
@param plugin_data pointer to plugin's per-connection data
@param connection_handle
@param stage current protocol stage
@param event the trace event
@param args trace event arguments
@return Non-zero if tracing of the connection should end here.
*/
typedef
int (trace_event_handler)(struct st_mysql_client_plugin_TRACE *self,
void *plugin_data,
struct st_mysql *connection_handle,
enum protocol_stage stage,
enum trace_event event,
struct st_trace_event_args args);
struct st_mysql_client_plugin_TRACE
{
MYSQL_CLIENT_PLUGIN_HEADER
tracing_start_callback *tracing_start;
tracing_stop_callback *tracing_stop;
trace_event_handler *trace_event;
};
/**
The global trace_plugin pointer. If it is not NULL, it points at a
loaded trace plugin which should be used to trace all connections made
to the server.
*/
extern
struct st_mysql_client_plugin_TRACE *trace_plugin;
#ifndef DBUG_OFF
/*
Functions for getting names of trace events and protocol
stages for debugging purposes.
*/
const char* protocol_stage_name(enum protocol_stage stage);
const char* trace_event_name(enum trace_event ev);
#endif
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,96 @@
/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_IDLE_H
#define MYSQL_IDLE_H
/**
@file mysql/psi/mysql_idle.h
Instrumentation helpers for idle waits.
*/
#include "mysql/psi/psi.h"
#ifndef PSI_IDLE_CALL
#define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
/**
@defgroup Idle_instrumentation Idle Instrumentation
@ingroup Instrumentation_interface
@{
*/
/**
@def MYSQL_START_IDLE_WAIT
Instrumentation helper for table io_waits.
This instrumentation marks the start of a wait event.
@param LOCKER the locker
@param STATE the locker state
@sa MYSQL_END_IDLE_WAIT.
*/
#ifdef HAVE_PSI_IDLE_INTERFACE
#define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \
LOCKER= inline_mysql_start_idle_wait(STATE, __FILE__, __LINE__)
#else
#define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \
do {} while (0)
#endif
/**
@def MYSQL_END_IDLE_WAIT
Instrumentation helper for idle waits.
This instrumentation marks the end of a wait event.
@param LOCKER the locker
@sa MYSQL_START_IDLE_WAIT.
*/
#ifdef HAVE_PSI_IDLE_INTERFACE
#define MYSQL_END_IDLE_WAIT(LOCKER) \
inline_mysql_end_idle_wait(LOCKER)
#else
#define MYSQL_END_IDLE_WAIT(LOCKER) \
do {} while (0)
#endif
#ifdef HAVE_PSI_IDLE_INTERFACE
/**
Instrumentation calls for MYSQL_START_IDLE_WAIT.
@sa MYSQL_END_IDLE_WAIT.
*/
static inline struct PSI_idle_locker *
inline_mysql_start_idle_wait(PSI_idle_locker_state *state,
const char *src_file, int src_line)
{
struct PSI_idle_locker *locker;
locker= PSI_IDLE_CALL(start_idle_wait)(state, src_file, src_line);
return locker;
}
/**
Instrumentation calls for MYSQL_END_IDLE_WAIT.
@sa MYSQL_START_IDLE_WAIT.
*/
static inline void
inline_mysql_end_idle_wait(struct PSI_idle_locker *locker)
{
if (likely(locker != NULL))
PSI_IDLE_CALL(end_idle_wait)(locker);
}
#endif
/** @} (end of group Idle_instrumentation) */
#endif

View File

@@ -0,0 +1,121 @@
/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_MDL_H
#define MYSQL_MDL_H
/**
@file mysql/psi/mysql_mdl.h
Instrumentation helpers for metadata locks.
*/
#include "mysql/psi/psi.h"
#ifndef PSI_METADATA_CALL
#define PSI_METADATA_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
/**
@defgroup Thread_instrumentation Metadata Instrumentation
@ingroup Instrumentation_interface
@{
*/
/**
@def mysql_mdl_create(K, M, A)
Instrumented metadata lock creation.
@param I Metadata lock identity
@param K Metadata key
@param T Metadata lock type
@param D Metadata lock duration
@param S Metadata lock status
@param F request source file
@param L request source line
*/
#ifdef HAVE_PSI_METADATA_INTERFACE
#define mysql_mdl_create(I, K, T, D, S, F, L) \
inline_mysql_mdl_create(I, K, T, D, S, F, L)
#else
#define mysql_mdl_create(I, K, T, D, S, F, L) NULL
#endif
#ifdef HAVE_PSI_METADATA_INTERFACE
#define mysql_mdl_set_status(L, S) \
inline_mysql_mdl_set_status(L, S)
#else
#define mysql_mdl_set_status(L, S) \
do {} while (0)
#endif
/**
@def mysql_mdl_destroy(M)
Instrumented metadata lock destruction.
@param M Metadata lock
*/
#ifdef HAVE_PSI_METADATA_INTERFACE
#define mysql_mdl_destroy(M) \
inline_mysql_mdl_destroy(M, __FILE__, __LINE__)
#else
#define mysql_mdl_destroy(M) \
do {} while (0)
#endif
#ifdef HAVE_PSI_METADATA_INTERFACE
static inline PSI_metadata_lock *
inline_mysql_mdl_create(void *identity,
const MDL_key *mdl_key,
enum_mdl_type mdl_type,
enum_mdl_duration mdl_duration,
MDL_ticket::enum_psi_status mdl_status,
const char *src_file, uint src_line)
{
PSI_metadata_lock *result;
/* static_cast: Fit a round C++ enum peg into a square C int hole ... */
result= PSI_METADATA_CALL(create_metadata_lock)
(identity,
mdl_key,
static_cast<opaque_mdl_type> (mdl_type),
static_cast<opaque_mdl_duration> (mdl_duration),
static_cast<opaque_mdl_status> (mdl_status),
src_file, src_line);
return result;
}
static inline void inline_mysql_mdl_set_status(
PSI_metadata_lock *psi,
MDL_ticket::enum_psi_status mdl_status)
{
if (psi != NULL)
PSI_METADATA_CALL(set_metadata_lock_status)(psi, mdl_status);
}
static inline void inline_mysql_mdl_destroy(
PSI_metadata_lock *psi,
const char *src_file, uint src_line)
{
if (psi != NULL)
PSI_METADATA_CALL(destroy_metadata_lock)(psi);
}
#endif /* HAVE_PSI_METADATA_INTERFACE */
/** @} (end of group Metadata_instrumentation) */
#endif

View File

@@ -0,0 +1,62 @@
/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_MEMORY_H
#define MYSQL_MEMORY_H
/**
@file mysql/psi/mysql_memory.h
Instrumentation helpers for memory allocation.
*/
#include "mysql/psi/psi.h"
#ifndef PSI_MEMORY_CALL
#define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
/**
@defgroup Memory_instrumentation Memory Instrumentation
@ingroup Instrumentation_interface
@{
*/
/**
@def mysql_memory_register(P1, P2, P3)
Memory registration.
*/
#define mysql_memory_register(P1, P2, P3) \
inline_mysql_memory_register(P1, P2, P3)
static inline void inline_mysql_memory_register(
#ifdef HAVE_PSI_MEMORY_INTERFACE
const char *category,
PSI_memory_info *info,
int count)
#else
const char *category MY_ATTRIBUTE((unused)),
void *info MY_ATTRIBUTE((unused)),
int count MY_ATTRIBUTE((unused)))
#endif
{
#ifdef HAVE_PSI_MEMORY_INTERFACE
PSI_MEMORY_CALL(register_memory)(category, info, count);
#endif
}
/** @} (end of group Memory_instrumentation) */
#endif

View File

@@ -0,0 +1,88 @@
/* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MYSQL_PS_H
#define MYSQL_PS_H
/**
@file mysql/psi/mysql_ps.h
Instrumentation helpers for prepared statements.
*/
#include "mysql/psi/psi.h"
#ifndef PSI_PS_CALL
#define PSI_PS_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
#ifdef HAVE_PSI_PS_INTERFACE
#define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \
inline_mysql_create_prepared_stmt(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH)
#define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \
inline_mysql_execute_prepared_stmt(LOCKER, PREPARED_STMT)
#define MYSQL_DESTROY_PS(PREPARED_STMT) \
inline_mysql_destroy_prepared_stmt(PREPARED_STMT)
#define MYSQL_REPREPARE_PS(PREPARED_STMT) \
inline_mysql_reprepare_prepared_stmt(PREPARED_STMT)
#else
#define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \
NULL
#define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \
do {} while (0)
#define MYSQL_DESTROY_PS(PREPARED_STMT) \
do {} while (0)
#define MYSQL_REPREPARE_PS(PREPARED_STMT) \
do {} while (0)
#endif
#ifdef HAVE_PSI_PS_INTERFACE
static inline struct PSI_prepared_stmt*
inline_mysql_create_prepared_stmt(void *identity, uint stmt_id,
PSI_statement_locker *locker,
const char *stmt_name, size_t stmt_name_length,
const char *sqltext, size_t sqltext_length)
{
if (locker == NULL)
return NULL;
return PSI_PS_CALL(create_prepared_stmt)(identity, stmt_id,
locker,
stmt_name, stmt_name_length,
sqltext, sqltext_length);
}
static inline void
inline_mysql_execute_prepared_stmt(PSI_statement_locker *locker,
PSI_prepared_stmt* prepared_stmt)
{
if (prepared_stmt != NULL && locker != NULL)
PSI_PS_CALL(execute_prepared_stmt)(locker, prepared_stmt);
}
static inline void
inline_mysql_destroy_prepared_stmt(PSI_prepared_stmt *prepared_stmt)
{
if (prepared_stmt != NULL)
PSI_PS_CALL(destroy_prepared_stmt)(prepared_stmt);
}
static inline void
inline_mysql_reprepare_prepared_stmt(PSI_prepared_stmt *prepared_stmt)
{
if (prepared_stmt != NULL)
PSI_PS_CALL(reprepare_prepared_stmt)(prepared_stmt);
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,97 @@
/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MYSQL_SP_H
#define MYSQL_SP_H
/**
@file mysql/psi/mysql_sp.h
Instrumentation helpers for stored programs.
*/
#include "mysql/psi/psi.h"
#ifndef PSI_SP_CALL
#define PSI_SP_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
#ifdef HAVE_PSI_SP_INTERFACE
#define MYSQL_START_SP(STATE, SP_SHARE) \
inline_mysql_start_sp(STATE, SP_SHARE)
#else
#define MYSQL_START_SP(STATE, SP_SHARE) \
NULL
#endif
#ifdef HAVE_PSI_SP_INTERFACE
#define MYSQL_END_SP(LOCKER) \
inline_mysql_end_sp(LOCKER)
#else
#define MYSQL_END_SP(LOCKER) \
do {} while (0)
#endif
#ifdef HAVE_PSI_SP_INTERFACE
#define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \
inline_mysql_drop_sp(OT, SN, SNL, ON, ONL)
#else
#define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \
do {} while (0)
#endif
#ifdef HAVE_PSI_SP_INTERFACE
#define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \
inline_mysql_get_sp_share(OT, SN, SNL, ON, ONL)
#else
#define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \
NULL
#endif
#ifdef HAVE_PSI_SP_INTERFACE
static inline struct PSI_sp_locker*
inline_mysql_start_sp(PSI_sp_locker_state *state, PSI_sp_share *sp_share)
{
return PSI_SP_CALL(start_sp)(state, sp_share);
}
static inline void inline_mysql_end_sp(PSI_sp_locker *locker)
{
if (likely(locker != NULL))
PSI_SP_CALL(end_sp)(locker);
}
static inline void
inline_mysql_drop_sp(uint sp_type,
const char* schema_name, uint shcema_name_length,
const char* object_name, uint object_name_length)
{
PSI_SP_CALL(drop_sp)(sp_type,
schema_name, shcema_name_length,
object_name, object_name_length);
}
static inline PSI_sp_share*
inline_mysql_get_sp_share(uint sp_type,
const char* schema_name, uint shcema_name_length,
const char* object_name, uint object_name_length)
{
return PSI_SP_CALL(get_sp_share)(sp_type,
schema_name, shcema_name_length,
object_name, object_name_length);
}
#endif
#endif

View File

@@ -0,0 +1,198 @@
/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MYSQL_STAGE_H
#define MYSQL_STAGE_H
/**
@file mysql/psi/mysql_stage.h
Instrumentation helpers for stages.
*/
#include "mysql/psi/psi.h"
#ifndef PSI_STAGE_CALL
#define PSI_STAGE_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
/**
@defgroup Stage_instrumentation Stage Instrumentation
@ingroup Instrumentation_interface
@{
*/
/**
@def mysql_stage_register(P1, P2, P3)
Stage registration.
*/
#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_stage_register(P1, P2, P3) \
inline_mysql_stage_register(P1, P2, P3)
#else
#define mysql_stage_register(P1, P2, P3) \
do {} while (0)
#endif
/**
@def MYSQL_SET_STAGE
Set the current stage.
Use this API when the file and line
is passed from the caller.
@param K the stage key
@param F the source file name
@param L the source file line
@return the current stage progress
*/
#ifdef HAVE_PSI_STAGE_INTERFACE
#define MYSQL_SET_STAGE(K, F, L) \
inline_mysql_set_stage(K, F, L)
#else
#define MYSQL_SET_STAGE(K, F, L) \
NULL
#endif
/**
@def mysql_set_stage
Set the current stage.
@param K the stage key
@return the current stage progress
*/
#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_set_stage(K) \
inline_mysql_set_stage(K, __FILE__, __LINE__)
#else
#define mysql_set_stage(K) \
NULL
#endif
/**
@def mysql_end_stage
End the last stage
*/
#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_end_stage \
inline_mysql_end_stage
#else
#define mysql_end_stage \
do {} while (0)
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void inline_mysql_stage_register(
const char *category, PSI_stage_info **info, int count)
{
PSI_STAGE_CALL(register_stage)(category, info, count);
}
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
static inline PSI_stage_progress*
inline_mysql_set_stage(PSI_stage_key key,
const char *src_file, int src_line)
{
return PSI_STAGE_CALL(start_stage)(key, src_file, src_line);
}
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void
inline_mysql_end_stage()
{
PSI_STAGE_CALL(end_stage)();
}
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_stage_set_work_completed(P1, P2) \
inline_mysql_stage_set_work_completed(P1, P2)
#define mysql_stage_get_work_completed(P1) \
inline_mysql_stage_get_work_completed(P1)
#else
#define mysql_stage_set_work_completed(P1, P2) \
do {} while (0)
#define mysql_stage_get_work_completed(P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_stage_inc_work_completed(P1, P2) \
inline_mysql_stage_inc_work_completed(P1, P2)
#else
#define mysql_stage_inc_work_completed(P1, P2) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
#define mysql_stage_set_work_estimated(P1, P2) \
inline_mysql_stage_set_work_estimated(P1, P2)
#define mysql_stage_get_work_estimated(P1) \
inline_mysql_stage_get_work_estimated(P1)
#else
#define mysql_stage_set_work_estimated(P1, P2) \
do {} while (0)
#define mysql_stage_get_work_estimated(P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void
inline_mysql_stage_set_work_completed(PSI_stage_progress *progress,
ulonglong val)
{
if (progress != NULL)
progress->m_work_completed= val;
}
static inline ulonglong
inline_mysql_stage_get_work_completed(PSI_stage_progress *progress)
{
return progress->m_work_completed;
}
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void
inline_mysql_stage_inc_work_completed(PSI_stage_progress *progress,
ulonglong val)
{
if (progress != NULL)
progress->m_work_completed+= val;
}
#endif
#ifdef HAVE_PSI_STAGE_INTERFACE
static inline void
inline_mysql_stage_set_work_estimated(PSI_stage_progress *progress,
ulonglong val)
{
if (progress != NULL)
progress->m_work_estimated= val;
}
static inline ulonglong
inline_mysql_stage_get_work_estimated(PSI_stage_progress *progress)
{
return progress->m_work_estimated;
}
#endif
/** @} (end of group Stage_instrumentation) */
#endif

View File

@@ -0,0 +1,235 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MYSQL_STATEMENT_H
#define MYSQL_STATEMENT_H
/**
@file mysql/psi/mysql_statement.h
Instrumentation helpers for statements.
*/
#include "mysql/psi/psi.h"
class Diagnostics_area;
typedef struct charset_info_st CHARSET_INFO;
#ifndef PSI_STATEMENT_CALL
#define PSI_STATEMENT_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
#ifndef PSI_DIGEST_CALL
#define PSI_DIGEST_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
/**
@defgroup Statement_instrumentation Statement Instrumentation
@ingroup Instrumentation_interface
@{
*/
/**
@def mysql_statement_register(P1, P2, P3)
Statement registration.
*/
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define mysql_statement_register(P1, P2, P3) \
inline_mysql_statement_register(P1, P2, P3)
#else
#define mysql_statement_register(P1, P2, P3) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
#define MYSQL_DIGEST_START(LOCKER) \
inline_mysql_digest_start(LOCKER)
#else
#define MYSQL_DIGEST_START(LOCKER) \
NULL
#endif
#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
#define MYSQL_DIGEST_END(LOCKER, DIGEST) \
inline_mysql_digest_end(LOCKER, DIGEST)
#else
#define MYSQL_DIGEST_END(LOCKER, DIGEST) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS, SPS) \
inline_mysql_start_statement(STATE, K, DB, DB_LEN, CS, SPS, __FILE__, __LINE__)
#else
#define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS, SPS) \
NULL
#endif
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define MYSQL_REFINE_STATEMENT(LOCKER, K) \
inline_mysql_refine_statement(LOCKER, K)
#else
#define MYSQL_REFINE_STATEMENT(LOCKER, K) \
NULL
#endif
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define MYSQL_SET_STATEMENT_TEXT(LOCKER, P1, P2) \
inline_mysql_set_statement_text(LOCKER, P1, P2)
#else
#define MYSQL_SET_STATEMENT_TEXT(LOCKER, P1, P2) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define MYSQL_SET_STATEMENT_LOCK_TIME(LOCKER, P1) \
inline_mysql_set_statement_lock_time(LOCKER, P1)
#else
#define MYSQL_SET_STATEMENT_LOCK_TIME(LOCKER, P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define MYSQL_SET_STATEMENT_ROWS_SENT(LOCKER, P1) \
inline_mysql_set_statement_rows_sent(LOCKER, P1)
#else
#define MYSQL_SET_STATEMENT_ROWS_SENT(LOCKER, P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define MYSQL_SET_STATEMENT_ROWS_EXAMINED(LOCKER, P1) \
inline_mysql_set_statement_rows_examined(LOCKER, P1)
#else
#define MYSQL_SET_STATEMENT_ROWS_EXAMINED(LOCKER, P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STATEMENT_INTERFACE
#define MYSQL_END_STATEMENT(LOCKER, DA) \
inline_mysql_end_statement(LOCKER, DA)
#else
#define MYSQL_END_STATEMENT(LOCKER, DA) \
do {} while (0)
#endif
#ifdef HAVE_PSI_STATEMENT_INTERFACE
static inline void inline_mysql_statement_register(
const char *category, PSI_statement_info *info, int count)
{
PSI_STATEMENT_CALL(register_statement)(category, info, count);
}
#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
static inline struct PSI_digest_locker *
inline_mysql_digest_start(PSI_statement_locker *locker)
{
PSI_digest_locker* digest_locker= NULL;
if (likely(locker != NULL))
digest_locker= PSI_DIGEST_CALL(digest_start)(locker);
return digest_locker;
}
#endif
#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
static inline void
inline_mysql_digest_end(PSI_digest_locker *locker, const sql_digest_storage *digest)
{
if (likely(locker != NULL))
PSI_DIGEST_CALL(digest_end)(locker, digest);
}
#endif
static inline struct PSI_statement_locker *
inline_mysql_start_statement(PSI_statement_locker_state *state,
PSI_statement_key key,
const char *db, uint db_len,
const CHARSET_INFO *charset,
PSI_sp_share *sp_share,
const char *src_file, int src_line)
{
PSI_statement_locker *locker;
locker= PSI_STATEMENT_CALL(get_thread_statement_locker)(state, key, charset,
sp_share);
if (likely(locker != NULL))
PSI_STATEMENT_CALL(start_statement)(locker, db, db_len, src_file, src_line);
return locker;
}
static inline struct PSI_statement_locker *
inline_mysql_refine_statement(PSI_statement_locker *locker,
PSI_statement_key key)
{
if (likely(locker != NULL))
{
locker= PSI_STATEMENT_CALL(refine_statement)(locker, key);
}
return locker;
}
static inline void
inline_mysql_set_statement_text(PSI_statement_locker *locker,
const char *text, uint text_len)
{
if (likely(locker != NULL))
{
PSI_STATEMENT_CALL(set_statement_text)(locker, text, text_len);
}
}
static inline void
inline_mysql_set_statement_lock_time(PSI_statement_locker *locker,
ulonglong count)
{
if (likely(locker != NULL))
{
PSI_STATEMENT_CALL(set_statement_lock_time)(locker, count);
}
}
static inline void
inline_mysql_set_statement_rows_sent(PSI_statement_locker *locker,
ulonglong count)
{
if (likely(locker != NULL))
{
PSI_STATEMENT_CALL(set_statement_rows_sent)(locker, count);
}
}
static inline void
inline_mysql_set_statement_rows_examined(PSI_statement_locker *locker,
ulonglong count)
{
if (likely(locker != NULL))
{
PSI_STATEMENT_CALL(set_statement_rows_examined)(locker, count);
}
}
static inline void
inline_mysql_end_statement(struct PSI_statement_locker *locker,
Diagnostics_area *stmt_da)
{
PSI_STAGE_CALL(end_stage)();
if (likely(locker != NULL))
PSI_STATEMENT_CALL(end_statement)(locker, stmt_da);
}
#endif
/** @} (end of group Statement_instrumentation) */
#endif

View File

@@ -0,0 +1,142 @@
/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_TABLE_H
#define MYSQL_TABLE_H
/**
@file mysql/psi/mysql_table.h
Instrumentation helpers for table io.
*/
#include "mysql/psi/psi.h"
#ifndef PSI_TABLE_CALL
#define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
/**
@defgroup Table_instrumentation Table Instrumentation
@ingroup Instrumentation_interface
@{
*/
/**
@def MYSQL_TABLE_WAIT_VARIABLES
Instrumentation helper for table waits.
This instrumentation declares local variables.
Do not use a ';' after this macro
@param LOCKER the locker
@param STATE the locker state
@sa MYSQL_START_TABLE_IO_WAIT.
@sa MYSQL_END_TABLE_IO_WAIT.
@sa MYSQL_START_TABLE_LOCK_WAIT.
@sa MYSQL_END_TABLE_LOCK_WAIT.
*/
#ifdef HAVE_PSI_TABLE_INTERFACE
#define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) \
struct PSI_table_locker* LOCKER; \
PSI_table_locker_state STATE;
#else
#define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE)
#endif
/**
@def MYSQL_START_TABLE_LOCK_WAIT
Instrumentation helper for table lock waits.
This instrumentation marks the start of a wait event.
@param LOCKER the locker
@param STATE the locker state
@param PSI the instrumented table
@param OP the table operation to be performed
@param FLAGS per table operation flags.
@sa MYSQL_END_TABLE_LOCK_WAIT.
*/
#ifdef HAVE_PSI_TABLE_INTERFACE
#define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \
LOCKER= inline_mysql_start_table_lock_wait(STATE, PSI, \
OP, FLAGS, __FILE__, __LINE__)
#else
#define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \
do {} while (0)
#endif
/**
@def MYSQL_END_TABLE_LOCK_WAIT
Instrumentation helper for table lock waits.
This instrumentation marks the end of a wait event.
@param LOCKER the locker
@sa MYSQL_START_TABLE_LOCK_WAIT.
*/
#ifdef HAVE_PSI_TABLE_INTERFACE
#define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \
inline_mysql_end_table_lock_wait(LOCKER)
#else
#define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TABLE_INTERFACE
#define MYSQL_UNLOCK_TABLE(T) \
inline_mysql_unlock_table(T)
#else
#define MYSQL_UNLOCK_TABLE(T) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TABLE_INTERFACE
/**
Instrumentation calls for MYSQL_START_TABLE_LOCK_WAIT.
@sa MYSQL_END_TABLE_LOCK_WAIT.
*/
static inline struct PSI_table_locker *
inline_mysql_start_table_lock_wait(PSI_table_locker_state *state,
struct PSI_table *psi,
enum PSI_table_lock_operation op,
ulong flags, const char *src_file, int src_line)
{
if (psi != NULL)
{
struct PSI_table_locker *locker;
locker= PSI_TABLE_CALL(start_table_lock_wait)
(state, psi, op, flags, src_file, src_line);
return locker;
}
return NULL;
}
/**
Instrumentation calls for MYSQL_END_TABLE_LOCK_WAIT.
@sa MYSQL_START_TABLE_LOCK_WAIT.
*/
static inline void
inline_mysql_end_table_lock_wait(struct PSI_table_locker *locker)
{
if (locker != NULL)
PSI_TABLE_CALL(end_table_lock_wait)(locker);
}
static inline void
inline_mysql_unlock_table(struct PSI_table *table)
{
if (table != NULL)
PSI_TABLE_CALL(unlock_table)(table);
}
#endif
/** @} (end of group Table_instrumentation) */
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,213 @@
/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MYSQL_TRANSACTION_H
#define MYSQL_TRANSACTION_H
/**
@file mysql/psi/mysql_transaction.h
Instrumentation helpers for transactions.
*/
#include "mysql/psi/psi.h"
#ifndef PSI_TRANSACTION_CALL
#define PSI_TRANSACTION_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
/**
@defgroup Transaction_instrumentation Transaction Instrumentation
@ingroup Instrumentation_interface
@{
*/
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \
inline_mysql_start_transaction(STATE, XID, TRXID, ISO, RO, AC, __FILE__, __LINE__)
#else
#define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \
inline_mysql_set_transaction_gtid(LOCKER, P1, P2)
#else
#define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \
inline_mysql_set_transaction_xid(LOCKER, P1, P2)
#else
#define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \
inline_mysql_set_transaction_xa_state(LOCKER, P1)
#else
#define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
inline_mysql_set_transaction_trxid(LOCKER, P1)
#else
#define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \
inline_mysql_inc_transaction_savepoints(LOCKER, P1)
#else
#define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \
inline_mysql_inc_transaction_rollback_to_savepoint(LOCKER, P1)
#else
#define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \
inline_mysql_inc_transaction_release_savepoint(LOCKER, P1)
#else
#define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \
do {} while (0)
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \
inline_mysql_rollback_transaction(LOCKER)
#else
#define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \
NULL
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
#define MYSQL_COMMIT_TRANSACTION(LOCKER) \
inline_mysql_commit_transaction(LOCKER)
#else
#define MYSQL_COMMIT_TRANSACTION(LOCKER) \
NULL
#endif
#ifdef HAVE_PSI_TRANSACTION_INTERFACE
static inline struct PSI_transaction_locker *
inline_mysql_start_transaction(PSI_transaction_locker_state *state,
const void *xid,
const ulonglong *trxid,
int isolation_level,
my_bool read_only,
my_bool autocommit,
const char *src_file, int src_line)
{
PSI_transaction_locker *locker;
locker= PSI_TRANSACTION_CALL(get_thread_transaction_locker)(state,
xid, trxid,
isolation_level,
read_only,
autocommit);
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(start_transaction)(locker, src_file, src_line);
return locker;
}
static inline void
inline_mysql_set_transaction_gtid(PSI_transaction_locker *locker,
const void *sid,
const void *gtid_spec)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(set_transaction_gtid)(locker, sid, gtid_spec);
}
static inline void
inline_mysql_set_transaction_xid(PSI_transaction_locker *locker,
const void *xid,
int xa_state)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(set_transaction_xid)(locker, xid, xa_state);
}
static inline void
inline_mysql_set_transaction_xa_state(PSI_transaction_locker *locker,
int xa_state)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(set_transaction_xa_state)(locker, xa_state);
}
static inline void
inline_mysql_set_transaction_trxid(PSI_transaction_locker *locker,
const ulonglong *trxid)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(set_transaction_trxid)(locker, trxid);
}
static inline void
inline_mysql_inc_transaction_savepoints(PSI_transaction_locker *locker,
ulong count)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(inc_transaction_savepoints)(locker, count);
}
static inline void
inline_mysql_inc_transaction_rollback_to_savepoint(PSI_transaction_locker *locker,
ulong count)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(inc_transaction_rollback_to_savepoint)(locker, count);
}
static inline void
inline_mysql_inc_transaction_release_savepoint(PSI_transaction_locker *locker,
ulong count)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(inc_transaction_release_savepoint)(locker, count);
}
static inline void
inline_mysql_rollback_transaction(struct PSI_transaction_locker *locker)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(end_transaction)(locker, false);
}
static inline void
inline_mysql_commit_transaction(struct PSI_transaction_locker *locker)
{
if (likely(locker != NULL))
PSI_TRANSACTION_CALL(end_transaction)(locker, true);
}
#endif
/** @} (end of group Transaction_instrumentation) */
#endif

2980
3rdparty/mysql/include/mysql/psi/psi.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_PSI_BASE_H
#define MYSQL_PSI_BASE_H
#ifdef __cplusplus
extern "C" {
#endif
/**
@file mysql/psi/psi_base.h
Performance schema instrumentation interface.
@defgroup Instrumentation_interface Instrumentation Interface
@ingroup Performance_schema
@{
*/
#define PSI_INSTRUMENT_ME 0
#define PSI_NOT_INSTRUMENTED 0
/**
Global flag.
This flag indicate that an instrumentation point is a global variable,
or a singleton.
*/
#define PSI_FLAG_GLOBAL (1 << 0)
/**
Mutable flag.
This flag indicate that an instrumentation point is a general placeholder,
that can mutate into a more specific instrumentation point.
*/
#define PSI_FLAG_MUTABLE (1 << 1)
#define PSI_FLAG_THREAD (1 << 2)
/**
Stage progress flag.
This flag apply to the stage instruments only.
It indicates the instrumentation provides progress data.
*/
#define PSI_FLAG_STAGE_PROGRESS (1 << 3)
/**
Shared Exclusive flag.
Indicates that rwlock support the shared exclusive state.
*/
#define PSI_RWLOCK_FLAG_SX (1 << 4)
/**
Transferable flag.
This flag indicate that an instrumented object can
be created by a thread and destroyed by another thread.
*/
#define PSI_FLAG_TRANSFER (1 << 5)
/**
Volatility flag.
This flag indicate that an instrumented object
has a volatility (life cycle) comparable
to the volatility of a session.
*/
#define PSI_FLAG_VOLATILITY_SESSION (1 << 6)
#ifdef HAVE_PSI_INTERFACE
/**
@def PSI_VERSION_1
Performance Schema Interface number for version 1.
This version is supported.
*/
#define PSI_VERSION_1 1
/**
@def PSI_VERSION_2
Performance Schema Interface number for version 2.
This version is not implemented, it's a placeholder.
*/
#define PSI_VERSION_2 2
/**
@def PSI_CURRENT_VERSION
Performance Schema Interface number for the most recent version.
The most current version is @c PSI_VERSION_1
*/
#define PSI_CURRENT_VERSION 1
/**
@def USE_PSI_1
Define USE_PSI_1 to use the interface version 1.
*/
/**
@def USE_PSI_2
Define USE_PSI_2 to use the interface version 2.
*/
/**
@def HAVE_PSI_1
Define HAVE_PSI_1 if the interface version 1 needs to be compiled in.
*/
/**
@def HAVE_PSI_2
Define HAVE_PSI_2 if the interface version 2 needs to be compiled in.
*/
#ifndef USE_PSI_2
#ifndef USE_PSI_1
#define USE_PSI_1
#endif
#endif
#ifdef USE_PSI_1
#define HAVE_PSI_1
#endif
#ifdef USE_PSI_2
#define HAVE_PSI_2
#endif
/*
Allow to override PSI_XXX_CALL at compile time
with more efficient implementations, if available.
If nothing better is available,
make a dynamic call using the PSI_server function pointer.
*/
#define PSI_DYNAMIC_CALL(M) PSI_server->M
#endif /* HAVE_PSI_INTERFACE */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* MYSQL_PSI_BASE_H */

View File

@@ -0,0 +1,155 @@
/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_PSI_MEMORY_H
#define MYSQL_PSI_MEMORY_H
#include "psi_base.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
@file mysql/psi/psi_memory.h
Performance schema instrumentation interface.
@defgroup Instrumentation_interface Instrumentation Interface
@ingroup Performance_schema
@{
*/
#ifdef HAVE_PSI_INTERFACE
#ifndef DISABLE_ALL_PSI
#ifndef DISABLE_PSI_MEMORY
#define HAVE_PSI_MEMORY_INTERFACE
#endif /* DISABLE_PSI_MEMORY */
#endif /* DISABLE_ALL_PSI */
#endif /* HAVE_PSI_INTERFACE */
struct PSI_thread;
/**
Instrumented memory key.
To instrument memory, a memory key must be obtained using @c register_memory.
Using a zero key always disable the instrumentation.
*/
typedef unsigned int PSI_memory_key;
#ifdef HAVE_PSI_1
/**
@defgroup Group_PSI_v1 Application Binary Interface, version 1
@ingroup Instrumentation_interface
@{
*/
/**
Memory instrument information.
@since PSI_VERSION_1
This structure is used to register instrumented memory.
*/
struct PSI_memory_info_v1
{
/** Pointer to the key assigned to the registered memory. */
PSI_memory_key *m_key;
/** The name of the memory instrument to register. */
const char *m_name;
/**
The flags of the socket instrument to register.
@sa PSI_FLAG_GLOBAL
*/
int m_flags;
};
typedef struct PSI_memory_info_v1 PSI_memory_info_v1;
/**
Memory registration API.
@param category a category name (typically a plugin name)
@param info an array of memory info to register
@param count the size of the info array
*/
typedef void (*register_memory_v1_t)
(const char *category, struct PSI_memory_info_v1 *info, int count);
/**
Instrument memory allocation.
@param key the memory instrument key
@param size the size of memory allocated
@param[out] owner the memory owner
@return the effective memory instrument key
*/
typedef PSI_memory_key (*memory_alloc_v1_t)
(PSI_memory_key key, size_t size, struct PSI_thread ** owner);
/**
Instrument memory re allocation.
@param key the memory instrument key
@param old_size the size of memory previously allocated
@param new_size the size of memory re allocated
@param[in, out] owner the memory owner
@return the effective memory instrument key
*/
typedef PSI_memory_key (*memory_realloc_v1_t)
(PSI_memory_key key, size_t old_size, size_t new_size, struct PSI_thread ** owner);
/**
Instrument memory claim.
@param key the memory instrument key
@param size the size of memory allocated
@param[in, out] owner the memory owner
@return the effective memory instrument key
*/
typedef PSI_memory_key (*memory_claim_v1_t)
(PSI_memory_key key, size_t size, struct PSI_thread ** owner);
/**
Instrument memory free.
@param key the memory instrument key
@param size the size of memory allocated
@param owner the memory owner
*/
typedef void (*memory_free_v1_t)
(PSI_memory_key key, size_t size, struct PSI_thread * owner);
/** @} (end of group Group_PSI_v1) */
#endif /* HAVE_PSI_1 */
#ifdef HAVE_PSI_2
struct PSI_memory_info_v2
{
int placeholder;
};
#endif /* HAVE_PSI_2 */
#ifdef USE_PSI_1
typedef struct PSI_memory_info_v1 PSI_memory_info;
#endif
#ifdef USE_PSI_2
typedef struct PSI_memory_info_v2 PSI_memory_info;
#endif
/** @} (end of group Instrumentation_interface) */
#ifdef __cplusplus
}
#endif
#endif /* MYSQL_PSI_MEMORY_H */

View File

@@ -0,0 +1,101 @@
#ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
#define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
my_snprintf service
Portable and limited vsnprintf() implementation.
This is a portable, limited vsnprintf() implementation, with some
extra features. "Portable" means that it'll produce identical result
on all platforms (for example, on Windows and Linux system printf %e
formats the exponent differently, on different systems %p either
prints leading 0x or not, %s may accept null pointer or crash on
it). "Limited" means that it does not support all the C89 features.
But it supports few extensions, not in any standard.
my_vsnprintf(to, n, fmt, ap)
@param[out] to A buffer to store the result in
@param[in] n Store up to n-1 characters, followed by an end 0
@param[in] fmt printf-like format string
@param[in] ap Arguments
@return a number of bytes written to a buffer *excluding* terminating '\0'
@post
The syntax of a format string is generally the same:
% <flag> <width> <precision> <length modifier> <format>
where everithing but the format is optional.
Three one-character flags are recognized:
'0' has the standard zero-padding semantics;
'-' is parsed, but silently ignored;
'`' (backtick) is only supported for strings (%s) and means that the
string will be quoted according to MySQL identifier quoting rules.
Both <width> and <precision> can be specified as numbers or '*'.
If an asterisk is used, an argument of type int is consumed.
<length modifier> can be 'l', 'll', or 'z'.
Supported formats are 's' (null pointer is accepted, printed as
"(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o',
'X', 'p' (works as 0x%x).
Standard syntax for positional arguments $n is supported.
Extensions:
Flag '`' (backtick): see above.
Format 'b': binary buffer, prints exactly <precision> bytes from the
argument, without stopping at '\0'.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MYSQL_ABI_CHECK
#include <stdarg.h>
#include <stdlib.h>
#endif
extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
#define my_vsnprintf my_snprintf_service->my_vsnprintf_type
#define my_snprintf my_snprintf_service->my_snprintf_type
#else
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
#endif
#ifdef __cplusplus
}
#endif
#endif /* #define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED */

View File

@@ -0,0 +1,81 @@
/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED
#define MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED
#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif
/* PSI_memory_key */
#include "mysql/psi/psi_memory.h"
#ifdef __cplusplus
extern "C" {
#endif
/* myf */
typedef int myf_t;
typedef void * (*mysql_malloc_t)(PSI_memory_key key, size_t size, myf_t flags);
typedef void * (*mysql_realloc_t)(PSI_memory_key key, void *ptr, size_t size, myf_t flags);
typedef void (*mysql_claim_t)(void *ptr);
typedef void (*mysql_free_t)(void *ptr);
typedef void * (*my_memdup_t)(PSI_memory_key key, const void *from, size_t length, myf_t flags);
typedef char * (*my_strdup_t)(PSI_memory_key key, const char *from, myf_t flags);
typedef char * (*my_strndup_t)(PSI_memory_key key, const char *from, size_t length, myf_t flags);
struct mysql_malloc_service_st
{
mysql_malloc_t mysql_malloc;
mysql_realloc_t mysql_realloc;
mysql_claim_t mysql_claim;
mysql_free_t mysql_free;
my_memdup_t my_memdup;
my_strdup_t my_strdup;
my_strndup_t my_strndup;
};
extern struct mysql_malloc_service_st *mysql_malloc_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
#define my_malloc mysql_malloc_service->mysql_malloc
#define my_realloc mysql_malloc_service->mysql_realloc
#define my_claim mysql_malloc_service->mysql_claim
#define my_free mysql_malloc_service->mysql_free
#define my_memdup mysql_malloc_service->my_memdup
#define my_strdup mysql_malloc_service->my_strdup
#define my_strndup mysql_malloc_service->my_strndup
#else
extern void * my_malloc(PSI_memory_key key, size_t size, myf_t flags);
extern void * my_realloc(PSI_memory_key key, void *ptr, size_t size, myf_t flags);
extern void my_claim(void *ptr);
extern void my_free(void *ptr);
extern void * my_memdup(PSI_memory_key key, const void *from, size_t length, myf_t flags);
extern char * my_strdup(PSI_memory_key key, const char *from, myf_t flags);
extern char * my_strndup(PSI_memory_key key, const char *from, size_t length, myf_t flags);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,9 +1,8 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
** Common definition between mysql server & client
@@ -20,13 +19,41 @@
#ifndef _mysql_com_h
#define _mysql_com_h
#define NAME_LEN 64 /* Field/table name length */
#include "binary_log_types.h"
#include "my_command.h"
#define HOSTNAME_LENGTH 60
#define USERNAME_LENGTH 16
#define SYSTEM_CHARSET_MBMAXLEN 3
#define FILENAME_CHARSET_MBMAXLEN 5
#define NAME_CHAR_LEN 64 /* Field/table name length */
#define USERNAME_CHAR_LENGTH 32
#define USERNAME_CHAR_LENGTH_STR "32"
#ifndef NAME_LEN
#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
#endif
#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN)
#define MYSQL_AUTODETECT_CHARSET_NAME "auto"
#define SERVER_VERSION_LENGTH 60
#define SQLSTATE_LENGTH 5
/*
Maximum length of comments
*/
#define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 6.0: 60 characters */
#define TABLE_COMMENT_MAXLEN 2048
#define COLUMN_COMMENT_MAXLEN 1024
#define INDEX_COMMENT_MAXLEN 1024
#define TABLE_PARTITION_COMMENT_MAXLEN 1024
/*
Maximum length of protocol packet.
OK packet length limit also restricted to this value as any length greater
than this value will have first byte of OK packet to be 254 thus does not
provide a means to identify if this is OK or EOF packet.
*/
#define MAX_PACKET_LENGTH (256L*256L*256L-1)
/*
USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
username and hostname parts of the user identifier with trailing zero in
@@ -39,41 +66,25 @@
#define LOCAL_HOST_NAMEDPIPE "."
#if defined(__WIN__) && !defined( _CUSTOMCONFIG_)
#if defined(_WIN32)
#define MYSQL_NAMEDPIPE "MySQL"
#define MYSQL_SERVICENAME "MySQL"
#endif /* __WIN__ */
#endif /* _WIN32 */
/* The length of the header part for each generated column in the .frm file. */
#define FRM_GCOL_HEADER_SIZE 4
/*
You should add new commands to the end of this list, otherwise old
servers won't be able to handle them as 'unsupported'.
Maximum length of the expression statement defined for generated columns.
*/
enum enum_server_command
{
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH,
/* don't forget to update const char *command_name[] in sql_parse.cc */
/* Must be last */
COM_END
};
#define GENERATED_COLUMN_EXPRESSION_MAXLEN 65535 - FRM_GCOL_HEADER_SIZE
/*
Length of random string sent by server on handshake; this is also length of
obfuscated password, recieved from client
obfuscated password, received from client
*/
#define SCRAMBLE_LENGTH 20
#define SCRAMBLE_LENGTH_323 8
#define AUTH_PLUGIN_DATA_PART_1_LENGTH 8
/* length of password stored in the db: new passwords are preceeded with '*' */
#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1)
#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
@@ -91,11 +102,27 @@ enum enum_server_command
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
#define SET_FLAG 2048 /* field is a set */
#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */
#define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */
#define NUM_FLAG 32768 /* Field is num (for clients) */
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
#define GROUP_FLAG 32768 /* Intern: Group field */
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */
#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */
/**
Intern: Field in TABLE object for new version of altered table,
which participates in a newly added index.
*/
#define FIELD_IN_ADD_INDEX (1 << 20)
#define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */
#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23 */
#define FIELD_FLAGS_STORAGE_MEDIA_MASK (3 << FIELD_FLAGS_STORAGE_MEDIA)
#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25 */
#define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT)
#define FIELD_IS_DROPPED (1<< 26) /* Intern: Field is being dropped */
#define EXPLICIT_NULL_FLAG (1<< 27) /* Field is explicitly specified as
NULL by the user */
#define REFRESH_GRANT 1 /* Refresh grant tables */
#define REFRESH_LOG 2 /* Start on new log file */
@@ -107,6 +134,12 @@ enum enum_server_command
thread */
#define REFRESH_MASTER 128 /* Remove all bin logs in the index
and truncate the index */
#define REFRESH_ERROR_LOG 256 /* Rotate only the erorr log */
#define REFRESH_ENGINE_LOG 512 /* Flush all storage engine logs */
#define REFRESH_BINARY_LOG 1024 /* Flush the binary log */
#define REFRESH_RELAY_LOG 2048 /* Flush the relay log */
#define REFRESH_GENERAL_LOG 4096 /* Flush the general log */
#define REFRESH_SLOW_LOG 8192 /* Flush the slow query log */
/* The following can't be set with mysql_refresh() */
#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
@@ -117,6 +150,8 @@ enum enum_server_command
#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
#define REFRESH_DES_KEY_FILE 0x40000L
#define REFRESH_USER_RESOURCES 0x80000L
#define REFRESH_FOR_EXPORT 0x100000L /* FLUSH TABLES ... FOR EXPORT */
#define REFRESH_OPTIMIZER_COSTS 0x200000L /* FLUSH OPTIMIZER_COSTS */
#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
@@ -133,30 +168,146 @@ enum enum_server_command
#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt support */
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
#define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31)
#define CLIENT_RESERVED2 32768 /* Old flag for 4.1 authentication */
#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */
#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */
#define CLIENT_CONNECT_ATTRS (1UL << 20) /* Client supports connection attributes */
/* Enable authentication response packet to be larger than 255 bytes. */
#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21)
/* Don't close the connection for a connection with expired password. */
#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22)
/**
Capable of handling server state change information. Its a hint to the
server to include the state change information in Ok packet.
*/
#define CLIENT_SESSION_TRACK (1UL << 23)
/* Client no longer needs EOF packet */
#define CLIENT_DEPRECATE_EOF (1UL << 24)
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
#ifdef HAVE_COMPRESS
#define CAN_CLIENT_COMPRESS CLIENT_COMPRESS
#else
#define CAN_CLIENT_COMPRESS 0
#endif
/* Gather all possible capabilites (flags) supported by the server */
#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD \
| CLIENT_FOUND_ROWS \
| CLIENT_LONG_FLAG \
| CLIENT_CONNECT_WITH_DB \
| CLIENT_NO_SCHEMA \
| CLIENT_COMPRESS \
| CLIENT_ODBC \
| CLIENT_LOCAL_FILES \
| CLIENT_IGNORE_SPACE \
| CLIENT_PROTOCOL_41 \
| CLIENT_INTERACTIVE \
| CLIENT_SSL \
| CLIENT_IGNORE_SIGPIPE \
| CLIENT_TRANSACTIONS \
| CLIENT_RESERVED \
| CLIENT_RESERVED2 \
| CLIENT_MULTI_STATEMENTS \
| CLIENT_MULTI_RESULTS \
| CLIENT_PS_MULTI_RESULTS \
| CLIENT_SSL_VERIFY_SERVER_CERT \
| CLIENT_REMEMBER_OPTIONS \
| CLIENT_PLUGIN_AUTH \
| CLIENT_CONNECT_ATTRS \
| CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA \
| CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS \
| CLIENT_SESSION_TRACK \
| CLIENT_DEPRECATE_EOF \
)
/*
Switch off the flags that are optional and depending on build flags
If any of the optional flags is supported by the build it will be switched
on before sending to the client during the connection handshake.
*/
#define CLIENT_BASIC_FLAGS (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \
& ~CLIENT_COMPRESS) \
& ~CLIENT_SSL_VERIFY_SERVER_CERT)
/**
Is raised when a multi-statement transaction
has been started, either explicitly, by means
of BEGIN or COMMIT AND CHAIN, or
implicitly, by the first transactional
statement, when autocommit=off.
*/
#define SERVER_STATUS_IN_TRANS 1
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_STATUS_MORE_RESULTS 4 /* More results on server */
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
#define SERVER_QUERY_NO_INDEX_USED 32
/*
/**
The server was able to fulfill the clients request and opened a
read-only non-scrollable cursor for a query. This flag comes
in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
*/
#define SERVER_STATUS_CURSOR_EXISTS 64
/*
/**
This flag is sent when a read-only cursor is exhausted, in reply to
COM_STMT_FETCH command.
*/
#define SERVER_STATUS_LAST_ROW_SENT 128
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
/**
Sent to the client if after a prepared statement reprepare
we discovered that the new statement returns a different
number of result set columns.
*/
#define SERVER_STATUS_METADATA_CHANGED 1024
#define SERVER_QUERY_WAS_SLOW 2048
/**
To mark ResultSet containing output parameter values.
*/
#define SERVER_PS_OUT_PARAMS 4096
/**
Set at the same time as SERVER_STATUS_IN_TRANS if the started
multi-statement transaction is a read-only transaction. Cleared
when the transaction commits or aborts. Since this flag is sent
to clients in OK and EOF packets, the flag indicates the
transaction status at the end of command execution.
*/
#define SERVER_STATUS_IN_TRANS_READONLY 8192
/**
This status flag, when on, implies that one of the state information has
changed on the server because of the execution of the last statement.
*/
#define SERVER_SESSION_STATE_CHANGED (1UL << 14)
/**
Server status flags that must be cleared when starting
execution of a new SQL statement.
Flags from this set are only added to the
current server status by the execution engine, but
never removed -- the execution engine expects them
to disappear automagically by the next command.
*/
#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \
SERVER_QUERY_NO_INDEX_USED|\
SERVER_MORE_RESULTS_EXISTS|\
SERVER_STATUS_METADATA_CHANGED |\
SERVER_QUERY_WAS_SLOW |\
SERVER_STATUS_DB_DROPPED |\
SERVER_STATUS_CURSOR_EXISTS|\
SERVER_STATUS_LAST_ROW_SENT|\
SERVER_SESSION_STATE_CHANGED)
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */
@@ -165,6 +316,7 @@ enum enum_server_command
#define ONLY_KILL_QUERY 1
struct st_vio; /* Only C */
typedef struct st_vio Vio;
@@ -174,71 +326,58 @@ typedef struct st_vio Vio;
#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */
#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */
#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */
#define MAX_BLOB_WIDTH 8192 /* Default width for blob */
#define MAX_BLOB_WIDTH 16777216 /* Default width for blob */
typedef struct st_net {
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
Vio* vio;
Vio *vio;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
my_socket fd; /* For Perl DBI/dbd */
unsigned long max_packet,max_packet_size;
unsigned int pkt_nr,compress_pkt_nr;
unsigned int write_timeout, read_timeout, retry_count;
int fcntl;
my_bool compress;
/*
The following variable is set if we are doing several queries in one
command ( as in LOAD TABLE ... FROM MASTER ),
and do not want to confuse the client with OK at the wrong time
*/
unsigned long remain_in_buf,length, buf_length, where_b;
unsigned long max_packet,max_packet_size;
unsigned int pkt_nr,compress_pkt_nr;
unsigned int write_timeout, read_timeout, retry_count;
int fcntl;
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
my_bool no_send_ok; /* For SPs and other things that do multiple stmts */
my_bool no_send_eof; /* For SPs' first version read-only cursors */
/*
Set if OK packet is already sent, and we do not need to send error
messages
*/
my_bool no_send_error;
my_bool unused1; /* Please remove with the next incompatible ABI change */
my_bool unused2; /* Please remove with the next incompatible ABI change */
my_bool compress;
my_bool unused3; /* Please remove with the next incompatible ABI change. */
/*
Pointer to query object in query cache, do not equal NULL (0) for
queries in cache that have not stored its results yet
*/
#endif
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
/*
Unused, please remove with the next incompatible ABI change.
*/
unsigned char *unused;
unsigned int last_errno;
unsigned char error;
gptr query_cache_query;
my_bool report_error; /* We should report error (we have unreported error) */
my_bool return_errno;
unsigned char error;
my_bool unused4; /* Please remove with the next incompatible ABI change. */
my_bool unused5; /* Please remove with the next incompatible ABI change. */
/** Client library error message buffer. Actually belongs to struct MYSQL. */
char last_error[MYSQL_ERRMSG_SIZE];
/** Client library sqlstate buffer. Set along with the error message. */
char sqlstate[SQLSTATE_LENGTH+1];
/**
Extension pointer, for the caller private use.
Any program linking with the networking library can use this pointer,
which is handy when private connection specific data needs to be
maintained.
The mysqld server process uses this pointer internally,
to maintain the server internal instrumentation for the connection.
*/
void *extension;
} NET;
#define packet_error (~(unsigned long) 0)
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
MYSQL_TYPE_TINY_BLOB=249,
MYSQL_TYPE_MEDIUM_BLOB=250,
MYSQL_TYPE_LONG_BLOB=251,
MYSQL_TYPE_BLOB=252,
MYSQL_TYPE_VAR_STRING=253,
MYSQL_TYPE_STRING=254,
MYSQL_TYPE_GEOMETRY=255
};
/* For backward compatibility */
#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS
#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
@@ -297,9 +436,7 @@ enum mysql_enum_shutdown_level {
/* don't flush InnoDB buffers, flush other storage engines' buffers*/
SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1,
/* Now the 2 levels of the KILL command */
#if MYSQL_VERSION_ID >= 50000
KILL_QUERY= 254,
#endif
KILL_CONNECTION= 255
};
@@ -320,6 +457,30 @@ enum enum_mysql_set_option
MYSQL_OPTION_MULTI_STATEMENTS_OFF
};
/*
Type of state change information that the server can include in the Ok
packet.
Note : 1) session_state_type shouldn't go past 255 (i.e. 1-byte boundary).
2) Modify the definition of SESSION_TRACK_END when a new member is
added.
*/
enum enum_session_state_type
{
SESSION_TRACK_SYSTEM_VARIABLES, /* Session system variables */
SESSION_TRACK_SCHEMA, /* Current schema */
SESSION_TRACK_STATE_CHANGE, /* track session state changes */
SESSION_TRACK_GTIDS,
SESSION_TRACK_TRANSACTION_CHARACTERISTICS, /* Transaction chistics */
SESSION_TRACK_TRANSACTION_STATE /* Transaction state */
};
#define SESSION_TRACK_BEGIN SESSION_TRACK_SYSTEM_VARIABLES
#define SESSION_TRACK_END SESSION_TRACK_TRANSACTION_STATE
#define IS_SESSION_STATE_TYPE(T) \
(((int)(T) >= SESSION_TRACK_BEGIN) && ((T) <= SESSION_TRACK_END))
#define net_new_transaction(net) ((net)->pkt_nr=0)
#ifdef __cplusplus
@@ -327,25 +488,23 @@ extern "C" {
#endif
my_bool my_net_init(NET *net, Vio* vio);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net);
my_bool net_realloc(NET *net, unsigned long length);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net, my_bool check_buffer);
void net_claim_memory_ownership(NET *net);
my_bool net_realloc(NET *net, size_t length);
my_bool net_flush(NET *net);
my_bool my_net_write(NET *net,const char *packet,unsigned long len);
my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
my_bool net_write_command(NET *net,unsigned char command,
const char *header, unsigned long head_len,
const char *packet, unsigned long len);
int net_real_write(NET *net,const char *packet,unsigned long len);
const unsigned char *header, size_t head_len,
const unsigned char *packet, size_t len);
my_bool net_write_packet(NET *net, const unsigned char *packet, size_t length);
unsigned long my_net_read(NET *net);
/*
The following function is not meant for normal usage
Currently it's used internally by manager.c
*/
struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
unsigned int timeout);
#ifdef MY_GLOBAL_INCLUDED
void my_net_set_write_timeout(NET *net, uint timeout);
void my_net_set_read_timeout(NET *net, uint timeout);
#endif
struct rand_struct {
unsigned long seed1,seed2,max_value;
@@ -370,18 +529,24 @@ typedef struct st_udf_args
char *maybe_null; /* Set to 1 for all maybe_null args */
char **attributes; /* Pointer to attribute name */
unsigned long *attribute_lengths; /* Length of attribute arguments */
void *extension;
} UDF_ARGS;
/* This holds information about the result */
typedef struct st_udf_init
{
my_bool maybe_null; /* 1 if function can return NULL */
unsigned int decimals; /* for real functions */
unsigned long max_length; /* For string functions */
char *ptr; /* free pointer for function data */
my_bool const_item; /* 0 if result is independent of arguments */
my_bool maybe_null; /* 1 if function can return NULL */
unsigned int decimals; /* for real functions */
unsigned long max_length; /* For string functions */
char *ptr; /* free pointer for function data */
my_bool const_item; /* 1 if function always returns the same value */
void *extension;
} UDF_INIT;
/*
TODO: add a notion for determinism of the UDF.
See Item_udf_func::update_used_tables ()
*/
/* Constants when using compression */
#define NET_HEADER_SIZE 4 /* standard header size */
@@ -406,14 +571,14 @@ void create_random_string(char *to, unsigned int length, struct rand_struct *ran
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
void make_scrambled_password_323(char *to, const char *password);
void scramble_323(char *to, const char *message, const char *password);
my_bool check_scramble_323(const char *, const char *message,
my_bool check_scramble_323(const unsigned char *reply, const char *message,
unsigned long *salt);
void get_salt_from_password_323(unsigned long *res, const char *password);
void make_password_from_salt_323(char *to, const unsigned long *salt);
void make_scrambled_password(char *to, const char *password);
void scramble(char *to, const char *message, const char *password);
my_bool check_scramble(const char *reply, const char *message,
my_bool check_scramble(const unsigned char *reply, const char *message,
const unsigned char *hash_stage2);
void get_salt_from_password(unsigned char *res, const char *password);
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
@@ -421,24 +586,19 @@ char *octet2hex(char *to, const char *str, unsigned int len);
/* end of password.c */
char *get_tty_password(char *opt_message);
char *get_tty_password(const char *opt_message);
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
/* Some other useful functions */
my_bool my_init(void);
extern int modify_defaults_file(const char *file_location, const char *option,
const char *option_value,
const char *section_name, int remove_option);
int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv);
my_bool my_thread_init(void);
void my_thread_end(void);
#ifdef _global_h
#ifdef MY_GLOBAL_INCLUDED
ulong STDCALL net_field_length(uchar **packet);
my_ulonglong net_field_length_ll(uchar **packet);
char *net_store_length(char *pkg, ulonglong length);
uchar *net_store_length(uchar *pkg, ulonglong length);
unsigned int net_length_size(ulonglong num);
#endif
#ifdef __cplusplus
@@ -449,4 +609,5 @@ char *net_store_length(char *pkg, ulonglong length);
#define MYSQL_STMT_HEADER 4
#define MYSQL_LONG_DATA_HEADER 6
#define NOT_FIXED_DEC 31
#endif

View File

@@ -0,0 +1,41 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Definitions private to the server,
used in the networking layer to notify specific events.
*/
#ifndef _mysql_com_server_h
#define _mysql_com_server_h
struct st_net_server;
typedef void (*before_header_callback_fn)
(struct st_net *net, void *user_data, size_t count);
typedef void (*after_header_callback_fn)
(struct st_net *net, void *user_data, size_t count, my_bool rc);
struct st_net_server
{
before_header_callback_fn m_before_header;
after_header_callback_fn m_after_header;
void *m_user_data;
};
typedef struct st_net_server NET_SERVER;
#endif

29
3rdparty/mysql/include/mysql_embed.h vendored Normal file
View File

@@ -0,0 +1,29 @@
#ifndef MYSQL_EMBED_INCLUDED
#define MYSQL_EMBED_INCLUDED
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Defines that are unique to the embedded version of MySQL */
#ifdef EMBEDDED_LIBRARY
/* Things we don't need in the embedded version of MySQL */
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
#undef HAVE_DLOPEN /* No udf functions */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_EMBED_INCLUDED */

View File

@@ -1,9 +1,8 @@
/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef _mysql_time_h_
#define _mysql_time_h_
@@ -48,7 +47,7 @@ enum enum_mysql_timestamp_type
typedef struct st_mysql_time
{
unsigned int year, month, day, hour, minute, second;
unsigned long second_part;
unsigned long second_part; /**< microseconds */
my_bool neg;
enum enum_mysql_timestamp_type time_type;
} MYSQL_TIME;

View File

@@ -1,5 +1,7 @@
/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
This file is public domain and comes with NO WARRANTY of any kind */
/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB
& Detron HB, 1996, 1999-2004, 2007 MySQL AB.
This file is public domain and comes with NO WARRANTY of any kind
*/
/* Version numbers for protocol & mysqld */
@@ -8,22 +10,22 @@
#ifdef _CUSTOMCONFIG_
#include <custom_conf.h>
#else
#define PROTOCOL_VERSION 10
#define MYSQL_SERVER_VERSION "5.0.20"
#define MYSQL_BASE_VERSION "mysqld-5.0"
#define MYSQL_SERVER_SUFFIX_DEF "-community-max-nt"
#define FRM_VER 6
#define MYSQL_VERSION_ID 50020
#define MYSQL_PORT 3306
#define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
#define MYSQL_CONFIG_NAME "my"
#define MYSQL_COMPILATION_COMMENT "MySQL Community Edition - Max (GPL)"
#define PROTOCOL_VERSION 10
#define MYSQL_SERVER_VERSION "5.7.16"
#define MYSQL_VERSION_ID 50716
#define MYSQL_PORT 3306
#define MYSQL_PORT_DEFAULT 0
#define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
#define MYSQL_CONFIG_NAME "my"
#define MYSQL_COMPILATION_COMMENT "MySQL Connector/C (GPL)"
#define LIBMYSQL_VERSION "6.1.9"
#define LIBMYSQL_VERSION_ID 60109
/* mysqld compile time options */
#endif /* _CUSTOMCONFIG_ */
#ifndef LICENSE
#define LICENSE GPL
#define LICENSE GPL
#endif /* LICENSE */
#endif /* _mysql_version_h */

1082
3rdparty/mysql/include/mysqld_ername.h vendored Normal file

File diff suppressed because it is too large Load Diff

1089
3rdparty/mysql/include/mysqld_error.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,159 +0,0 @@
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Parser needs these defines always, even if USE_RAID is not defined */
#define RAID_TYPE_0 1 /* Striping */
#define RAID_TYPE_x 2 /* Some new modes */
#define RAID_TYPE_y 3
#define RAID_DEFAULT_CHUNKS 4
#define RAID_DEFAULT_CHUNKSIZE 256*1024 /* 256kB */
C_MODE_START
#define my_raid_type(raid_type) raid_type_string[(int)(raid_type)]
extern const char *raid_type_string[];
C_MODE_END
#ifdef DONT_USE_RAID
#undef USE_RAID
#endif
#if defined(USE_RAID)
#include "my_dir.h"
/* Trap all occurences of my_...() in source and use our wrapper around this function */
#ifdef MAP_TO_USE_RAID
#define my_read(A,B,C,D) my_raid_read(A,B,C,D)
#define my_write(A,B,C,D) my_raid_write(A,B,C,D)
#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E)
#define my_pread(A,B,C,D,E) my_raid_pread(A,B,C,D,E)
#define my_chsize(A,B,C,D) my_raid_chsize(A,B,C,D)
#define my_close(A,B) my_raid_close(A,B)
#define my_tell(A,B) my_raid_tell(A,B)
#define my_seek(A,B,C,D) my_raid_seek(A,B,C,D)
#define my_lock(A,B,C,D,E) my_raid_lock(A,B,C,D,E)
#define my_fstat(A,B,C) my_raid_fstat(A,B,C)
#endif /* MAP_TO_USE_RAID */
#ifdef __cplusplus
extern "C" {
#endif
void init_raid(void);
void end_raid(void);
bool is_raid(File fd);
File my_raid_create(const char *FileName, int CreateFlags, int access_flags,
uint raid_type, uint raid_chunks, ulong raid_chunksize,
myf MyFlags);
File my_raid_open(const char *FileName, int Flags,
uint raid_type, uint raid_chunks, ulong raid_chunksize,
myf MyFlags);
int my_raid_rename(const char *from, const char *to, uint raid_chunks,
myf MyFlags);
int my_raid_delete(const char *from, uint raid_chunks, myf MyFlags);
int my_raid_redel(const char *old_name, const char *new_name,
uint raid_chunks, myf MyFlags);
my_off_t my_raid_seek(File fd, my_off_t pos, int whence, myf MyFlags);
my_off_t my_raid_tell(File fd, myf MyFlags);
uint my_raid_write(File,const byte *Buffer, uint Count, myf MyFlags);
uint my_raid_read(File Filedes, byte *Buffer, uint Count, myf MyFlags);
uint my_raid_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
myf MyFlags);
uint my_raid_pwrite(int Filedes, const byte *Buffer, uint Count,
my_off_t offset, myf MyFlags);
int my_raid_lock(File,int locktype, my_off_t start, my_off_t length,
myf MyFlags);
int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
int my_raid_close(File, myf MyFlags);
int my_raid_fstat(int Filedes, struct stat *buf, myf MyFlags);
#ifdef __cplusplus
}
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
class RaidName {
public:
RaidName(const char *FileName);
~RaidName();
bool IsRaid();
int Rename(const char * from, const char * to, myf MyFlags);
private:
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
uint _raid_chunks; /* 1..n */
ulong _raid_chunksize; /* 1..n in bytes */
};
class RaidFd {
public:
RaidFd(uint raid_type, uint raid_chunks , ulong raid_chunksize);
~RaidFd();
File Create(const char *FileName, int CreateFlags, int access_flags,
myf MyFlags);
File Open(const char *FileName, int Flags, myf MyFlags);
my_off_t Seek(my_off_t pos,int whence,myf MyFlags);
my_off_t Tell(myf MyFlags);
int Write(const byte *Buffer, uint Count, myf MyFlags);
int Read(const byte *Buffer, uint Count, myf MyFlags);
int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags);
int Chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
int Fstat(int fd, MY_STAT *stat_area, myf MyFlags );
int Close(myf MyFlags);
static bool IsRaid(File fd);
static DYNAMIC_ARRAY _raid_map; /* Map of RaidFD* */
private:
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
uint _raid_chunks; /* 1..n */
ulong _raid_chunksize; /* 1..n in bytes */
ulong _total_block; /* We are operating with block no x (can be 0..many). */
uint _this_block; /* can be 0.._raid_chunks */
uint _remaining_bytes; /* Maximum bytes that can be written in this block */
my_off_t _position;
my_off_t _size; /* Cached file size for faster seek(SEEK_END) */
File _fd;
File *_fd_vector; /* Array of File */
off_t *_seek_vector; /* Array of cached seek positions */
inline void Calculate()
{
DBUG_ENTER("RaidFd::_Calculate");
DBUG_PRINT("info",("_position: %lu _raid_chunksize: %d, _size: %lu",
(ulong) _position, _raid_chunksize, (ulong) _size));
_total_block = (ulong) (_position / _raid_chunksize);
_this_block = _total_block % _raid_chunks; /* can be 0.._raid_chunks */
_remaining_bytes = (uint) (_raid_chunksize -
(_position - _total_block * _raid_chunksize));
DBUG_PRINT("info",
("_total_block: %d this_block: %d _remaining_bytes:%d",
_total_block, _this_block, _remaining_bytes));
DBUG_VOID_RETURN;
}
};
#endif /* __cplusplus */
#endif /* USE_RAID */

206
3rdparty/mysql/include/sql_common.h vendored Normal file
View File

@@ -0,0 +1,206 @@
#ifndef SQL_COMMON_INCLUDED
#define SQL_COMMON_INCLUDED
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#define SQL_COMMON_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include <mysql.h>
#include <hash.h>
extern const char *unknown_sqlstate;
extern const char *cant_connect_sqlstate;
extern const char *not_error_sqlstate;
/*
Free all memory allocated in MYSQL handle except the
current options.
*/
void mysql_close_free(MYSQL *mysql);
/*
Clear connection options stored in MYSQL handle and
free memory used by them.
*/
void mysql_close_free_options(MYSQL *mysql);
/**
The structure is used to hold the state change information
received from the server. LIST functions are used for manipulation
of the members of the structure.
*/
typedef struct st_session_track_info_node {
/** head_node->data is a LEX_STRING which contains the variable name. */
LIST *head_node;
LIST *current_node;
} STATE_INFO_NODE;
/**
Store the change info received from the server in an array of linked lists
with STATE_INFO_NODE elements (one per state type).
*/
typedef struct st_session_track_info {
/** Array of STATE_NODE_INFO elements (one per state type). */
struct st_session_track_info_node info_list[SESSION_TRACK_END + 1];
} STATE_INFO;
/*
Access to MYSQL::extension member.
Note: functions mysql_extension_{init,free}() are defined
in client.c.
*/
struct st_mysql_trace_info;
typedef struct st_mysql_extension {
struct st_mysql_trace_info *trace_data;
struct st_session_track_info state_change;
} MYSQL_EXTENSION;
/* "Constructor/destructor" for MYSQL extension structure. */
struct st_mysql_extension* mysql_extension_init(struct st_mysql*);
void mysql_extension_free(struct st_mysql_extension*);
/*
Note: Allocated extension structure is freed in mysql_close_free()
called by mysql_close().
*/
#define MYSQL_EXTENSION_PTR(H) \
( \
(struct st_mysql_extension*) \
( (H)->extension ? \
(H)->extension : ((H)->extension= mysql_extension_init(H)) \
) \
)
struct st_mysql_options_extention {
char *plugin_dir;
char *default_auth;
char *ssl_crl; /* PEM CRL file */
char *ssl_crlpath; /* PEM directory of CRL-s? */
HASH connection_attributes;
char *server_public_key_path;
size_t connection_attributes_length;
my_bool enable_cleartext_plugin;
my_bool unused0; /* Former ssl_enforce */
char *tls_version; /* TLS version option */
long ssl_ctx_flags; /* SSL ctx options flag */
unsigned int ssl_mode;
};
typedef struct st_mysql_methods
{
my_bool (*read_query_result)(MYSQL *mysql);
my_bool (*advanced_command)(MYSQL *mysql,
enum enum_server_command command,
const unsigned char *header,
size_t header_length,
const unsigned char *arg,
size_t arg_length,
my_bool skip_check,
MYSQL_STMT *stmt);
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
unsigned int fields);
MYSQL_RES * (*use_result)(MYSQL *mysql);
void (*fetch_lengths)(unsigned long *to,
MYSQL_ROW column, unsigned int field_count);
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
int (*read_change_user_result)(MYSQL *mysql);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt);
int (*read_binary_rows)(MYSQL_STMT *stmt);
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
void (*free_embedded_thd)(MYSQL *mysql);
const char *(*read_statistics)(MYSQL *mysql);
my_bool (*next_result)(MYSQL *mysql);
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
void (*free_rows)(MYSQL_DATA *cur);
#endif
} MYSQL_METHODS;
#define simple_command(mysql, command, arg, length, skip_check) \
((mysql)->methods \
? (*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, skip_check, NULL) \
: (set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate), 1))
#define stmt_command(mysql, command, arg, length, stmt) \
((mysql)->methods \
? (*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, 1, stmt) \
: (set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate), 1))
extern CHARSET_INFO *default_client_charset_info;
MYSQL_FIELD *unpack_fields(MYSQL *mysql, MYSQL_ROWS *data,MEM_ROOT *alloc,
uint fields, my_bool default_value,
uint server_capabilities);
MYSQL_FIELD * cli_read_metadata_ex(MYSQL *mysql, MEM_ROOT *alloc,
unsigned long field_count,
unsigned int fields);
MYSQL_FIELD * cli_read_metadata(MYSQL *mysql, unsigned long field_count,
unsigned int fields);
void free_rows(MYSQL_DATA *cur);
void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql);
my_bool mysql_reconnect(MYSQL *mysql);
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group);
my_bool
cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
const unsigned char *header, size_t header_length,
const unsigned char *arg, size_t arg_length,
my_bool skip_check, MYSQL_STMT *stmt);
unsigned long cli_safe_read(MYSQL *mysql, my_bool *is_data_packet);
unsigned long cli_safe_read_with_ok(MYSQL *mysql, my_bool parse_ok,
my_bool *is_data_packet);
void net_clear_error(NET *net);
void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net);
void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate,
const char *err);
void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate,
const char *format, ...);
/* client side of the pluggable authentication */
struct st_plugin_vio_info;
void mpvio_info(Vio *vio, struct st_plugin_vio_info *info);
int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
const char *data_plugin, const char *db);
int mysql_client_plugin_init();
void mysql_client_plugin_deinit();
struct st_mysql_client_plugin;
extern struct st_mysql_client_plugin *mysql_client_builtins[];
uchar * send_client_connect_attrs(MYSQL *mysql, uchar *buf);
extern my_bool libmysql_cleartext_plugin_enabled;
void read_ok_ex(MYSQL *mysql, unsigned long len);
#ifdef __cplusplus
}
#endif
#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)
#endif /* SQL_COMMON_INCLUDED */

255
3rdparty/mysql/include/sql_state.h vendored Normal file
View File

@@ -0,0 +1,255 @@
/* Autogenerated file, please don't edit */
{ ER_DUP_KEY ,"23000", "" },
{ ER_OUTOFMEMORY ,"HY001", "S1001" },
{ ER_OUT_OF_SORTMEMORY ,"HY001", "S1001" },
{ ER_CON_COUNT_ERROR ,"08004", "" },
{ ER_BAD_HOST_ERROR ,"08S01", "" },
{ ER_HANDSHAKE_ERROR ,"08S01", "" },
{ ER_DBACCESS_DENIED_ERROR ,"42000", "" },
{ ER_ACCESS_DENIED_ERROR ,"28000", "" },
{ ER_NO_DB_ERROR ,"3D000", "" },
{ ER_UNKNOWN_COM_ERROR ,"08S01", "" },
{ ER_BAD_NULL_ERROR ,"23000", "" },
{ ER_BAD_DB_ERROR ,"42000", "" },
{ ER_TABLE_EXISTS_ERROR ,"42S01", "" },
{ ER_BAD_TABLE_ERROR ,"42S02", "" },
{ ER_NON_UNIQ_ERROR ,"23000", "" },
{ ER_SERVER_SHUTDOWN ,"08S01", "" },
{ ER_BAD_FIELD_ERROR ,"42S22", "S0022" },
{ ER_WRONG_FIELD_WITH_GROUP ,"42000", "S1009" },
{ ER_WRONG_GROUP_FIELD ,"42000", "S1009" },
{ ER_WRONG_SUM_SELECT ,"42000", "S1009" },
{ ER_WRONG_VALUE_COUNT ,"21S01", "" },
{ ER_TOO_LONG_IDENT ,"42000", "S1009" },
{ ER_DUP_FIELDNAME ,"42S21", "S1009" },
{ ER_DUP_KEYNAME ,"42000", "S1009" },
{ ER_DUP_ENTRY ,"23000", "S1009" },
{ ER_WRONG_FIELD_SPEC ,"42000", "S1009" },
{ ER_PARSE_ERROR ,"42000", "s1009" },
{ ER_EMPTY_QUERY ,"42000", "" },
{ ER_NONUNIQ_TABLE ,"42000", "S1009" },
{ ER_INVALID_DEFAULT ,"42000", "S1009" },
{ ER_MULTIPLE_PRI_KEY ,"42000", "S1009" },
{ ER_TOO_MANY_KEYS ,"42000", "S1009" },
{ ER_TOO_MANY_KEY_PARTS ,"42000", "S1009" },
{ ER_TOO_LONG_KEY ,"42000", "S1009" },
{ ER_KEY_COLUMN_DOES_NOT_EXITS ,"42000", "S1009" },
{ ER_BLOB_USED_AS_KEY ,"42000", "S1009" },
{ ER_TOO_BIG_FIELDLENGTH ,"42000", "S1009" },
{ ER_WRONG_AUTO_KEY ,"42000", "S1009" },
{ ER_FORCING_CLOSE ,"08S01", "" },
{ ER_IPSOCK_ERROR ,"08S01", "" },
{ ER_NO_SUCH_INDEX ,"42S12", "S1009" },
{ ER_WRONG_FIELD_TERMINATORS ,"42000", "S1009" },
{ ER_BLOBS_AND_NO_TERMINATED ,"42000", "S1009" },
{ ER_CANT_REMOVE_ALL_FIELDS ,"42000", "" },
{ ER_CANT_DROP_FIELD_OR_KEY ,"42000", "" },
{ ER_BLOB_CANT_HAVE_DEFAULT ,"42000", "" },
{ ER_WRONG_DB_NAME ,"42000", "" },
{ ER_WRONG_TABLE_NAME ,"42000", "" },
{ ER_TOO_BIG_SELECT ,"42000", "" },
{ ER_UNKNOWN_PROCEDURE ,"42000", "" },
{ ER_WRONG_PARAMCOUNT_TO_PROCEDURE ,"42000", "" },
{ ER_UNKNOWN_TABLE ,"42S02", "" },
{ ER_FIELD_SPECIFIED_TWICE ,"42000", "" },
{ ER_UNSUPPORTED_EXTENSION ,"42000", "" },
{ ER_TABLE_MUST_HAVE_COLUMNS ,"42000", "" },
{ ER_UNKNOWN_CHARACTER_SET ,"42000", "" },
{ ER_TOO_BIG_ROWSIZE ,"42000", "" },
{ ER_WRONG_OUTER_JOIN ,"42000", "" },
{ ER_NULL_COLUMN_IN_INDEX ,"42000", "" },
{ ER_PASSWORD_ANONYMOUS_USER ,"42000", "" },
{ ER_PASSWORD_NOT_ALLOWED ,"42000", "" },
{ ER_PASSWORD_NO_MATCH ,"42000", "" },
{ ER_WRONG_VALUE_COUNT_ON_ROW ,"21S01", "" },
{ ER_INVALID_USE_OF_NULL ,"22004", "" },
{ ER_REGEXP_ERROR ,"42000", "" },
{ ER_MIX_OF_GROUP_FUNC_AND_FIELDS ,"42000", "" },
{ ER_NONEXISTING_GRANT ,"42000", "" },
{ ER_TABLEACCESS_DENIED_ERROR ,"42000", "" },
{ ER_COLUMNACCESS_DENIED_ERROR ,"42000", "" },
{ ER_ILLEGAL_GRANT_FOR_TABLE ,"42000", "" },
{ ER_GRANT_WRONG_HOST_OR_USER ,"42000", "" },
{ ER_NO_SUCH_TABLE ,"42S02", "" },
{ ER_NONEXISTING_TABLE_GRANT ,"42000", "" },
{ ER_NOT_ALLOWED_COMMAND ,"42000", "" },
{ ER_SYNTAX_ERROR ,"42000", "" },
{ ER_ABORTING_CONNECTION ,"08S01", "" },
{ ER_NET_PACKET_TOO_LARGE ,"08S01", "" },
{ ER_NET_READ_ERROR_FROM_PIPE ,"08S01", "" },
{ ER_NET_FCNTL_ERROR ,"08S01", "" },
{ ER_NET_PACKETS_OUT_OF_ORDER ,"08S01", "" },
{ ER_NET_UNCOMPRESS_ERROR ,"08S01", "" },
{ ER_NET_READ_ERROR ,"08S01", "" },
{ ER_NET_READ_INTERRUPTED ,"08S01", "" },
{ ER_NET_ERROR_ON_WRITE ,"08S01", "" },
{ ER_NET_WRITE_INTERRUPTED ,"08S01", "" },
{ ER_TOO_LONG_STRING ,"42000", "" },
{ ER_TABLE_CANT_HANDLE_BLOB ,"42000", "" },
{ ER_TABLE_CANT_HANDLE_AUTO_INCREMENT ,"42000", "" },
{ ER_WRONG_COLUMN_NAME ,"42000", "" },
{ ER_WRONG_KEY_COLUMN ,"42000", "" },
{ ER_DUP_UNIQUE ,"23000", "" },
{ ER_BLOB_KEY_WITHOUT_LENGTH ,"42000", "" },
{ ER_PRIMARY_CANT_HAVE_NULL ,"42000", "" },
{ ER_TOO_MANY_ROWS ,"42000", "" },
{ ER_REQUIRES_PRIMARY_KEY ,"42000", "" },
{ ER_KEY_DOES_NOT_EXITS ,"42000", "S1009" },
{ ER_CHECK_NO_SUCH_TABLE ,"42000", "" },
{ ER_CHECK_NOT_IMPLEMENTED ,"42000", "" },
{ ER_CANT_DO_THIS_DURING_AN_TRANSACTION ,"25000", "" },
{ ER_NEW_ABORTING_CONNECTION ,"08S01", "" },
{ ER_MASTER_NET_READ ,"08S01", "" },
{ ER_MASTER_NET_WRITE ,"08S01", "" },
{ ER_TOO_MANY_USER_CONNECTIONS ,"42000", "" },
{ ER_READ_ONLY_TRANSACTION ,"25000", "" },
{ ER_NO_PERMISSION_TO_CREATE_USER ,"42000", "" },
{ ER_LOCK_DEADLOCK ,"40001", "" },
{ ER_NO_REFERENCED_ROW ,"23000", "" },
{ ER_ROW_IS_REFERENCED ,"23000", "" },
{ ER_CONNECT_TO_MASTER ,"08S01", "" },
{ ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT ,"21000", "" },
{ ER_USER_LIMIT_REACHED ,"42000", "" },
{ ER_SPECIFIC_ACCESS_DENIED_ERROR ,"42000", "" },
{ ER_NO_DEFAULT ,"42000", "" },
{ ER_WRONG_VALUE_FOR_VAR ,"42000", "" },
{ ER_WRONG_TYPE_FOR_VAR ,"42000", "" },
{ ER_CANT_USE_OPTION_HERE ,"42000", "" },
{ ER_NOT_SUPPORTED_YET ,"42000", "" },
{ ER_WRONG_FK_DEF ,"42000", "" },
{ ER_OPERAND_COLUMNS ,"21000", "" },
{ ER_SUBQUERY_NO_1_ROW ,"21000", "" },
{ ER_ILLEGAL_REFERENCE ,"42S22", "" },
{ ER_DERIVED_MUST_HAVE_ALIAS ,"42000", "" },
{ ER_SELECT_REDUCED ,"01000", "" },
{ ER_TABLENAME_NOT_ALLOWED_HERE ,"42000", "" },
{ ER_NOT_SUPPORTED_AUTH_MODE ,"08004", "" },
{ ER_SPATIAL_CANT_HAVE_NULL ,"42000", "" },
{ ER_COLLATION_CHARSET_MISMATCH ,"42000", "" },
{ ER_WARN_TOO_FEW_RECORDS ,"01000", "" },
{ ER_WARN_TOO_MANY_RECORDS ,"01000", "" },
{ ER_WARN_NULL_TO_NOTNULL ,"22004", "" },
{ ER_WARN_DATA_OUT_OF_RANGE ,"22003", "" },
{ WARN_DATA_TRUNCATED ,"01000", "" },
{ ER_WRONG_NAME_FOR_INDEX ,"42000", "" },
{ ER_WRONG_NAME_FOR_CATALOG ,"42000", "" },
{ ER_UNKNOWN_STORAGE_ENGINE ,"42000", "" },
{ ER_TRUNCATED_WRONG_VALUE ,"22007", "" },
{ ER_SP_NO_RECURSIVE_CREATE ,"2F003", "" },
{ ER_SP_ALREADY_EXISTS ,"42000", "" },
{ ER_SP_DOES_NOT_EXIST ,"42000", "" },
{ ER_SP_LILABEL_MISMATCH ,"42000", "" },
{ ER_SP_LABEL_REDEFINE ,"42000", "" },
{ ER_SP_LABEL_MISMATCH ,"42000", "" },
{ ER_SP_UNINIT_VAR ,"01000", "" },
{ ER_SP_BADSELECT ,"0A000", "" },
{ ER_SP_BADRETURN ,"42000", "" },
{ ER_SP_BADSTATEMENT ,"0A000", "" },
{ ER_UPDATE_LOG_DEPRECATED_IGNORED ,"42000", "" },
{ ER_UPDATE_LOG_DEPRECATED_TRANSLATED ,"42000", "" },
{ ER_QUERY_INTERRUPTED ,"70100", "" },
{ ER_SP_WRONG_NO_OF_ARGS ,"42000", "" },
{ ER_SP_COND_MISMATCH ,"42000", "" },
{ ER_SP_NORETURN ,"42000", "" },
{ ER_SP_NORETURNEND ,"2F005", "" },
{ ER_SP_BAD_CURSOR_QUERY ,"42000", "" },
{ ER_SP_BAD_CURSOR_SELECT ,"42000", "" },
{ ER_SP_CURSOR_MISMATCH ,"42000", "" },
{ ER_SP_CURSOR_ALREADY_OPEN ,"24000", "" },
{ ER_SP_CURSOR_NOT_OPEN ,"24000", "" },
{ ER_SP_UNDECLARED_VAR ,"42000", "" },
{ ER_SP_FETCH_NO_DATA ,"02000", "" },
{ ER_SP_DUP_PARAM ,"42000", "" },
{ ER_SP_DUP_VAR ,"42000", "" },
{ ER_SP_DUP_COND ,"42000", "" },
{ ER_SP_DUP_CURS ,"42000", "" },
{ ER_SP_SUBSELECT_NYI ,"0A000", "" },
{ ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG ,"0A000", "" },
{ ER_SP_VARCOND_AFTER_CURSHNDLR ,"42000", "" },
{ ER_SP_CURSOR_AFTER_HANDLER ,"42000", "" },
{ ER_SP_CASE_NOT_FOUND ,"20000", "" },
{ ER_DIVISION_BY_ZERO ,"22012", "" },
{ ER_ILLEGAL_VALUE_FOR_TYPE ,"22007", "" },
{ ER_PROCACCESS_DENIED_ERROR ,"42000", "" },
{ ER_XAER_NOTA ,"XAE04", "" },
{ ER_XAER_INVAL ,"XAE05", "" },
{ ER_XAER_RMFAIL ,"XAE07", "" },
{ ER_XAER_OUTSIDE ,"XAE09", "" },
{ ER_XAER_RMERR ,"XAE03", "" },
{ ER_XA_RBROLLBACK ,"XA100", "" },
{ ER_NONEXISTING_PROC_GRANT ,"42000", "" },
{ ER_DATA_TOO_LONG ,"22001", "" },
{ ER_SP_BAD_SQLSTATE ,"42000", "" },
{ ER_CANT_CREATE_USER_WITH_GRANT ,"42000", "" },
{ ER_SP_DUP_HANDLER ,"42000", "" },
{ ER_SP_NOT_VAR_ARG ,"42000", "" },
{ ER_SP_NO_RETSET ,"0A000", "" },
{ ER_CANT_CREATE_GEOMETRY_OBJECT ,"22003", "" },
{ ER_TOO_BIG_SCALE ,"42000", "S1009" },
{ ER_TOO_BIG_PRECISION ,"42000", "S1009" },
{ ER_M_BIGGER_THAN_D ,"42000", "S1009" },
{ ER_TOO_LONG_BODY ,"42000", "S1009" },
{ ER_TOO_BIG_DISPLAYWIDTH ,"42000", "S1009" },
{ ER_XAER_DUPID ,"XAE08", "" },
{ ER_DATETIME_FUNCTION_OVERFLOW ,"22008", "" },
{ ER_ROW_IS_REFERENCED_2 ,"23000", "" },
{ ER_NO_REFERENCED_ROW_2 ,"23000", "" },
{ ER_SP_BAD_VAR_SHADOW ,"42000", "" },
{ ER_SP_WRONG_NAME ,"42000", "" },
{ ER_SP_NO_AGGREGATE ,"42000", "" },
{ ER_MAX_PREPARED_STMT_COUNT_REACHED ,"42000", "" },
{ ER_NON_GROUPING_FIELD_USED ,"42000", "" },
{ ER_FOREIGN_DUPLICATE_KEY_OLD_UNUSED ,"23000", "S1009" },
{ ER_CANT_CHANGE_TX_CHARACTERISTICS ,"25001", "" },
{ ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT ,"42000", "" },
{ ER_WRONG_PARAMETERS_TO_NATIVE_FCT ,"42000", "" },
{ ER_WRONG_PARAMETERS_TO_STORED_FCT ,"42000", "" },
{ ER_DUP_ENTRY_WITH_KEY_NAME ,"23000", "S1009" },
{ ER_XA_RBTIMEOUT ,"XA106", "" },
{ ER_XA_RBDEADLOCK ,"XA102", "" },
{ ER_FUNC_INEXISTENT_NAME_COLLISION ,"42000", "" },
{ ER_DUP_SIGNAL_SET ,"42000", "" },
{ ER_SIGNAL_WARN ,"01000", "" },
{ ER_SIGNAL_NOT_FOUND ,"02000", "" },
{ ER_SIGNAL_EXCEPTION ,"HY000", "" },
{ ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER ,"0K000", "" },
{ ER_SPATIAL_MUST_HAVE_GEOM_COL ,"42000", "" },
{ ER_DATA_OUT_OF_RANGE ,"22003", "" },
{ ER_ACCESS_DENIED_NO_PASSWORD_ERROR ,"28000", "" },
{ ER_TRUNCATE_ILLEGAL_FK ,"42000", "" },
{ ER_DA_INVALID_CONDITION_NUMBER ,"35000", "" },
{ ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO,"23000", "S1009" },
{ ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO,"23000", "S1009" },
{ ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION,"25006", "" },
{ ER_ALTER_OPERATION_NOT_SUPPORTED ,"0A000", "" },
{ ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ,"0A000", "" },
{ ER_DUP_UNKNOWN_IN_INDEX ,"23000", "" },
{ ER_ACCESS_DENIED_CHANGE_USER_ERROR ,"28000", "" },
{ ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER,"0Z002", "" },
{ ER_INVALID_ARGUMENT_FOR_LOGARITHM ,"2201E", "" },
{ ER_GIS_INVALID_DATA ,"22023", "" },
{ ER_USER_LOCK_WRONG_NAME ,"42000", "" },
{ ER_ILLEGAL_USER_VAR ,"42000", "S1009" },
{ ER_NET_OK_PACKET_TOO_LARGE ,"08S01", "" },
{ ER_WRONG_TABLESPACE_NAME ,"42000", "" },
{ ER_LOCKING_SERVICE_WRONG_NAME ,"42000", "" },
{ ER_INVALID_JSON_TEXT ,"22032", "" },
{ ER_INVALID_JSON_TEXT_IN_PARAM ,"22032", "" },
{ ER_INVALID_JSON_PATH ,"42000", "" },
{ ER_INVALID_JSON_CHARSET ,"22032", "" },
{ ER_INVALID_JSON_CHARSET_IN_FUNCTION ,"22032", "" },
{ ER_INVALID_TYPE_FOR_JSON ,"22032", "" },
{ ER_INVALID_CAST_TO_JSON ,"22032", "" },
{ ER_INVALID_JSON_PATH_CHARSET ,"42000", "" },
{ ER_INVALID_JSON_PATH_WILDCARD ,"42000", "" },
{ ER_JSON_VALUE_TOO_BIG ,"22032", "" },
{ ER_JSON_KEY_TOO_BIG ,"22032", "" },
{ ER_JSON_USED_AS_KEY ,"42000", "" },
{ ER_JSON_VACUOUS_PATH ,"42000", "" },
{ ER_JSON_BAD_ONE_OR_ALL_ARG ,"42000", "" },
{ ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE ,"22003", "" },
{ ER_INVALID_JSON_VALUE_FOR_CAST ,"22018", "" },
{ ER_JSON_DOCUMENT_TOO_DEEP ,"22032", "" },
{ ER_JSON_DOCUMENT_NULL_KEY ,"22032", "" },
{ ER_INVALID_JSON_PATH_ARRAY_CELL ,"42000", "" },

63
3rdparty/mysql/include/sslopt-case.h vendored Normal file
View File

@@ -0,0 +1,63 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
#ifndef MYSQL_CLIENT
#error This header is supposed to be used only in the client
#endif
case OPT_SSL_MODE:
opt_ssl_mode= find_type_or_exit(argument, &ssl_mode_typelib,
opt->name);
ssl_mode_set_explicitly= TRUE;
break;
case OPT_SSL_SSL:
CLIENT_WARN_DEPRECATED("--ssl", "--ssl-mode");
if (!opt_use_ssl_arg)
opt_ssl_mode= SSL_MODE_DISABLED;
else if (opt_ssl_mode < SSL_MODE_REQUIRED)
opt_ssl_mode= SSL_MODE_REQUIRED;
break;
case OPT_SSL_VERIFY_SERVER_CERT:
CLIENT_WARN_DEPRECATED("--ssl-verify-server-cert",
"--ssl-mode=VERIFY_IDENTITY");
if (!opt_ssl_verify_server_cert_arg)
{
if (opt_ssl_mode >= SSL_MODE_VERIFY_IDENTITY)
opt_ssl_mode= SSL_MODE_VERIFY_CA;
}
else
opt_ssl_mode= SSL_MODE_VERIFY_IDENTITY;
break;
case OPT_SSL_CA:
case OPT_SSL_CAPATH:
/* Don't change ssl-mode if set explicitly. */
if (!ssl_mode_set_explicitly)
opt_ssl_mode= SSL_MODE_VERIFY_CA;
break;
case OPT_SSL_KEY:
case OPT_SSL_CERT:
case OPT_SSL_CIPHER:
case OPT_SSL_CRL:
case OPT_SSL_CRLPATH:
case OPT_TLS_VERSION:
#ifdef HAVE_YASSL
/* crl has no effect in yaSSL. */
opt_ssl_crl= NULL;
opt_ssl_crlpath= NULL;
#endif /* HAVE_YASSL */
break;
#endif /* HAVE_OPENSSL */

View File

@@ -0,0 +1,67 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
#ifdef MYSQL_CLIENT
{"ssl-mode", OPT_SSL_MODE,
"SSL connection mode.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ssl", OPT_SSL_SSL,
"Deprecated. Use --ssl-mode instead.",
&opt_use_ssl_arg, &opt_use_ssl_arg, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
"Deprecated. Use --ssl-mode=VERIFY_IDENTITY instead.",
&opt_ssl_verify_server_cert_arg, &opt_ssl_verify_server_cert_arg,
0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
{"ssl", OPT_SSL_SSL,
"If set to ON, this option enforces that SSL is established before client "
"attempts to authenticate to the server. To disable client SSL capabilities "
"use --ssl=OFF.",
&opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
#endif
{"ssl-ca", OPT_SSL_CA,
"CA file in PEM format.",
&opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-capath", OPT_SSL_CAPATH,
"CA directory.",
&opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format.",
&opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use.",
&opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format.",
&opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crl", OPT_SSL_CRL, "Certificate revocation list.",
&opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crlpath", OPT_SSL_CRLPATH,
"Certificate revocation list path.",
&opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"tls-version", OPT_TLS_VERSION, "TLS version to use, "
#ifndef HAVE_YASSL
"permitted values are: TLSv1, TLSv1.1, TLSv1.2",
#else
"permitted values are: TLSv1, TLSv1.1",
#endif
&opt_tls_version, &opt_tls_version, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif /* HAVE_OPENSSL */

75
3rdparty/mysql/include/sslopt-vars.h vendored Normal file
View File

@@ -0,0 +1,75 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef SSLOPT_VARS_INCLUDED
#define SSLOPT_VARS_INCLUDED
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
#ifndef MYSQL_CLIENT
#error This header is supposed to be used only in the client
#endif
const char *ssl_mode_names_lib[] =
{"DISABLED", "PREFERRED", "REQUIRED", "VERIFY_CA", "VERIFY_IDENTITY",
NullS };
TYPELIB ssl_mode_typelib = {array_elements(ssl_mode_names_lib) - 1, "",
ssl_mode_names_lib, NULL};
static uint opt_ssl_mode = SSL_MODE_PREFERRED;
static char *opt_ssl_ca = 0;
static char *opt_ssl_capath = 0;
static char *opt_ssl_cert = 0;
static char *opt_ssl_cipher = 0;
static char *opt_ssl_key = 0;
static char *opt_ssl_crl = 0;
static char *opt_ssl_crlpath = 0;
static char *opt_tls_version = 0;
static my_bool ssl_mode_set_explicitly= FALSE;
static my_bool opt_use_ssl_arg= TRUE;
static my_bool opt_ssl_verify_server_cert_arg= FALSE;
static void set_client_ssl_options(MYSQL *mysql)
{
/*
Print a warning if explicitly defined combination of --ssl-mode other than
VERIFY_CA or VERIFY_IDENTITY with explicit --ssl-ca or --ssl-capath values.
*/
if (ssl_mode_set_explicitly &&
opt_ssl_mode < SSL_MODE_VERIFY_CA &&
(opt_ssl_ca || opt_ssl_capath))
{
printf("WARNING: no verification of server certificate will be done. "
"Use --ssl-mode=VERIFY_CA or VERIFY_IDENTITY.\n");
}
/* Set SSL parameters: key, cert, ca, capath, cipher, clr, clrpath. */
if (opt_ssl_mode >= SSL_MODE_VERIFY_CA)
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
else
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, NULL,
NULL, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
mysql_options(mysql, MYSQL_OPT_TLS_VERSION, opt_tls_version);
mysql_options(mysql, MYSQL_OPT_SSL_MODE, &opt_ssl_mode);
}
#define SSL_SET_OPTIONS(mysql) set_client_ssl_options(mysql);
#else
#define SSL_SET_OPTIONS(mysql) do { } while(0)
#endif
#endif /* SSLOPT_VARS_INCLUDED */

201
3rdparty/mysql/include/thr_cond.h vendored Normal file
View File

@@ -0,0 +1,201 @@
#ifndef THR_COND_INCLUDED
#define THR_COND_INCLUDED
/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
MySQL condition variable implementation.
There are three "layers":
1) native_cond_*()
Functions that map directly down to OS primitives.
Windows - ConditionVariable
Other OSes - pthread
2) my_cond_*()
Functions that use SAFE_MUTEX (default for debug).
Otherwise native_cond_*() is used.
3) mysql_cond*()
Functions that include Performance Schema instrumentation.
See include/mysql/psi/mysql_thread.h
*/
#include "my_thread.h"
#include "thr_mutex.h"
C_MODE_START
#ifdef _WIN32
typedef CONDITION_VARIABLE native_cond_t;
#else
typedef pthread_cond_t native_cond_t;
#endif
#ifdef _WIN32
/**
Convert abstime to milliseconds
*/
static DWORD get_milliseconds(const struct timespec *abstime)
{
#ifndef HAVE_STRUCT_TIMESPEC
long long millis;
union ft64 now;
if (abstime == NULL)
return INFINITE;
GetSystemTimeAsFileTime(&now.ft);
/*
Calculate time left to abstime
- subtract start time from current time(values are in 100ns units)
- convert to millisec by dividing with 10000
*/
millis= (abstime->tv.i64 - now.i64) / 10000;
/* Don't allow the timeout to be negative */
if (millis < 0)
return 0;
/*
Make sure the calculated timeout does not exceed original timeout
value which could cause "wait for ever" if system time changes
*/
if (millis > abstime->max_timeout_msec)
millis= abstime->max_timeout_msec;
if (millis > UINT_MAX)
millis= UINT_MAX;
return (DWORD)millis;
#else
/*
Convert timespec to millis and subtract current time.
my_getsystime() returns time in 100 ns units.
*/
ulonglong future= abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000;
ulonglong now= my_getsystime() / 10000;
/* Don't allow the timeout to be negative. */
if (future < now)
return 0;
return (DWORD)(future - now);
#endif
}
#endif /* _WIN32 */
static inline int native_cond_init(native_cond_t *cond)
{
#ifdef _WIN32
InitializeConditionVariable(cond);
return 0;
#else
/* pthread_condattr_t is not used in MySQL */
return pthread_cond_init(cond, NULL);
#endif
}
static inline int native_cond_destroy(native_cond_t *cond)
{
#ifdef _WIN32
return 0; /* no destroy function */
#else
return pthread_cond_destroy(cond);
#endif
}
static inline int native_cond_timedwait(native_cond_t *cond,
native_mutex_t *mutex,
const struct timespec *abstime)
{
#ifdef _WIN32
DWORD timeout= get_milliseconds(abstime);
if (!SleepConditionVariableCS(cond, mutex, timeout))
return ETIMEDOUT;
return 0;
#else
return pthread_cond_timedwait(cond, mutex, abstime);
#endif
}
static inline int native_cond_wait(native_cond_t *cond, native_mutex_t *mutex)
{
#ifdef _WIN32
if (!SleepConditionVariableCS(cond, mutex, INFINITE))
return ETIMEDOUT;
return 0;
#else
return pthread_cond_wait(cond, mutex);
#endif
}
static inline int native_cond_signal(native_cond_t *cond)
{
#ifdef _WIN32
WakeConditionVariable(cond);
return 0;
#else
return pthread_cond_signal(cond);
#endif
}
static inline int native_cond_broadcast(native_cond_t *cond)
{
#ifdef _WIN32
WakeAllConditionVariable(cond);
return 0;
#else
return pthread_cond_broadcast(cond);
#endif
}
#ifdef SAFE_MUTEX
int safe_cond_wait(native_cond_t *cond, my_mutex_t *mp,
const char *file, uint line);
int safe_cond_timedwait(native_cond_t *cond, my_mutex_t *mp,
const struct timespec *abstime,
const char *file, uint line);
#endif
static inline int my_cond_timedwait(native_cond_t *cond, my_mutex_t *mp,
const struct timespec *abstime
#ifdef SAFE_MUTEX
, const char *file, uint line
#endif
)
{
#ifdef SAFE_MUTEX
return safe_cond_timedwait(cond, mp, abstime, file, line);
#else
return native_cond_timedwait(cond, mp, abstime);
#endif
}
static inline int my_cond_wait(native_cond_t *cond, my_mutex_t *mp
#ifdef SAFE_MUTEX
, const char *file, uint line
#endif
)
{
#ifdef SAFE_MUTEX
return safe_cond_wait(cond, mp, file, line);
#else
return native_cond_wait(cond, mp);
#endif
}
C_MODE_END
#endif /* THR_COND_INCLUDED */

227
3rdparty/mysql/include/thr_mutex.h vendored Normal file
View File

@@ -0,0 +1,227 @@
#ifndef THR_MUTEX_INCLUDED
#define THR_MUTEX_INCLUDED
/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
MySQL mutex implementation.
There are three "layers":
1) native_mutex_*()
Functions that map directly down to OS primitives.
Windows - CriticalSection
Other OSes - pthread
2) my_mutex_*()
Functions that implement SAFE_MUTEX (default for debug),
Otherwise native_mutex_*() is used.
3) mysql_mutex_*()
Functions that include Performance Schema instrumentation.
See include/mysql/psi/mysql_thread.h
*/
#include <my_global.h>
#include "my_thread.h"
C_MODE_START
#ifdef _WIN32
typedef CRITICAL_SECTION native_mutex_t;
typedef int native_mutexattr_t;
#else
typedef pthread_mutex_t native_mutex_t;
typedef pthread_mutexattr_t native_mutexattr_t;
#endif
/* Define mutex types, see my_thr_init.c */
#define MY_MUTEX_INIT_SLOW NULL
/* Can be set in /usr/include/pthread.h */
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
extern native_mutexattr_t my_fast_mutexattr;
#define MY_MUTEX_INIT_FAST &my_fast_mutexattr
#else
#define MY_MUTEX_INIT_FAST NULL
#endif
/* Can be set in /usr/include/pthread.h */
#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
extern native_mutexattr_t my_errorcheck_mutexattr;
#define MY_MUTEX_INIT_ERRCHK &my_errorcheck_mutexattr
#else
#define MY_MUTEX_INIT_ERRCHK NULL
#endif
static inline int native_mutex_init(native_mutex_t *mutex,
const native_mutexattr_t *attr)
{
#ifdef _WIN32
InitializeCriticalSection(mutex);
return 0;
#else
return pthread_mutex_init(mutex, attr);
#endif
}
static inline int native_mutex_lock(native_mutex_t *mutex)
{
#ifdef _WIN32
EnterCriticalSection(mutex);
return 0;
#else
return pthread_mutex_lock(mutex);
#endif
}
static inline int native_mutex_trylock(native_mutex_t *mutex)
{
#ifdef _WIN32
if (TryEnterCriticalSection(mutex))
{
/* Don't allow recursive lock */
if (mutex->RecursionCount > 1){
LeaveCriticalSection(mutex);
return EBUSY;
}
return 0;
}
return EBUSY;
#else
return pthread_mutex_trylock(mutex);
#endif
}
static inline int native_mutex_unlock(native_mutex_t *mutex)
{
#ifdef _WIN32
LeaveCriticalSection(mutex);
return 0;
#else
return pthread_mutex_unlock(mutex);
#endif
}
static inline int native_mutex_destroy(native_mutex_t *mutex)
{
#ifdef _WIN32
DeleteCriticalSection(mutex);
return 0;
#else
return pthread_mutex_destroy(mutex);
#endif
}
#ifdef SAFE_MUTEX
/* safe_mutex adds checking to mutex for easier debugging */
typedef struct st_safe_mutex_t
{
native_mutex_t global, mutex;
const char *file;
uint line, count;
my_thread_t thread;
} my_mutex_t;
void safe_mutex_global_init();
int safe_mutex_init(my_mutex_t *mp, const native_mutexattr_t *attr,
const char *file, uint line);
int safe_mutex_lock(my_mutex_t *mp, my_bool try_lock, const char *file, uint line);
int safe_mutex_unlock(my_mutex_t *mp, const char *file, uint line);
int safe_mutex_destroy(my_mutex_t *mp, const char *file, uint line);
static inline void safe_mutex_assert_owner(const my_mutex_t *mp)
{
DBUG_ASSERT(mp->count > 0 &&
my_thread_equal(my_thread_self(), mp->thread));
}
static inline void safe_mutex_assert_not_owner(const my_mutex_t *mp)
{
DBUG_ASSERT(!mp->count ||
!my_thread_equal(my_thread_self(), mp->thread));
}
#else
typedef native_mutex_t my_mutex_t;
#endif
static inline int my_mutex_init(my_mutex_t *mp, const native_mutexattr_t *attr
#ifdef SAFE_MUTEX
, const char *file, uint line
#endif
)
{
#ifdef SAFE_MUTEX
return safe_mutex_init(mp, attr, file, line);
#else
return native_mutex_init(mp, attr);
#endif
}
static inline int my_mutex_lock(my_mutex_t *mp
#ifdef SAFE_MUTEX
, const char *file, uint line
#endif
)
{
#ifdef SAFE_MUTEX
return safe_mutex_lock(mp, FALSE, file, line);
#else
return native_mutex_lock(mp);
#endif
}
static inline int my_mutex_trylock(my_mutex_t *mp
#ifdef SAFE_MUTEX
, const char *file, uint line
#endif
)
{
#ifdef SAFE_MUTEX
return safe_mutex_lock(mp, TRUE, file, line);
#else
return native_mutex_trylock(mp);
#endif
}
static inline int my_mutex_unlock(my_mutex_t *mp
#ifdef SAFE_MUTEX
, const char *file, uint line
#endif
)
{
#ifdef SAFE_MUTEX
return safe_mutex_unlock(mp, file, line);
#else
return native_mutex_unlock(mp);
#endif
}
static inline int my_mutex_destroy(my_mutex_t *mp
#ifdef SAFE_MUTEX
, const char *file, uint line
#endif
)
{
#ifdef SAFE_MUTEX
return safe_mutex_destroy(mp, file, line);
#else
return native_mutex_destroy(mp);
#endif
}
C_MODE_END
#endif /* THR_MUTEX_INCLUDED */

214
3rdparty/mysql/include/thr_rwlock.h vendored Normal file
View File

@@ -0,0 +1,214 @@
#ifndef THR_RWLOCK_INCLUDED
#define THR_RWLOCK_INCLUDED
/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
MySQL rwlock implementation.
There are two "layers":
1) native_rw_*()
Functions that map directly down to OS primitives.
Windows - SRWLock
Other OSes - pthread
2) mysql_rw*()
Functions that include Performance Schema instrumentation.
See include/mysql/psi/mysql_thread.h
This file also includes rw_pr_*(), which implements a special
version of rwlocks that prefer readers. The P_S version of these
are mysql_prlock_*() - see include/mysql/psi/mysql_thread.h
*/
#include "my_global.h"
#include "my_thread.h"
#include "thr_cond.h"
C_MODE_START
#ifdef _WIN32
typedef struct st_my_rw_lock_t
{
SRWLOCK srwlock; /* native reader writer lock */
BOOL have_exclusive_srwlock; /* used for unlock */
} native_rw_lock_t;
#else
typedef pthread_rwlock_t native_rw_lock_t;
#endif
static inline int native_rw_init(native_rw_lock_t *rwp)
{
#ifdef _WIN32
InitializeSRWLock(&rwp->srwlock);
rwp->have_exclusive_srwlock = FALSE;
return 0;
#else
/* pthread_rwlockattr_t is not used in MySQL */
return pthread_rwlock_init(rwp, NULL);
#endif
}
static inline int native_rw_destroy(native_rw_lock_t *rwp)
{
#ifdef _WIN32
return 0; /* no destroy function */
#else
return pthread_rwlock_destroy(rwp);
#endif
}
static inline int native_rw_rdlock(native_rw_lock_t *rwp)
{
#ifdef _WIN32
AcquireSRWLockShared(&rwp->srwlock);
return 0;
#else
return pthread_rwlock_rdlock(rwp);
#endif
}
static inline int native_rw_tryrdlock(native_rw_lock_t *rwp)
{
#ifdef _WIN32
if (!TryAcquireSRWLockShared(&rwp->srwlock))
return EBUSY;
return 0;
#else
return pthread_rwlock_tryrdlock(rwp);
#endif
}
static inline int native_rw_wrlock(native_rw_lock_t *rwp)
{
#ifdef _WIN32
AcquireSRWLockExclusive(&rwp->srwlock);
rwp->have_exclusive_srwlock= TRUE;
return 0;
#else
return pthread_rwlock_wrlock(rwp);
#endif
}
static inline int native_rw_trywrlock(native_rw_lock_t *rwp)
{
#ifdef _WIN32
if (!TryAcquireSRWLockExclusive(&rwp->srwlock))
return EBUSY;
rwp->have_exclusive_srwlock= TRUE;
return 0;
#else
return pthread_rwlock_trywrlock(rwp);
#endif
}
static inline int native_rw_unlock(native_rw_lock_t *rwp)
{
#ifdef _WIN32
if (rwp->have_exclusive_srwlock)
{
rwp->have_exclusive_srwlock= FALSE;
ReleaseSRWLockExclusive(&rwp->srwlock);
}
else
ReleaseSRWLockShared(&rwp->srwlock);
return 0;
#else
return pthread_rwlock_unlock(rwp);
#endif
}
/**
Portable implementation of special type of read-write locks.
These locks have two properties which are unusual for rwlocks:
1) They "prefer readers" in the sense that they do not allow
situations in which rwlock is rd-locked and there is a
pending rd-lock which is blocked (e.g. due to pending
request for wr-lock).
This is a stronger guarantee than one which is provided for
PTHREAD_RWLOCK_PREFER_READER_NP rwlocks in Linux.
MDL subsystem deadlock detector relies on this property for
its correctness.
2) They are optimized for uncontended wr-lock/unlock case.
This is scenario in which they are most oftenly used
within MDL subsystem. Optimizing for it gives significant
performance improvements in some of tests involving many
connections.
Another important requirement imposed on this type of rwlock
by the MDL subsystem is that it should be OK to destroy rwlock
object which is in unlocked state even though some threads might
have not yet fully left unlock operation for it (of course there
is an external guarantee that no thread will try to lock rwlock
which is destroyed).
Putting it another way the unlock operation should not access
rwlock data after changing its state to unlocked.
TODO/FIXME: We should consider alleviating this requirement as
it blocks us from doing certain performance optimizations.
*/
typedef struct st_rw_pr_lock_t {
/**
Lock which protects the structure.
Also held for the duration of wr-lock.
*/
native_mutex_t lock;
/**
Condition variable which is used to wake-up
writers waiting for readers to go away.
*/
native_cond_t no_active_readers;
/** Number of active readers. */
uint active_readers;
/** Number of writers waiting for readers to go away. */
uint writers_waiting_readers;
/** Indicates whether there is an active writer. */
my_bool active_writer;
#ifdef SAFE_MUTEX
/** Thread holding wr-lock (for debug purposes only). */
my_thread_t writer_thread;
#endif
} rw_pr_lock_t;
extern int rw_pr_init(rw_pr_lock_t *);
extern int rw_pr_rdlock(rw_pr_lock_t *);
extern int rw_pr_wrlock(rw_pr_lock_t *);
extern int rw_pr_unlock(rw_pr_lock_t *);
extern int rw_pr_destroy(rw_pr_lock_t *);
static inline void
rw_pr_lock_assert_write_owner(const rw_pr_lock_t *rwlock MY_ATTRIBUTE((unused)))
{
#ifdef SAFE_MUTEX
DBUG_ASSERT(rwlock->active_writer &&
my_thread_equal(my_thread_self(), rwlock->writer_thread));
#endif
}
static inline void
rw_pr_lock_assert_not_write_owner(const rw_pr_lock_t *rwlock MY_ATTRIBUTE((unused)))
{
#ifdef SAFE_MUTEX
DBUG_ASSERT(!rwlock->active_writer ||
!my_thread_equal(my_thread_self(), rwlock->writer_thread));
#endif
}
C_MODE_END
#endif /* THR_RWLOCK_INCLUDED */

Some files were not shown because too many files have changed in this diff Show More