summaryrefslogtreecommitdiff
path: root/src/common/utils.c
AgeCommit message (Collapse)AuthorFilesLines
2008-07-26Merged the /loginmerge branch (topic:192754)ultramage1-3/+3
* the login server storage, ipban and logging systems have been abstracted and now provide a common interface; the rest has been merged into a single login server core (no more login/login_sql duplicity) * storage systems are now added via compiler options (WITH_SQL / WITH_TXT) * multiple storage engines can be compiled in at the same time, and the config option account.engine defines which one will be used. * due to MySQL autoincrement limitations, accounts with id '0' will not be supported; account IDs from this point on should start from '1'. * login_log() functions now again record IP addresses in dotted format, not as 4-byte integers (undo from r6868). * removed config options that defined column names in the login table * removed `memo` and `error message` columns from login db/savefile * moved `loginlog` table to the logs database * added sql files upgrade_svn12975.sql and upgrade_svn12975_log.sql * due to changes to the login table layout, I added an !optional! sql file (upgrade_svn12975_view.sql) that will provide a certain degree of backwards compatibility with existing software; read the instructions inside carefully! * moved third-party includes/libs to a separate directory * updated project files / makefiles Changed the way GM levels are handled * removed conf/gm_account.txt * added the gm level column to the txt savefile (after 'email' column) * gm level information is now transferred along with account data For open problems see bugreport:1889. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13000 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-05-02Replaced the very ineffective clif_foreachclient() with map_foreachpc() ↵ultramage1-1/+1
since they essentially do the same thing (bugreport:1174). Rewrote map_foreachpc() so that its callback function signature now uses a more natural 'sd' instead of a DBKey/void* pair. Rewrote atcommand_users() to use a single function, instead of depending on two helper functions and global objects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12683 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-05-01Replaced the integers+checking approach in r12679 with usage of floating ↵ultramage1-7/+15
point arithmetic. Applied search&replace to use the new name of the function. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12680 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-05-01Implemented get_percentage() for compact and safe calculation of percentual ↵ultramage1-0/+16
values. Fixed integer arithmetic overflows that were occuring in several supernovice checks (bugreport:1135). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12679 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-20* Merged the tmpsql branch:FlavioJS1-129/+25
- Abstraction for the sql code (sql.c/h). - New configure script and makefiles. - Restored txt zeny logging code. (r10814) - Rewrote mapserver's sql code - itemdb, mobdb, mapreg, logs. (r10814) - Fixed a precedence issue (&& and ) in char_sql/char.c. (r10833) - Improved db reading code a bit for consistency. (r11077) - Added separate atcommand for mail deletion. (r11077) - Corrected a few messages that said "new" instead of "unread". (r11077) - Broadcast (*) messages now use "*" as the target's name (not ""). (r11077) - Moved StringBuf code from utils.c/h to strlib.c/h. (r11084 r11117) - Some misc login server cleanups (reformatting etc). (r11136) - Corrected/modified some header entries. (r11141 r11147 11148) - Adjusted VS project files. (r11147) - Adjusted the way the sql charserver does item saving. (r11192) - Corrected usage of reserved keyword 'friend' in mmo.h. (r11192) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11245 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-04Some all-around code reformatting/cleaningultramage1-20/+19
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10947 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-26* Changed the string hash of the script engine to SDBM.FlavioJS1-15/+20
* Reporting information about script data when an error occurs. * More work on ticket #41 (array functions). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10813 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-29Gave each file an empty last line, to make svn happierultramage1-1/+0
Added svn:eol-style native where missing Removed remaining .gats git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10401 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-22* Extended the functionality of StringBuf - length and appending a string.FlavioJS1-0/+25
* menu/select/prompt script functions support grouped and empty options. The selected option number is consistent with them. * More work on ticket #41. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10316 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-09* Changed db key from 'unsigned char*' to 'const char*'.FlavioJS1-36/+41
* Defined out the dump function in util.h/c. Notes: saw some suspicious code in npc.c so kept the 'const char*' propagation to a minimum for now git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10193 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-05* Made a crazy attempt to at least partially synchronize login&char codeultramage1-28/+18
* Major edit to the way the servers handle ip addresses, making them obey the "host byte order inside, network byte order outside" rule - hopefully covered all entry- and exit-points for IP address data - discovered several places where Gravity's client breaks the convention, will need to come up with a suitable countermeasure for that - other than that, the code should be portable, except for printing and ipban mask testing (those still assume a specific byte order) - tested both txt and sql in all usual situations; tested single- and multi-server setups, all seems to work (but watch out for hidden bugs!) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10162 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-05- Major reconfiguration of the trunk VS8 project files, read the changelog ↵ultramage1-89/+0
for details - Also removed some deprecated code that was causing linking conflicts - And fixed a missing md5calc reference in stable's VS8 files git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9619 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-15- There will be now warnings printed when a shop sells an item which's buy ↵skotlex1-0/+1
price is 20z, since those usually are "rare" items with no buyying price set. Note that this reports one fake, and that is the selling of a certain shuriken that indeed costs 20z. - Most likely fixed client crash when xmas/wedding status runs out. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9505 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-07- Fixed ladmin's linux compilation and moved some platform specific defines ↵FlavioJS1-4/+2
to cbasetypes.h git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9435 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-06- Added StringBuf_Vprintf to utils.c and changed the showmsg.c buffer.FlavioJS1-6/+16
Now it uses a static buffer and a StringBuf when needed (a debug message indicating the static buffer needs to be increased is shown). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9414 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-05- Massive EOL normalization & 'svn:eol-style native' flag setting for all ↵FlavioJS1-384/+384
txt/conf/h/c files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9410 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-18* Fixed warnings on compilers again.Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5654 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29AS OF SVN REV. 5901, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES ↵Valaris1-0/+384
GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5094 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29Clearing trunk.Valaris1-189/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5091 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-01-23update(no author)1-4/+5
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2004-12-27updateamber1-2/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@821 54d463be-8e91-2dee-dedb-b68131a5f0ec
2004-12-19guild_cacheamber1-0/+79
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@619 54d463be-8e91-2dee-dedb-b68131a5f0ec
2004-11-14Fixed some file typesamber1-108/+108
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@172 54d463be-8e91-2dee-dedb-b68131a5f0ec
2004-11-04git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@2 ↵(no author)1-0/+108
54d463be-8e91-2dee-dedb-b68131a5f0ec