163 Commits

Author SHA1 Message Date
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
c28c9f61be Removed maximum packet size from configuration
It's a source side define now, because you should really only change this if you know what you are doing.
Beautified the number for pre 2013-12-23, thanks to @dastgir.
Fixed a warning which was added by the last commit and was issued with the default settings, thanks to @cydh.

Follow up to f4b42b2
2015-12-09 19:28:44 +01:00
Lemongrass3110
f4b42b26fb Updated the maximum size for packets
According to 3ceam revision 764 clients from 2013-12-23 on can deal with bigger packets. 3ceam uses 65636 as maximum, but we decided to stick with the maximum for unsigned shorts. Thanks to Rytech!

Please consider staying with the default value, because we will remove this configuration soon and make it a source side define which is depending on the packetversion define.
2015-12-08 17:35:58 +01:00
lighta
b480cb3d47 Valkyrie example
Move valkyrie sample config into conf/
Change path for relative path so that it could be applied for all.
tested with : 'valkyrie -f valkyrie_sample.cfg'
Change include in common, true that complicate move for those file but
will facilitate the parsing for some ide.
2015-10-21 01:59:32 -04:00
lighta
8066bdef46 Data alignement
Align account_id and char_id to uint32 as this is the value they can be
in DB.
Remove src/test folder, unused
Remove useless #include to speedup compilation.
2014-12-19 21:31:04 -05:00
lighta
b92230e33e Cppcheck
Fix typo in race bonus fix : race<RC_NONE_ && race<RC_MAX
Fix bugreport:8418 => clif_instance_changestatus possible mapcrash
Reduce lot of variable scope and fix unsafe scanf
2014-01-09 02:18:51 -05:00
lighta
d6caec1c51 Various fixs
Fix bugreport:8418 (possible mapcrash from custom instance script)
Fix bugreport:8439 (pc_bonus_item_drop typos) thx to Baalberith
Fix some errors detected by cppcheck
upd install.sh (leftover of svn and wrong simlink)
2014-01-07 20:15:40 -05:00
lighta
744195a931 Leak and Optimisation
Fix many typo and optimisation found by :
http://rathena.org/cppreport/index.html
Fix multiple unsafe scanf of string
Fix multiple battle wrong check (elemental bonus)
Fix camouflage defense reduction and cap expiato def reduction
Fix geoip leak
Upd few documentation in doxygen style
Fix path working directory issue to start servers
(now you won't need to be in maindir to launch server)
2013-12-30 02:05:34 -05:00
akinari1087
1ed6911a71 Follow-up to r17404 : Fix carts not being usable - Fixes bugreport:7800
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17407 54d463be-8e91-2dee-dedb-b68131a5f0ec
2013-07-07 14:49:12 +00:00
akinari1087
de7b41c4f9 Fixed cast time not being reduced for SC__LAZINESS - Fixes bugreport:7795
Script commands 'sit' and 'stand' now work only when character is in required state. (Euphy)

~ Hercules Merges ~
* Added extra support to GM unload NPC via right-click [credits: Ind]
* Implemented real-time server stats (in and out data and ram usage). [credits: Ai4rei, mkbu95]
* Fixed chatrooms disappearing after using @disguise. [credits: MatiasSW]
* Implemented 'notomb' mapflag for Bossnia maps. [credits: CairoLee]

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17404 54d463be-8e91-2dee-dedb-b68131a5f0ec
2013-07-07 03:08:24 +00:00
glighta
38f9f0c208 -Update Char_Client packet 2013+, thx (Yommy, Shaktoh)
--change connection sequence for 82d+9a0+20d => 9a1 => 99d
-Merge some Hercules stuffs:
--upd char (default map check, 0x99d HC)
--CreateParty enforced chk
--mapindex_db for name lookup
-Add max packet_len check on chrif init for mmo_charstatus. 
-Upd @mapinfo, add missing mapflag info.
-Expand teleport_timer for pet,homon,ele (Daegaladh)
-Make homon,ele inherit master speed (Daegaladh)
-Fix frostnova status chance and driven fail msg. (Daegaladh)
-Cleanup, replace hardcoded ai value with enum eq, change pet.msd to pet.master to harmonize with other blchar.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17332 54d463be-8e91-2dee-dedb-b68131a5f0ec
2013-05-23 12:44:12 +00:00
glighta
f67f82c472 -Follow up r17236
-- Add timeout option for windows. linked to bugreport:7670
-- remove unuse variable (Akinari) bugreport:7672
-- upd script_command documentation (Akinari)
-- cleanup checkweight (remove hardcode change msg).
- Add new packets definition (Shaktoh)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17327 54d463be-8e91-2dee-dedb-b68131a5f0ec
2013-05-10 18:31:31 +00:00
akinari1087
b770bb52e7 Implemented script commands 'addmonsterdrop' and 'delmonsterdrop' (cool)
-> Added documentation
Updated script command 'sc_start' to allow for more variables and options - Fixes bugreport:7664
-> Item databases and some scripts updated
Cleanup of script commands 'countitem' and 'countitem2'
Rework of @ 'reload' commands - Now offers @reload dbname
-> @reload packetdb now available
Restricted bonuses 'SPRecovRate' and 'HPRecovRate' to short range melee only - Fixes bugreport:2916
Increase AGI no longer makes characters stand - Fixes bugeport:7657
Small warning fix for 'below array bounds' in skill.c
Added short timeout to make_connection (lighta) - Fixes bugreport:7670
Some visual fixes for equipment and items (lighta)
Rework of script command 'checkweight' (lighta)
Some channel system cleanup (lighta)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17326 54d463be-8e91-2dee-dedb-b68131a5f0ec
2013-05-10 08:11:21 +00:00
euphyy
058a7b4f4e > Hercules merges:
* 7e72f0c, 3bba651:
Improvements all over the place.

* 327a46d:
Arrullo no longer crashes the server when used by monsters.

* 1093763:
Fixed official behiavior of WZ_SIGHTBLASTER dealing with HW_MAGICPOWER.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17139 54d463be-8e91-2dee-dedb-b68131a5f0ec
2013-02-18 23:54:33 +00:00
brianluau
a2bdc47daf - Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).
[16969:16991/trunk/src/] will be re-committed in the next 24 hours.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-12-05 02:53:33 +00:00
greenboxal2
a7c32653f7 Applied AStyle code formating as discussed on tid:74602.
Removed /SAFESEH option from MSVC11 projects.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-25 21:20:43 +00:00
shennetsind
9758407d3f Fixed bugreport:6779 dropped between-server ping timers, replaced by a much more reliable and performance-efficient on-demand flagging.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16854 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-10-31 20:17:38 +00:00
shennetsind
56256a4532 Introducing rAthena's anonymous data collector. This aims at improving rAthena's overall features by letting we know which options are most and least used.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16785 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-09-16 21:14:33 +00:00
blacksirius
bde86942c0 cleaned up windows header usage (added one central file to use windows / winapi specific stuff, to be able to set the appropriate flags before including it correctly)
Note: this may screw up mingw or cygwin building,  ill fix it later... 



git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16219 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-03 17:55:38 +00:00
brianluau
a0ef961db9 - Removed leftover TXT configs, follow-up to r15503.
- Edited more ***_config_read() functions to show a warning if "Unknown setting" is found.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16009 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-29 20:32:21 +00:00
lordttseven
27933caa3d - reverted part of r15609 since apparently the issue is purely limited to ZC_SKILLINFO_LIST, and this change breaks big storages
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15613 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-02-19 10:21:16 +00:00
shennetsind
6a2e86ce84 Follow up r15609, fixed gcc warnings
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15610 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-02-18 22:30:19 +00:00
lordttseven
930048790b * adjusted socket_max_client_packet to a more accurate (if guessed) value to prevent undefined client behavior (may only affect more recent clients?)
+ added a workaround for too large ZC_SKILLINFO_LIST packets resulting from all_skill group permission by sending excess skills one by one (bugreport:5348 and bugreport:5349)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15609 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-02-18 22:05:21 +00:00
gepard1984
26d7d34132 Socket init now gives meaningful error description if failed to set socket limit (tid:58887).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15574 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-02-13 20:17:45 +00:00
gepard1984
4d01a4f6e6 Added user-friendly socket error messages (bugreport:117).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15518 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-25 03:44:04 +00:00
shennetsind
dad1da6ed2 Fixed gm_all_skill, bugreport:5239
Removed broken skills from skill tree, so @allskill doesn't give resource errors when gm_all_skill is enabled.
Increased maximum client packet size drop limit (was limiting gm_all_skill unnecessarily since the client doesn't crash with it)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15462 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-15 04:50:51 +00:00
gepard1984
5b66b21b67 Sending to a broken socket will no longer cause SIGPIPE signal to be sent back on most *nix systems (those supporting MSG_NOSIGNAL flag) (bugreport:5224)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15415 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-09 22:47:11 +00:00
ai4rei
d0aafe2fdc * Added a check to WFIFOSET to detect zero-length 'sets' of packets, that could cause memory corruption (through code after WFIFOHEAD(fd,packet_len(cmd)) where the length is 0).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14995 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-11-17 23:41:13 +00:00
ai4rei
b13243b678 * Added a message indicating how many concurrent connections the server was compiled to support.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14978 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-10-16 09:56:30 +00:00
flaviojs
dd51e5d71a * Remove fds from the shortlist before processing.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14966 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-10-07 11:09:12 +00:00
flaviojs
967eaaa7a5 * Add consistency checks to the shortlist.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14953 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-09-05 16:18:27 +00:00
flaviojs
305dc5421a * Changed the warning message of when setrlimit fails to be more explicit.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14907 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-15 06:16:51 +00:00
flaviojs
13a4063735 * CMake: added search for math.h, added search for socket/nsl library. (tested with Solaris-201011-x86)
* Added missing include to socket.c.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14903 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-12 22:01:45 +00:00
ultramage
edcb998d59 Replaced custom type 'intptr' with standard 'intptr_t'.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30 09:14:21 +00:00
flaviojs
b02133b422 * Merges from charmerge:
- Added DBMap::exists. (r14090)
- Added sv_parse_next, a stepped version of sv_parse (delim-separated parser). (r14100 r14104)
- Added missing fd check to do_close. (r14145)
- Normalized, refactored and restructured some code (in preparation for shutdown/reconnect code). (r14145 r14150)
- Changed the char select request code to allow the char-server to reject it. (player in map-server trying to go to char select) (r14150)
- Added shutdown support to the servers. (incomplete) (r14152)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14851 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-16 10:22:35 +00:00
ai4rei
953ddef5bb * Fixed memory corruption when amount of players online approached FD_SETSIZE (topic:262388, bugreport:4856, since r11897).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14781 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-09 01:39:46 +00:00
ai4rei
d82968afbf * Fixed a compile error when socket send shortlists are disabled (s->eof instead of s->flag.eof) (follow up to r11930).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-08 16:25:50 +00:00
ai4rei
7557d37013 * Various accumulated cleanups and fixes.
- Improved the compile speed for files which include common/socket.h on windows builds (related r10471).
- Moved FIFOSIZE_SERVERLINK define from common/mmo.h to common/socket.h (since it is a server connection FIFO size setting).
- Fixed script command 'areamobuseskill' canceling monster's skill cast before it determined it's new target, which could be 'none' (bugreport:3272, since r13897).
- Added a protection against attempts to read an empty backup / write to a full backup in skill_dance_switch as per TODO from r11347.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14690 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-31 12:39:54 +00:00
ai4rei
8fb6c1f646 * Fixed faulty WFIFO reallocation causing memory exhaustion (bugreport:4737, since r1816, related r11503, r11571, r11886 and r12232).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14689 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-31 11:30:57 +00:00
ai4rei
7a85df4fe0 * Resolving allow/deny IP rules not working (bugreport:2632).
- Fixed 'mask' being filled with 'ip' when standard mask was specified (since r9647).
- Fixed 'ip' and 'mask' (bit mask) being stored in wrong byte order (network order instead of host order) (since r10162).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14683 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-28 01:38:33 +00:00
ai4rei
ff135c1ee5 * Added an error message when a client connection exceeds the socket write buffer, so that it does not appear to be closed for no apparent reason (follow up to r13469).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14546 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-02 16:40:44 +00:00
ai4rei
10396bbbbf * Too large client packets, which would otherwise cause the client to crash, are now dropped and reported (bugreport:4391).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14503 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-25 23:06:06 +00:00
FlavioJS
8326096602 * Modified WFIFOSET to trigger a fatal error when trying to send a packet that is too big.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13539 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-02-20 05:53:50 +00:00
FlavioJS
672dbf2946 * Added a limit of 1MB of pending data in the write fifo for non-server sockets. Connections that go over the limit are closed.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13469 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-01-21 15:18:51 +00:00
FlavioJS
2fdf093539 * Made the socket limit not be set in cygwin, which has bogus behavior. (bugreport:1684)
* Made the socket limit be set to the maximum allowed value when setting to FD_SETSIZE fails.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12839 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-06-16 05:07:56 +00:00
FlavioJS
c9a3dc80bf * Added experimental code to set the socket limit at runtime.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12803 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-06-09 23:44:52 +00:00
FlavioJS
c880052f0f * Changed the data field of timers from int to intptr.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12633 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-21 21:34:31 +00:00
ultramage
cdb70a3a4c Altered socket code to do a graceful connection shutdown when exiting.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12251 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-27 20:21:27 +00:00
ultramage
f4347446d4 * Removed code in socket.c that tries to avoid send buffer overloading, as there is a scenario (many players and charserver disconnect) where mass char saving produces huge ammounts of data to send (see r11503)
* Cleaned up player respawning code (bugreport:1022)
* Increased the max amount of different autocast skills from 5 to 10
* Added a missing function declaration, for real this time (followup to r12229)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12232 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-22 18:19:11 +00:00
FlavioJS
e8c226e1f3 * Forgotten update to the definition of script command 'input'.
* Enabled DEBUG_MEMMGR only in DEBUG mode. 
* Made autotrading characters be kicked instead of reporting double login.
* Made create_session initialize session_data to NULL.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12218 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-19 16:55:13 +00:00