Merged the /loginmerge branch (topic:192754)
* 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://svn.code.sf.net/p/rathena/svn/trunk@13000 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
19d4559ab6
commit
106b44c1e7
0
lib/pcre-7.0 → 3rdparty/pcre/pcre-7.0
vendored
0
lib/pcre-7.0 → 3rdparty/pcre/pcre-7.0
vendored
@ -3,6 +3,33 @@ Date Added
|
||||
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||
|
||||
2008/07/27
|
||||
* 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
|
||||
* Merged the /loginmerge branch [ultramage]
|
||||
- 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
|
||||
|
||||
2008/07/20
|
||||
* Simplified the search in pop_timer_heap and added more debug info to help
|
||||
determine the source condition of timer errors. (bugreport:1860)
|
||||
|
@ -43,10 +43,10 @@ common_sql: $(COMMON_SQL_DEPENDS)
|
||||
@$(MAKE) -C src/common sql
|
||||
|
||||
login: common
|
||||
@$(MAKE) -C src/login
|
||||
@$(MAKE) -C src/login txt
|
||||
|
||||
login_sql: $(LOGIN_SQL_DEPENDS)
|
||||
@$(MAKE) -C src/login_sql
|
||||
@$(MAKE) -C src/login sql
|
||||
|
||||
char: common
|
||||
@$(MAKE) -C src/char
|
||||
@ -93,7 +93,6 @@ save:
|
||||
clean:
|
||||
@$(MAKE) -C src/common $@
|
||||
@$(MAKE) -C src/login $@
|
||||
@$(MAKE) -C src/login_sql $@
|
||||
@$(MAKE) -C src/char $@
|
||||
@$(MAKE) -C src/char_sql $@
|
||||
@$(MAKE) -C src/map $@
|
||||
|
@ -1,5 +1,13 @@
|
||||
Date Added
|
||||
|
||||
2008/07/27
|
||||
* Conf file adjustments for the loginmerge branch
|
||||
- added new login and ipban db config options to login_athena.conf
|
||||
- login database options are no longer in inter_athena.conf!
|
||||
- moved setting 'lowest_gm_level' from inter_athena.conf to battle/gm.conf
|
||||
- removed setting 'gm_read_method'
|
||||
- removed options for setting `login` table column names
|
||||
- deleted file GM_account.txt, now the savefile is used for this
|
||||
2008/07/23
|
||||
* Increased max. hairstyle number, 23 -> 25 (bugreport:1773) [ultramage]
|
||||
2008/07/22
|
||||
|
@ -1,10 +0,0 @@
|
||||
// eAthena's GM Accounts File (for TXT servers only)
|
||||
// Edited by MC Cameri to enable account id ranges
|
||||
// Changing this file while login server is running
|
||||
// Usage #1(Standard): <account id> <level>
|
||||
// Usage #2(Range): <beginning of range[-:~]end of range> <level>
|
||||
// Examples:
|
||||
// 2000002 99
|
||||
// 2000003-2000005 99
|
||||
// 2000003~2000005 99
|
||||
// 2000001 30
|
@ -30,6 +30,11 @@ atcommand_slave_clone_limit: 25
|
||||
// current map server.
|
||||
partial_name_scan: yes
|
||||
|
||||
// The level at which a player with access is considered a GM.
|
||||
// An account with an access level lower than this is not effected
|
||||
// by gm_can_drop_lv (battle_athena.conf).
|
||||
lowest_gm_level: 1
|
||||
|
||||
// [GM] Can use all skills? (No or mimimum GM level)
|
||||
gm_all_skill: no
|
||||
|
||||
|
@ -1,5 +1,17 @@
|
||||
// Athena InterServer configuration.
|
||||
|
||||
// Options for both versions
|
||||
|
||||
// Log Inter Connections, etc.?
|
||||
log_inter: 1
|
||||
|
||||
// Inter Log Filename
|
||||
inter_log_filename: log/inter.log
|
||||
|
||||
// Level range for sharing within a party
|
||||
party_share_level: 10
|
||||
|
||||
|
||||
// TXT version options only
|
||||
|
||||
// Storage flatfile database, used for Karfa storage.
|
||||
@ -26,32 +38,14 @@ castle_txt: save/castle.txt
|
||||
// Status change flatfile database, for status changes that are saved between sessions.
|
||||
scdata_txt: save/scdata.txt
|
||||
|
||||
// Options for both versions
|
||||
|
||||
// Log Inter Connections, etc.?
|
||||
log_inter: 1
|
||||
|
||||
// Inter Log Filename
|
||||
inter_log_filename: log/inter.log
|
||||
|
||||
// Level range for sharing within a party
|
||||
party_share_level: 10
|
||||
|
||||
// SQL version options only
|
||||
|
||||
// GM Reading Method
|
||||
// 1 to have Char read GMs, 0 to have Login-controlled GMs
|
||||
gm_read_method: 0
|
||||
|
||||
// The level at which a player with access is considered a GM.
|
||||
// An account with an access level lower than this is not effected
|
||||
// by gm_can_drop_lv (battle_athena.conf).
|
||||
lowest_gm_level: 1
|
||||
|
||||
// You can specify the codepage to use in your mySQL tables here.
|
||||
// (Note that this feature requires MySQL 4.1+)
|
||||
//default_codepage:
|
||||
|
||||
|
||||
// For IPs, ideally under linux, you want to use localhost instead of 127.0.0.1
|
||||
// Under windows, you want to use 127.0.0.1. If you see a message like
|
||||
// "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"
|
||||
@ -96,16 +90,9 @@ db_server_logindb: ragnarok
|
||||
// this is meant for people who KNOW their stuff, and for some reason want to change their
|
||||
// database layout. [CLOWNISIUS]
|
||||
|
||||
//Column names for the login table.
|
||||
login_db_account_id: account_id
|
||||
login_db_userid: userid
|
||||
login_db_user_pass: user_pass
|
||||
login_db_level: level
|
||||
|
||||
// ALL MySQL Database Table names
|
||||
|
||||
// Login Database Tables
|
||||
login_db: login
|
||||
loginlog_db: loginlog
|
||||
|
||||
// Char Database Tables
|
||||
|
@ -15,11 +15,6 @@ admin_pass: admin
|
||||
// 2: password+key
|
||||
passenc: 2
|
||||
|
||||
// Language of ladmin
|
||||
// F: Français
|
||||
// E: English (default)
|
||||
defaultlanguage: E
|
||||
|
||||
// Log Filename. All operations done by the software are logged in this file.
|
||||
ladmin_log_filename: log/ladmin.log
|
||||
|
||||
|
@ -38,13 +38,12 @@ console_silent: 0
|
||||
// Whether remote administration is enabled or disabled
|
||||
admin_state: no
|
||||
|
||||
// Administrative password, used by ladmin (perl software) to connect remotely to server.
|
||||
// NOTICE: If you enable remote administration, you should change its value for security
|
||||
// NOTE: ladmin only works on TXT login servers.
|
||||
// Administrative password, used by ladmin to connect remotely to server.
|
||||
// NOTICE: you should change this value for security if you use ladmin.
|
||||
admin_pass: admin
|
||||
|
||||
// Indicate the IP/host that the server accepts for remote administration.
|
||||
admin_allowed_ip: 127.0.0.1
|
||||
admin_allowed_host: 127.0.0.1
|
||||
|
||||
// Console Commands
|
||||
// Allow for console commands to be used on/off
|
||||
@ -62,15 +61,8 @@ new_account: yes
|
||||
allowed_regs: 1
|
||||
time_allowed: 10
|
||||
|
||||
// Account flatfile database, stores account information.
|
||||
account_filename: save/account.txt
|
||||
|
||||
// What account AIDs have GM privs, and what level?
|
||||
gm_account_filename: conf/GM_account.txt
|
||||
|
||||
// Timer to check if GM_account file has been changed and reload GM account automaticaly
|
||||
// (in seconds; default: 15; value: 0 (disabled), or 2 or more)
|
||||
gm_account_filename_check_timer: 15
|
||||
// Log Filename. All operations received by the server are logged in this file.
|
||||
login_log_filename: log/login.log
|
||||
|
||||
// To log the login server?
|
||||
// NOTE: The login-sql server needs the login logs to enable dynamic pass failure bans.
|
||||
@ -110,11 +102,18 @@ client_version_to_connect: 20
|
||||
use_MD5_passwords: no
|
||||
|
||||
// Ipban features (SQL only)
|
||||
ipban: yes
|
||||
dynamic_pass_failure_ban: yes
|
||||
dynamic_pass_failure_ban_interval: 5
|
||||
dynamic_pass_failure_ban_limit: 7
|
||||
dynamic_pass_failure_ban_duration: 5
|
||||
ipban.enable: yes
|
||||
ipban.sql.db_hostname: 127.0.0.1
|
||||
ipban.sql.db_port: 3306
|
||||
ipban.sql.db_username: ragnarok
|
||||
ipban.sql.db_password: ragnarok
|
||||
ipban.sql.db_database: ragnarok
|
||||
ipban.sql.ipban_table: ipbanlist
|
||||
// Dynamic password failure ipban system
|
||||
ipban.dynamic_pass_failure_ban: yes
|
||||
ipban.dynamic_pass_failure_ban_interval: 5
|
||||
ipban.dynamic_pass_failure_ban_limit: 7
|
||||
ipban.dynamic_pass_failure_ban_duration: 5
|
||||
|
||||
// Interval (in minutes) to execute a DNS/IP update. Disabled by default.
|
||||
// Enable it if your server uses a dynamic IP which changes with time.
|
||||
@ -126,4 +125,24 @@ dynamic_pass_failure_ban_duration: 5
|
||||
use_dnsbl: no
|
||||
dnsbl_servers: dnsbl.deltaanime.net
|
||||
|
||||
// Which account engine to use.
|
||||
// 'auto' selects the first engine available (txt, sql, then others)
|
||||
// (defaults to auto)
|
||||
account.engine: auto
|
||||
|
||||
// Account data storage configuration
|
||||
// TXT
|
||||
account.txt.account_db: save/account.txt
|
||||
account.txt.case_sensitive: no
|
||||
// SQL
|
||||
account.sql.db_hostname: 127.0.0.1
|
||||
account.sql.db_port: 3306
|
||||
account.sql.db_username: ragnarok
|
||||
account.sql.db_password: ragnarok
|
||||
account.sql.db_database: ragnarok
|
||||
account.sql.codepage:
|
||||
account.sql.case_sensitive: no
|
||||
account.sql.account_db: login
|
||||
account.sql.accreg_db: global_reg_value
|
||||
|
||||
import: conf/import/login_conf.txt
|
||||
|
41
configure
vendored
41
configure
vendored
@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# From configure.in Revision: 12803 .
|
||||
# From configure.in Revision: 12731 .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.61.
|
||||
#
|
||||
@ -663,6 +663,7 @@ OBJEXT
|
||||
CPP
|
||||
GREP
|
||||
EGREP
|
||||
HAVE_OPENRJ_TXT
|
||||
MYSQL_CONFIG_HOME
|
||||
HAVE_MYSQL
|
||||
MYSQL_VERSION
|
||||
@ -1259,7 +1260,9 @@ Optional Features:
|
||||
--enable-mapregsql Makes map-wide script variables be saved to SQL
|
||||
instead of TXT files in the sql map-server.
|
||||
(disabled by default)
|
||||
--enable-debug Compiles in debug mode. (disabled by default)
|
||||
--enable-debug Compiles extra debug code. (disabled by default)
|
||||
--disable-openrj-txt Disables the openrj-based account engine in the TXT
|
||||
login-server (enabled by default)
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
@ -1718,7 +1721,7 @@ ac_config_files="$ac_config_files Makefile src/common/Makefile"
|
||||
|
||||
ac_config_files="$ac_config_files src/char/Makefile src/login/Makefile src/ladmin/Makefile"
|
||||
|
||||
ac_config_files="$ac_config_files src/char_sql/Makefile src/login_sql/Makefile src/txt-converter/Makefile"
|
||||
ac_config_files="$ac_config_files src/char_sql/Makefile src/txt-converter/Makefile"
|
||||
|
||||
ac_config_files="$ac_config_files src/map/Makefile src/plugins/Makefile src/tool/Makefile"
|
||||
|
||||
@ -1807,6 +1810,28 @@ fi
|
||||
|
||||
|
||||
|
||||
#
|
||||
# OpenRJ account engine in the txt login server
|
||||
#
|
||||
# Check whether --enable-openrj-txt was given.
|
||||
if test "${enable_openrj_txt+set}" = set; then
|
||||
enableval=$enable_openrj_txt;
|
||||
HAVE_OPENRJ_TXT="$enableval"
|
||||
case $enableval in
|
||||
no);;
|
||||
yes);;
|
||||
*) { { echo "$as_me:$LINENO: error: invalid argument --enable-openrj-txt=$enableval... stopping" >&5
|
||||
echo "$as_me: error: invalid argument --enable-openrj-txt=$enableval... stopping" >&2;}
|
||||
{ (exit 1); exit 1; }; };;
|
||||
esac
|
||||
|
||||
else
|
||||
HAVE_OPENRJ_TXT="yes"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Enable/disable MySql and optionally specify the path to mysql_config (optional library)
|
||||
#
|
||||
@ -4530,6 +4555,12 @@ if test "$enable_debug" = "yes" ; then
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# OpenRJ account engine in the txt login server
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# zlib library (required)
|
||||
#
|
||||
@ -6002,7 +6033,6 @@ do
|
||||
"src/login/Makefile") CONFIG_FILES="$CONFIG_FILES src/login/Makefile" ;;
|
||||
"src/ladmin/Makefile") CONFIG_FILES="$CONFIG_FILES src/ladmin/Makefile" ;;
|
||||
"src/char_sql/Makefile") CONFIG_FILES="$CONFIG_FILES src/char_sql/Makefile" ;;
|
||||
"src/login_sql/Makefile") CONFIG_FILES="$CONFIG_FILES src/login_sql/Makefile" ;;
|
||||
"src/txt-converter/Makefile") CONFIG_FILES="$CONFIG_FILES src/txt-converter/Makefile" ;;
|
||||
"src/map/Makefile") CONFIG_FILES="$CONFIG_FILES src/map/Makefile" ;;
|
||||
"src/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/Makefile" ;;
|
||||
@ -6115,6 +6145,7 @@ OBJEXT!$OBJEXT$ac_delim
|
||||
CPP!$CPP$ac_delim
|
||||
GREP!$GREP$ac_delim
|
||||
EGREP!$EGREP$ac_delim
|
||||
HAVE_OPENRJ_TXT!$HAVE_OPENRJ_TXT$ac_delim
|
||||
MYSQL_CONFIG_HOME!$MYSQL_CONFIG_HOME$ac_delim
|
||||
HAVE_MYSQL!$HAVE_MYSQL$ac_delim
|
||||
MYSQL_VERSION!$MYSQL_VERSION$ac_delim
|
||||
@ -6128,7 +6159,7 @@ LIBOBJS!$LIBOBJS$ac_delim
|
||||
LTLIBOBJS!$LTLIBOBJS$ac_delim
|
||||
_ACEOF
|
||||
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 59; then
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then
|
||||
break
|
||||
elif $ac_last_try; then
|
||||
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
|
||||
|
@ -7,7 +7,7 @@ AC_PREREQ([2.59])
|
||||
AC_CONFIG_SRCDIR([src/common/cbasetypes.h])
|
||||
AC_CONFIG_FILES([Makefile src/common/Makefile])
|
||||
AC_CONFIG_FILES([src/char/Makefile src/login/Makefile src/ladmin/Makefile])
|
||||
AC_CONFIG_FILES([src/char_sql/Makefile src/login_sql/Makefile src/txt-converter/Makefile])
|
||||
AC_CONFIG_FILES([src/char_sql/Makefile src/txt-converter/Makefile])
|
||||
AC_CONFIG_FILES([src/map/Makefile src/plugins/Makefile src/tool/Makefile])
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ AC_ARG_ENABLE(
|
||||
[debug],
|
||||
AC_HELP_STRING(
|
||||
[--enable-debug],
|
||||
[Compiles in debug mode. (disabled by default)]
|
||||
[Compiles extra debug code. (disabled by default)]
|
||||
),
|
||||
[
|
||||
enable_debug="$enableval"
|
||||
|
@ -1,19 +1,16 @@
|
||||
20080409
|
||||
// Accounts file: here are saved all information about the accounts.
|
||||
// Structure: ID, account name, password, last login time, sex, # of logins, state, email, error message for state 7, validity time, last (accepted) login ip, memo field, ban timestamp, repeated(register text, register value)
|
||||
// Some explanations:
|
||||
// account name : between 4 to 23 char for a normal account (standard client can't send less than 4 char).
|
||||
// account password: between 4 to 23 char
|
||||
// Structure: account ID, username, password, sex, email, level, state, unban time, expiration time, # of logins, last login time, last (accepted) login ip, repeated(register key, register value)
|
||||
// where:
|
||||
// sex : M or F for normal accounts, S for server accounts
|
||||
// level : this account's gm level
|
||||
// state : 0: account is ok, 1 to 256: error code of packet 0x006a + 1
|
||||
// email : between 3 to 39 char (a@a.com is like no email)
|
||||
// error message : text for the state 7: 'Your are Prohibited to login until <text>'. Max 19 char
|
||||
// valitidy time : 0: unlimited account, <other value>: date calculated by addition of 1/1/1970 + value (number of seconds since the 1/1/1970)
|
||||
// memo field : max 254 char
|
||||
// ban time : 0: no ban, <other value>: banned until the date: date calculated by addition of 1/1/1970 + value (number of seconds since the 1/1/1970)
|
||||
0 s1 p1 2004-10-25 01:12:04.147 S 2 0 a@a.com - 0 127.0.0.1 - 0
|
||||
1 s2 p2 - S 0 0 a@a.com - 0 - - 0
|
||||
2 s3 p3 - S 0 0 a@a.com - 0 - - 0
|
||||
3 s4 p4 - S 0 0 a@a.com - 0 - - 0
|
||||
4 s5 p5 - S 0 0 a@a.com - 0 - - 0
|
||||
2000001 Test Test - M 0 0 a@a.com - 0 - - 0
|
||||
// unban time : 0: no ban, <other value>: banned until the date (unix timestamp)
|
||||
// expiration time : 0: unlimited account, <other value>: account expires on the date (unix timestamp)
|
||||
1 s1 p1 S a@a.com 0 0 0 0 0 - -
|
||||
2 s2 p2 S a@a.com 0 0 0 0 0 - -
|
||||
3 s3 p3 S a@a.com 0 0 0 0 0 - -
|
||||
4 s4 p4 S a@a.com 0 0 0 0 0 - -
|
||||
5 s5 p5 S a@a.com 0 0 0 0 0 - -
|
||||
2000001 Test Test M a@a.com 0 0 0 0 0 - -
|
||||
2000002 %newid%
|
||||
|
@ -1,34 +1,34 @@
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
|
@ -113,3 +113,15 @@ CREATE TABLE `chatlog` (
|
||||
INDEX (`src_accountid`),
|
||||
INDEX (`src_charid`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
|
||||
|
||||
#Database: log
|
||||
#Table: loginlog
|
||||
CREATE TABLE `loginlog` (
|
||||
`time` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`ip` varchar(15) NOT NULL default '',
|
||||
`user` varchar(23) NOT NULL default '',
|
||||
`rcode` tinyint(4) NOT NULL default '0',
|
||||
`log` varchar(255) NOT NULL default '',
|
||||
INDEX (`ip`)
|
||||
) ENGINE=MyISAM ;
|
||||
|
||||
|
@ -421,17 +421,15 @@ CREATE TABLE `login` (
|
||||
`account_id` int(11) unsigned NOT NULL auto_increment,
|
||||
`userid` varchar(23) NOT NULL default '',
|
||||
`user_pass` varchar(32) NOT NULL default '',
|
||||
`lastlogin` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`sex` enum('M','F','S') NOT NULL default 'M',
|
||||
`logincount` mediumint(9) unsigned NOT NULL default '0',
|
||||
`email` varchar(39) NOT NULL default '',
|
||||
`level` tinyint(3) NOT NULL default '0',
|
||||
`error_message` smallint(11) unsigned NOT NULL default '0',
|
||||
`connect_until` int(11) unsigned NOT NULL default '0',
|
||||
`last_ip` varchar(100) NOT NULL default '',
|
||||
`memo` smallint(11) unsigned NOT NULL default '0',
|
||||
`ban_until` int(11) unsigned NOT NULL default '0',
|
||||
`state` int(11) unsigned NOT NULL default '0',
|
||||
`unban_time` int(11) unsigned NOT NULL default '0',
|
||||
`expiration_time` int(11) unsigned NOT NULL default '0',
|
||||
`logincount` mediumint(9) unsigned NOT NULL default '0',
|
||||
`lastlogin` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`last_ip` varchar(100) NOT NULL default '',
|
||||
PRIMARY KEY (`account_id`),
|
||||
KEY `name` (`userid`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=2000000;
|
||||
@ -472,20 +470,6 @@ CREATE TABLE `sc_data` (
|
||||
KEY (`char_id`)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
--
|
||||
-- Table structure for table `loginlog`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `loginlog`;
|
||||
CREATE TABLE `loginlog` (
|
||||
`time` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`ip` int(10) unsigned NOT NULL default '0',
|
||||
`user` varchar(23) NOT NULL default '',
|
||||
`rcode` tinyint(4) NOT NULL default '0',
|
||||
`log` varchar(255) NOT NULL default '',
|
||||
INDEX (`ip`)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
--
|
||||
-- Table structure for table `mail`
|
||||
--
|
||||
|
24
sql-files/upgrade_svn12975.sql
Normal file
24
sql-files/upgrade_svn12975.sql
Normal file
@ -0,0 +1,24 @@
|
||||
START TRANSACTION;
|
||||
|
||||
-- delete columns
|
||||
ALTER TABLE `login` DROP `error_message`;
|
||||
ALTER TABLE `login` DROP `memo`;
|
||||
|
||||
-- rename columns
|
||||
ALTER TABLE `login` CHANGE `connect_until` `expiration_time` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `login` CHANGE `ban_until` `unban_time` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0';
|
||||
|
||||
-- reorder columns
|
||||
ALTER TABLE `login` MODIFY `sex` enum('M','F','S') NOT NULL default 'M' AFTER `user_pass`;
|
||||
ALTER TABLE `login` MODIFY `email` varchar(39) NOT NULL default '' AFTER `sex`;
|
||||
ALTER TABLE `login` MODIFY `level` tinyint(3) NOT NULL default '0' AFTER `email`;
|
||||
ALTER TABLE `login` MODIFY `state` int(11) unsigned NOT NULL default '0' AFTER `level`;
|
||||
ALTER TABLE `login` MODIFY `unban_time` int(11) unsigned NOT NULL default '0' AFTER `state`;
|
||||
ALTER TABLE `login` MODIFY `expiration_time` int(11) unsigned NOT NULL default '0' AFTER `unban_time`;
|
||||
ALTER TABLE `login` MODIFY `logincount` mediumint(9) unsigned NOT NULL default '0' AFTER `expiration_time`;
|
||||
|
||||
-- change ip format
|
||||
ALTER TABLE `loginlog` CHANGE `ip` `ip` VARCHAR( 15 ) NOT NULL default '';
|
||||
UPDATE `loginlog` SET `ip` = inet_ntoa(`ip`);
|
||||
|
||||
COMMIT;
|
20
sql-files/upgrade_svn12975_log.sql
Normal file
20
sql-files/upgrade_svn12975_log.sql
Normal file
@ -0,0 +1,20 @@
|
||||
-- NOTE: change `ragnarok` and `log` to whatever your database names are.
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
CREATE TABLE `log`.`loginlog` (
|
||||
`time` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`ip` varchar( 15 ) NOT NULL ,
|
||||
`user` varchar( 23 ) NOT NULL default '',
|
||||
`rcode` tinyint( 4 ) NOT NULL default '0',
|
||||
`log` varchar( 255 ) NOT NULL default '',
|
||||
KEY `ip` ( `ip` )
|
||||
) ENGINE = MYISAM;
|
||||
|
||||
INSERT INTO `log`.`loginlog`
|
||||
SELECT *
|
||||
FROM `ragnarok`.`loginlog` ;
|
||||
|
||||
DROP TABLE `ragnarok`.`loginlog` ;
|
||||
|
||||
COMMIT;
|
17
sql-files/upgrade_svn12975_view.sql
Normal file
17
sql-files/upgrade_svn12975_view.sql
Normal file
@ -0,0 +1,17 @@
|
||||
-- The statements below will create a 'view' (virtual table) that mimics
|
||||
-- the previous `login` table layout. You can use this hack to make your db
|
||||
-- compatible with older eathena servers or control panels.
|
||||
-- Note: also adjust the account.sql.account_db setting in login_athena.conf.
|
||||
-- Note: if your CP does not have a config setting for the `login` table name
|
||||
-- you'll have to either modify its code or do some table renaming.
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
-- create dummy columns, needed to make the view insertable
|
||||
ALTER TABLE `login` ADD `error_message` SMALLINT UNSIGNED NOT NULL;
|
||||
ALTER TABLE `login` ADD `memo` SMALLINT UNSIGNED NOT NULL;
|
||||
|
||||
-- create the view
|
||||
CREATE VIEW `login_view` ( `account_id`, `userid`, `user_pass`, `lastlogin`, `sex`, `logincount`, `email`, `level`, `error_message`, `connect_until`, `last_ip`, `memo`, `ban_until`, `state` ) AS SELECT `account_id`, `userid`, `user_pass`, `lastlogin`, `sex`, `logincount`, `email`, `level`, `error_message`, `expiration_time`, `last_ip`, `memo`, `unban_time`, `state` FROM `login`;
|
||||
|
||||
COMMIT;
|
165
src/char/char.c
165
src/char/char.c
@ -109,6 +109,7 @@ struct char_session_data {
|
||||
int found_char[MAX_CHARS]; // ids of chars on this account
|
||||
char email[40]; // e-mail (default: a@a.com) by [Yor]
|
||||
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
|
||||
int gmlevel;
|
||||
};
|
||||
|
||||
int char_id_count = START_CHAR_NUM;
|
||||
@ -136,9 +137,6 @@ struct fame_list taekwon_fame_list[MAX_FAME_LIST];
|
||||
// Initial position (it's possible to set it in conf file)
|
||||
struct point start_point = { 0, 53, 111 };
|
||||
|
||||
struct gm_account *gm_account = NULL;
|
||||
int GM_num = 0;
|
||||
|
||||
// online players by [Yor]
|
||||
char online_txt_filename[1024] = "online.txt";
|
||||
char online_html_filename[1024] = "online.html";
|
||||
@ -162,6 +160,7 @@ struct auth_node {
|
||||
uint32 ip;
|
||||
int sex;
|
||||
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
|
||||
int gmlevel;
|
||||
};
|
||||
|
||||
static DBMap* auth_db; // int account_id -> struct auth_node*
|
||||
@ -344,20 +343,6 @@ int char_log(char *fmt, ...)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Determine if an account (id) is a GM account
|
||||
// and returns its level (or 0 if it isn't a GM account or if not found)
|
||||
//----------------------------------------------------------------------
|
||||
int isGM(int account_id)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < GM_num; i++)
|
||||
if (gm_account[i].account_id == account_id)
|
||||
return gm_account[i].level;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Search character data from the aid/cid givem
|
||||
struct mmo_charstatus* search_character(int aid, int cid)
|
||||
{
|
||||
@ -1556,7 +1541,8 @@ void create_online_files(void)
|
||||
// displaying the character name
|
||||
if ((online_display_option & 1) || (online_display_option & 64)) { // without/with 'GM' display
|
||||
strcpy(temp, char_dat[j].status.name);
|
||||
l = isGM(char_dat[j].status.account_id);
|
||||
//l = isGM(char_dat[j].status.account_id);
|
||||
l = 0; //FIXME: how to get the gm level?
|
||||
if (online_display_option & 64) {
|
||||
if (l >= online_gm_display_min_level)
|
||||
fprintf(fp, "%-24s (GM) ", temp);
|
||||
@ -1892,7 +1878,7 @@ static int char_delete(struct mmo_charstatus *cs)
|
||||
static void char_auth_ok(int fd, struct char_session_data *sd)
|
||||
{
|
||||
struct online_char_data* character;
|
||||
if (max_connect_user && count_users() >= max_connect_user && isGM(sd->account_id) < gm_allow_level)
|
||||
if (max_connect_user && count_users() >= max_connect_user && sd->gmlevel < gm_allow_level)
|
||||
{
|
||||
// refuse connection (over populated)
|
||||
WFIFOW(fd,0) = 0x6c;
|
||||
@ -1999,7 +1985,7 @@ int parse_fromlogin(int fd)
|
||||
|
||||
// acknowledgement of account authentication request
|
||||
case 0x2713:
|
||||
if (RFIFOREST(fd) < 59)
|
||||
if (RFIFOREST(fd) < 60)
|
||||
return 0;
|
||||
{
|
||||
int account_id = RFIFOL(fd,2);
|
||||
@ -2008,6 +1994,7 @@ int parse_fromlogin(int fd)
|
||||
bool result = RFIFOB(fd,14);
|
||||
const char* email = (const char*)RFIFOP(fd,15);
|
||||
time_t expiration_time = (time_t)RFIFOL(fd,55);
|
||||
int gmlevel = RFIFOB(fd,59);
|
||||
|
||||
// find the session with this account id
|
||||
ARR_FIND( 0, fd_max, i, session[i] && (sd = (struct char_session_data*)session[i]->session_data) &&
|
||||
@ -2021,32 +2008,29 @@ int parse_fromlogin(int fd)
|
||||
WFIFOSET(i,3);
|
||||
} else { // success
|
||||
memcpy(sd->email, email, 40);
|
||||
if (e_mail_check(sd->email) == 0)
|
||||
strncpy(sd->email, "a@a.com", 40); // default e-mail
|
||||
sd->expiration_time = expiration_time;
|
||||
sd->gmlevel = gmlevel;
|
||||
char_auth_ok(i, sd);
|
||||
}
|
||||
}
|
||||
}
|
||||
RFIFOSKIP(fd,59);
|
||||
RFIFOSKIP(fd,60);
|
||||
break;
|
||||
|
||||
// Receiving of an e-mail/time limit from the login-server (answer of a request because a player comes back from map-server to char-server) by [Yor]
|
||||
case 0x2717:
|
||||
if (RFIFOREST(fd) < 50)
|
||||
if (RFIFOREST(fd) < 51)
|
||||
return 0;
|
||||
for(i = 0; i < fd_max; i++) {
|
||||
if (session[i] && (sd = (struct char_session_data*)session[i]->session_data)) {
|
||||
if (sd->account_id == RFIFOL(fd,2)) {
|
||||
memcpy(sd->email, RFIFOP(fd,6), 40);
|
||||
if (e_mail_check(sd->email) == 0)
|
||||
strncpy(sd->email, "a@a.com", 40); // default e-mail
|
||||
sd->expiration_time = (time_t)RFIFOL(fd,46);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// find the session with this account id
|
||||
ARR_FIND( 0, fd_max, i, session[i] && (sd = (struct char_session_data*)session[i]->session_data) && sd->account_id == RFIFOL(fd,2) );
|
||||
if( i < fd_max )
|
||||
{
|
||||
memcpy(sd->email, RFIFOP(fd,6), 40);
|
||||
sd->expiration_time = (time_t)RFIFOL(fd,46);
|
||||
sd->gmlevel = RFIFOB(fd,50);
|
||||
}
|
||||
RFIFOSKIP(fd,50);
|
||||
RFIFOSKIP(fd,51);
|
||||
break;
|
||||
|
||||
// login-server alive packet
|
||||
@ -2209,7 +2193,7 @@ int parse_fromlogin(int fd)
|
||||
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
|
||||
return 0;
|
||||
{ //Receive account_reg2 registry, forward to map servers.
|
||||
unsigned char buf[ACCOUNT_REG2_NUM*(256+32+2)+16];
|
||||
unsigned char buf[13+ACCOUNT_REG2_NUM*sizeof(struct global_reg)];
|
||||
memcpy(buf,RFIFOP(fd,0), RFIFOW(fd,2));
|
||||
// WBUFW(buf,0) = 0x2b11;
|
||||
WBUFW(buf,0) = 0x3804; //Map server can now receive all kinds of reg values with the same packet. [Skotlex]
|
||||
@ -2284,33 +2268,6 @@ int parse_fromlogin(int fd)
|
||||
RFIFOSKIP(fd,11);
|
||||
break;
|
||||
|
||||
// Receiving GM acounts info from login-server (by [Yor])
|
||||
case 0x2732:
|
||||
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
|
||||
return 0;
|
||||
{
|
||||
unsigned char buf[32000]; //FIXME: this will crash
|
||||
if (gm_account != NULL)
|
||||
aFree(gm_account);
|
||||
CREATE(gm_account, struct gm_account, (RFIFOW(fd,2) - 4)/5);
|
||||
GM_num = 0;
|
||||
for (i = 4; i < RFIFOW(fd,2); i = i + 5) {
|
||||
gm_account[GM_num].account_id = RFIFOL(fd,i);
|
||||
gm_account[GM_num].level = (int)RFIFOB(fd,i+4);
|
||||
//printf("GM account: %d -> level %d\n", gm_account[GM_num].account_id, gm_account[GM_num].level);
|
||||
GM_num++;
|
||||
}
|
||||
ShowStatus("From login-server: receiving information of %d GM accounts.\n", GM_num);
|
||||
char_log("From login-server: receiving information of %d GM accounts.\n", GM_num);
|
||||
// send new gm acccounts level to map-servers
|
||||
memcpy(buf, RFIFOP(fd,0), RFIFOW(fd,2));
|
||||
WBUFW(buf,0) = 0x2b15;
|
||||
mapif_sendall(buf, RFIFOW(fd,2));
|
||||
|
||||
RFIFOSKIP(fd,RFIFOW(fd,2));
|
||||
}
|
||||
break;
|
||||
|
||||
// Login server request to kick a character out. [Skotlex]
|
||||
case 0x2734:
|
||||
if (RFIFOREST(fd) < 6)
|
||||
@ -2634,15 +2591,6 @@ int parse_frommap(int fd)
|
||||
switch(RFIFOW(fd,0))
|
||||
{
|
||||
|
||||
case 0x2af7: // request from map-server to reload GM accounts. Transmission to login-server
|
||||
if (login_fd > 0) { // don't send request if no login-server
|
||||
WFIFOHEAD(login_fd,2);
|
||||
WFIFOW(login_fd,0) = 0x2709;
|
||||
WFIFOSET(login_fd,2);
|
||||
}
|
||||
RFIFOSKIP(fd,2);
|
||||
break;
|
||||
|
||||
case 0x2afa: // Receiving map names list from the map-server
|
||||
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
|
||||
return 0;
|
||||
@ -2844,8 +2792,9 @@ int parse_frommap(int fd)
|
||||
char_dat[i].status.char_id == RFIFOL(fd,14))
|
||||
break;
|
||||
}
|
||||
|
||||
char_data = i < char_num ? &char_dat[i].status : NULL;
|
||||
//Tell the new map server about this player using Kevin's new auth packet. [Skotlex]
|
||||
|
||||
if (map_fd >= 0 && session[map_fd] && char_data)
|
||||
{ //Send the map server the auth of this player.
|
||||
struct auth_node* node;
|
||||
@ -2856,19 +2805,6 @@ int parse_frommap(int fd)
|
||||
char_data->last_point.y = RFIFOW(fd,22);
|
||||
char_data->sex = RFIFOB(fd,30);
|
||||
|
||||
#if 0
|
||||
// the map-server must request it [FlavioJS]
|
||||
WFIFOHEAD(map_fd, 20 + sizeof(struct mmo_charstatus));
|
||||
WFIFOW(map_fd,0) = 0x2afd;
|
||||
WFIFOW(map_fd,2) = 20 + sizeof(struct mmo_charstatus);
|
||||
WFIFOL(map_fd,4) = RFIFOL(fd,2); //Account ID
|
||||
WFIFOL(map_fd,8) = RFIFOL(fd,6); //Login1
|
||||
WFIFOL(map_fd,16) = RFIFOL(fd,10); //Login2
|
||||
WFIFOL(map_fd,12) = (unsigned long)0; //TODO: expiration_time, how do I figure it out right now?
|
||||
memcpy(WFIFOP(map_fd,20), char_data, sizeof(struct mmo_charstatus));
|
||||
WFIFOSET(map_fd, WFIFOW(map_fd,2));
|
||||
#endif
|
||||
|
||||
// create temporary auth entry
|
||||
CREATE(node, struct auth_node, 1);
|
||||
node->account_id = RFIFOL(fd,2);
|
||||
@ -2959,9 +2895,9 @@ int parse_frommap(int fd)
|
||||
|
||||
if( login_fd <= 0 )
|
||||
result = 3; // 3-login-server offline
|
||||
else
|
||||
if( acc != -1 && isGM(acc) < isGM(account_id) )
|
||||
result = 2; // 2-gm level too low
|
||||
// else
|
||||
// if( acc != -1 && isGM(acc) < isGM(account_id) )
|
||||
// result = 2; // 2-gm level too low
|
||||
else
|
||||
switch( type ) {
|
||||
case 1: // block
|
||||
@ -3168,14 +3104,15 @@ int parse_frommap(int fd)
|
||||
{// auth ok
|
||||
cd->sex = sex;
|
||||
|
||||
WFIFOHEAD(fd,20 + sizeof(struct mmo_charstatus));
|
||||
WFIFOHEAD(fd,24 + sizeof(struct mmo_charstatus));
|
||||
WFIFOW(fd,0) = 0x2afd;
|
||||
WFIFOW(fd,2) = 20 + sizeof(struct mmo_charstatus);
|
||||
WFIFOW(fd,2) = 24 + sizeof(struct mmo_charstatus);
|
||||
WFIFOL(fd,4) = account_id;
|
||||
WFIFOL(fd,8) = login_id1;
|
||||
WFIFOL(fd,12) = (uint32)node->expiration_time; // FIXME: will wrap to negative after "19-Jan-2038, 03:14:07 AM GMT"
|
||||
WFIFOL(fd,16) = node->login_id2;
|
||||
memcpy(WFIFOP(fd,20), cd, sizeof(struct mmo_charstatus));
|
||||
WFIFOL(fd,8) = node->login_id1;
|
||||
WFIFOL(fd,12) = node->login_id2;
|
||||
WFIFOL(fd,16) = (uint32)node->expiration_time; // FIXME: will wrap to negative after "19-Jan-2038, 03:14:07 AM GMT"
|
||||
WFIFOL(fd,20) = node->gmlevel;
|
||||
memcpy(WFIFOP(fd,24), cd, sizeof(struct mmo_charstatus));
|
||||
WFIFOSET(fd, WFIFOW(fd,2));
|
||||
|
||||
// only use the auth once and mark user online
|
||||
@ -3309,7 +3246,6 @@ int parse_char(int fd)
|
||||
return 0;
|
||||
{
|
||||
struct auth_node* node;
|
||||
int GM_value;
|
||||
|
||||
int account_id = RFIFOL(fd,2);
|
||||
uint32 login_id1 = RFIFOL(fd,6);
|
||||
@ -3325,16 +3261,9 @@ int parse_char(int fd)
|
||||
//TODO: and perhaps send back a reply?
|
||||
break;
|
||||
}
|
||||
|
||||
if( (GM_value = isGM(account_id)) != 0 )
|
||||
ShowInfo("Account Logged On; Account ID: %d (GM level %d).\n", account_id, GM_value);
|
||||
else
|
||||
ShowInfo("Account Logged On; Account ID: %d.\n", account_id);
|
||||
|
||||
CREATE(session[fd]->session_data, struct char_session_data, 1);
|
||||
sd = (struct char_session_data*)session[fd]->session_data;
|
||||
strncpy(sd->email, "no mail", 40); // put here a mail without '@' to refuse deletion if we don't receive the e-mail
|
||||
sd->expiration_time = 0; // unknown or unlimited (not displaying on map-server)
|
||||
sd->account_id = account_id;
|
||||
sd->login_id1 = login_id1;
|
||||
sd->login_id2 = login_id2;
|
||||
@ -3454,7 +3383,6 @@ int parse_char(int fd)
|
||||
cd->last_point.map = j;
|
||||
}
|
||||
|
||||
//Send NEW auth packet [Kevin]
|
||||
//FIXME: is this case even possible? [ultramage]
|
||||
if ((map_fd = server[i].fd) < 1 || session[map_fd] == NULL)
|
||||
{
|
||||
@ -3474,29 +3402,13 @@ int parse_char(int fd)
|
||||
WFIFOW(fd,0) = 0x71;
|
||||
WFIFOL(fd,2) = cd->char_id;
|
||||
mapindex_getmapname_ext(mapindex_id2name(cd->last_point.map), (char*)WFIFOP(fd,6));
|
||||
|
||||
// Advanced subnet check [LuzZza]
|
||||
subnet_map_ip = lan_subnetcheck(ipl);
|
||||
subnet_map_ip = lan_subnetcheck(ipl); // Advanced subnet check [LuzZza]
|
||||
WFIFOL(fd,22) = htonl((subnet_map_ip) ? subnet_map_ip : server[i].ip);
|
||||
WFIFOW(fd,26) = ntows(htons(server[i].port)); // [!] LE byte order here [!]
|
||||
WFIFOSET(fd,28);
|
||||
|
||||
ShowInfo("Character selection '%s' (account: %d, slot: %d).\n", cd->name, sd->account_id, ch);
|
||||
|
||||
#if 0
|
||||
// The server must request it [FlavioJS]
|
||||
//Send auth ok to map server
|
||||
WFIFOHEAD(map_fd,20 + sizeof(struct mmo_charstatus));
|
||||
WFIFOW(map_fd,0) = 0x2afd;
|
||||
WFIFOW(map_fd,2) = 20 + sizeof(struct mmo_charstatus);
|
||||
WFIFOL(map_fd,4) = sd->account_id;
|
||||
WFIFOL(map_fd,8) = sd->login_id1;
|
||||
WFIFOL(map_fd,16) = sd->login_id2;
|
||||
WFIFOL(map_fd,12) = (unsigned long)sd->expiration_time;
|
||||
memcpy(WFIFOP(map_fd,20), cd, sizeof(struct mmo_charstatus));
|
||||
WFIFOSET(map_fd, WFIFOW(map_fd,2));
|
||||
#endif
|
||||
|
||||
// create temporary auth entry
|
||||
CREATE(node, struct auth_node, 1);
|
||||
node->account_id = sd->account_id;
|
||||
@ -3505,6 +3417,7 @@ int parse_char(int fd)
|
||||
node->login_id2 = sd->login_id2;
|
||||
node->sex = sd->sex;
|
||||
node->expiration_time = sd->expiration_time;
|
||||
node->gmlevel = sd->gmlevel;
|
||||
node->ip = ipl;
|
||||
idb_put(auth_db, sd->account_id, node);
|
||||
}
|
||||
@ -3706,15 +3619,6 @@ int parse_char(int fd)
|
||||
session[fd]->flag.server = 1;
|
||||
realloc_fifo(fd, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK);
|
||||
char_mapif_init(fd);
|
||||
// send gm acccounts level to map-servers
|
||||
WFIFOHEAD(fd,4+5*GM_num);
|
||||
WFIFOW(fd,0) = 0x2b15;
|
||||
for(i = 0; i < GM_num; i++) {
|
||||
WFIFOL(fd,4+5*i) = gm_account[i].account_id;
|
||||
WFIFOB(fd,4+5*i+4) = (unsigned char)gm_account[i].level;
|
||||
}
|
||||
WFIFOW(fd,2) = 4+5*GM_num;
|
||||
WFIFOSET(fd,WFIFOW(fd,2));
|
||||
}
|
||||
|
||||
RFIFOSKIP(fd,60);
|
||||
@ -4245,7 +4149,6 @@ void do_final(void)
|
||||
online_char_db->destroy(online_char_db, NULL); //dispose the db...
|
||||
auth_db->destroy(auth_db, NULL);
|
||||
|
||||
if(gm_account) aFree(gm_account);
|
||||
if(char_dat) aFree(char_dat);
|
||||
|
||||
if (login_fd > 0)
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "../common/mmo.h"
|
||||
|
||||
#define START_CHAR_NUM 150000
|
||||
#define MAX_MAP_SERVERS 30
|
||||
|
||||
#define DEFAULT_AUTOSAVE_INTERVAL 300*1000
|
||||
|
@ -650,6 +650,25 @@ int mapif_parse_NameChangeRequest(int fd)
|
||||
|
||||
//--------------------------------------------------------
|
||||
|
||||
/// Returns the length of the next complete packet to process,
|
||||
/// or 0 if no complete packet exists in the queue.
|
||||
///
|
||||
/// @param length The minimum allowed length, or -1 for dynamic lookup
|
||||
int inter_check_length(int fd, int length)
|
||||
{
|
||||
if( length == -1 )
|
||||
{// variable-length packet
|
||||
if( RFIFOREST(fd) < 4 )
|
||||
return 0;
|
||||
length = RFIFOW(fd,2);
|
||||
}
|
||||
|
||||
if( (int)RFIFOREST(fd) < length )
|
||||
return 0;
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
// map server からの通信(1パケットのみ解析すること)
|
||||
// エラーなら0(false)、処理できたなら1、
|
||||
// パケット長が足りなければ2をかえさなければならない
|
||||
@ -695,19 +714,4 @@ int inter_parse_frommap(int fd) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// RFIFOのパケット長確認
|
||||
// 必要パケット長があればパケット長、まだ足りなければ0
|
||||
int inter_check_length(int fd, int length) {
|
||||
if (length == -1) { // 可変パケット長
|
||||
RFIFOHEAD(fd);
|
||||
if (RFIFOREST(fd) < 4) // パケット長が未着
|
||||
return 0;
|
||||
length = RFIFOW(fd,2);
|
||||
}
|
||||
|
||||
if ((int)RFIFOREST(fd) < length) // パケットが未着
|
||||
return 0;
|
||||
|
||||
return length;
|
||||
}
|
||||
#endif //TXT_SQL_CONVERT
|
||||
|
@ -13,14 +13,11 @@ int inter_parse_frommap(int fd);
|
||||
int inter_mapif_init(int fd);
|
||||
int mapif_disconnectplayer(int fd, int account_id, int char_id, int reason);
|
||||
|
||||
int inter_check_length(int fd,int length);
|
||||
|
||||
int inter_log(char *fmt,...);
|
||||
|
||||
#define inter_cfgName "conf/inter_athena.conf"
|
||||
|
||||
extern unsigned int party_share_level;
|
||||
extern char inter_log_filename[1024];
|
||||
extern char main_chat_nick[16];
|
||||
|
||||
//For TXT->SQL conversion
|
||||
|
@ -69,12 +69,6 @@ char db_path[1024] = "db";
|
||||
|
||||
int db_use_sqldbs;
|
||||
|
||||
char login_db[256] = "login";
|
||||
char login_db_account_id[32] = "account_id";
|
||||
char login_db_level[32] = "level";
|
||||
|
||||
int lowest_gm_level = 1;
|
||||
|
||||
struct mmo_map_server {
|
||||
int fd;
|
||||
uint32 ip;
|
||||
@ -135,6 +129,7 @@ struct char_session_data {
|
||||
int found_char[MAX_CHARS]; // ids of chars on this account
|
||||
char email[40]; // e-mail (default: a@a.com) by [Yor]
|
||||
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
|
||||
int gmlevel;
|
||||
};
|
||||
|
||||
int char_num, char_max;
|
||||
@ -164,10 +159,6 @@ unsigned int save_flag = 0;
|
||||
// Initial position (it's possible to set it in conf file)
|
||||
struct point start_point = { 0, 53, 111 };
|
||||
|
||||
bool char_gm_read = false;
|
||||
struct gm_account *gm_account = NULL;
|
||||
int GM_num = 0;
|
||||
|
||||
int console = 0;
|
||||
|
||||
//-----------------------------------------------------
|
||||
@ -183,6 +174,7 @@ struct auth_node {
|
||||
uint32 ip;
|
||||
int sex;
|
||||
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
|
||||
int gmlevel;
|
||||
};
|
||||
|
||||
static DBMap* auth_db; // int account_id -> struct auth_node*
|
||||
@ -394,53 +386,6 @@ void set_all_offline_sql(void)
|
||||
Sql_ShowDebug(sql_handle);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Determine if an account (id) is a GM account
|
||||
// and returns its level (or 0 if it isn't a GM account or if not found)
|
||||
//----------------------------------------------------------------------
|
||||
int isGM(int account_id)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < GM_num; i++)
|
||||
if (gm_account[i].account_id == account_id)
|
||||
return gm_account[i].level;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void read_gm_account(void)
|
||||
{
|
||||
if(!char_gm_read)
|
||||
return;
|
||||
|
||||
if (gm_account != NULL)
|
||||
aFree(gm_account);
|
||||
GM_num = 0;
|
||||
|
||||
if( SQL_ERROR == Sql_Query(lsql_handle, "SELECT `%s`,`%s` FROM `%s` WHERE `%s`>='%d'", login_db_account_id, login_db_level, login_db, login_db_level, lowest_gm_level) )
|
||||
Sql_ShowDebug(lsql_handle);
|
||||
|
||||
if( Sql_NumRows(lsql_handle) > 0 )
|
||||
{
|
||||
char* data;
|
||||
|
||||
CREATE(gm_account, struct gm_account, (size_t)Sql_NumRows(lsql_handle));
|
||||
while( SQL_SUCCESS == Sql_NextRow(lsql_handle) )
|
||||
{
|
||||
// account_id
|
||||
Sql_GetData(lsql_handle, 0, &data, NULL);
|
||||
gm_account[GM_num].account_id = atoi(data);
|
||||
// account_id
|
||||
Sql_GetData(lsql_handle, 1, &data, NULL);
|
||||
gm_account[GM_num].level = atoi(data);
|
||||
++GM_num;
|
||||
}
|
||||
}
|
||||
Sql_FreeResult(lsql_handle);
|
||||
|
||||
mapif_send_gmaccounts();
|
||||
}
|
||||
|
||||
static void* create_charstatus(DBKey key, va_list args)
|
||||
{
|
||||
struct mmo_charstatus *cp;
|
||||
@ -1636,7 +1581,7 @@ int char_family(int pl1, int pl2, int pl3)
|
||||
static void char_auth_ok(int fd, struct char_session_data *sd)
|
||||
{
|
||||
struct online_char_data* character;
|
||||
if (max_connect_user && count_users() >= max_connect_user && isGM(sd->account_id) < gm_allow_level)
|
||||
if (max_connect_user && count_users() >= max_connect_user && sd->gmlevel < gm_allow_level)
|
||||
{
|
||||
// refuse connection (over populated)
|
||||
WFIFOW(fd,0) = 0x6c;
|
||||
@ -1742,7 +1687,7 @@ int parse_fromlogin(int fd)
|
||||
|
||||
// acknowledgement of account authentication request
|
||||
case 0x2713:
|
||||
if (RFIFOREST(fd) < 59)
|
||||
if (RFIFOREST(fd) < 60)
|
||||
return 0;
|
||||
{
|
||||
int account_id = RFIFOL(fd,2);
|
||||
@ -1751,6 +1696,7 @@ int parse_fromlogin(int fd)
|
||||
bool result = RFIFOB(fd,14);
|
||||
const char* email = (const char*)RFIFOP(fd,15);
|
||||
time_t expiration_time = (time_t)RFIFOL(fd,55);
|
||||
int gmlevel = RFIFOB(fd,59);
|
||||
|
||||
// find the session with this account id
|
||||
ARR_FIND( 0, fd_max, i, session[i] && (sd = (struct char_session_data*)session[i]->session_data) &&
|
||||
@ -1765,16 +1711,17 @@ int parse_fromlogin(int fd)
|
||||
} else { // success
|
||||
memcpy(sd->email, email, 40);
|
||||
sd->expiration_time = expiration_time;
|
||||
sd->gmlevel = gmlevel;
|
||||
char_auth_ok(i, sd);
|
||||
}
|
||||
}
|
||||
}
|
||||
RFIFOSKIP(fd,59);
|
||||
RFIFOSKIP(fd,60);
|
||||
break;
|
||||
|
||||
// acknowledgement of e-mail/limited time request
|
||||
case 0x2717:
|
||||
if (RFIFOREST(fd) < 50)
|
||||
if (RFIFOREST(fd) < 51)
|
||||
return 0;
|
||||
|
||||
// find the session with this account id
|
||||
@ -1783,8 +1730,9 @@ int parse_fromlogin(int fd)
|
||||
{
|
||||
memcpy(sd->email, RFIFOP(fd,6), 40);
|
||||
sd->expiration_time = (time_t)RFIFOL(fd,46);
|
||||
sd->gmlevel = RFIFOB(fd,50);
|
||||
}
|
||||
RFIFOSKIP(fd,50);
|
||||
RFIFOSKIP(fd,51);
|
||||
break;
|
||||
|
||||
// login-server alive packet
|
||||
@ -1881,7 +1829,7 @@ int parse_fromlogin(int fd)
|
||||
return 0;
|
||||
|
||||
{ //Receive account_reg2 registry, forward to map servers.
|
||||
unsigned char buf[ACCOUNT_REG2_NUM*(256+32+2)+16];
|
||||
unsigned char buf[13+ACCOUNT_REG2_NUM*sizeof(struct global_reg)];
|
||||
memcpy(buf,RFIFOP(fd,0), RFIFOW(fd,2));
|
||||
WBUFW(buf,0) = 0x3804; //Map server can now receive all kinds of reg values with the same packet. [Skotlex]
|
||||
mapif_sendall(buf, WBUFW(buf,2));
|
||||
@ -1910,33 +1858,6 @@ int parse_fromlogin(int fd)
|
||||
RFIFOSKIP(fd,11);
|
||||
break;
|
||||
|
||||
// gm account information from login server
|
||||
case 0x2732:
|
||||
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
|
||||
return 0;
|
||||
|
||||
if(!char_gm_read) {
|
||||
unsigned char buf[32000]; //FIXME: this will crash
|
||||
if (gm_account != NULL)
|
||||
aFree(gm_account);
|
||||
gm_account = (struct gm_account*)aCalloc(sizeof(struct gm_account) * ((RFIFOW(fd,2) - 4) / 5), 1);
|
||||
GM_num = 0;
|
||||
for (i = 4; i < RFIFOW(fd,2); i = i + 5) {
|
||||
gm_account[GM_num].account_id = RFIFOL(fd,i);
|
||||
gm_account[GM_num].level = (int)RFIFOB(fd,i+4);
|
||||
//printf("GM account: %d -> level %d\n", gm_account[GM_num].account_id, gm_account[GM_num].level);
|
||||
GM_num++;
|
||||
}
|
||||
ShowStatus("From login-server: receiving information of %d GM accounts.\n", GM_num);
|
||||
// send new gm acccounts level to map-servers
|
||||
memcpy(buf, RFIFOP(fd,0), RFIFOW(fd,2));
|
||||
WBUFW(buf,0) = 0x2b15;
|
||||
mapif_sendall(buf, RFIFOW(fd,2));
|
||||
}
|
||||
|
||||
RFIFOSKIP(fd,RFIFOW(fd,2));
|
||||
break;
|
||||
|
||||
// Login server request to kick a character out. [Skotlex]
|
||||
case 0x2734:
|
||||
if (RFIFOREST(fd) < 6)
|
||||
@ -2214,18 +2135,6 @@ int parse_frommap(int fd)
|
||||
switch(RFIFOW(fd, 0))
|
||||
{
|
||||
|
||||
case 0x2af7: // request from map-server to reload GM accounts. Transmission to login-server
|
||||
if(char_gm_read) //Re-read gm accounts.
|
||||
read_gm_account();
|
||||
//Send to login request to reload gm accounts.
|
||||
else if (login_fd > 0) { // don't send request if no login-server
|
||||
WFIFOHEAD(login_fd,2);
|
||||
WFIFOW(login_fd,0) = 0x2709;
|
||||
WFIFOSET(login_fd,2);
|
||||
}
|
||||
RFIFOSKIP(fd,2);
|
||||
break;
|
||||
|
||||
case 0x2afa: // Receiving map names list from the map-server
|
||||
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
|
||||
return 0;
|
||||
@ -2434,7 +2343,8 @@ int parse_frommap(int fd)
|
||||
node->login_id2 = login_id2;
|
||||
//node->sex = 0;
|
||||
node->ip = ntohl(ip);
|
||||
node->expiration_time = 0; // unlimited/unknown time by default (not display in map-server)
|
||||
//node->expiration_time = 0; // unlimited/unknown time by default (not display in map-server)
|
||||
//node->gmlevel = 0;
|
||||
idb_put(auth_db, account_id, node);
|
||||
|
||||
//Set char to "@ char select" in online db [Kevin]
|
||||
@ -2467,7 +2377,7 @@ int parse_frommap(int fd)
|
||||
mmo_char_fromsql(RFIFOL(fd,14), &char_dat, true);
|
||||
char_data = (struct mmo_charstatus*)uidb_get(char_db_,RFIFOL(fd,14));
|
||||
}
|
||||
//Tell the new map server about this player using Kevin's new auth packet. [Skotlex]
|
||||
|
||||
if (map_fd >= 0 && session[map_fd] && char_data)
|
||||
{ //Send the map server the auth of this player.
|
||||
struct auth_node* node;
|
||||
@ -2478,19 +2388,6 @@ int parse_frommap(int fd)
|
||||
char_data->last_point.y = RFIFOW(fd,22);
|
||||
char_data->sex = RFIFOB(fd,30);
|
||||
|
||||
#if 0
|
||||
// the map-server must request it [FlavioJS]
|
||||
WFIFOHEAD(map_fd, 20 + sizeof(struct mmo_charstatus));
|
||||
WFIFOW(map_fd,0) = 0x2afd;
|
||||
WFIFOW(map_fd,2) = 20 + sizeof(struct mmo_charstatus);
|
||||
WFIFOL(map_fd,4) = RFIFOL(fd,2); //Account ID
|
||||
WFIFOL(map_fd,8) = RFIFOL(fd,6); //Login1
|
||||
WFIFOL(map_fd,16) = RFIFOL(fd,10); //Login2
|
||||
WFIFOL(map_fd,12) = (unsigned long)0; //TODO: expiration_time, how do I figure it out right now?
|
||||
memcpy(WFIFOP(map_fd,20), char_data, sizeof(struct mmo_charstatus));
|
||||
WFIFOSET(map_fd, WFIFOW(map_fd,2));
|
||||
#endif
|
||||
|
||||
// create temporary auth entry
|
||||
CREATE(node, struct auth_node, 1);
|
||||
node->account_id = RFIFOL(fd,2);
|
||||
@ -2588,9 +2485,10 @@ int parse_frommap(int fd)
|
||||
|
||||
if( login_fd <= 0 )
|
||||
result = 3; // 3-login-server offline
|
||||
else
|
||||
if( acc != -1 && isGM(acc) < isGM(account_id) )
|
||||
result = 2; // 2-gm level too low
|
||||
//FIXME: need to move this check to login server [ultramage]
|
||||
// else
|
||||
// if( acc != -1 && isGM(acc) < isGM(account_id) )
|
||||
// result = 2; // 2-gm level too low
|
||||
else
|
||||
switch( type ) {
|
||||
case 1: // block
|
||||
@ -2838,14 +2736,15 @@ int parse_frommap(int fd)
|
||||
{// auth ok
|
||||
cd->sex = sex;
|
||||
|
||||
WFIFOHEAD(fd,20 + sizeof(struct mmo_charstatus));
|
||||
WFIFOHEAD(fd,24 + sizeof(struct mmo_charstatus));
|
||||
WFIFOW(fd,0) = 0x2afd;
|
||||
WFIFOW(fd,2) = 20 + sizeof(struct mmo_charstatus);
|
||||
WFIFOW(fd,2) = 24 + sizeof(struct mmo_charstatus);
|
||||
WFIFOL(fd,4) = account_id;
|
||||
WFIFOL(fd,8) = login_id1;
|
||||
WFIFOL(fd,12) = (uint32)node->expiration_time; // FIXME: will wrap to negative after "19-Jan-2038, 03:14:07 AM GMT"
|
||||
WFIFOL(fd,16) = node->login_id2;
|
||||
memcpy(WFIFOP(fd,20), cd, sizeof(struct mmo_charstatus));
|
||||
WFIFOL(fd,8) = node->login_id1;
|
||||
WFIFOL(fd,12) = node->login_id2;
|
||||
WFIFOL(fd,16) = (uint32)node->expiration_time; // FIXME: will wrap to negative after "19-Jan-2038, 03:14:07 AM GMT"
|
||||
WFIFOL(fd,20) = node->gmlevel;
|
||||
memcpy(WFIFOP(fd,24), cd, sizeof(struct mmo_charstatus));
|
||||
WFIFOSET(fd, WFIFOW(fd,2));
|
||||
|
||||
// only use the auth once and mark user online
|
||||
@ -2996,7 +2895,6 @@ int parse_char(int fd)
|
||||
|
||||
CREATE(session[fd]->session_data, struct char_session_data, 1);
|
||||
sd = (struct char_session_data*)session[fd]->session_data;
|
||||
sd->expiration_time = 0; // unknown or unlimited (not displaying on map-server)
|
||||
sd->account_id = account_id;
|
||||
sd->login_id1 = login_id1;
|
||||
sd->login_id2 = login_id2;
|
||||
@ -3149,8 +3047,6 @@ int parse_char(int fd)
|
||||
WFIFOW(fd,0) = 0x71;
|
||||
WFIFOL(fd,2) = cp->char_id;
|
||||
mapindex_getmapname_ext(mapindex_id2name(cp->last_point.map), (char*)WFIFOP(fd,6));
|
||||
|
||||
// Advanced subnet check [LuzZza]
|
||||
subnet_map_ip = lan_subnetcheck(ipl);
|
||||
WFIFOL(fd,22) = htonl((subnet_map_ip) ? subnet_map_ip : server[i].ip);
|
||||
WFIFOW(fd,26) = ntows(htons(server[i].port)); // [!] LE byte order here [!]
|
||||
@ -3164,6 +3060,7 @@ int parse_char(int fd)
|
||||
node->login_id2 = sd->login_id2;
|
||||
node->sex = sd->sex;
|
||||
node->expiration_time = sd->expiration_time;
|
||||
node->gmlevel = sd->gmlevel;
|
||||
node->ip = ipl;
|
||||
idb_put(auth_db, sd->account_id, node);
|
||||
|
||||
@ -3324,15 +3221,6 @@ int parse_char(int fd)
|
||||
session[fd]->flag.server = 1;
|
||||
realloc_fifo(fd, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK);
|
||||
char_mapif_init(fd);
|
||||
// send gm acccounts level to map-servers
|
||||
WFIFOHEAD(fd,4+5*GM_num);
|
||||
WFIFOW(fd,0) = 0x2b15;
|
||||
for(i = 0; i < GM_num; i++) {
|
||||
WFIFOL(fd,4+5*i) = gm_account[i].account_id;
|
||||
WFIFOB(fd,4+5*i+4) = (unsigned char)gm_account[i].level;
|
||||
}
|
||||
WFIFOW(fd,2) = 4+5*GM_num;
|
||||
WFIFOSET(fd,WFIFOW(fd,2));
|
||||
}
|
||||
|
||||
RFIFOSKIP(fd,60);
|
||||
@ -3669,21 +3557,6 @@ void sql_config_read(const char* cfgName)
|
||||
|
||||
if(!strcmpi(w1,"char_db"))
|
||||
strcpy(char_db,w2);
|
||||
#ifndef TXT_SQL_CONVERT
|
||||
else if(!strcmpi(w1,"gm_read_method"))
|
||||
char_gm_read = config_switch(w2);
|
||||
//custom columns for login database
|
||||
else if(!strcmpi(w1,"login_db"))
|
||||
strcpy(login_db,w2);
|
||||
else if(!strcmpi(w1,"login_db_level"))
|
||||
strcpy(login_db_level,w2);
|
||||
else if(!strcmpi(w1,"login_db_account_id"))
|
||||
strcpy(login_db_account_id,w2);
|
||||
else if(!strcmpi(w1,"lowest_gm_level")) {
|
||||
lowest_gm_level = atoi(w2);
|
||||
ShowStatus("set lowest_gm_level : %s\n", w2);
|
||||
}
|
||||
#endif
|
||||
else if(!strcmpi(w1,"scdata_db"))
|
||||
strcpy(scdata_db,w2);
|
||||
else if(!strcmpi(w1,"cart_db"))
|
||||
@ -3920,11 +3793,6 @@ void do_final(void)
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `ragsrvinfo") )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
if(gm_account) {
|
||||
aFree(gm_account);
|
||||
gm_account = 0;
|
||||
}
|
||||
|
||||
if (login_fd > 0)
|
||||
do_close(login_fd);
|
||||
if (char_fd > 0)
|
||||
@ -3934,8 +3802,6 @@ void do_final(void)
|
||||
auth_db->destroy(auth_db, NULL);
|
||||
|
||||
Sql_Free(sql_handle);
|
||||
if( lsql_handle )
|
||||
Sql_Free(lsql_handle);
|
||||
|
||||
ShowInfo("ok! all done...\n");
|
||||
}
|
||||
@ -3986,8 +3852,6 @@ int do_init(int argc, char **argv)
|
||||
online_char_db = idb_alloc(DB_OPT_RELEASE_DATA);
|
||||
mmo_char_sql_init();
|
||||
char_read_fame_list(); //Read fame lists.
|
||||
if(char_gm_read)
|
||||
read_gm_account();
|
||||
ShowInfo("char server initialized.\n");
|
||||
|
||||
set_defaultparse(parse_char);
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
struct mmo_charstatus;
|
||||
|
||||
#define START_CHAR_NUM 150000
|
||||
#define MAX_MAP_SERVERS 30
|
||||
|
||||
#define DEFAULT_AUTOSAVE_INTERVAL 300*1000
|
||||
@ -64,13 +63,6 @@ extern char quest_obj_db[256];
|
||||
|
||||
extern int db_use_sqldbs; // added for sql item_db read for char server [Valaris]
|
||||
|
||||
extern char login_db_level[32];
|
||||
extern char login_db_account_id[32];
|
||||
|
||||
extern int lowest_gm_level;
|
||||
extern int GM_num;
|
||||
extern struct gm_account *gm_account;
|
||||
|
||||
extern int guild_exp_rate;
|
||||
extern int log_inter;
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
|
||||
Sql* sql_handle = NULL;
|
||||
Sql* lsql_handle = NULL;
|
||||
|
||||
int char_server_port = 3306;
|
||||
char char_server_ip[32] = "127.0.0.1";
|
||||
@ -37,12 +36,6 @@ char char_server_pw[32] = "ragnarok";
|
||||
char char_server_db[32] = "ragnarok";
|
||||
char default_codepage[32] = ""; //Feature by irmin.
|
||||
|
||||
int login_server_port = 3306;
|
||||
char login_server_ip[32] = "127.0.0.1";
|
||||
char login_server_id[32] = "ragnarok";
|
||||
char login_server_pw[32] = "ragnarok";
|
||||
char login_server_db[32] = "ragnarok";
|
||||
|
||||
#ifndef TXT_SQL_CONVERT
|
||||
|
||||
static struct accreg *accreg_pt;
|
||||
@ -71,8 +64,6 @@ struct WisData {
|
||||
static DBMap* wis_db = NULL; // int wis_id -> struct WisData*
|
||||
static int wis_dellist[WISDELLIST_MAX], wis_delnum;
|
||||
|
||||
int inter_sql_test (void);
|
||||
|
||||
#endif //TXT_SQL_CONVERT
|
||||
//--------------------------------------------------------
|
||||
// Save registry to sql
|
||||
@ -237,29 +228,6 @@ static int inter_config_read(const char* cfgName)
|
||||
strcpy(default_codepage,w2);
|
||||
ShowStatus ("set default_codepage : %s\n", w2);
|
||||
}
|
||||
//Logins information to be read from the inter_athena.conf
|
||||
//for character deletion (checks email in the loginDB)
|
||||
else
|
||||
if(!strcmpi(w1,"login_server_ip")) {
|
||||
strcpy(login_server_ip, w2);
|
||||
ShowStatus ("set login_server_ip : %s\n", w2);
|
||||
} else
|
||||
if(!strcmpi(w1,"login_server_port")) {
|
||||
login_server_port = atoi(w2);
|
||||
ShowStatus ("set login_server_port : %s\n", w2);
|
||||
} else
|
||||
if(!strcmpi(w1,"login_server_id")) {
|
||||
strcpy(login_server_id, w2);
|
||||
ShowStatus ("set login_server_id : %s\n", w2);
|
||||
} else
|
||||
if(!strcmpi(w1,"login_server_pw")) {
|
||||
strcpy(login_server_pw, w2);
|
||||
ShowStatus ("set login_server_pw : %s\n", w2);
|
||||
} else
|
||||
if(!strcmpi(w1,"login_server_db")) {
|
||||
strcpy(login_server_db, w2);
|
||||
ShowStatus ("set login_server_db : %s\n", w2);
|
||||
}
|
||||
#ifndef TXT_SQL_CONVERT
|
||||
else if(!strcmpi(w1,"party_share_level"))
|
||||
party_share_level = atoi(w2);
|
||||
@ -297,38 +265,6 @@ int inter_log(char* fmt, ...)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*=============================================
|
||||
* Does a mysql_ping to all connection handles
|
||||
*---------------------------------------------*/
|
||||
int inter_sql_ping(int tid, unsigned int tick, int id, intptr data)
|
||||
{
|
||||
ShowInfo("Pinging SQL server to keep connection alive...\n");
|
||||
Sql_Ping(sql_handle);
|
||||
if( char_gm_read )
|
||||
Sql_Ping(lsql_handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int sql_ping_init(void)
|
||||
{
|
||||
uint32 connection_timeout, connection_ping_interval;
|
||||
|
||||
// set a default value first
|
||||
connection_timeout = 28800; // 8 hours
|
||||
|
||||
// ask the mysql server for the timeout value
|
||||
if( SQL_SUCCESS == Sql_GetTimeout(sql_handle, &connection_timeout) && connection_timeout < 60 )
|
||||
connection_timeout = 60;
|
||||
|
||||
// establish keepalive
|
||||
connection_ping_interval = connection_timeout - 30; // 30-second reserve
|
||||
add_timer_func_list(inter_sql_ping, "inter_sql_ping");
|
||||
add_timer_interval(gettick() + connection_ping_interval*1000, inter_sql_ping, 0, 0, connection_ping_interval*1000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif //TXT_SQL_CONVERT
|
||||
|
||||
// initialize
|
||||
@ -348,34 +284,10 @@ int inter_init_sql(const char *file)
|
||||
Sql_Free(sql_handle);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#ifndef TXT_SQL_CONVERT
|
||||
else if (inter_sql_test()) {
|
||||
ShowStatus("Connect Success! (Character Server)\n");
|
||||
}
|
||||
|
||||
if(char_gm_read) {
|
||||
lsql_handle = Sql_Malloc();
|
||||
ShowInfo("Connect Character DB server.... (login server)\n");
|
||||
if( SQL_ERROR == Sql_Connect(lsql_handle, login_server_id, login_server_pw, login_server_ip, (uint16)login_server_port, login_server_db) )
|
||||
{
|
||||
Sql_ShowDebug(lsql_handle);
|
||||
Sql_Free(lsql_handle);
|
||||
Sql_Free(sql_handle);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowStatus ("Connect Success! (Login Server)\n");
|
||||
}
|
||||
}
|
||||
#endif //TXT_SQL_CONVERT
|
||||
if( *default_codepage ) {
|
||||
if( SQL_ERROR == Sql_SetEncoding(sql_handle, default_codepage) )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
#ifndef TXT_SQL_CONVERT
|
||||
if( char_gm_read && SQL_ERROR == Sql_SetEncoding(lsql_handle, default_codepage) )
|
||||
Sql_ShowDebug(lsql_handle);
|
||||
#endif //TXT_SQL_CONVERT
|
||||
}
|
||||
|
||||
#ifndef TXT_SQL_CONVERT
|
||||
@ -389,46 +301,11 @@ int inter_init_sql(const char *file)
|
||||
inter_mail_sql_init();
|
||||
inter_auction_sql_init();
|
||||
|
||||
sql_ping_init();
|
||||
#endif //TXT_SQL_CONVERT
|
||||
return 0;
|
||||
}
|
||||
#ifndef TXT_SQL_CONVERT
|
||||
|
||||
int inter_sql_test (void)
|
||||
{
|
||||
const char fields[][24] = {
|
||||
"father", // version 1363
|
||||
"fame", // version 1491
|
||||
};
|
||||
char buf[1024] = "";
|
||||
char* p;
|
||||
size_t len;
|
||||
int i;
|
||||
|
||||
if( SQL_ERROR == Sql_GetColumnNames(sql_handle, char_db, buf, sizeof(buf), '\n') )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
// check DB strings
|
||||
for( i = 0; i < ARRAYLENGTH(fields); ++i )
|
||||
{
|
||||
len = strlen(fields[i]);
|
||||
p = strstr(buf, fields[i]);
|
||||
while( p != NULL && p[len] != '\n' )
|
||||
p = strstr(p, fields[i]);
|
||||
if( p == NULL )
|
||||
{
|
||||
ShowSQL ("Field `%s` not be found in `%s`. Consider updating your database!\n", fields[i], char_db);
|
||||
if( lsql_handle )
|
||||
Sql_Free(lsql_handle);
|
||||
Sql_Free(sql_handle);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// finalize
|
||||
void inter_final(void)
|
||||
{
|
||||
@ -533,26 +410,6 @@ int mapif_account_reg_reply(int fd,int account_id,int char_id, int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mapif_send_gmaccounts()
|
||||
{
|
||||
int i, len = 4;
|
||||
unsigned char buf[32000];
|
||||
|
||||
// forward the gm accounts to the map server
|
||||
len = 4;
|
||||
WBUFW(buf,0) = 0x2b15;
|
||||
|
||||
for(i = 0; i < GM_num; i++) {
|
||||
WBUFL(buf,len) = gm_account[i].account_id;
|
||||
WBUFB(buf,len+4) = (uint8)gm_account[i].level;
|
||||
len += 5;
|
||||
}
|
||||
WBUFW(buf,2) = len;
|
||||
mapif_sendall(buf, len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Request to kick char from a certain map server. [Skotlex]
|
||||
int mapif_disconnectplayer(int fd, int account_id, int char_id, int reason)
|
||||
{
|
||||
@ -815,6 +672,26 @@ int mapif_parse_NameChangeRequest(int fd)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
|
||||
/// Returns the length of the next complete packet to process,
|
||||
/// or 0 if no complete packet exists in the queue.
|
||||
///
|
||||
/// @param length The minimum allowed length, or -1 for dynamic lookup
|
||||
int inter_check_length(int fd, int length)
|
||||
{
|
||||
if( length == -1 )
|
||||
{// variable-length packet
|
||||
if( RFIFOREST(fd) < 4 )
|
||||
return 0;
|
||||
length = RFIFOW(fd,2);
|
||||
}
|
||||
|
||||
if( (int)RFIFOREST(fd) < length )
|
||||
return 0;
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
int inter_parse_frommap(int fd)
|
||||
{
|
||||
int cmd;
|
||||
@ -855,18 +732,4 @@ int inter_parse_frommap(int fd)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// RFIFO check
|
||||
int inter_check_length(int fd, int length)
|
||||
{
|
||||
if(length == -1) { // v-len packet
|
||||
if(RFIFOREST(fd) < 4) // packet not yet
|
||||
return 0;
|
||||
length = RFIFOW(fd, 2);
|
||||
}
|
||||
|
||||
if((int)RFIFOREST(fd) < length) // packet not yet
|
||||
return 0;
|
||||
|
||||
return length;
|
||||
}
|
||||
#endif //TXT_SQL_CONVERT
|
||||
|
@ -14,30 +14,15 @@ int inter_mapif_init(int fd);
|
||||
int mapif_send_gmaccounts(void);
|
||||
int mapif_disconnectplayer(int fd, int account_id, int char_id, int reason);
|
||||
|
||||
int inter_check_length(int fd,int length);
|
||||
|
||||
int inter_log(char *fmt,...);
|
||||
|
||||
#define inter_cfgName "conf/inter_athena.conf"
|
||||
|
||||
extern unsigned int party_share_level;
|
||||
extern char inter_log_filename[1024];
|
||||
|
||||
extern Sql* sql_handle;
|
||||
extern Sql* lsql_handle;
|
||||
|
||||
extern int char_server_port;
|
||||
extern char char_server_ip[32];
|
||||
extern char char_server_id[32];
|
||||
extern char char_server_pw[32];
|
||||
extern char char_server_db[32];
|
||||
|
||||
extern int login_db_server_port;
|
||||
extern char login_db_server_ip[32];
|
||||
extern char login_db_server_id[32];
|
||||
extern char login_db_server_pw[32];
|
||||
extern char login_db_server_db[32];
|
||||
|
||||
extern char main_chat_nick[16];
|
||||
|
||||
int inter_accreg_tosql(int account_id, int char_id, struct accreg *reg, int type);
|
||||
|
@ -90,6 +90,7 @@
|
||||
//Limits to avoid ID collision with other game objects
|
||||
#define START_ACCOUNT_NUM 2000000
|
||||
#define END_ACCOUNT_NUM 100000000
|
||||
#define START_CHAR_NUM 150000
|
||||
|
||||
//Base Homun skill.
|
||||
#define HM_SKILLBASE 8001
|
||||
@ -344,11 +345,6 @@ struct registry {
|
||||
struct global_reg account2[ACCOUNT_REG2_NUM];
|
||||
};
|
||||
|
||||
struct gm_account {
|
||||
int account_id;
|
||||
int level;
|
||||
};
|
||||
|
||||
struct party_member {
|
||||
int account_id;
|
||||
int char_id;
|
||||
|
@ -287,7 +287,7 @@ char *DLL_ERROR(void)
|
||||
{
|
||||
static char dllbuf[80];
|
||||
DWORD dw = GetLastError();
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, 0, dllbuf, 80, NULL);
|
||||
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, 0, dllbuf, 80, NULL);
|
||||
return dllbuf;
|
||||
}
|
||||
#endif
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#define DLL_OPEN(x) LoadLibrary(x)
|
||||
#define DLL_OPEN(x) LoadLibraryA(x)
|
||||
#define DLL_SYM(x,y) GetProcAddress(x,y)
|
||||
#define DLL_CLOSE(x) FreeLibrary(x)
|
||||
char *DLL_ERROR(void);
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "../common/malloc.h"
|
||||
#include "../common/showmsg.h"
|
||||
#include "../common/strlib.h"
|
||||
#include "../common/timer.h"
|
||||
#include "sql.h"
|
||||
|
||||
#ifdef WIN32
|
||||
@ -24,6 +25,7 @@ struct Sql
|
||||
MYSQL_RES* result;
|
||||
MYSQL_ROW row;
|
||||
unsigned long* lengths;
|
||||
int keepalive;
|
||||
};
|
||||
|
||||
|
||||
@ -73,6 +75,8 @@ Sql* Sql_Malloc(void)
|
||||
|
||||
|
||||
|
||||
static int Sql_P_Keepalive(Sql* self);
|
||||
|
||||
/// Establishes a connection.
|
||||
int Sql_Connect(Sql* self, const char* user, const char* passwd, const char* host, uint16 port, const char* db)
|
||||
{
|
||||
@ -85,6 +89,14 @@ int Sql_Connect(Sql* self, const char* user, const char* passwd, const char* hos
|
||||
ShowSQL("%s\n", mysql_error(&self->handle));
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
||||
self->keepalive = Sql_P_Keepalive(self);
|
||||
if( self->keepalive == INVALID_TIMER )
|
||||
{
|
||||
ShowSQL("Failed to establish keepalive for DB connection!\n");
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
||||
return SQL_SUCCESS;
|
||||
}
|
||||
|
||||
@ -162,6 +174,44 @@ int Sql_Ping(Sql* self)
|
||||
|
||||
|
||||
|
||||
/// Wrapper function for Sql_Ping.
|
||||
///
|
||||
/// @private
|
||||
static int Sql_P_KeepaliveTimer(int tid, unsigned int tick, int id, intptr data)
|
||||
{
|
||||
Sql* self = (Sql*)data;
|
||||
ShowInfo("Pinging SQL server to keep connection alive...\n");
|
||||
Sql_Ping(self);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Establishes keepalive (periodic ping) on the connection.
|
||||
///
|
||||
/// @return the keepalive timer id, or INVALID_TIMER
|
||||
/// @private
|
||||
static int Sql_P_Keepalive(Sql* self)
|
||||
{
|
||||
uint32 timeout, ping_interval;
|
||||
|
||||
// set a default value first
|
||||
timeout = 28800; // 8 hours
|
||||
|
||||
// request the timeout value from the mysql server
|
||||
Sql_GetTimeout(self, &timeout);
|
||||
|
||||
if( timeout < 60 )
|
||||
timeout = 60;
|
||||
|
||||
// establish keepalive
|
||||
ping_interval = timeout - 30; // 30-second reserve
|
||||
//add_timer_func_list(Sql_P_KeepaliveTimer, "Sql_P_KeepaliveTimer");
|
||||
return add_timer_interval(gettick() + ping_interval*1000, Sql_P_KeepaliveTimer, 0, (int)self, ping_interval*1000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Escapes a string.
|
||||
size_t Sql_EscapeString(Sql* self, char *out_to, const char *from)
|
||||
{
|
||||
@ -356,6 +406,7 @@ void Sql_Free(Sql* self)
|
||||
{
|
||||
Sql_FreeResult(self);
|
||||
StringBuf_Destroy(&self->buf);
|
||||
delete_timer(self->keepalive, Sql_P_KeepaliveTimer);
|
||||
aFree(self);
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ static char* checkpath(char *path, const char *srcpath)
|
||||
|
||||
void findfile(const char *p, const char *pat, void (func)(const char*))
|
||||
{
|
||||
WIN32_FIND_DATA FindFileData;
|
||||
WIN32_FIND_DATAA FindFileData;
|
||||
HANDLE hFind;
|
||||
char tmppath[MAX_PATH+1];
|
||||
|
||||
@ -90,7 +90,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
|
||||
else
|
||||
strcat(tmppath, "*");
|
||||
|
||||
hFind = FindFirstFile(tmppath, &FindFileData);
|
||||
hFind = FindFirstFileA(tmppath, &FindFileData);
|
||||
if (hFind != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
do
|
||||
@ -111,7 +111,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
|
||||
{
|
||||
findfile(tmppath, pat, func);
|
||||
}
|
||||
}while (FindNextFile(hFind, &FindFileData) != 0);
|
||||
}while (FindNextFileA(hFind, &FindFileData) != 0);
|
||||
FindClose(hFind);
|
||||
}
|
||||
return;
|
||||
|
2809
src/ladmin/ladmin.c
2809
src/ladmin/ladmin.c
File diff suppressed because it is too large
Load Diff
@ -10,36 +10,71 @@ COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h
|
||||
../common/grfio.h ../common/mapindex.h \
|
||||
../common/ers.h ../common/md5calc.h
|
||||
|
||||
LOGIN_OBJ = obj_txt/login.o obj_txt/admin.o
|
||||
LOGIN_H = login.h
|
||||
COMMON_SQL_OBJ = ../common/obj_sql/sql.o
|
||||
COMMON_SQL_H = ../common/sql.h
|
||||
|
||||
LOGIN_OBJ = login.o admin.o
|
||||
LOGIN_TXT_OBJ = $(LOGIN_OBJ:%=obj_txt/%) \
|
||||
obj_txt/account_txt.o obj_txt/ipban_txt.o obj_txt/loginlog_txt.o
|
||||
LOGIN_SQL_OBJ = $(LOGIN_OBJ:%=obj_sql/%) \
|
||||
obj_sql/account_sql.o obj_sql/ipban_sql.o obj_sql/loginlog_sql.o
|
||||
LOGIN_H = login.h account.h ipban.h loginlog.h
|
||||
|
||||
HAVE_MYSQL=@HAVE_MYSQL@
|
||||
ifeq ($(HAVE_MYSQL),yes)
|
||||
LOGIN_SERVER_SQL_DEPENDS=obj_sql $(LOGIN_SQL_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ)
|
||||
else
|
||||
LOGIN_SERVER_SQL_DEPENDS=needs_mysql
|
||||
endif
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
#####################################################################
|
||||
.PHONY : all login-server clean help
|
||||
.PHONY :all txt sql clean help
|
||||
|
||||
all: login-server
|
||||
all: txt sql
|
||||
|
||||
login-server: obj_txt $(LOGIN_OBJ) $(COMMON_OBJ)
|
||||
@CC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_OBJ) @LIBS@
|
||||
txt: obj_txt login-server
|
||||
|
||||
sql: obj_sql login-server_sql
|
||||
|
||||
clean:
|
||||
rm -rf *.o obj_txt ../../login-server@EXEEXT@
|
||||
rm -rf *.o obj_txt obj_sql ../../login-server@EXEEXT@ ../../login-server_sql@EXEEXT@
|
||||
|
||||
help:
|
||||
@echo "possible targets are 'login-server' 'all' 'clean' 'help'"
|
||||
@echo "'login-server' - login server (TXT version)"
|
||||
@echo "'all' - builds all above targets"
|
||||
@echo "'clean' - cleans builds and objects"
|
||||
@echo "'help' - outputs this message"
|
||||
@echo "possible targets are 'sql' 'txt' 'all' 'clean' 'help'"
|
||||
@echo "'sql' - login server (SQL version)"
|
||||
@echo "'txt' - login server (TXT version)"
|
||||
@echo "'all' - builds all above targets"
|
||||
@echo "'clean' - cleans builds and objects"
|
||||
@echo "'help' - outputs this message"
|
||||
|
||||
#####################################################################
|
||||
|
||||
obj_txt:
|
||||
-mkdir obj_txt
|
||||
needs_mysql:
|
||||
@echo "MySQL not found or disabled by the configure script"
|
||||
@exit 1
|
||||
|
||||
# object directories
|
||||
obj_txt:
|
||||
test -d obj_txt || mkdir obj_txt
|
||||
|
||||
obj_sql:
|
||||
test -d obj_sql || mkdir obj_sql
|
||||
|
||||
#executables
|
||||
login-server: $(LOGIN_TXT_OBJ) $(COMMON_OBJ)
|
||||
@CC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_TXT_OBJ) $(COMMON_OBJ) @LIBS@
|
||||
|
||||
login-server_sql: $(LOGIN_SERVER_SQL_DEPENDS)
|
||||
@CC@ @LDFLAGS@ -o ../../login-server_sql@EXEEXT@ $(LOGIN_SQL_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) @LIBS@ @MYSQL_LIBS@
|
||||
|
||||
# login object files
|
||||
obj_txt/%.o: %.c $(LOGIN_H) $(COMMON_H)
|
||||
@CC@ @CFLAGS@ $(CUSTOM_CFLAGS) -DTXT_ONLY @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
|
||||
@CC@ @CFLAGS@ $(CUSTOM_CFLAGS) -DWITH_TXT @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
|
||||
|
||||
obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H)
|
||||
@CC@ @CFLAGS@ $(CUSTOM_CFLAGS) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
|
||||
|
||||
# missing common object files
|
||||
../common/obj_all/%.o:
|
||||
|
159
src/login/account.h
Normal file
159
src/login/account.h
Normal file
@ -0,0 +1,159 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#ifndef __ACCOUNT_H_INCLUDED__
|
||||
#define __ACCOUNT_H_INCLUDED__
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
#include "../common/mmo.h" // ACCOUNT_REG2_NUM
|
||||
|
||||
typedef struct AccountDB AccountDB;
|
||||
typedef struct AccountDBIterator AccountDBIterator;
|
||||
|
||||
|
||||
// standard engines
|
||||
#ifdef WITH_TXT
|
||||
AccountDB* account_db_txt(void);
|
||||
#endif
|
||||
#ifdef WITH_SQL
|
||||
AccountDB* account_db_sql(void);
|
||||
#endif
|
||||
// extra engines (will probably use the other txt functions)
|
||||
#define ACCOUNTDB_CONSTRUCTOR_(engine) account_db_##engine
|
||||
#define ACCOUNTDB_CONSTRUCTOR(engine) ACCOUNTDB_CONSTRUCTOR_(engine)
|
||||
#ifdef ACCOUNTDB_ENGINE_0
|
||||
AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_0)(void);
|
||||
#endif
|
||||
#ifdef ACCOUNTDB_ENGINE_1
|
||||
AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_1)(void);
|
||||
#endif
|
||||
#ifdef ACCOUNTDB_ENGINE_2
|
||||
AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_2)(void);
|
||||
#endif
|
||||
#ifdef ACCOUNTDB_ENGINE_3
|
||||
AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_3)(void);
|
||||
#endif
|
||||
#ifdef ACCOUNTDB_ENGINE_4
|
||||
AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_4)(void);
|
||||
#endif
|
||||
|
||||
|
||||
struct mmo_account
|
||||
{
|
||||
int account_id;
|
||||
char userid[24];
|
||||
char pass[32+1]; // 23+1 for plaintext, 32+1 for md5-ed passwords
|
||||
char sex; // gender (M/F/S)
|
||||
char email[40]; // e-mail (by default: a@a.com)
|
||||
int level; // GM level
|
||||
unsigned int state; // packet 0x006a value + 1 (0: compte OK)
|
||||
time_t unban_time; // (timestamp): ban time limit of the account (0 = no ban)
|
||||
time_t expiration_time; // (timestamp): validity limit of the account (0 = unlimited)
|
||||
unsigned int logincount;// number of successful auth attempts
|
||||
char lastlogin[24]; // date+time of last successful login
|
||||
char last_ip[16]; // save of last IP of connection
|
||||
int account_reg2_num;
|
||||
struct global_reg account_reg2[ACCOUNT_REG2_NUM]; // account script variables (stored on login server)
|
||||
};
|
||||
|
||||
|
||||
struct AccountDBIterator
|
||||
{
|
||||
/// Destroys this iterator, releasing all allocated memory (including itself).
|
||||
///
|
||||
/// @param self Iterator
|
||||
void (*destroy)(AccountDBIterator* self);
|
||||
|
||||
/// Fetches the next account in the database.
|
||||
/// Fills acc with the account data.
|
||||
/// @param self Iterator
|
||||
/// @param acc Account data
|
||||
/// @return true if successful
|
||||
bool (*next)(AccountDBIterator* self, struct mmo_account* acc);
|
||||
};
|
||||
|
||||
|
||||
struct AccountDB
|
||||
{
|
||||
/// Initializes this database, making it ready for use.
|
||||
/// Call this after setting the properties.
|
||||
///
|
||||
/// @param self Database
|
||||
/// @return true if successful
|
||||
bool (*init)(AccountDB* self);
|
||||
|
||||
/// Destroys this database, releasing all allocated memory (including itself).
|
||||
///
|
||||
/// @param self Database
|
||||
void (*destroy)(AccountDB* self);
|
||||
|
||||
/// Gets a property from this database.
|
||||
/// These read-only properties must be implemented:
|
||||
/// "engine.name" -> "txt", "sql", ...
|
||||
/// "engine.version" -> internal version
|
||||
/// "engine.comment" -> anything (suggestion: description or specs of the engine)
|
||||
///
|
||||
/// @param self Database
|
||||
/// @param key Property name
|
||||
/// @param buf Buffer for the value
|
||||
/// @param buflen Buffer length
|
||||
/// @return true if successful
|
||||
bool (*get_property)(AccountDB* self, const char* key, char* buf, size_t buflen);
|
||||
|
||||
/// Sets a property in this database.
|
||||
///
|
||||
/// @param self Database
|
||||
/// @param key Property name
|
||||
/// @param value Property value
|
||||
/// @return true if successful
|
||||
bool (*set_property)(AccountDB* self, const char* key, const char* value);
|
||||
|
||||
/// Creates a new account in this database.
|
||||
/// If acc->account_id is not -1, the provided value will be used.
|
||||
/// Otherwise the account_id will be auto-generated and written to acc->account_id.
|
||||
///
|
||||
/// @param self Database
|
||||
/// @param acc Account data
|
||||
/// @return true if successful
|
||||
bool (*create)(AccountDB* self, struct mmo_account* acc);
|
||||
|
||||
/// Removes an account from this database.
|
||||
///
|
||||
/// @param self Database
|
||||
/// @param account_id Account id
|
||||
/// @return true if successful
|
||||
bool (*remove)(AccountDB* self, const int account_id);
|
||||
|
||||
/// Modifies the data of an existing account.
|
||||
/// Uses acc->account_id to identify the account.
|
||||
///
|
||||
/// @param self Database
|
||||
/// @param acc Account data
|
||||
/// @return true if successful
|
||||
bool (*save)(AccountDB* self, const struct mmo_account* acc);
|
||||
|
||||
/// Finds an account with account_id and copies it to acc.
|
||||
///
|
||||
/// @param self Database
|
||||
/// @param acc Pointer that receives the account data
|
||||
/// @param account_id Target account id
|
||||
/// @return true if successful
|
||||
bool (*load_num)(AccountDB* self, struct mmo_account* acc, const int account_id);
|
||||
|
||||
/// Finds an account with userid and copies it to acc.
|
||||
///
|
||||
/// @param self Database
|
||||
/// @param acc Pointer that receives the account data
|
||||
/// @param userid Target username
|
||||
/// @return true if successful
|
||||
bool (*load_str)(AccountDB* self, struct mmo_account* acc, const char* userid);
|
||||
|
||||
/// Returns a new forward iterator.
|
||||
///
|
||||
/// @param self Database
|
||||
/// @return Iterator
|
||||
AccountDBIterator* (*iterator)(AccountDB* self);
|
||||
};
|
||||
|
||||
|
||||
#endif // __ACCOUNT_H_INCLUDED__
|
578
src/login/account_sql.c
Normal file
578
src/login/account_sql.c
Normal file
@ -0,0 +1,578 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#include "../common/malloc.h"
|
||||
#include "../common/mmo.h"
|
||||
#include "../common/showmsg.h"
|
||||
#include "../common/sql.h"
|
||||
#include "../common/strlib.h"
|
||||
#include "../common/timer.h"
|
||||
#include "account.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/// global defines
|
||||
#define ACCOUNT_SQL_DB_VERSION 20080417
|
||||
|
||||
/// internal structure
|
||||
typedef struct AccountDB_SQL
|
||||
{
|
||||
AccountDB vtable; // public interface
|
||||
|
||||
Sql* accounts; // SQL accounts storage
|
||||
|
||||
char db_hostname[32];
|
||||
uint16 db_port;
|
||||
char db_username[32];
|
||||
char db_password[32];
|
||||
char db_database[32];
|
||||
char codepage[32];
|
||||
bool case_sensitive;
|
||||
char account_db[32];
|
||||
char accreg_db[32];
|
||||
|
||||
} AccountDB_SQL;
|
||||
|
||||
/// internal structure
|
||||
typedef struct AccountDBIterator_SQL
|
||||
{
|
||||
AccountDBIterator vtable; // public interface
|
||||
|
||||
AccountDB_SQL* db;
|
||||
int last_account_id;
|
||||
} AccountDBIterator_SQL;
|
||||
|
||||
/// internal functions
|
||||
static bool account_db_sql_init(AccountDB* self);
|
||||
static void account_db_sql_destroy(AccountDB* self);
|
||||
static bool account_db_sql_get_property(AccountDB* self, const char* key, char* buf, size_t buflen);
|
||||
static bool account_db_sql_set_property(AccountDB* self, const char* option, const char* value);
|
||||
static bool account_db_sql_create(AccountDB* self, struct mmo_account* acc);
|
||||
static bool account_db_sql_remove(AccountDB* self, const int account_id);
|
||||
static bool account_db_sql_save(AccountDB* self, const struct mmo_account* acc);
|
||||
static bool account_db_sql_load_num(AccountDB* self, struct mmo_account* acc, const int account_id);
|
||||
static bool account_db_sql_load_str(AccountDB* self, struct mmo_account* acc, const char* userid);
|
||||
static AccountDBIterator* account_db_sql_iterator(AccountDB* self);
|
||||
static void account_db_sql_iter_destroy(AccountDBIterator* self);
|
||||
static bool account_db_sql_iter_next(AccountDBIterator* self, struct mmo_account* acc);
|
||||
|
||||
static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int account_id);
|
||||
static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, bool is_new);
|
||||
|
||||
/// public constructor
|
||||
AccountDB* account_db_sql(void)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)aCalloc(1, sizeof(AccountDB_SQL));
|
||||
|
||||
// set up the vtable
|
||||
db->vtable.init = &account_db_sql_init;
|
||||
db->vtable.destroy = &account_db_sql_destroy;
|
||||
db->vtable.get_property = &account_db_sql_get_property;
|
||||
db->vtable.set_property = &account_db_sql_set_property;
|
||||
db->vtable.save = &account_db_sql_save;
|
||||
db->vtable.create = &account_db_sql_create;
|
||||
db->vtable.remove = &account_db_sql_remove;
|
||||
db->vtable.load_num = &account_db_sql_load_num;
|
||||
db->vtable.load_str = &account_db_sql_load_str;
|
||||
db->vtable.iterator = &account_db_sql_iterator;
|
||||
|
||||
// initialize to default values
|
||||
db->accounts = NULL;
|
||||
safestrncpy(db->db_hostname, "127.0.0.1", sizeof(db->db_hostname));
|
||||
db->db_port = 3306;
|
||||
safestrncpy(db->db_username, "ragnarok", sizeof(db->db_username));
|
||||
safestrncpy(db->db_password, "ragnarok", sizeof(db->db_password));
|
||||
safestrncpy(db->db_database, "ragnarok", sizeof(db->db_database));
|
||||
safestrncpy(db->codepage, "", sizeof(db->codepage));
|
||||
db->case_sensitive = false;
|
||||
safestrncpy(db->account_db, "login", sizeof(db->account_db));
|
||||
safestrncpy(db->accreg_db, "global_reg_value", sizeof(db->accreg_db));
|
||||
|
||||
return &db->vtable;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
/// establishes database connection
|
||||
static bool account_db_sql_init(AccountDB* self)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
Sql* sql_handle;
|
||||
|
||||
db->accounts = Sql_Malloc();
|
||||
sql_handle = db->accounts;
|
||||
|
||||
if( SQL_ERROR == Sql_Connect(sql_handle, db->db_username, db->db_password, db->db_hostname, db->db_port, db->db_database) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
Sql_Free(db->accounts);
|
||||
db->accounts = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( db->codepage[0] != '\0' && SQL_ERROR == Sql_SetEncoding(sql_handle, db->codepage) )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// disconnects from database
|
||||
static void account_db_sql_destroy(AccountDB* self)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
|
||||
Sql_Free(db->accounts);
|
||||
db->accounts = NULL;
|
||||
}
|
||||
|
||||
/// Gets a property from this database.
|
||||
static bool account_db_sql_get_property(AccountDB* self, const char* key, char* buf, size_t buflen)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
const char* signature = "account.sql.";
|
||||
|
||||
if( strcmp(key, "engine.name") == 0 )
|
||||
{
|
||||
safesnprintf(buf, buflen, "sql");
|
||||
return true;
|
||||
}
|
||||
if( strcmp(key, "engine.version") == 0 )
|
||||
{
|
||||
safesnprintf(buf, buflen, "%d", ACCOUNT_SQL_DB_VERSION);
|
||||
return true;
|
||||
}
|
||||
if( strcmp(key, "engine.comment") == 0 )
|
||||
{
|
||||
safesnprintf(buf, buflen, "SQL Account Database");
|
||||
return true;
|
||||
}
|
||||
|
||||
if( strncmp(key, signature, strlen(signature)) != 0 )
|
||||
return false;
|
||||
|
||||
key += strlen(signature);
|
||||
|
||||
if( strcmpi(key, "db_hostname") == 0 )
|
||||
safesnprintf(buf, buflen, "%s", db->db_hostname);
|
||||
else
|
||||
if( strcmpi(key, "db_port") == 0 )
|
||||
safesnprintf(buf, buflen, "%d", db->db_port);
|
||||
else
|
||||
if( strcmpi(key, "db_username") == 0 )
|
||||
safesnprintf(buf, buflen, "%s", db->db_username);
|
||||
else
|
||||
if( strcmpi(key, "db_password") == 0 )
|
||||
safesnprintf(buf, buflen, "%s", db->db_password);
|
||||
else
|
||||
if( strcmpi(key, "db_database") == 0 )
|
||||
safesnprintf(buf, buflen, "%s", db->db_database);
|
||||
else
|
||||
if( strcmpi(key, "codepage") == 0 )
|
||||
safesnprintf(buf, buflen, "%s", db->codepage);
|
||||
else
|
||||
if( strcmpi(key, "case_sensitive") == 0 )
|
||||
safesnprintf(buf, buflen, "%d", (db->case_sensitive ? 1 : 0));
|
||||
else
|
||||
if( strcmpi(key, "account_db") == 0 )
|
||||
safesnprintf(buf, buflen, "%s", db->account_db);
|
||||
else
|
||||
if( strcmpi(key, "accreg_db") == 0 )
|
||||
safesnprintf(buf, buflen, "%s", db->accreg_db);
|
||||
else
|
||||
return false;// not found
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// if the option is supported, adjusts the internal state
|
||||
static bool account_db_sql_set_property(AccountDB* self, const char* key, const char* value)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
const char* signature = "account.sql.";
|
||||
|
||||
if( strncmp(key, signature, strlen(signature)) != 0 )
|
||||
return false;
|
||||
|
||||
key += strlen(signature);
|
||||
|
||||
if( strcmpi(key, "db_hostname") == 0 )
|
||||
safestrncpy(db->db_hostname, value, sizeof(db->db_hostname));
|
||||
else
|
||||
if( strcmpi(key, "db_port") == 0 )
|
||||
db->db_port = (uint16)strtoul(value, NULL, 10);
|
||||
else
|
||||
if( strcmpi(key, "db_username") == 0 )
|
||||
safestrncpy(db->db_username, value, sizeof(db->db_username));
|
||||
else
|
||||
if( strcmpi(key, "db_password") == 0 )
|
||||
safestrncpy(db->db_password, value, sizeof(db->db_password));
|
||||
else
|
||||
if( strcmpi(key, "db_database") == 0 )
|
||||
safestrncpy(db->db_database, value, sizeof(db->db_database));
|
||||
else
|
||||
if( strcmpi(key, "codepage") == 0 )
|
||||
safestrncpy(db->codepage, value, sizeof(db->codepage));
|
||||
else
|
||||
if( strcmpi(key, "case_sensitive") == 0 )
|
||||
db->case_sensitive = config_switch(value);
|
||||
else
|
||||
if( strcmpi(key, "account_db") == 0 )
|
||||
safestrncpy(db->account_db, value, sizeof(db->account_db));
|
||||
else
|
||||
if( strcmpi(key, "accreg_db") == 0 )
|
||||
safestrncpy(db->accreg_db, value, sizeof(db->accreg_db));
|
||||
else // no match
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// create a new account entry
|
||||
/// If acc->account_id is -1, the account id will be auto-generated,
|
||||
/// and its value will be written to acc->account_id if everything succeeds.
|
||||
static bool account_db_sql_create(AccountDB* self, struct mmo_account* acc)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
Sql* sql_handle = db->accounts;
|
||||
|
||||
// decide on the account id to assign
|
||||
int account_id;
|
||||
if( acc->account_id != -1 )
|
||||
{// caller specifies it manually
|
||||
account_id = acc->account_id;
|
||||
}
|
||||
else
|
||||
{// ask the database
|
||||
char* data;
|
||||
size_t len;
|
||||
|
||||
if( SQL_SUCCESS != Sql_Query(sql_handle, "SELECT MAX(`account_id`)+1 FROM `%s`", db->account_db) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
return false;
|
||||
}
|
||||
if( SQL_SUCCESS != Sql_NextRow(sql_handle) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
Sql_FreeResult(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
Sql_GetData(sql_handle, 0, &data, &len);
|
||||
account_id = ( data != NULL ) ? atoi(data) : 0;
|
||||
Sql_FreeResult(sql_handle);
|
||||
|
||||
if( account_id < START_ACCOUNT_NUM )
|
||||
account_id = START_ACCOUNT_NUM;
|
||||
|
||||
}
|
||||
|
||||
// zero value is prohibited
|
||||
if( account_id == 0 )
|
||||
return false;
|
||||
|
||||
// absolute maximum
|
||||
if( account_id > END_ACCOUNT_NUM )
|
||||
return false;
|
||||
|
||||
// insert the data into the database
|
||||
acc->account_id = account_id;
|
||||
return mmo_auth_tosql(db, acc, true);
|
||||
}
|
||||
|
||||
/// delete an existing account entry + its regs
|
||||
static bool account_db_sql_remove(AccountDB* self, const int account_id)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
Sql* sql_handle = db->accounts;
|
||||
bool result = false;
|
||||
|
||||
if( SQL_SUCCESS != Sql_QueryStr(sql_handle, "START TRANSACTION")
|
||||
|| SQL_SUCCESS != Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `account_id` = %d", db->account_db, account_id)
|
||||
|| SQL_SUCCESS != Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `account_id` = %d", db->accreg_db, account_id) )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
else
|
||||
result = true;
|
||||
|
||||
result &= ( SQL_SUCCESS == Sql_QueryStr(sql_handle, (result == true) ? "COMMIT" : "ROLLBACK") );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// update an existing account with the provided new data (both account and regs)
|
||||
static bool account_db_sql_save(AccountDB* self, const struct mmo_account* acc)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
return mmo_auth_tosql(db, acc, false);
|
||||
}
|
||||
|
||||
/// retrieve data from db and store it in the provided data structure
|
||||
static bool account_db_sql_load_num(AccountDB* self, struct mmo_account* acc, const int account_id)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
return mmo_auth_fromsql(db, acc, account_id);
|
||||
}
|
||||
|
||||
/// retrieve data from db and store it in the provided data structure
|
||||
static bool account_db_sql_load_str(AccountDB* self, struct mmo_account* acc, const char* userid)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
Sql* sql_handle = db->accounts;
|
||||
char esc_userid[2*NAME_LENGTH+1];
|
||||
int account_id;
|
||||
char* data;
|
||||
|
||||
Sql_EscapeString(sql_handle, esc_userid, userid);
|
||||
|
||||
// get the list of account IDs for this user ID
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `account_id` FROM `%s` WHERE `userid`= %s '%s'",
|
||||
db->account_db, (db->case_sensitive ? "BINARY" : ""), esc_userid) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
if( Sql_NumRows(sql_handle) > 1 )
|
||||
{// serious problem - duplicit account
|
||||
ShowError("account_db_sql_load_str: multiple accounts found when retrieving data for account '%s'!\n", userid);
|
||||
Sql_FreeResult(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
if( SQL_SUCCESS != Sql_NextRow(sql_handle) )
|
||||
{// no such entry
|
||||
Sql_FreeResult(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
Sql_GetData(sql_handle, 0, &data, NULL);
|
||||
account_id = atoi(data);
|
||||
|
||||
return account_db_sql_load_num(self, acc, account_id);
|
||||
}
|
||||
|
||||
|
||||
/// Returns a new forward iterator.
|
||||
static AccountDBIterator* account_db_sql_iterator(AccountDB* self)
|
||||
{
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)self;
|
||||
AccountDBIterator_SQL* iter = (AccountDBIterator_SQL*)aCalloc(1, sizeof(AccountDBIterator_SQL));
|
||||
|
||||
// set up the vtable
|
||||
iter->vtable.destroy = &account_db_sql_iter_destroy;
|
||||
iter->vtable.next = &account_db_sql_iter_next;
|
||||
|
||||
// fill data
|
||||
iter->db = db;
|
||||
iter->last_account_id = -1;
|
||||
|
||||
return &iter->vtable;
|
||||
}
|
||||
|
||||
|
||||
/// Destroys this iterator, releasing all allocated memory (including itself).
|
||||
static void account_db_sql_iter_destroy(AccountDBIterator* self)
|
||||
{
|
||||
AccountDBIterator_SQL* iter = (AccountDBIterator_SQL*)self;
|
||||
aFree(iter);
|
||||
}
|
||||
|
||||
|
||||
/// Fetches the next account in the database.
|
||||
static bool account_db_sql_iter_next(AccountDBIterator* self, struct mmo_account* acc)
|
||||
{
|
||||
AccountDBIterator_SQL* iter = (AccountDBIterator_SQL*)self;
|
||||
AccountDB_SQL* db = (AccountDB_SQL*)iter->db;
|
||||
Sql* sql_handle = db->accounts;
|
||||
int account_id;
|
||||
char* data;
|
||||
|
||||
// get next account ID
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `account_id` FROM `%s` WHERE `account_id` > '%d' ORDER BY `account_id` ASC LIMIT 1",
|
||||
db->account_db, iter->last_account_id) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
if( SQL_SUCCESS == Sql_NextRow(sql_handle) &&
|
||||
SQL_SUCCESS == Sql_GetData(sql_handle, 0, &data, NULL) &&
|
||||
data != NULL )
|
||||
{// get account data
|
||||
account_id = atoi(data);
|
||||
if( mmo_auth_fromsql(db, acc, account_id) )
|
||||
{
|
||||
iter->last_account_id = account_id;
|
||||
Sql_FreeResult(sql_handle);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Sql_FreeResult(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int account_id)
|
||||
{
|
||||
Sql* sql_handle = db->accounts;
|
||||
char* data;
|
||||
int i = 0;
|
||||
|
||||
// retrieve login entry for the specified account
|
||||
if( SQL_ERROR == Sql_Query(sql_handle,
|
||||
"SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`level`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip` FROM `%s` WHERE `account_id` = %d",
|
||||
db->account_db, account_id )
|
||||
) {
|
||||
Sql_ShowDebug(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
if( SQL_SUCCESS != Sql_NextRow(sql_handle) )
|
||||
{// no such entry
|
||||
Sql_FreeResult(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
Sql_GetData(sql_handle, 0, &data, NULL); acc->account_id = atoi(data);
|
||||
Sql_GetData(sql_handle, 1, &data, NULL); safestrncpy(acc->userid, data, sizeof(acc->userid));
|
||||
Sql_GetData(sql_handle, 2, &data, NULL); safestrncpy(acc->pass, data, sizeof(acc->pass));
|
||||
Sql_GetData(sql_handle, 3, &data, NULL); acc->sex = data[0];
|
||||
Sql_GetData(sql_handle, 4, &data, NULL); safestrncpy(acc->email, data, sizeof(acc->email));
|
||||
Sql_GetData(sql_handle, 5, &data, NULL); acc->level = atoi(data);
|
||||
Sql_GetData(sql_handle, 6, &data, NULL); acc->state = strtoul(data, NULL, 10);
|
||||
Sql_GetData(sql_handle, 7, &data, NULL); acc->unban_time = atol(data);
|
||||
Sql_GetData(sql_handle, 8, &data, NULL); acc->expiration_time = atol(data);
|
||||
Sql_GetData(sql_handle, 9, &data, NULL); acc->logincount = strtoul(data, NULL, 10);
|
||||
Sql_GetData(sql_handle, 10, &data, NULL); safestrncpy(acc->lastlogin, data, sizeof(acc->lastlogin));
|
||||
Sql_GetData(sql_handle, 11, &data, NULL); safestrncpy(acc->last_ip, data, sizeof(acc->last_ip));
|
||||
|
||||
Sql_FreeResult(sql_handle);
|
||||
|
||||
|
||||
// retrieve account regs for the specified user
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `str`,`value` FROM `%s` WHERE `type`='1' AND `account_id`='%d'", db->accreg_db, acc->account_id) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
acc->account_reg2_num = (int)Sql_NumRows(sql_handle);
|
||||
|
||||
while( SQL_SUCCESS == Sql_NextRow(sql_handle) )
|
||||
{
|
||||
char* data;
|
||||
Sql_GetData(sql_handle, 0, &data, NULL); safestrncpy(acc->account_reg2[i].str, data, sizeof(acc->account_reg2[i].str));
|
||||
Sql_GetData(sql_handle, 1, &data, NULL); safestrncpy(acc->account_reg2[i].value, data, sizeof(acc->account_reg2[i].value));
|
||||
++i;
|
||||
}
|
||||
Sql_FreeResult(sql_handle);
|
||||
|
||||
if( i != acc->account_reg2_num )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, bool is_new)
|
||||
{
|
||||
Sql* sql_handle = db->accounts;
|
||||
SqlStmt* stmt = SqlStmt_Malloc(sql_handle);
|
||||
bool result = false;
|
||||
int i;
|
||||
|
||||
// try
|
||||
do
|
||||
{
|
||||
|
||||
if( SQL_SUCCESS != Sql_QueryStr(sql_handle, "START TRANSACTION") )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
break;
|
||||
}
|
||||
|
||||
if( is_new )
|
||||
{// insert into account table
|
||||
if( SQL_SUCCESS != SqlStmt_Prepare(stmt,
|
||||
"INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `level`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
db->account_db)
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_INT, (void*)&acc->account_id, sizeof(acc->account_id))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 2, SQLDT_STRING, (void*)acc->pass, strlen(acc->pass))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 3, SQLDT_ENUM, (void*)&acc->sex, sizeof(acc->sex))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 4, SQLDT_STRING, (void*)&acc->email, strlen(acc->email))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 5, SQLDT_INT, (void*)&acc->level, sizeof(acc->level))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 6, SQLDT_UINT, (void*)&acc->state, sizeof(acc->state))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 7, SQLDT_LONG, (void*)&acc->unban_time, sizeof(acc->unban_time))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 8, SQLDT_INT, (void*)&acc->expiration_time, sizeof(acc->expiration_time))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 9, SQLDT_UINT, (void*)&acc->logincount, sizeof(acc->logincount))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 10, SQLDT_STRING, (void*)&acc->lastlogin, strlen(acc->lastlogin))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 11, SQLDT_STRING, (void*)&acc->last_ip, strlen(acc->last_ip))
|
||||
|| SQL_SUCCESS != SqlStmt_Execute(stmt)
|
||||
) {
|
||||
SqlStmt_ShowDebug(stmt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{// update account table
|
||||
stmt = SqlStmt_Malloc(sql_handle);
|
||||
if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`level`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id)
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (void*)acc->pass, strlen(acc->pass))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 2, SQLDT_ENUM, (void*)&acc->sex, sizeof(acc->sex))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 3, SQLDT_STRING, (void*)acc->email, strlen(acc->email))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 4, SQLDT_INT, (void*)&acc->level, sizeof(acc->level))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 5, SQLDT_UINT, (void*)&acc->state, sizeof(acc->state))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 6, SQLDT_LONG, (void*)&acc->unban_time, sizeof(acc->unban_time))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 7, SQLDT_LONG, (void*)&acc->expiration_time, sizeof(acc->expiration_time))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 8, SQLDT_UINT, (void*)&acc->logincount, sizeof(acc->logincount))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 9, SQLDT_STRING, (void*)&acc->lastlogin, strlen(acc->lastlogin))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 10, SQLDT_STRING, (void*)&acc->last_ip, strlen(acc->last_ip))
|
||||
|| SQL_SUCCESS != SqlStmt_Execute(stmt)
|
||||
) {
|
||||
SqlStmt_ShowDebug(stmt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// remove old account regs
|
||||
if( SQL_SUCCESS != Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `type`='1' AND `account_id`='%d'", db->accreg_db, acc->account_id) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
break;
|
||||
}
|
||||
// insert new account regs
|
||||
if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "INSERT INTO `%s` (`type`, `account_id`, `str`, `value`) VALUES ( 1 , '%d' , ? , ? );", db->accreg_db, acc->account_id) )
|
||||
{
|
||||
SqlStmt_ShowDebug(stmt);
|
||||
break;
|
||||
}
|
||||
for( i = 0; i < acc->account_reg2_num; ++i )
|
||||
{
|
||||
if( SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, (void*)acc->account_reg2[i].str, strlen(acc->account_reg2[i].str))
|
||||
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (void*)acc->account_reg2[i].value, strlen(acc->account_reg2[i].value))
|
||||
|| SQL_SUCCESS != SqlStmt_Execute(stmt)
|
||||
) {
|
||||
SqlStmt_ShowDebug(stmt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( i < acc->account_reg2_num )
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// if we got this far, everything was successful
|
||||
result = true;
|
||||
|
||||
} while(0);
|
||||
// finally
|
||||
|
||||
result &= ( SQL_SUCCESS == Sql_QueryStr(sql_handle, (result == true) ? "COMMIT" : "ROLLBACK") );
|
||||
SqlStmt_Free(stmt);
|
||||
|
||||
return result;
|
||||
}
|
622
src/login/account_txt.c
Normal file
622
src/login/account_txt.c
Normal file
@ -0,0 +1,622 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#include "../common/db.h"
|
||||
#include "../common/lock.h"
|
||||
#include "../common/malloc.h"
|
||||
#include "../common/mmo.h"
|
||||
#include "../common/showmsg.h"
|
||||
#include "../common/strlib.h"
|
||||
#include "../common/timer.h"
|
||||
#include "account.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/// global defines
|
||||
#define ACCOUNT_TXT_DB_VERSION 20080409
|
||||
#define AUTHS_BEFORE_SAVE 10 // flush every 10 saves
|
||||
#define AUTH_SAVING_INTERVAL 60000 // flush every 10 minutes
|
||||
|
||||
/// internal structure
|
||||
typedef struct AccountDB_TXT
|
||||
{
|
||||
AccountDB vtable; // public interface
|
||||
|
||||
DBMap* accounts; // in-memory accounts storage
|
||||
int next_account_id; // auto_increment
|
||||
int auths_before_save; // prevents writing to disk too often
|
||||
int save_timer; // save timer id
|
||||
|
||||
char account_db[1024]; // account data storage file
|
||||
bool case_sensitive; // how to look up usernames
|
||||
|
||||
} AccountDB_TXT;
|
||||
|
||||
/// internal structure
|
||||
typedef struct AccountDBIterator_TXT
|
||||
{
|
||||
AccountDBIterator vtable; // public interface
|
||||
|
||||
DBIterator* iter;
|
||||
} AccountDBIterator_TXT;
|
||||
|
||||
/// internal functions
|
||||
static bool account_db_txt_init(AccountDB* self);
|
||||
static void account_db_txt_destroy(AccountDB* self);
|
||||
static bool account_db_txt_get_property(AccountDB* self, const char* key, char* buf, size_t buflen);
|
||||
static bool account_db_txt_set_property(AccountDB* self, const char* option, const char* value);
|
||||
static bool account_db_txt_create(AccountDB* self, struct mmo_account* acc);
|
||||
static bool account_db_txt_remove(AccountDB* self, const int account_id);
|
||||
static bool account_db_txt_save(AccountDB* self, const struct mmo_account* acc);
|
||||
static bool account_db_txt_load_num(AccountDB* self, struct mmo_account* acc, const int account_id);
|
||||
static bool account_db_txt_load_str(AccountDB* self, struct mmo_account* acc, const char* userid);
|
||||
static AccountDBIterator* account_db_txt_iterator(AccountDB* self);
|
||||
static void account_db_txt_iter_destroy(AccountDBIterator* self);
|
||||
static bool account_db_txt_iter_next(AccountDBIterator* self, struct mmo_account* acc);
|
||||
|
||||
static bool mmo_auth_fromstr(struct mmo_account* acc, char* str, unsigned int version);
|
||||
static bool mmo_auth_tostr(const struct mmo_account* acc, char* str);
|
||||
static void mmo_auth_sync(AccountDB_TXT* self);
|
||||
static int mmo_auth_sync_timer(int tid, unsigned int tick, int id, intptr data);
|
||||
|
||||
/// public constructor
|
||||
AccountDB* account_db_txt(void)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)aCalloc(1, sizeof(AccountDB_TXT));
|
||||
|
||||
// set up the vtable
|
||||
db->vtable.init = &account_db_txt_init;
|
||||
db->vtable.destroy = &account_db_txt_destroy;
|
||||
db->vtable.get_property = &account_db_txt_get_property;
|
||||
db->vtable.set_property = &account_db_txt_set_property;
|
||||
db->vtable.save = &account_db_txt_save;
|
||||
db->vtable.create = &account_db_txt_create;
|
||||
db->vtable.remove = &account_db_txt_remove;
|
||||
db->vtable.load_num = &account_db_txt_load_num;
|
||||
db->vtable.load_str = &account_db_txt_load_str;
|
||||
db->vtable.iterator = &account_db_txt_iterator;
|
||||
|
||||
// initialize to default values
|
||||
db->accounts = NULL;
|
||||
db->next_account_id = START_ACCOUNT_NUM;
|
||||
db->auths_before_save = AUTHS_BEFORE_SAVE;
|
||||
db->save_timer = INVALID_TIMER;
|
||||
safestrncpy(db->account_db, "save/account.txt", sizeof(db->account_db));
|
||||
db->case_sensitive = false;
|
||||
|
||||
return &db->vtable;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
/// opens accounts file, loads it, and starts a periodic saving timer
|
||||
static bool account_db_txt_init(AccountDB* self)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
DBMap* accounts;
|
||||
FILE* fp;
|
||||
char line[2048];
|
||||
unsigned int version = 0;
|
||||
|
||||
// create accounts database
|
||||
db->accounts = idb_alloc(DB_OPT_RELEASE_DATA);
|
||||
accounts = db->accounts;
|
||||
|
||||
// open data file
|
||||
fp = fopen(db->account_db, "r");
|
||||
if( fp == NULL )
|
||||
{
|
||||
// no account file -> no account -> no login, including char-server (ERROR)
|
||||
ShowError(CL_RED"account_db_txt_init: Accounts file [%s] not found."CL_RESET"\n", db->account_db);
|
||||
return false;
|
||||
}
|
||||
|
||||
// load data file
|
||||
while( fgets(line, sizeof(line), fp) != NULL )
|
||||
{
|
||||
int account_id, n;
|
||||
unsigned int v;
|
||||
struct mmo_account acc;
|
||||
struct mmo_account* tmp;
|
||||
struct DBIterator* iter;
|
||||
int (*compare)(const char* str1, const char* str2) = ( db->case_sensitive ) ? strcmp : stricmp;
|
||||
|
||||
if( line[0] == '/' && line[1] == '/' )
|
||||
continue;
|
||||
|
||||
if( sscanf(line, "%d%n", &v, &n) == 1 && line[n] == '\n' )
|
||||
{// format version definition
|
||||
version = v;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( sscanf(line, "%d\t%%newid%%%n", &account_id, &n) == 1 && line[n] == '\n' )
|
||||
{// auto-increment
|
||||
if( account_id > db->next_account_id )
|
||||
db->next_account_id = account_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( !mmo_auth_fromstr(&acc, line, version) )
|
||||
{
|
||||
ShowError("account_db_txt_init: skipping invalid data: %s", line);
|
||||
continue;
|
||||
}
|
||||
|
||||
// apply constraints & checks here
|
||||
if( acc.sex != 'S' && (acc.account_id < START_ACCOUNT_NUM || acc.account_id > END_ACCOUNT_NUM) )
|
||||
ShowWarning("account_db_txt_init: account %d:'%s' has ID outside of the defined range for accounts (min:%d max:%d)!\n", acc.account_id, acc.userid, START_ACCOUNT_NUM, END_ACCOUNT_NUM);
|
||||
|
||||
iter = accounts->iterator(accounts);
|
||||
for( tmp = (struct mmo_account*)iter->first(iter,NULL); iter->exists(iter); tmp = (struct mmo_account*)iter->next(iter,NULL) )
|
||||
if( compare(acc.userid, tmp->userid) == 0 )
|
||||
break;
|
||||
iter->destroy(iter);
|
||||
|
||||
if( tmp != NULL )
|
||||
{// entry with identical username
|
||||
ShowWarning("account_db_txt_init: account %d:'%s' has same username as account %d. The account will be inaccessible!\n", acc.account_id, acc.userid, tmp->account_id);
|
||||
}
|
||||
|
||||
if( idb_get(accounts, acc.account_id) != NULL )
|
||||
{// account id already occupied
|
||||
ShowError("account_db_txt_init: ID collision for account id %d! Discarding data for account '%s'...\n", acc.account_id, acc.userid);
|
||||
continue;
|
||||
}
|
||||
|
||||
// record entry in db
|
||||
tmp = (struct mmo_account*)aMalloc(sizeof(struct mmo_account));
|
||||
memcpy(tmp, &acc, sizeof(struct mmo_account));
|
||||
idb_put(accounts, acc.account_id, tmp);
|
||||
|
||||
if( db->next_account_id < acc.account_id)
|
||||
db->next_account_id = acc.account_id + 1;
|
||||
}
|
||||
|
||||
// close data file
|
||||
fclose(fp);
|
||||
|
||||
// initialize data saving timer
|
||||
add_timer_func_list(mmo_auth_sync_timer, "mmo_auth_sync_timer");
|
||||
db->save_timer = add_timer_interval(gettick() + AUTH_SAVING_INTERVAL, mmo_auth_sync_timer, 0, (int)db, AUTH_SAVING_INTERVAL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// flush accounts db, close savefile and deallocate structures
|
||||
static void account_db_txt_destroy(AccountDB* self)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
DBMap* accounts = db->accounts;
|
||||
|
||||
// stop saving timer
|
||||
delete_timer(db->save_timer, mmo_auth_sync_timer);
|
||||
|
||||
// write data
|
||||
mmo_auth_sync(db);
|
||||
|
||||
// delete accounts database
|
||||
accounts->destroy(accounts, NULL);
|
||||
db->accounts = NULL;
|
||||
|
||||
// delete entire structure
|
||||
aFree(db);
|
||||
}
|
||||
|
||||
/// Gets a property from this database.
|
||||
static bool account_db_txt_get_property(AccountDB* self, const char* key, char* buf, size_t buflen)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
const char* signature = "account.txt.";
|
||||
|
||||
if( strcmp(key, "engine.name") == 0 )
|
||||
{
|
||||
safesnprintf(buf, buflen, "txt");
|
||||
return true;
|
||||
}
|
||||
if( strcmp(key, "engine.version") == 0 )
|
||||
{
|
||||
safesnprintf(buf, buflen, "%d", ACCOUNT_TXT_DB_VERSION);
|
||||
return true;
|
||||
}
|
||||
if( strcmp(key, "engine.comment") == 0 )
|
||||
{
|
||||
safesnprintf(buf, buflen, "TXT Account Database %d", ACCOUNT_TXT_DB_VERSION);
|
||||
return true;
|
||||
}
|
||||
|
||||
if( strncmp(key, signature, strlen(signature)) != 0 )
|
||||
return false;
|
||||
|
||||
key += strlen(signature);
|
||||
|
||||
if( strcmpi(key, "account_db") == 0 )
|
||||
safesnprintf(buf, buflen, "%s", db->account_db);
|
||||
else if( strcmpi(key, "case_sensitive") == 0 )
|
||||
safesnprintf(buf, buflen, "%d", (db->case_sensitive ? 1 : 0));
|
||||
else
|
||||
return false;// not found
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Sets a property in this database.
|
||||
static bool account_db_txt_set_property(AccountDB* self, const char* key, const char* value)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
const char* signature = "account.txt.";
|
||||
|
||||
if( strncmp(key, signature, strlen(signature)) != 0 )
|
||||
return false;
|
||||
|
||||
key += strlen(signature);
|
||||
|
||||
if( strcmpi(key, "account_db") == 0 )
|
||||
safestrncpy(db->account_db, value, sizeof(db->account_db));
|
||||
else if( strcmpi(key, "case_sensitive") == 0 )
|
||||
db->case_sensitive = config_switch(value);
|
||||
else // no match
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Add a new entry for this account to the account db and save it.
|
||||
/// If acc->account_id is -1, the account id will be auto-generated,
|
||||
/// and its value will be written to acc->account_id if everything succeeds.
|
||||
static bool account_db_txt_create(AccountDB* self, struct mmo_account* acc)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
DBMap* accounts = db->accounts;
|
||||
struct mmo_account* tmp;
|
||||
|
||||
// decide on the account id to assign
|
||||
int account_id = ( acc->account_id != -1 ) ? acc->account_id : db->next_account_id;
|
||||
|
||||
// absolute maximum
|
||||
if( account_id > END_ACCOUNT_NUM )
|
||||
return false;
|
||||
|
||||
// check if the account_id is free
|
||||
tmp = idb_get(accounts, account_id);
|
||||
if( tmp != NULL )
|
||||
{// error condition - entry already present
|
||||
ShowError("account_db_txt_create: cannot create account %d:'%s', this id is already occupied by %d:'%s'!\n", account_id, acc->userid, account_id, tmp->userid);
|
||||
return false;
|
||||
}
|
||||
|
||||
// copy the data and store it in the db
|
||||
CREATE(tmp, struct mmo_account, 1);
|
||||
memcpy(tmp, acc, sizeof(struct mmo_account));
|
||||
tmp->account_id = account_id;
|
||||
idb_put(accounts, account_id, tmp);
|
||||
|
||||
// increment the auto_increment value
|
||||
if( account_id >= db->next_account_id )
|
||||
db->next_account_id = account_id + 1;
|
||||
|
||||
// flush data
|
||||
mmo_auth_sync(db);
|
||||
|
||||
// write output
|
||||
acc->account_id = account_id;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// find an existing entry for this account id and delete it
|
||||
static bool account_db_txt_remove(AccountDB* self, const int account_id)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
DBMap* accounts = db->accounts;
|
||||
|
||||
//TODO: find out if this really works
|
||||
struct mmo_account* tmp = idb_remove(accounts, account_id);
|
||||
if( tmp == NULL )
|
||||
{// error condition - entry not present
|
||||
ShowError("account_db_txt_remove: no such account with id %d\n", account_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
// flush data
|
||||
mmo_auth_sync(db);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// rewrite the data stored in the account_db with the one provided
|
||||
static bool account_db_txt_save(AccountDB* self, const struct mmo_account* acc)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
DBMap* accounts = db->accounts;
|
||||
int account_id = acc->account_id;
|
||||
|
||||
// retrieve previous data
|
||||
struct mmo_acount* tmp = idb_get(accounts, account_id);
|
||||
if( tmp == NULL )
|
||||
{// error condition - entry not found
|
||||
return false;
|
||||
}
|
||||
|
||||
// overwrite with new data
|
||||
memcpy(tmp, acc, sizeof(struct mmo_account));
|
||||
|
||||
// modify save counter and save if needed
|
||||
if( --db->auths_before_save == 0 )
|
||||
mmo_auth_sync(db);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// retrieve data from db and store it in the provided data structure
|
||||
static bool account_db_txt_load_num(AccountDB* self, struct mmo_account* acc, const int account_id)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
DBMap* accounts = db->accounts;
|
||||
|
||||
// retrieve data
|
||||
struct mmo_account* tmp = idb_get(accounts, account_id);
|
||||
if( tmp == NULL )
|
||||
{// entry not found
|
||||
return false;
|
||||
}
|
||||
|
||||
// store it
|
||||
memcpy(acc, tmp, sizeof(struct mmo_account));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// retrieve data from db and store it in the provided data structure
|
||||
static bool account_db_txt_load_str(AccountDB* self, struct mmo_account* acc, const char* userid)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
DBMap* accounts = db->accounts;
|
||||
|
||||
// retrieve data
|
||||
struct DBIterator* iter = accounts->iterator(accounts);
|
||||
struct mmo_account* tmp;
|
||||
int (*compare)(const char* str1, const char* str2) = ( db->case_sensitive ) ? strcmp : stricmp;
|
||||
|
||||
for( tmp = (struct mmo_account*)iter->first(iter,NULL); iter->exists(iter); tmp = (struct mmo_account*)iter->next(iter,NULL) )
|
||||
if( compare(userid, tmp->userid) == 0 )
|
||||
break;
|
||||
iter->destroy(iter);
|
||||
|
||||
if( tmp == NULL )
|
||||
{// entry not found
|
||||
return false;
|
||||
}
|
||||
|
||||
// store it
|
||||
memcpy(acc, tmp, sizeof(struct mmo_account));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// Returns a new forward iterator.
|
||||
static AccountDBIterator* account_db_txt_iterator(AccountDB* self)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)self;
|
||||
DBMap* accounts = db->accounts;
|
||||
AccountDBIterator_TXT* iter = (AccountDBIterator_TXT*)aCalloc(1, sizeof(AccountDBIterator_TXT));
|
||||
|
||||
// set up the vtable
|
||||
iter->vtable.destroy = &account_db_txt_iter_destroy;
|
||||
iter->vtable.next = &account_db_txt_iter_next;
|
||||
|
||||
// fill data
|
||||
iter->iter = db_iterator(accounts);
|
||||
|
||||
return &iter->vtable;
|
||||
}
|
||||
|
||||
|
||||
/// Destroys this iterator, releasing all allocated memory (including itself).
|
||||
static void account_db_txt_iter_destroy(AccountDBIterator* self)
|
||||
{
|
||||
AccountDBIterator_TXT* iter = (AccountDBIterator_TXT*)self;
|
||||
dbi_destroy(iter->iter);
|
||||
aFree(iter);
|
||||
}
|
||||
|
||||
|
||||
/// Fetches the next account in the database.
|
||||
static bool account_db_txt_iter_next(AccountDBIterator* self, struct mmo_account* acc)
|
||||
{
|
||||
AccountDBIterator_TXT* iter = (AccountDBIterator_TXT*)self;
|
||||
struct mmo_account* tmp = (struct mmo_account*)dbi_next(iter->iter);
|
||||
if( dbi_exists(iter->iter) )
|
||||
{
|
||||
memcpy(acc, tmp, sizeof(struct mmo_account));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// parse input string into the provided account data structure
|
||||
static bool mmo_auth_fromstr(struct mmo_account* a, char* str, unsigned int version)
|
||||
{
|
||||
char* fields[32];
|
||||
int count;
|
||||
char* regs;
|
||||
int i, n;
|
||||
|
||||
// zero out the destination first
|
||||
memset(a, 0x00, sizeof(struct mmo_account));
|
||||
|
||||
// extract tab-separated columns from line
|
||||
count = sv_split(str, strlen(str), 0, '\t', fields, ARRAYLENGTH(fields), SV_NOESCAPE_NOTERMINATE);
|
||||
|
||||
if( version == ACCOUNT_TXT_DB_VERSION && count == 13 )
|
||||
{
|
||||
a->account_id = strtol(fields[1], NULL, 10);
|
||||
safestrncpy(a->userid, fields[2], sizeof(a->userid));
|
||||
safestrncpy(a->pass, fields[3], sizeof(a->pass));
|
||||
a->sex = fields[4][0];
|
||||
safestrncpy(a->email, fields[5], sizeof(a->email));
|
||||
a->level = strtoul(fields[6], NULL, 10);
|
||||
a->state = strtoul(fields[7], NULL, 10);
|
||||
a->unban_time = strtol(fields[8], NULL, 10);
|
||||
a->expiration_time = strtol(fields[9], NULL, 10);
|
||||
a->logincount = strtoul(fields[10], NULL, 10);
|
||||
safestrncpy(a->lastlogin, fields[11], sizeof(a->lastlogin));
|
||||
safestrncpy(a->last_ip, fields[12], sizeof(a->last_ip));
|
||||
regs = fields[13];
|
||||
}
|
||||
else
|
||||
if( version == 0 && count == 14 )
|
||||
{
|
||||
a->account_id = strtol(fields[1], NULL, 10);
|
||||
safestrncpy(a->userid, fields[2], sizeof(a->userid));
|
||||
safestrncpy(a->pass, fields[3], sizeof(a->pass));
|
||||
safestrncpy(a->lastlogin, fields[4], sizeof(a->lastlogin));
|
||||
a->sex = fields[5][0];
|
||||
a->logincount = strtoul(fields[6], NULL, 10);
|
||||
a->state = strtoul(fields[7], NULL, 10);
|
||||
safestrncpy(a->email, fields[8], sizeof(a->email));
|
||||
//safestrncpy(a->error_message, fields[9], sizeof(a->error_message));
|
||||
a->expiration_time = strtol(fields[10], NULL, 10);
|
||||
safestrncpy(a->last_ip, fields[11], sizeof(a->last_ip));
|
||||
//safestrncpy(a->memo, fields[12], sizeof(a->memo));
|
||||
a->unban_time = strtol(fields[13], NULL, 10);
|
||||
regs = fields[14];
|
||||
}
|
||||
else
|
||||
if( version == 0 && count == 13 )
|
||||
{
|
||||
a->account_id = strtol(fields[1], NULL, 10);
|
||||
safestrncpy(a->userid, fields[2], sizeof(a->userid));
|
||||
safestrncpy(a->pass, fields[3], sizeof(a->pass));
|
||||
safestrncpy(a->lastlogin, fields[4], sizeof(a->lastlogin));
|
||||
a->sex = fields[5][0];
|
||||
a->logincount = strtoul(fields[6], NULL, 10);
|
||||
a->state = strtoul(fields[7], NULL, 10);
|
||||
safestrncpy(a->email, fields[8], sizeof(a->email));
|
||||
//safestrncpy(a->error_message, fields[9], sizeof(a->error_message));
|
||||
a->expiration_time = strtol(fields[10], NULL, 10);
|
||||
safestrncpy(a->last_ip, fields[11], sizeof(a->last_ip));
|
||||
//safestrncpy(a->memo, fields[12], sizeof(a->memo));
|
||||
regs = fields[13];
|
||||
}
|
||||
else
|
||||
if( version == 0 && count == 8 )
|
||||
{
|
||||
a->account_id = strtol(fields[1], NULL, 10);
|
||||
safestrncpy(a->userid, fields[2], sizeof(a->userid));
|
||||
safestrncpy(a->pass, fields[3], sizeof(a->pass));
|
||||
safestrncpy(a->lastlogin, fields[4], sizeof(a->lastlogin));
|
||||
a->sex = fields[5][0];
|
||||
a->logincount = strtoul(fields[6], NULL, 10);
|
||||
a->state = strtoul(fields[7], NULL, 10);
|
||||
regs = fields[8];
|
||||
}
|
||||
else
|
||||
{// unmatched row
|
||||
return false;
|
||||
}
|
||||
|
||||
// extract account regs
|
||||
// {reg name<COMMA>reg value<SPACE>}*
|
||||
n = 0;
|
||||
for( i = 0; i < ACCOUNT_REG2_NUM; ++i )
|
||||
{
|
||||
char key[32];
|
||||
char value[256];
|
||||
|
||||
regs += n;
|
||||
|
||||
if (sscanf(regs, "%31[^\t,],%255[^\t ] %n", key, value, &n) != 2)
|
||||
{
|
||||
// We must check if a str is void. If it's, we can continue to read other REG2.
|
||||
// Account line will have something like: str2,9 ,9 str3,1 (here, ,9 is not good)
|
||||
if (regs[0] == ',' && sscanf(regs, ",%[^\t ] %n", value, &n) == 1) {
|
||||
i--;
|
||||
continue;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
|
||||
safestrncpy(a->account_reg2[i].str, key, 32);
|
||||
safestrncpy(a->account_reg2[i].value, value, 256);
|
||||
}
|
||||
a->account_reg2_num = i;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// dump the contents of the account data structure into the provided string buffer
|
||||
static bool mmo_auth_tostr(const struct mmo_account* a, char* str)
|
||||
{
|
||||
int i;
|
||||
char* str_p = str;
|
||||
|
||||
str_p += sprintf(str_p, "%d\t%s\t%s\t%c\t%s\t%u\t%u\t%ld\t%ld\t%u\t%s\t%s\t",
|
||||
a->account_id, a->userid, a->pass, a->sex, a->email, a->level,
|
||||
a->state, (long)a->unban_time, (long)a->expiration_time,
|
||||
a->logincount, a->lastlogin, a->last_ip);
|
||||
|
||||
for( i = 0; i < a->account_reg2_num; ++i )
|
||||
if( a->account_reg2[i].str[0] )
|
||||
str_p += sprintf(str_p, "%s,%s ", a->account_reg2[i].str, a->account_reg2[i].value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// dump the entire account db to disk
|
||||
static void mmo_auth_sync(AccountDB_TXT* db)
|
||||
{
|
||||
int lock;
|
||||
FILE *fp;
|
||||
struct DBIterator* iter;
|
||||
struct mmo_account* acc;
|
||||
|
||||
fp = lock_fopen(db->account_db, &lock);
|
||||
if( fp == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fp, "%d\n", ACCOUNT_TXT_DB_VERSION); // savefile version
|
||||
|
||||
fprintf(fp, "// Accounts file: here are saved all information about the accounts.\n");
|
||||
fprintf(fp, "// Structure: account ID, username, password, sex, email, level, state, unban time, expiration time, # of logins, last login time, last (accepted) login ip, repeated(register key, register value)\n");
|
||||
fprintf(fp, "// where:\n");
|
||||
fprintf(fp, "// sex : M or F for normal accounts, S for server accounts\n");
|
||||
fprintf(fp, "// level : this account's gm level\n");
|
||||
fprintf(fp, "// state : 0: account is ok, 1 to 256: error code of packet 0x006a + 1\n");
|
||||
fprintf(fp, "// unban time : 0: no ban, <other value>: banned until the date (unix timestamp)\n");
|
||||
fprintf(fp, "// expiration time : 0: unlimited account, <other value>: account expires on the date (unix timestamp)\n");
|
||||
|
||||
//TODO: sort?
|
||||
|
||||
iter = db->accounts->iterator(db->accounts);
|
||||
for( acc = (struct mmo_account*)iter->first(iter,NULL); iter->exists(iter); acc = (struct mmo_account*)iter->next(iter,NULL) )
|
||||
{
|
||||
char buf[2048]; // ought to be big enough ^^
|
||||
mmo_auth_tostr(acc, buf);
|
||||
fprintf(fp, "%s\n", buf);
|
||||
}
|
||||
fprintf(fp, "%d\t%%newid%%\n", db->next_account_id);
|
||||
iter->destroy(iter);
|
||||
|
||||
lock_fclose(fp, db->account_db, &lock);
|
||||
|
||||
// reset save counter
|
||||
db->auths_before_save = AUTHS_BEFORE_SAVE;
|
||||
}
|
||||
|
||||
static int mmo_auth_sync_timer(int tid, unsigned int tick, int id, intptr data)
|
||||
{
|
||||
AccountDB_TXT* db = (AccountDB_TXT*)data;
|
||||
|
||||
if( db->auths_before_save < AUTHS_BEFORE_SAVE )
|
||||
mmo_auth_sync(db); // db was modified, flush it
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,3 +1,6 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
#include "../common/mmo.h"
|
||||
#include "../common/core.h"
|
||||
@ -10,6 +13,7 @@
|
||||
#include "../common/version.h"
|
||||
#include "../common/md5calc.h"
|
||||
#include "../common/lock.h"
|
||||
#include "account.h"
|
||||
#include "login.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@ -17,31 +21,72 @@
|
||||
#include <string.h>
|
||||
#include <sys/stat.h> // for stat/lstat/fstat
|
||||
|
||||
extern struct Login_Config login_config;
|
||||
|
||||
#define MAX_SERVERS 30
|
||||
extern struct mmo_char_server server[MAX_SERVERS];
|
||||
extern struct mmo_account* auth_dat;
|
||||
extern uint32 auth_num;
|
||||
extern int account_id_count;
|
||||
extern char GM_account_filename[1024];
|
||||
extern AccountDB* accounts;
|
||||
|
||||
int charif_sendallwos(int sfd, unsigned char *buf, unsigned int len);
|
||||
int search_account_index(char* account_name);
|
||||
int mmo_auth_new(struct mmo_account* account);
|
||||
void mmo_auth_sync(void);
|
||||
int mmo_auth_tostr(char* str, struct mmo_account* p);
|
||||
int read_gm_account(void);
|
||||
void send_GM_accounts(int fd);
|
||||
int isGM(int account_id);
|
||||
bool check_password(const char* md5key, int passwdenc, const char* passwd, const char* refpass);
|
||||
int mmo_auth_new(const char* userid, const char* pass, const char sex, const char* last_ip);
|
||||
int parse_admin(int fd);
|
||||
|
||||
|
||||
bool ladmin_auth(struct login_session_data* sd, const char* ip)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if( str2ip(ip) != host2ip(login_config.admin_allowed_host) )
|
||||
ShowNotice("'ladmin'-login: Connection in administration mode REFUSED - IP isn't authorised (ip: %s).\n", ip);
|
||||
else
|
||||
if( !login_config.admin_state )
|
||||
ShowNotice("'ladmin'-login: Connection in administration mode REFUSED - remote administration is disabled (ip: %s)\n", ip);
|
||||
else
|
||||
if( !check_password(sd->md5key, sd->passwdenc, sd->passwd, login_config.admin_pass) )
|
||||
ShowNotice("'ladmin'-login: Connection in administration mode REFUSED - invalid password (ip: %s)\n", ip);
|
||||
else
|
||||
{
|
||||
ShowNotice("'ladmin'-login: Connection in administration mode accepted (ip: %s)\n", ip);
|
||||
session[sd->fd]->func_parse = parse_admin;
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------
|
||||
// Packet parsing for administation login
|
||||
//
|
||||
// List of supported operations:
|
||||
// 0x7530 - request server version (response: 0x7531)
|
||||
// 0x7938 - request server list (response: 0x7939)
|
||||
// 0x7920 - request entire list of accounts (response: 0x7921)
|
||||
// 0x794e - request message broadcast (response: 0x794f + 0x2726)
|
||||
|
||||
// 0x7930 - request account creation (response: 0x7931)
|
||||
// 0x7932 - request account deletion (response: 0x7933 + 0x2730)
|
||||
|
||||
// 0x7934 - request account password modification (response: 0x7935)
|
||||
// 0x7936 - request account state modification (response: 0x7937 + 0x2731)
|
||||
// 0x793a - request password check (response: 0x793b)
|
||||
// 0x793c - request account sex modification (response: 0x793d + 0x2723)
|
||||
// 0x793e - request account gm-level modification (response: 0x793f)
|
||||
// 0x7940 - request account email modification (response: 0x7941)
|
||||
// 0x7942 - request account memo modification (response: 0x7943)
|
||||
// 0x7948 - request account expiration-time modification - absolute (response: 0x7949)
|
||||
// 0x7950 - request account expiration-time modification - relative (response: 0x7951)
|
||||
// 0x794a - request account unban-time modification - absolute (response: 0x794b + 0x2731)
|
||||
// 0x794c - request account unban-time modification - relative (response: 0x794d + 0x2731)
|
||||
|
||||
// 0x7944 - request account id lookup by name (response: 0x7945)
|
||||
// 0x7946 - request account name lookup by id (response: 0x7947)
|
||||
// 0x7952 - request account information lookup by name (response: 0x7953)
|
||||
// 0x7954 - request account information lookup by id (response: 0x7953)
|
||||
//---------------------------------------
|
||||
int parse_admin(int fd)
|
||||
{
|
||||
unsigned int i, j;
|
||||
char* account_name;
|
||||
struct mmo_account acc;
|
||||
|
||||
uint32 ipl = session[fd]->client_addr;
|
||||
char ip[16];
|
||||
@ -75,7 +120,7 @@ int parse_admin(int fd)
|
||||
WFIFOSET(fd,10);
|
||||
RFIFOSKIP(fd,2);
|
||||
break;
|
||||
|
||||
/*
|
||||
case 0x7920: // Request of an accounts list
|
||||
if (RFIFOREST(fd) < 10)
|
||||
return 0;
|
||||
@ -130,158 +175,145 @@ int parse_admin(int fd)
|
||||
DELETE_BUFFER(id);
|
||||
}
|
||||
break;
|
||||
|
||||
*/
|
||||
case 0x7930: // Request for an account creation
|
||||
if (RFIFOREST(fd) < 91)
|
||||
return 0;
|
||||
{
|
||||
struct mmo_account ma;
|
||||
safestrncpy(ma.userid, (char*)RFIFOP(fd, 2), NAME_LENGTH);
|
||||
safestrncpy(ma.pass, (char*)RFIFOP(fd,26), NAME_LENGTH);
|
||||
safestrncpy(ma.email, (char*)RFIFOP(fd,51), 40);
|
||||
memcpy(ma.lastlogin, "-", 2);
|
||||
ma.sex = RFIFOB(fd,50);
|
||||
RFIFOSKIP(fd,91);
|
||||
{
|
||||
struct mmo_account ma;
|
||||
safestrncpy(ma.userid, (char*)RFIFOP(fd, 2), sizeof(ma.userid));
|
||||
safestrncpy(ma.pass, (char*)RFIFOP(fd,26), sizeof(ma.pass));
|
||||
ma.sex = RFIFOB(fd,50);
|
||||
safestrncpy(ma.email, (char*)RFIFOP(fd,51), sizeof(ma.email));
|
||||
safestrncpy(ma.lastlogin, "-", sizeof(ma.lastlogin));
|
||||
|
||||
WFIFOW(fd,0) = 0x7931;
|
||||
WFIFOL(fd,2) = 0xffffffff; // invalid account id
|
||||
safestrncpy((char*)WFIFOP(fd,6), ma.userid, 24);
|
||||
if (strlen(ma.userid) < 4 || strlen(ma.pass) < 4) {
|
||||
ShowNotice("'ladmin': Attempt to create an invalid account (account or pass is too short, ip: %s)\n", ip);
|
||||
} else if (ma.sex != 'F' && ma.sex != 'M') {
|
||||
ShowNotice("'ladmin': Attempt to create an invalid account (account: %s, received pass: %s, invalid sex, ip: %s)\n", ma.userid, ma.pass, ip);
|
||||
} else if (account_id_count > END_ACCOUNT_NUM) {
|
||||
ShowNotice("'ladmin': Attempt to create an account, but there is no more available id number (account: %s, pass: %s, sex: %c, ip: %s)\n", ma.userid, ma.pass, ma.sex, ip);
|
||||
} else {
|
||||
remove_control_chars(ma.userid);
|
||||
remove_control_chars(ma.pass);
|
||||
remove_control_chars(ma.email);
|
||||
ARR_FIND( 0, auth_num, i, strncmp(auth_dat[i].userid, ma.userid, 24) == 0 );
|
||||
if( i < auth_num )
|
||||
ShowNotice("'ladmin': Attempt to create an already existing account (account: %s, pass: %s, received pass: %s, ip: %s)\n", auth_dat[i].userid, auth_dat[i].pass, ma.pass, ip);
|
||||
else
|
||||
{
|
||||
int new_id;
|
||||
new_id = mmo_auth_new(&ma);
|
||||
ShowNotice("'ladmin': Account creation (account: %s (id: %d), pass: %s, sex: %c, email: %s, ip: %s)\n", ma.userid, new_id, ma.pass, ma.sex, auth_dat[i].email, ip);
|
||||
WFIFOL(fd,2) = new_id;
|
||||
mmo_auth_sync();
|
||||
}
|
||||
}
|
||||
WFIFOSET(fd,30);
|
||||
}
|
||||
ShowNotice("'ladmin': Account creation request (account: %s pass: %s, sex: %c, email: %s, ip: %s)\n", ma.userid, ma.pass, ma.sex, ma.email, ip);
|
||||
|
||||
WFIFOW(fd,0) = 0x7931;
|
||||
WFIFOL(fd,2) = mmo_auth_new(ma.userid, ma.pass, ma.sex, ip);
|
||||
safestrncpy((char*)WFIFOP(fd,6), ma.userid, 24);
|
||||
WFIFOSET(fd,30);
|
||||
}
|
||||
RFIFOSKIP(fd,91);
|
||||
break;
|
||||
|
||||
/*
|
||||
case 0x7932: // Request for an account deletion
|
||||
if (RFIFOREST(fd) < 26)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7933;
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF;
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
{
|
||||
struct mmo_account acc;
|
||||
|
||||
char* account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
if (i != -1) {
|
||||
|
||||
WFIFOW(fd,0) = 0x7933;
|
||||
|
||||
if( accounts->load_str(accounts, &acc, account_name) )
|
||||
{
|
||||
// Char-server is notified of deletion (for characters deletion).
|
||||
unsigned char buf[65535];
|
||||
WBUFW(buf,0) = 0x2730;
|
||||
WBUFL(buf,2) = auth_dat[i].account_id;
|
||||
WBUFL(buf,2) = acc.account_id;
|
||||
charif_sendallwos(-1, buf, 6);
|
||||
|
||||
// send answer
|
||||
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
WFIFOL(fd,2) = auth_dat[i].account_id;
|
||||
// save deleted account in log file
|
||||
ShowNotice("'ladmin': Account deletion (account: %s, id: %d, ip: %s) - saved in next line:\n", auth_dat[i].userid, auth_dat[i].account_id, ip);
|
||||
mmo_auth_tostr((char*)buf, &auth_dat[i]);
|
||||
ShowNotice("%s\n", buf);
|
||||
memcpy(WFIFOP(fd,6), acc.userid, 24);
|
||||
WFIFOL(fd,2) = acc.account_id;
|
||||
|
||||
// delete account
|
||||
memset(auth_dat[i].userid, '\0', sizeof(auth_dat[i].userid));
|
||||
memset(acc.userid, '\0', sizeof(acc.userid));
|
||||
auth_dat[i].account_id = -1;
|
||||
mmo_auth_sync();
|
||||
} else {
|
||||
WFIFOL(fd,2) = -1;
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
ShowNotice("'ladmin': Attempt to delete an unknown account (account: %s, ip: %s)\n", account_name, ip);
|
||||
}
|
||||
WFIFOSET(fd,30);
|
||||
}
|
||||
RFIFOSKIP(fd,26);
|
||||
break;
|
||||
|
||||
*/
|
||||
case 0x7934: // Request to change a password
|
||||
if (RFIFOREST(fd) < 50)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7935;
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF; /// WTF??? an unsigned being set to a -1
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
{
|
||||
struct mmo_account acc;
|
||||
|
||||
char* account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
if (i != -1) {
|
||||
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
memcpy(auth_dat[i].pass, RFIFOP(fd,26), 24);
|
||||
auth_dat[i].pass[23] = '\0';
|
||||
remove_control_chars(auth_dat[i].pass);
|
||||
WFIFOL(fd,2) = auth_dat[i].account_id;
|
||||
ShowNotice("'ladmin': Modification of a password (account: %s, new password: %s, ip: %s)\n", auth_dat[i].userid, auth_dat[i].pass, ip);
|
||||
mmo_auth_sync();
|
||||
} else {
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
|
||||
WFIFOW(fd,0) = 0x7935;
|
||||
|
||||
if( accounts->load_str(accounts, &acc, account_name) )
|
||||
{
|
||||
WFIFOL(fd,2) = acc.account_id;
|
||||
safestrncpy((char*)WFIFOP(fd,6), acc.userid, 24);
|
||||
safestrncpy(acc.pass, (char*)RFIFOP(fd,26), 24);
|
||||
ShowNotice("'ladmin': Modification of a password (account: %s, new password: %s, ip: %s)\n", acc.userid, acc.pass, ip);
|
||||
|
||||
accounts->save(accounts, &acc);
|
||||
}
|
||||
else
|
||||
{
|
||||
WFIFOL(fd,2) = -1;
|
||||
safestrncpy((char*)WFIFOP(fd,6), account_name, 24);
|
||||
ShowNotice("'ladmin': Attempt to modify the password of an unknown account (account: %s, ip: %s)\n", account_name, ip);
|
||||
}
|
||||
|
||||
WFIFOSET(fd,30);
|
||||
}
|
||||
RFIFOSKIP(fd,50);
|
||||
break;
|
||||
|
||||
case 0x7936: // Request to modify a state
|
||||
if (RFIFOREST(fd) < 50)
|
||||
return 0;
|
||||
{
|
||||
struct mmo_account acc;
|
||||
|
||||
char* account_name = (char*)RFIFOP(fd,2);
|
||||
uint32 state = RFIFOL(fd,26);
|
||||
account_name[23] = '\0';
|
||||
|
||||
WFIFOW(fd,0) = 0x7937;
|
||||
|
||||
if( accounts->load_str(accounts, &acc, account_name) )
|
||||
{
|
||||
char error_message[20];
|
||||
uint32 statut;
|
||||
WFIFOW(fd,0) = 0x7937;
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
statut = RFIFOL(fd,26);
|
||||
memcpy(error_message, RFIFOP(fd,30), 20);
|
||||
error_message[19] = '\0';
|
||||
remove_control_chars(error_message);
|
||||
if (statut != 7 || error_message[0] == '\0') { // 7: // 6 = Your are Prohibited to log in until %s
|
||||
strcpy(error_message, "-");
|
||||
}
|
||||
i = search_account_index(account_name);
|
||||
if (i != -1) {
|
||||
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
WFIFOL(fd,2) = auth_dat[i].account_id;
|
||||
if (auth_dat[i].state == statut && strcmp(auth_dat[i].error_message, error_message) == 0)
|
||||
ShowNotice("'ladmin': Modification of a state, but the state of the account is already the good state (account: %s, received state: %d, ip: %s)\n", account_name, statut, ip);
|
||||
else {
|
||||
if (statut == 7)
|
||||
ShowNotice("'ladmin': Modification of a state (account: %s, new state: %d - prohibited to login until '%s', ip: %s)\n", auth_dat[i].userid, statut, error_message, ip);
|
||||
else
|
||||
ShowNotice("'ladmin': Modification of a state (account: %s, new state: %d, ip: %s)\n", auth_dat[i].userid, statut, ip);
|
||||
if (auth_dat[i].state == 0) {
|
||||
unsigned char buf[16];
|
||||
WBUFW(buf,0) = 0x2731;
|
||||
WBUFL(buf,2) = auth_dat[i].account_id;
|
||||
WBUFB(buf,6) = 0; // 0: change of statut, 1: ban
|
||||
WBUFL(buf,7) = statut; // status or final date of a banishment
|
||||
charif_sendallwos(-1, buf, 11);
|
||||
}
|
||||
auth_dat[i].state = statut;
|
||||
memcpy(auth_dat[i].error_message, error_message, 20);
|
||||
mmo_auth_sync();
|
||||
memcpy(WFIFOP(fd,6), acc.userid, 24);
|
||||
WFIFOL(fd,2) = acc.account_id;
|
||||
|
||||
if (acc.state == state)
|
||||
ShowNotice("'ladmin': Modification of a state, but the state of the account already has this value (account: %s, received state: %d, ip: %s)\n", account_name, state, ip);
|
||||
else
|
||||
{
|
||||
ShowNotice("'ladmin': Modification of a state (account: %s, new state: %d, ip: %s)\n", acc.userid, state, ip);
|
||||
|
||||
if (acc.state == 0) {
|
||||
unsigned char buf[16];
|
||||
WBUFW(buf,0) = 0x2731;
|
||||
WBUFL(buf,2) = acc.account_id;
|
||||
WBUFB(buf,6) = 0; // 0: change of statut, 1: ban
|
||||
WBUFL(buf,7) = state; // status or final date of a banishment
|
||||
charif_sendallwos(-1, buf, 11);
|
||||
}
|
||||
} else {
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
ShowNotice("'ladmin': Attempt to modify the state of an unknown account (account: %s, received state: %d, ip: %s)\n", account_name, statut, ip);
|
||||
acc.state = state;
|
||||
accounts->save(accounts, &acc);
|
||||
}
|
||||
WFIFOL(fd,30) = statut;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotice("'ladmin': Attempt to modify the state of an unknown account (account: %s, received state: %d, ip: %s)\n", account_name, state, ip);
|
||||
WFIFOL(fd,2) = -1;
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
}
|
||||
|
||||
WFIFOL(fd,30) = state;
|
||||
WFIFOSET(fd,34);
|
||||
}
|
||||
RFIFOSKIP(fd,50);
|
||||
break;
|
||||
|
||||
/*
|
||||
case 0x7938: // Request for servers list and # of online players
|
||||
{
|
||||
uint8 server_num = 0;
|
||||
@ -312,18 +344,18 @@ int parse_admin(int fd)
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
if (i != -1) {
|
||||
if( accounts->load_str(accounts, &acc, account_name) )
|
||||
{
|
||||
char pass[25];
|
||||
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
memcpy(pass, RFIFOP(fd,26), 24);
|
||||
pass[24] = '\0';
|
||||
remove_control_chars(pass);
|
||||
if (strcmp(auth_dat[i].pass, pass) == 0) {
|
||||
WFIFOL(fd,2) = auth_dat[i].account_id;
|
||||
ShowNotice("'ladmin': Check of password OK (account: %s, password: %s, ip: %s)\n", auth_dat[i].userid, auth_dat[i].pass, ip);
|
||||
if (strcmp(acc.pass, pass) == 0) {
|
||||
WFIFOL(fd,2) = acc.account_id;
|
||||
ShowNotice("'ladmin': Check of password OK (account: %s, password: %s, ip: %s)\n", acc.userid, acc.pass, ip);
|
||||
} else {
|
||||
ShowNotice("'ladmin': Failure of password check (account: %s, proposed pass: %s, ip: %s)\n", auth_dat[i].userid, pass, ip);
|
||||
ShowNotice("'ladmin': Failure of password check (account: %s, proposed pass: %s, ip: %s)\n", acc.userid, pass, ip);
|
||||
}
|
||||
} else {
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
@ -337,7 +369,7 @@ int parse_admin(int fd)
|
||||
if (RFIFOREST(fd) < 27)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x793d;
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF; // WTF???
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF; // -1
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
@ -351,22 +383,25 @@ int parse_admin(int fd)
|
||||
else
|
||||
ShowNotice("'ladmin': Attempt to give an invalid sex (account: %s, received sex: 'control char', ip: %s)\n", account_name, ip);
|
||||
} else {
|
||||
i = search_account_index(account_name);
|
||||
if (i != -1) {
|
||||
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
if (auth_dat[i].sex != ((sex == 'S' || sex == 's') ? 2 : (sex == 'M' || sex == 'm'))) {
|
||||
if( accounts->load_str(accounts, &acc, account_name) )
|
||||
{
|
||||
memcpy(WFIFOP(fd,6), acc.userid, 24);
|
||||
if (acc.sex != sex)
|
||||
{
|
||||
unsigned char buf[16];
|
||||
WFIFOL(fd,2) = auth_dat[i].account_id;
|
||||
auth_dat[i].sex = (sex == 'S' || sex == 's') ? 2 : (sex == 'M' || sex == 'm');
|
||||
ShowNotice("'ladmin': Modification of a sex (account: %s, new sex: %c, ip: %s)\n", auth_dat[i].userid, sex, ip);
|
||||
mmo_auth_sync();
|
||||
ShowNotice("'ladmin': Modification of a sex (account: %s, new sex: %c, ip: %s)\n", acc.userid, sex, ip);
|
||||
|
||||
WFIFOL(fd,2) = acc.account_id;
|
||||
acc.sex = sex;
|
||||
accounts->save(accounts, &acc);
|
||||
|
||||
// send to all char-server the change
|
||||
WBUFW(buf,0) = 0x2723;
|
||||
WBUFL(buf,2) = auth_dat[i].account_id;
|
||||
WBUFB(buf,6) = auth_dat[i].sex;
|
||||
WBUFL(buf,2) = acc.account_id;
|
||||
WBUFB(buf,6) = acc.sex;
|
||||
charif_sendallwos(-1, buf, 7);
|
||||
} else {
|
||||
ShowNotice("'ladmin': Modification of a sex, but the sex is already the good sex (account: %s, sex: %c, ip: %s)\n", auth_dat[i].userid, sex, ip);
|
||||
ShowNotice("'ladmin': Modification of a sex, but the sex is already the good sex (account: %s, sex: %c, ip: %s)\n", acc.userid, sex, ip);
|
||||
}
|
||||
} else {
|
||||
ShowNotice("'ladmin': Attempt to modify the sex of an unknown account (account: %s, received sex: %c, ip: %s)\n", account_name, sex, ip);
|
||||
@ -381,82 +416,31 @@ int parse_admin(int fd)
|
||||
if (RFIFOREST(fd) < 27)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x793f;
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF; // WTF???
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF; // -1
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
{
|
||||
char new_gm_level;
|
||||
new_gm_level = RFIFOB(fd,26);
|
||||
if( new_gm_level < 0 || new_gm_level > 99 )
|
||||
ShowNotice("'ladmin': Attempt to give an invalid GM level (account: %s, received GM level: %d, ip: %s)\n", account_name, (int)new_gm_level, ip);
|
||||
else
|
||||
if( !accounts->load_str(accounts, &acc, account_name) )
|
||||
ShowNotice("'ladmin': Attempt to modify the GM level of an unknown account (account: %s, received GM level: %d, ip: %s)\n", account_name, (int)new_gm_level, ip);
|
||||
else
|
||||
{
|
||||
char new_gm_level;
|
||||
new_gm_level = RFIFOB(fd,26);
|
||||
if (new_gm_level < 0 || new_gm_level > 99) {
|
||||
ShowNotice("'ladmin': Attempt to give an invalid GM level (account: %s, received GM level: %d, ip: %s)\n", account_name, (int)new_gm_level, ip);
|
||||
} else {
|
||||
i = search_account_index(account_name);
|
||||
if (i != -1) {
|
||||
int acc = auth_dat[i].account_id;
|
||||
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
if (isGM(acc) != new_gm_level) {
|
||||
// modification of the file
|
||||
FILE *fp, *fp2;
|
||||
int lock;
|
||||
char line[512];
|
||||
int GM_account, GM_level;
|
||||
int modify_flag;
|
||||
char tmpstr[24];
|
||||
time_t raw_time;
|
||||
if ((fp2 = lock_fopen(GM_account_filename, &lock)) != NULL) {
|
||||
if ((fp = fopen(GM_account_filename, "r")) != NULL) {
|
||||
time(&raw_time);
|
||||
strftime(tmpstr, 23, login_config.date_format, localtime(&raw_time));
|
||||
modify_flag = 0;
|
||||
// read/write GM file
|
||||
while(fgets(line, sizeof(line), fp))
|
||||
{
|
||||
while(line[0] != '\0' && (line[strlen(line)-1] == '\n' || line[strlen(line)-1] == '\r'))
|
||||
line[strlen(line)-1] = '\0'; // TODO: remove this
|
||||
if ((line[0] == '/' && line[1] == '/') || line[0] == '\0')
|
||||
fprintf(fp2, "%s\n", line);
|
||||
else {
|
||||
if (sscanf(line, "%d %d", &GM_account, &GM_level) != 2 && sscanf(line, "%d: %d", &GM_account, &GM_level) != 2)
|
||||
fprintf(fp2, "%s\n", line);
|
||||
else if (GM_account != acc)
|
||||
fprintf(fp2, "%s\n", line);
|
||||
else if (new_gm_level < 1) {
|
||||
fprintf(fp2, "// %s: 'ladmin' GM level removed on account %d '%s' (previous level: %d)\n//%d %d\n", tmpstr, acc, auth_dat[i].userid, GM_level, acc, new_gm_level);
|
||||
modify_flag = 1;
|
||||
} else {
|
||||
fprintf(fp2, "// %s: 'ladmin' GM level on account %d '%s' (previous level: %d)\n%d %d\n", tmpstr, acc, auth_dat[i].userid, GM_level, acc, new_gm_level);
|
||||
modify_flag = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (modify_flag == 0)
|
||||
fprintf(fp2, "// %s: 'ladmin' GM level on account %d '%s' (previous level: 0)\n%d %d\n", tmpstr, acc, auth_dat[i].userid, acc, new_gm_level);
|
||||
fclose(fp);
|
||||
} else {
|
||||
ShowNotice("'ladmin': Attempt to modify of a GM level - impossible to read GM accounts file (account: %s (%d), received GM level: %d, ip: %s)\n", auth_dat[i].userid, acc, (int)new_gm_level, ip);
|
||||
}
|
||||
if (lock_fclose(fp2, GM_account_filename, &lock) == 0) {
|
||||
WFIFOL(fd,2) = acc;
|
||||
ShowNotice("'ladmin': Modification of a GM level (account: %s (%d), new GM level: %d, ip: %s)\n", auth_dat[i].userid, acc, (int)new_gm_level, ip);
|
||||
// read and send new GM informations
|
||||
read_gm_account();
|
||||
send_GM_accounts(-1);
|
||||
} else {
|
||||
ShowNotice("'ladmin': Attempt to modify of a GM level - impossible to write GM accounts file (account: %s (%d), received GM level: %d, ip: %s)\n", auth_dat[i].userid, acc, (int)new_gm_level, ip);
|
||||
}
|
||||
} else {
|
||||
ShowNotice("'ladmin': Attempt to modify of a GM level - impossible to write GM accounts file (account: %s (%d), received GM level: %d, ip: %s)\n", auth_dat[i].userid, acc, (int)new_gm_level, ip);
|
||||
}
|
||||
} else {
|
||||
ShowNotice("'ladmin': Attempt to modify of a GM level, but the GM level is already the good GM level (account: %s (%d), GM level: %d, ip: %s)\n", auth_dat[i].userid, acc, (int)new_gm_level, ip);
|
||||
}
|
||||
} else {
|
||||
ShowNotice("'ladmin': Attempt to modify the GM level of an unknown account (account: %s, received GM level: %d, ip: %s)\n", account_name, (int)new_gm_level, ip);
|
||||
}
|
||||
memcpy(WFIFOP(fd,6), acc.userid, 24);
|
||||
|
||||
if (isGM(acc.account_id) == new_gm_level)
|
||||
ShowNotice("'ladmin': Attempt to modify of a GM level, but the GM level is already the good GM level (account: %s (%d), GM level: %d, ip: %s)\n", acc.userid, acc.account_id, (int)new_gm_level, ip);
|
||||
else
|
||||
{
|
||||
//TODO: change level
|
||||
}
|
||||
}
|
||||
}
|
||||
WFIFOSET(fd,30);
|
||||
RFIFOSKIP(fd,27);
|
||||
break;
|
||||
@ -739,57 +723,12 @@ int parse_admin(int fd)
|
||||
case 0x7950: // Request to change the validity limite (timestamp) (relative change)
|
||||
if (RFIFOREST(fd) < 38)
|
||||
return 0;
|
||||
{
|
||||
time_t timestamp;
|
||||
struct tm *tmtime;
|
||||
char tmpstr[2048];
|
||||
char tmpstr2[2048];
|
||||
WFIFOW(fd,0) = 0x7951;
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
if (i != -1) {
|
||||
WFIFOL(fd,2) = auth_dat[i].account_id;
|
||||
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
timestamp = auth_dat[i].expiration_time;
|
||||
if (timestamp == 0 || timestamp < time(NULL))
|
||||
timestamp = time(NULL);
|
||||
tmtime = localtime(×tamp);
|
||||
tmtime->tm_year = tmtime->tm_year + (short)RFIFOW(fd,26);
|
||||
tmtime->tm_mon = tmtime->tm_mon + (short)RFIFOW(fd,28);
|
||||
tmtime->tm_mday = tmtime->tm_mday + (short)RFIFOW(fd,30);
|
||||
tmtime->tm_hour = tmtime->tm_hour + (short)RFIFOW(fd,32);
|
||||
tmtime->tm_min = tmtime->tm_min + (short)RFIFOW(fd,34);
|
||||
tmtime->tm_sec = tmtime->tm_sec + (short)RFIFOW(fd,36);
|
||||
timestamp = mktime(tmtime);
|
||||
if (timestamp != -1) {
|
||||
strftime(tmpstr, 24, login_config.date_format, localtime(&auth_dat[i].expiration_time));
|
||||
strftime(tmpstr2, 24, login_config.date_format, localtime(×tamp));
|
||||
ShowNotice("'ladmin': Adjustment of a validity limit (account: %s, %d (%s) + (%+d y %+d m %+d d %+d h %+d mn %+d s) -> new validity: %d (%s), ip: %s)\n", auth_dat[i].userid, auth_dat[i].expiration_time, (auth_dat[i].expiration_time == 0 ? "unlimited" : tmpstr), (short)RFIFOW(fd,26), (short)RFIFOW(fd,28), (short)RFIFOW(fd,30), (short)RFIFOW(fd,32), (short)RFIFOW(fd,34), (short)RFIFOW(fd,36), timestamp, (timestamp == 0 ? "unlimited" : tmpstr2), ip);
|
||||
auth_dat[i].expiration_time = timestamp;
|
||||
mmo_auth_sync();
|
||||
WFIFOL(fd,30) = (unsigned long)auth_dat[i].expiration_time;
|
||||
} else {
|
||||
strftime(tmpstr, 24, login_config.date_format, localtime(&auth_dat[i].expiration_time));
|
||||
ShowNotice("'ladmin': Impossible to adjust a validity limit (account: %s, %d (%s) + (%+d y %+d m %+d d %+d h %+d mn %+d s) -> ???, ip: %s)\n", auth_dat[i].userid, auth_dat[i].expiration_time, (auth_dat[i].expiration_time == 0 ? "unlimited" : tmpstr), (short)RFIFOW(fd,26), (short)RFIFOW(fd,28), (short)RFIFOW(fd,30), (short)RFIFOW(fd,32), (short)RFIFOW(fd,34), (short)RFIFOW(fd,36), ip);
|
||||
WFIFOL(fd,30) = 0;
|
||||
}
|
||||
} else {
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
ShowNotice("'ladmin': Attempt to adjust the validity limit of an unknown account (account: %s, ip: %s)\n", account_name, ip);
|
||||
WFIFOL(fd,30) = 0;
|
||||
}
|
||||
}
|
||||
WFIFOSET(fd,34);
|
||||
RFIFOSKIP(fd,38);
|
||||
break;
|
||||
|
||||
case 0x7952: // Request about informations of an account (by account name)
|
||||
if (RFIFOREST(fd) < 26)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7953;
|
||||
{
|
||||
time_t timestamp;
|
||||
struct tm *tmtime;
|
||||
char tmpstr[2048];
|
||||
char tmpstr2[2048];
|
||||
WFIFOW(fd,0) = 0x7951;
|
||||
WFIFOL(fd,2) = 0xFFFFFFFF; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
@ -797,75 +736,118 @@ int parse_admin(int fd)
|
||||
i = search_account_index(account_name);
|
||||
if (i != -1) {
|
||||
WFIFOL(fd,2) = auth_dat[i].account_id;
|
||||
WFIFOB(fd,6) = (unsigned char)isGM(auth_dat[i].account_id);
|
||||
memcpy(WFIFOP(fd,7), auth_dat[i].userid, 24);
|
||||
WFIFOB(fd,31) = auth_dat[i].sex;
|
||||
WFIFOL(fd,32) = auth_dat[i].logincount;
|
||||
WFIFOL(fd,36) = auth_dat[i].state;
|
||||
memcpy(WFIFOP(fd,40), auth_dat[i].error_message, 20);
|
||||
memcpy(WFIFOP(fd,60), auth_dat[i].lastlogin, 24);
|
||||
memcpy(WFIFOP(fd,84), auth_dat[i].last_ip, 16);
|
||||
memcpy(WFIFOP(fd,100), auth_dat[i].email, 40);
|
||||
WFIFOL(fd,140) = (unsigned long)auth_dat[i].expiration_time;
|
||||
WFIFOL(fd,144) = (unsigned long)auth_dat[i].unban_time;
|
||||
WFIFOW(fd,148) = (uint16)strlen(auth_dat[i].memo);
|
||||
if (auth_dat[i].memo[0]) {
|
||||
memcpy(WFIFOP(fd,150), auth_dat[i].memo, strlen(auth_dat[i].memo));
|
||||
memcpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
timestamp = auth_dat[i].expiration_time;
|
||||
if (timestamp == 0 || timestamp < time(NULL))
|
||||
timestamp = time(NULL);
|
||||
tmtime = localtime(×tamp);
|
||||
tmtime->tm_year = tmtime->tm_year + (short)RFIFOW(fd,26);
|
||||
tmtime->tm_mon = tmtime->tm_mon + (short)RFIFOW(fd,28);
|
||||
tmtime->tm_mday = tmtime->tm_mday + (short)RFIFOW(fd,30);
|
||||
tmtime->tm_hour = tmtime->tm_hour + (short)RFIFOW(fd,32);
|
||||
tmtime->tm_min = tmtime->tm_min + (short)RFIFOW(fd,34);
|
||||
tmtime->tm_sec = tmtime->tm_sec + (short)RFIFOW(fd,36);
|
||||
timestamp = mktime(tmtime);
|
||||
if (timestamp != -1) {
|
||||
strftime(tmpstr, 24, login_config.date_format, localtime(&auth_dat[i].expiration_time));
|
||||
strftime(tmpstr2, 24, login_config.date_format, localtime(×tamp));
|
||||
ShowNotice("'ladmin': Adjustment of a validity limit (account: %s, %d (%s) + (%+d y %+d m %+d d %+d h %+d mn %+d s) -> new validity: %d (%s), ip: %s)\n", auth_dat[i].userid, auth_dat[i].expiration_time, (auth_dat[i].expiration_time == 0 ? "unlimited" : tmpstr), (short)RFIFOW(fd,26), (short)RFIFOW(fd,28), (short)RFIFOW(fd,30), (short)RFIFOW(fd,32), (short)RFIFOW(fd,34), (short)RFIFOW(fd,36), timestamp, (timestamp == 0 ? "unlimited" : tmpstr2), ip);
|
||||
auth_dat[i].expiration_time = timestamp;
|
||||
mmo_auth_sync();
|
||||
WFIFOL(fd,30) = (unsigned long)auth_dat[i].expiration_time;
|
||||
} else {
|
||||
strftime(tmpstr, 24, login_config.date_format, localtime(&auth_dat[i].expiration_time));
|
||||
ShowNotice("'ladmin': Impossible to adjust a validity limit (account: %s, %d (%s) + (%+d y %+d m %+d d %+d h %+d mn %+d s) -> ???, ip: %s)\n", auth_dat[i].userid, auth_dat[i].expiration_time, (auth_dat[i].expiration_time == 0 ? "unlimited" : tmpstr), (short)RFIFOW(fd,26), (short)RFIFOW(fd,28), (short)RFIFOW(fd,30), (short)RFIFOW(fd,32), (short)RFIFOW(fd,34), (short)RFIFOW(fd,36), ip);
|
||||
WFIFOL(fd,30) = 0;
|
||||
}
|
||||
ShowNotice("'ladmin': Sending information of an account (request by the name; account: %s, id: %d, ip: %s)\n", auth_dat[i].userid, auth_dat[i].account_id, ip);
|
||||
WFIFOSET(fd,150+strlen(auth_dat[i].memo));
|
||||
} else {
|
||||
memcpy(WFIFOP(fd,7), account_name, 24);
|
||||
WFIFOW(fd,148) = 0;
|
||||
ShowNotice("'ladmin': Attempt to obtain information (by the name) of an unknown account (account: %s, ip: %s)\n", account_name, ip);
|
||||
WFIFOSET(fd,150);
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
ShowNotice("'ladmin': Attempt to adjust the validity limit of an unknown account (account: %s, ip: %s)\n", account_name, ip);
|
||||
WFIFOL(fd,30) = 0;
|
||||
}
|
||||
|
||||
WFIFOSET(fd,34);
|
||||
}
|
||||
RFIFOSKIP(fd,38);
|
||||
break;
|
||||
*/
|
||||
case 0x7952: // Request about informations of an account (by account name)
|
||||
if (RFIFOREST(fd) < 26)
|
||||
return 0;
|
||||
{
|
||||
struct mmo_account acc;
|
||||
|
||||
WFIFOW(fd,0) = 0x7953;
|
||||
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
|
||||
if( accounts->load_str(accounts, &acc, account_name) )
|
||||
{
|
||||
ShowNotice("'ladmin': Sending information of an account (request by the name; account: %s, id: %d, ip: %s)\n", acc.userid, acc.account_id, ip);
|
||||
WFIFOL(fd,2) = acc.account_id;
|
||||
WFIFOB(fd,6) = acc.level;
|
||||
safestrncpy((char*)WFIFOP(fd,7), acc.userid, 24);
|
||||
WFIFOB(fd,31) = acc.sex;
|
||||
WFIFOL(fd,32) = acc.logincount;
|
||||
WFIFOL(fd,36) = acc.state;
|
||||
safestrncpy((char*)WFIFOP(fd,40), "-", 20); // error message (removed)
|
||||
safestrncpy((char*)WFIFOP(fd,60), acc.lastlogin, 24);
|
||||
safestrncpy((char*)WFIFOP(fd,84), acc.last_ip, 16);
|
||||
safestrncpy((char*)WFIFOP(fd,100), acc.email, 40);
|
||||
WFIFOL(fd,140) = (unsigned long)acc.expiration_time;
|
||||
WFIFOL(fd,144) = (unsigned long)acc.unban_time;
|
||||
WFIFOW(fd,148) = 0; // previously, this was strlen(memo), and memo went afterwards
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotice("'ladmin': Attempt to obtain information (by the name) of an unknown account (account: %s, ip: %s)\n", account_name, ip);
|
||||
WFIFOL(fd,2) = -1;
|
||||
safestrncpy((char*)WFIFOP(fd,7), account_name, 24); // not found
|
||||
}
|
||||
|
||||
WFIFOSET(fd,150);
|
||||
}
|
||||
RFIFOSKIP(fd,26);
|
||||
break;
|
||||
|
||||
case 0x7954: // Request about information of an account (by account id)
|
||||
if (RFIFOREST(fd) < 6)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7953;
|
||||
WFIFOL(fd,2) = RFIFOL(fd,2);
|
||||
memset(WFIFOP(fd,7), '\0', 24);
|
||||
for(i = 0; i < auth_num; i++) {
|
||||
if (auth_dat[i].account_id == (int)RFIFOL(fd,2)) {
|
||||
ShowNotice("'ladmin': Sending information of an account (request by the id; account: %s, id: %d, ip: %s)\n", auth_dat[i].userid, RFIFOL(fd,2), ip);
|
||||
WFIFOB(fd,6) = (unsigned char)isGM(auth_dat[i].account_id);
|
||||
memcpy(WFIFOP(fd,7), auth_dat[i].userid, 24);
|
||||
WFIFOB(fd,31) = auth_dat[i].sex;
|
||||
WFIFOL(fd,32) = auth_dat[i].logincount;
|
||||
WFIFOL(fd,36) = auth_dat[i].state;
|
||||
memcpy(WFIFOP(fd,40), auth_dat[i].error_message, 20);
|
||||
memcpy(WFIFOP(fd,60), auth_dat[i].lastlogin, 24);
|
||||
memcpy(WFIFOP(fd,84), auth_dat[i].last_ip, 16);
|
||||
memcpy(WFIFOP(fd,100), auth_dat[i].email, 40);
|
||||
WFIFOL(fd,140) = (unsigned long)auth_dat[i].expiration_time;
|
||||
WFIFOL(fd,144) = (unsigned long)auth_dat[i].unban_time;
|
||||
WFIFOW(fd,148) = (uint16)strlen(auth_dat[i].memo);
|
||||
if (auth_dat[i].memo[0]) {
|
||||
memcpy(WFIFOP(fd,150), auth_dat[i].memo, strlen(auth_dat[i].memo));
|
||||
}
|
||||
WFIFOSET(fd,150+strlen(auth_dat[i].memo));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == auth_num) {
|
||||
ShowNotice("'ladmin': Attempt to obtain information (by the id) of an unknown account (id: %d, ip: %s)\n", RFIFOL(fd,2), ip);
|
||||
strncpy((char*)WFIFOP(fd,7), "", 24);
|
||||
WFIFOW(fd,148) = 0;
|
||||
WFIFOSET(fd,150);
|
||||
}
|
||||
RFIFOSKIP(fd,6);
|
||||
break;
|
||||
{
|
||||
struct mmo_account acc;
|
||||
|
||||
case 0x7955: // Request to reload GM file (no answer)
|
||||
ShowStatus("'ladmin': Request to re-load GM configuration file (ip: %s).\n", ip);
|
||||
read_gm_account();
|
||||
// send GM accounts to all char-servers
|
||||
send_GM_accounts(-1);
|
||||
RFIFOSKIP(fd,2);
|
||||
int account_id = RFIFOL(fd,2);
|
||||
|
||||
WFIFOHEAD(fd,150);
|
||||
WFIFOW(fd,0) = 0x7953;
|
||||
WFIFOL(fd,2) = account_id;
|
||||
|
||||
if( accounts->load_num(accounts, &acc, account_id) )
|
||||
{
|
||||
ShowNotice("'ladmin': Sending information of an account (request by the id; account: %s, id: %d, ip: %s)\n", acc.userid, account_id, ip);
|
||||
WFIFOB(fd,6) = acc.level;
|
||||
safestrncpy((char*)WFIFOP(fd,7), acc.userid, 24);
|
||||
WFIFOB(fd,31) = acc.sex;
|
||||
WFIFOL(fd,32) = acc.logincount;
|
||||
WFIFOL(fd,36) = acc.state;
|
||||
safestrncpy((char*)WFIFOP(fd,40), "-", 20); // error message (removed)
|
||||
safestrncpy((char*)WFIFOP(fd,60), acc.lastlogin, 24);
|
||||
safestrncpy((char*)WFIFOP(fd,84), acc.last_ip, 16);
|
||||
safestrncpy((char*)WFIFOP(fd,100), acc.email, 40);
|
||||
WFIFOL(fd,140) = (unsigned long)acc.expiration_time;
|
||||
WFIFOL(fd,144) = (unsigned long)acc.unban_time;
|
||||
WFIFOW(fd,148) = 0; // previously, this was strlen(memo), and memo went afterwards
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotice("'ladmin': Attempt to obtain information (by the id) of an unknown account (id: %d, ip: %s)\n", account_id, ip);
|
||||
safestrncpy((char*)WFIFOP(fd,7), "", 24); // not found
|
||||
}
|
||||
|
||||
WFIFOSET(fd,150);
|
||||
}
|
||||
RFIFOSKIP(fd,6);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
25
src/login/ipban.h
Normal file
25
src/login/ipban.h
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#ifndef __IPBAN_H_INCLUDED__
|
||||
#define __IPBAN_H_INCLUDED__
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
|
||||
// initialize
|
||||
void ipban_init(void);
|
||||
|
||||
// finalize
|
||||
void ipban_final(void);
|
||||
|
||||
// check ip against ban list
|
||||
bool ipban_check(uint32 ip);
|
||||
|
||||
// increases failure count for the specified IP
|
||||
void ipban_log(uint32 ip);
|
||||
|
||||
// parses configuration option
|
||||
bool ipban_config_read(const char* key, const char* value);
|
||||
|
||||
|
||||
#endif // __IPBAN_H_INCLUDED__
|
209
src/login/ipban_sql.c
Normal file
209
src/login/ipban_sql.c
Normal file
@ -0,0 +1,209 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
#include "../common/db.h"
|
||||
#include "../common/malloc.h"
|
||||
#include "../common/sql.h"
|
||||
#include "../common/socket.h"
|
||||
#include "../common/strlib.h"
|
||||
#include "../common/timer.h"
|
||||
#include "login.h"
|
||||
#include "ipban.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// database options
|
||||
static char ipban_db_hostname[32] = "127.0.0.1";
|
||||
static uint16 ipban_db_port = 3306;
|
||||
static char ipban_db_username[32] = "ragnarok";
|
||||
static char ipban_db_password[32] = "ragnarok";
|
||||
static char ipban_db_database[32] = "ragnarok";
|
||||
static char ipban_table[32] = "ipbanlist";
|
||||
|
||||
static char log_db_hostname[32] = "127.0.0.1";
|
||||
static uint16 log_db_port = 3306;
|
||||
static char log_db_username[32] = "ragnarok";
|
||||
static char log_db_password[32] = "ragnarok";
|
||||
static char log_db_database[32] = "ragnarok";
|
||||
static char loginlog_table[32] = "loginlog";
|
||||
|
||||
static char default_codepage[32] = "";
|
||||
|
||||
// globals
|
||||
static Sql* sql_handle;
|
||||
static Sql* logsql_handle;
|
||||
static int cleanup_timer_id = INVALID_TIMER;
|
||||
|
||||
int ipban_cleanup(int tid, unsigned int tick, int id, intptr data);
|
||||
|
||||
|
||||
// initialize
|
||||
void ipban_init(void)
|
||||
{
|
||||
// establish connections
|
||||
sql_handle = Sql_Malloc();
|
||||
if( SQL_ERROR == Sql_Connect(sql_handle, ipban_db_username, ipban_db_password, ipban_db_hostname, ipban_db_port, ipban_db_database) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
Sql_Free(sql_handle);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if( default_codepage[0] != '\0' && SQL_ERROR == Sql_SetEncoding(sql_handle, default_codepage) )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
logsql_handle = Sql_Malloc();
|
||||
if( SQL_ERROR == Sql_Connect(logsql_handle, log_db_username, log_db_password, log_db_hostname, log_db_port, log_db_database) )
|
||||
{
|
||||
Sql_ShowDebug(logsql_handle);
|
||||
Sql_Free(logsql_handle);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if( default_codepage[0] != '\0' && SQL_ERROR == Sql_SetEncoding(logsql_handle, default_codepage) )
|
||||
Sql_ShowDebug(logsql_handle);
|
||||
|
||||
// set up periodic cleanup of connection history and active bans
|
||||
add_timer_func_list(ipban_cleanup, "ipban_cleanup");
|
||||
cleanup_timer_id = add_timer_interval(gettick()+10, ipban_cleanup, 0, 0, 60*1000);
|
||||
}
|
||||
|
||||
// finalize
|
||||
void ipban_final(void)
|
||||
{
|
||||
// release data
|
||||
delete_timer(cleanup_timer_id, ipban_cleanup);
|
||||
|
||||
// close connections
|
||||
Sql_Free(sql_handle);
|
||||
sql_handle = NULL;
|
||||
Sql_Free(logsql_handle);
|
||||
logsql_handle = NULL;
|
||||
}
|
||||
|
||||
// load configuration options
|
||||
bool ipban_config_read(const char* key, const char* value)
|
||||
{
|
||||
// login server settings
|
||||
if( strcmpi(key, "ipban.enable") == 0 )
|
||||
login_config.ipban = (bool)config_switch(value);
|
||||
else
|
||||
if( strcmpi(key, "ipban.dynamic_pass_failure_ban") == 0 )
|
||||
login_config.dynamic_pass_failure_ban = (bool)config_switch(value);
|
||||
else
|
||||
if( strcmpi(key, "ipban.dynamic_pass_failure_ban_interval") == 0 )
|
||||
login_config.dynamic_pass_failure_ban_interval = atoi(value);
|
||||
else
|
||||
if( strcmpi(key, "ipban.dynamic_pass_failure_ban_limit") == 0 )
|
||||
login_config.dynamic_pass_failure_ban_limit = atoi(value);
|
||||
else
|
||||
if( strcmpi(key, "ipban.dynamic_pass_failure_ban_duration") == 0 )
|
||||
login_config.dynamic_pass_failure_ban_duration = atoi(value);
|
||||
else
|
||||
|
||||
// ipban table settings
|
||||
if( strcmpi(key, "ipban.sql.db_hostname") == 0 )
|
||||
safestrncpy(ipban_db_hostname, value, sizeof(ipban_db_hostname));
|
||||
else
|
||||
if( strcmpi(key, "ipban.sql.db_port") == 0 )
|
||||
ipban_db_port = (uint16)strtoul(value, NULL, 10);
|
||||
else
|
||||
if( strcmpi(key, "ipban.sql.db_username") == 0 )
|
||||
safestrncpy(ipban_db_username, value, sizeof(ipban_db_username));
|
||||
else
|
||||
if( strcmpi(key, "ipban.sql.db_password") == 0 )
|
||||
safestrncpy(ipban_db_password, value, sizeof(ipban_db_password));
|
||||
else
|
||||
if( strcmpi(key, "ipban.sql.db_database") == 0 )
|
||||
safestrncpy(ipban_db_database, value, sizeof(ipban_db_database));
|
||||
else
|
||||
if( strcmpi(key, "ipban.sql.ipban_table") == 0 )
|
||||
safestrncpy(ipban_table, value, sizeof(ipban_table));
|
||||
else
|
||||
|
||||
// interserver settings
|
||||
if( strcmpi(key, "log_db_ip") == 0 )
|
||||
safestrncpy(log_db_hostname, value, sizeof(log_db_hostname));
|
||||
else
|
||||
if( strcmpi(key, "log_db_port") == 0 )
|
||||
log_db_port = (uint16)strtoul(value, NULL, 10);
|
||||
else
|
||||
if( strcmpi(key, "log_db_id") == 0 )
|
||||
safestrncpy(log_db_username, value, sizeof(log_db_username));
|
||||
else
|
||||
if( strcmpi(key, "log_db_pw") == 0 )
|
||||
safestrncpy(log_db_password, value, sizeof(log_db_password));
|
||||
else
|
||||
if( strcmpi(key, "log_db") == 0 )
|
||||
safestrncpy(log_db_database, value, sizeof(log_db_database));
|
||||
else
|
||||
if( strcmpi(key, "loginlog_db") == 0 )
|
||||
safestrncpy(loginlog_table, value, sizeof(loginlog_table));
|
||||
else
|
||||
if( strcmpi(key, "default_codepage") == 0 )
|
||||
safestrncpy(default_codepage, value, sizeof(default_codepage));
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// check ip against active bans list
|
||||
bool ipban_check(uint32 ip)
|
||||
{
|
||||
uint8* p = (uint8*)&ip;
|
||||
char* data = NULL;
|
||||
int matches;
|
||||
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT count(*) FROM `%s` WHERE `list` = '%u.*.*.*' OR `list` = '%u.%u.*.*' OR `list` = '%u.%u.%u.*' OR `list` = '%u.%u.%u.%u'",
|
||||
ipban_table, p[3], p[3], p[2], p[3], p[2], p[1], p[3], p[2], p[1], p[0]) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
// close connection because we can't verify their connectivity.
|
||||
return true;
|
||||
}
|
||||
|
||||
if( SQL_ERROR == Sql_NextRow(sql_handle) )
|
||||
return true;// Shouldn't happen, but just in case...
|
||||
|
||||
Sql_GetData(sql_handle, 0, &data, NULL);
|
||||
matches = atoi(data);
|
||||
Sql_FreeResult(sql_handle);
|
||||
|
||||
return( matches > 0 );
|
||||
}
|
||||
|
||||
// log failed attempt
|
||||
void ipban_log(uint32 ip)
|
||||
{
|
||||
unsigned long failures = 0;
|
||||
if( SQL_ERROR == Sql_Query(logsql_handle, "SELECT count(*) FROM `%s` WHERE `ip` = '%s' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %d MINUTE",
|
||||
loginlog_table, ip2str(ip,NULL), login_config.dynamic_pass_failure_ban_interval) )// how many times failed account? in one ip.
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
//check query result
|
||||
if( SQL_SUCCESS == Sql_NextRow(logsql_handle) )
|
||||
{
|
||||
char* data;
|
||||
Sql_GetData(logsql_handle, 0, &data, NULL);
|
||||
failures = strtoul(data, NULL, 10);
|
||||
Sql_FreeResult(logsql_handle);
|
||||
}
|
||||
|
||||
// if over the limit, add a temporary ban entry
|
||||
if( failures >= login_config.dynamic_pass_failure_ban_limit )
|
||||
{
|
||||
uint8* p = (uint8*)&ip;
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s`(`list`,`btime`,`rtime`,`reason`) VALUES ('%u.%u.%u.*', NOW() , NOW() + INTERVAL %d MINUTE ,'Password error ban')",
|
||||
ipban_table, p[3], p[2], p[1], login_config.dynamic_pass_failure_ban_duration) )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
}
|
||||
}
|
||||
|
||||
// remove expired bans
|
||||
int ipban_cleanup(int tid, unsigned int tick, int id, intptr data)
|
||||
{
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `ipbanlist` WHERE `rtime` <= NOW()") )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
return 0;
|
||||
}
|
50
src/login/ipban_txt.c
Normal file
50
src/login/ipban_txt.c
Normal file
@ -0,0 +1,50 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
#include "../common/strlib.h"
|
||||
#include "login.h"
|
||||
#include "ipban.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void ipban_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
void ipban_final(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool ipban_check(uint32 ip)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void ipban_log(uint32 ip)
|
||||
{
|
||||
}
|
||||
|
||||
bool ipban_config_read(const char* key, const char* value)
|
||||
{
|
||||
// login server settings
|
||||
if( strcmpi(key, "ipban.enable") == 0 )
|
||||
login_config.ipban = (bool)config_switch(value);
|
||||
else
|
||||
if( strcmpi(key, "ipban.dynamic_pass_failure_ban") == 0 )
|
||||
login_config.dynamic_pass_failure_ban = (bool)config_switch(value);
|
||||
else
|
||||
if( strcmpi(key, "ipban.dynamic_pass_failure_ban_interval") == 0 )
|
||||
login_config.dynamic_pass_failure_ban_interval = atoi(value);
|
||||
else
|
||||
if( strcmpi(key, "ipban.dynamic_pass_failure_ban_limit") == 0 )
|
||||
login_config.dynamic_pass_failure_ban_limit = atoi(value);
|
||||
else
|
||||
if( strcmpi(key, "ipban.dynamic_pass_failure_ban_duration") == 0 )
|
||||
login_config.dynamic_pass_failure_ban_duration = atoi(value);
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
2069
src/login/login.c
2069
src/login/login.c
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,7 @@
|
||||
#include "../common/mmo.h" // NAME_LENGTH
|
||||
|
||||
#define LOGIN_CONF_NAME "conf/login_athena.conf"
|
||||
#define INTER_CONF_NAME "conf/inter_athena.conf"
|
||||
#define LAN_CONF_NAME "conf/subnet_athena.conf"
|
||||
|
||||
// supported encryption types: 1- passwordencrypt, 2- passwordencrypt2, 3- both
|
||||
@ -38,9 +39,9 @@ struct mmo_char_server {
|
||||
int fd;
|
||||
uint32 ip;
|
||||
uint16 port;
|
||||
uint16 users; // user count on this server
|
||||
uint16 maintenance; // in maintenance mode?
|
||||
uint16 new_; // allows creating new chars?
|
||||
uint16 users; // user count on this server
|
||||
uint16 maintenance; // in maintenance mode?
|
||||
uint16 new_; // should display as 'new'?
|
||||
};
|
||||
|
||||
struct Login_Config {
|
||||
@ -53,42 +54,28 @@ struct Login_Config {
|
||||
bool console; // console input system enabled?
|
||||
bool new_account_flag; // autoregistration via _M/_F ?
|
||||
int start_limited_time; // new account expiration time (-1: unlimited)
|
||||
// bool case_sensitive; // are logins case sensitive ?
|
||||
bool use_md5_passwds; // work with password hashes instead of plaintext passwords?
|
||||
// bool login_gm_read; // should the login server handle info about gm accounts?
|
||||
int min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect
|
||||
bool online_check; // reject incoming players that are already registered as online ?
|
||||
bool check_client_version; // check the clientversion set in the clientinfo ?
|
||||
int client_version_to_connect; // the client version needed to connect (if checking is enabled)
|
||||
|
||||
// bool ipban; // perform IP blocking (via contents of `ipbanlist`) ?
|
||||
// bool dynamic_pass_failure_ban; // automatic IP blocking due to failed login attemps ?
|
||||
// unsigned int dynamic_pass_failure_ban_interval; // how far to scan the loginlog for password failures
|
||||
// unsigned int dynamic_pass_failure_ban_limit; // number of failures needed to trigger the ipban
|
||||
// unsigned int dynamic_pass_failure_ban_duration; // duration of the ipban
|
||||
bool admin_state; // is ladmin support enabled?
|
||||
char admin_pass[24]; // security password for ladmin
|
||||
char admin_allowed_host[32]; // host/ip that is allowed to connect as ladmin
|
||||
|
||||
bool ipban; // perform IP blocking (via contents of `ipbanlist`) ?
|
||||
bool dynamic_pass_failure_ban; // automatic IP blocking due to failed login attemps ?
|
||||
unsigned int dynamic_pass_failure_ban_interval; // how far to scan the loginlog for password failures
|
||||
unsigned int dynamic_pass_failure_ban_limit; // number of failures needed to trigger the ipban
|
||||
unsigned int dynamic_pass_failure_ban_duration; // duration of the ipban
|
||||
bool use_dnsbl; // dns blacklist blocking ?
|
||||
char dnsbl_servs[1024]; // comma-separated list of dnsbl servers
|
||||
|
||||
char account_engine[256]; // name of the engine to use (defaults to auto, for the first available engine)
|
||||
};
|
||||
|
||||
struct mmo_account {
|
||||
|
||||
int account_id;
|
||||
char sex;
|
||||
char userid[24];
|
||||
char pass[32+1]; // 23+1 for normal, 32+1 for md5-ed passwords
|
||||
char lastlogin[24];
|
||||
int logincount;
|
||||
uint32 state; // packet 0x006a value + 1 (0: compte OK)
|
||||
char email[40]; // e-mail (by default: a@a.com)
|
||||
char error_message[20]; // Message of error code #6 = Your are Prohibited to log in until %s (packet 0x006a)
|
||||
time_t unban_time; // # of seconds 1/1/1970 (timestamp): ban time limit of the account (0 = no ban)
|
||||
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
|
||||
char last_ip[16]; // save of last IP of connection
|
||||
char memo[255]; // a memo field
|
||||
int account_reg2_num;
|
||||
struct global_reg account_reg2[ACCOUNT_REG2_NUM]; // account script variables (stored on login server)
|
||||
};
|
||||
extern struct Login_Config login_config;
|
||||
|
||||
|
||||
#endif /* _LOGIN_H_ */
|
||||
|
14
src/login/loginlog.h
Normal file
14
src/login/loginlog.h
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#ifndef __LOGINLOG_H_INCLUDED__
|
||||
#define __LOGINLOG_H_INCLUDED__
|
||||
|
||||
|
||||
void login_log(uint32 ip, const char* username, int rcode, const char* message);
|
||||
bool loginlog_init(void);
|
||||
bool loginlog_final(void);
|
||||
bool loginlog_config_read(const char* w1, const char* w2);
|
||||
|
||||
|
||||
#endif // __LOGINLOG_H_INCLUDED__
|
93
src/login/loginlog_sql.c
Normal file
93
src/login/loginlog_sql.c
Normal file
@ -0,0 +1,93 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
#include "../common/mmo.h"
|
||||
#include "../common/socket.h"
|
||||
#include "../common/sql.h"
|
||||
#include "../common/strlib.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h> // exit
|
||||
|
||||
char log_db_ip[32] = "127.0.0.1";
|
||||
uint16 log_db_port = 3306;
|
||||
char log_db_id[32] = "ragnarok";
|
||||
char log_db_pw[32] = "ragnarok";
|
||||
char log_db_db[32] = "ragnarok";
|
||||
char log_db[32] = "log";
|
||||
|
||||
char loginlog_db[256] = "loginlog";
|
||||
Sql* sql_handle;
|
||||
bool enabled = false;
|
||||
|
||||
|
||||
/*=============================================
|
||||
* Records an event in the login log
|
||||
*---------------------------------------------*/
|
||||
void login_log(uint32 ip, const char* username, int rcode, const char* message)
|
||||
{
|
||||
char esc_username[NAME_LENGTH*2+1];
|
||||
char esc_message[255*2+1];
|
||||
int retcode;
|
||||
|
||||
if( !enabled )
|
||||
return;
|
||||
|
||||
Sql_EscapeStringLen(sql_handle, esc_username, username, strnlen(username, NAME_LENGTH));
|
||||
Sql_EscapeStringLen(sql_handle, esc_message, message, strnlen(message, 255));
|
||||
|
||||
retcode = Sql_Query(sql_handle,
|
||||
"INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%s', '%s', '%d', '%s')",
|
||||
loginlog_db, ip2str(ip,NULL), esc_username, rcode, message);
|
||||
|
||||
if( retcode != SQL_SUCCESS )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
}
|
||||
|
||||
bool loginlog_init(void)
|
||||
{
|
||||
sql_handle = Sql_Malloc();
|
||||
|
||||
if( SQL_ERROR == Sql_Connect(sql_handle, log_db_id, log_db_pw, log_db_ip, log_db_port, log_db_db) )
|
||||
{
|
||||
Sql_ShowDebug(sql_handle);
|
||||
Sql_Free(sql_handle);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
enabled = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool loginlog_final(void)
|
||||
{
|
||||
Sql_Free(sql_handle);
|
||||
sql_handle = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool loginlog_config_read(const char* key, const char* value)
|
||||
{
|
||||
if( strcmpi(key, "log_db_ip") == 0 )
|
||||
safestrncpy(log_db_ip, value, sizeof(log_db_ip));
|
||||
else
|
||||
if( strcmpi(key, "log_db_port") == 0 )
|
||||
log_db_port = (uint16)strtoul(value, NULL, 10);
|
||||
else
|
||||
if( strcmpi(key, "log_db_id") == 0 )
|
||||
safestrncpy(log_db_id, value, sizeof(log_db_id));
|
||||
else
|
||||
if( strcmpi(key, "log_db_pw") == 0 )
|
||||
safestrncpy(log_db_pw, value, sizeof(log_db_pw));
|
||||
else
|
||||
if( strcmpi(key, "log_db") == 0 )
|
||||
safestrncpy(log_db, value, sizeof(log_db));
|
||||
else
|
||||
if( strcmpi(key, "loginlog_db") == 0 )
|
||||
safestrncpy(loginlog_db, value, sizeof(loginlog_db));
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
74
src/login/loginlog_txt.c
Normal file
74
src/login/loginlog_txt.c
Normal file
@ -0,0 +1,74 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
#include "../common/mmo.h"
|
||||
#include "../common/core.h"
|
||||
#include "../common/malloc.h"
|
||||
#include "../common/socket.h"
|
||||
#include "../common/strlib.h"
|
||||
#include "../common/showmsg.h"
|
||||
#include "account.h"
|
||||
#include "login.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
char login_log_filename[1024] = "log/login.log";
|
||||
|
||||
|
||||
|
||||
/*=============================================
|
||||
* Records an event in the login log
|
||||
*---------------------------------------------*/
|
||||
void login_log(uint32 ip, const char* username, int rcode, const char* message)
|
||||
{
|
||||
FILE* log_fp;
|
||||
|
||||
if( !login_config.log_login )
|
||||
return;
|
||||
|
||||
log_fp = fopen(login_log_filename, "a");
|
||||
if( log_fp != NULL )
|
||||
{
|
||||
char esc_username[NAME_LENGTH*4+1];
|
||||
char esc_message[255*4+1];
|
||||
time_t raw_time;
|
||||
char str_time[24];
|
||||
|
||||
sv_escape_c(esc_username, username, NAME_LENGTH, NULL);
|
||||
sv_escape_c(esc_message, message, 255, NULL);
|
||||
|
||||
time(&raw_time);
|
||||
strftime(str_time, 24, login_config.date_format, localtime(&raw_time));
|
||||
str_time[23] = '\0';
|
||||
|
||||
fprintf(log_fp, "%s\t%s\t%s\t%d\t%s\n", str_time, ip2str(ip,NULL), esc_username, rcode, esc_message);
|
||||
|
||||
fclose(log_fp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool loginlog_config_read(const char* w1, const char* w2)
|
||||
{
|
||||
if(!strcmpi(w1, "login_log_filename"))
|
||||
safestrncpy(login_log_filename, w2, sizeof(login_log_filename));
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool loginlog_init(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool loginlog_final(void)
|
||||
{
|
||||
return true;
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
|
||||
COMMON_OBJ = ../common/obj_all/core.o ../common/obj_all/socket.o ../common/obj_all/timer.o \
|
||||
../common/obj_all/db.o ../common/obj_all/plugins.o ../common/obj_all/lock.o \
|
||||
../common/obj_all/malloc.o ../common/obj_all/showmsg.o ../common/obj_all/utils.o \
|
||||
../common/obj_all/strlib.o ../common/obj_all/grfio.o ../common/obj_all/mapindex.o \
|
||||
../common/obj_all/ers.o ../common/obj_all/md5calc.o ../common/obj_sql/sql.o
|
||||
COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \
|
||||
../common/version.h ../common/db.h ../common/plugins.h ../common/lock.h \
|
||||
../common/malloc.h ../common/showmsg.h ../common/utils.h ../common/strlib.h \
|
||||
../common/grfio.h ../common/mapindex.h \
|
||||
../common/ers.h ../common/md5calc.h ../common/sql.h
|
||||
|
||||
LOGIN_OBJ = obj_sql/login.o
|
||||
LOGIN_H = login.h
|
||||
|
||||
HAVE_MYSQL=@HAVE_MYSQL@
|
||||
ifeq ($(HAVE_MYSQL),yes)
|
||||
LOGIN_SERVER_SQL_DEPENDS=obj_sql $(LOGIN_OBJ) $(COMMON_OBJ)
|
||||
else
|
||||
LOGIN_SERVER_SQL_DEPENDS=needs_mysql
|
||||
endif
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
#####################################################################
|
||||
.PHONY : all login-server_sql clean help
|
||||
|
||||
all: login-server_sql
|
||||
|
||||
login-server_sql: $(LOGIN_SERVER_SQL_DEPENDS)
|
||||
@CC@ @LDFLAGS@ -o ../../login-server_sql@EXEEXT@ $(LOGIN_OBJ) $(COMMON_OBJ) @LIBS@ @MYSQL_LIBS@
|
||||
|
||||
clean:
|
||||
rm -rf *.o obj_sql ../../login-server_sql@EXEEXT@
|
||||
|
||||
help:
|
||||
@echo "possible targets are 'login-server_sql' 'all' 'clean' 'help'"
|
||||
@echo "'login-server_sql' - login server (SQL version)"
|
||||
@echo "'all' - builds all above targets"
|
||||
@echo "'clean' - cleans builds and objects"
|
||||
@echo "'help' - outputs this message"
|
||||
|
||||
#####################################################################
|
||||
|
||||
needs_mysql:
|
||||
@echo "MySQL not found or disabled by the configure script"
|
||||
@exit 1
|
||||
|
||||
obj_sql:
|
||||
-mkdir obj_sql
|
||||
|
||||
obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H)
|
||||
@CC@ @CFLAGS@ $(CUSTOM_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
|
||||
|
||||
# missing common object files
|
||||
../common/obj_all/%.o:
|
||||
@$(MAKE) -C ../common sql
|
||||
|
||||
../common/obj_sql/%.o:
|
||||
@$(MAKE) -C ../common sql
|
File diff suppressed because it is too large
Load Diff
@ -1,94 +0,0 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#ifndef _LOGIN_SQL_H_
|
||||
#define _LOGIN_SQL_H_
|
||||
|
||||
#include "../common/mmo.h" // NAME_LENGTH
|
||||
|
||||
#define LOGIN_CONF_NAME "conf/login_athena.conf"
|
||||
#define SQL_CONF_NAME "conf/inter_athena.conf"
|
||||
#define LAN_CONF_NAME "conf/subnet_athena.conf"
|
||||
|
||||
// supported encryption types: 1- passwordencrypt, 2- passwordencrypt2, 3- both
|
||||
#define PASSWORDENC 3
|
||||
|
||||
struct login_session_data {
|
||||
|
||||
int account_id;
|
||||
long login_id1;
|
||||
long login_id2;
|
||||
char sex;
|
||||
|
||||
char userid[NAME_LENGTH];
|
||||
char passwd[NAME_LENGTH];
|
||||
int passwdenc;
|
||||
char md5key[20];
|
||||
uint16 md5keylen;
|
||||
|
||||
char lastlogin[24];
|
||||
uint8 level;
|
||||
int version;
|
||||
|
||||
int fd;
|
||||
};
|
||||
|
||||
struct mmo_char_server {
|
||||
char name[20];
|
||||
int fd;
|
||||
uint32 ip;
|
||||
uint16 port;
|
||||
int users;
|
||||
int maintenance;
|
||||
int new_;
|
||||
};
|
||||
|
||||
struct Login_Config {
|
||||
|
||||
uint32 login_ip; // the address to bind to
|
||||
uint16 login_port; // the port to bind to
|
||||
unsigned int ip_sync_interval; // interval (in minutes) to execute a DNS/IP update (for dynamic IPs)
|
||||
bool log_login; // whether to log login server actions or not
|
||||
char date_format[32]; // date format used in messages
|
||||
bool console; // console input system enabled?
|
||||
bool new_account_flag; // autoregistration via _M/_F ?
|
||||
int start_limited_time; // new account expiration time (-1: unlimited)
|
||||
bool case_sensitive; // are logins case sensitive ?
|
||||
bool use_md5_passwds; // work with password hashes instead of plaintext passwords?
|
||||
bool login_gm_read; // should the login server handle info about gm accounts?
|
||||
int min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect
|
||||
bool online_check; // reject incoming players that are already registered as online ?
|
||||
bool check_client_version; // check the clientversion set in the clientinfo ?
|
||||
int client_version_to_connect; // the client version needed to connect (if checking is enabled)
|
||||
|
||||
bool ipban; // perform IP blocking (via contents of `ipbanlist`) ?
|
||||
bool dynamic_pass_failure_ban; // automatic IP blocking due to failed login attemps ?
|
||||
unsigned int dynamic_pass_failure_ban_interval; // how far to scan the loginlog for password failures
|
||||
unsigned int dynamic_pass_failure_ban_limit; // number of failures needed to trigger the ipban
|
||||
unsigned int dynamic_pass_failure_ban_duration; // duration of the ipban
|
||||
bool use_dnsbl; // dns blacklist blocking ?
|
||||
char dnsbl_servs[1024]; // comma-separated list of dnsbl servers
|
||||
|
||||
};
|
||||
|
||||
struct mmo_account {
|
||||
|
||||
int account_id;
|
||||
char sex;
|
||||
char userid[24];
|
||||
char pass[32+1]; // 23+1 for normal, 32+1 for md5-ed passwords
|
||||
char lastlogin[24];
|
||||
int logincount;
|
||||
uint32 state; // packet 0x006a value + 1 (0: compte OK)
|
||||
char email[40]; // e-mail (by default: a@a.com)
|
||||
char error_message[20]; // Message of error code #6 = Your are Prohibited to log in until %s (packet 0x006a)
|
||||
time_t unban_time; // # of seconds 1/1/1970 (timestamp): ban time limit of the account (0 = no ban)
|
||||
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
|
||||
char last_ip[16]; // save of last IP of connection
|
||||
char memo[255]; // a memo field
|
||||
int account_reg2_num;
|
||||
struct global_reg account_reg2[ACCOUNT_REG2_NUM]; // account script variables (stored on login server)
|
||||
};
|
||||
|
||||
|
||||
#endif /* _LOGIN_SQL_H_ */
|
@ -4187,19 +4187,6 @@ int atcommand_reloadscript(const int fd, struct map_session_data* sd, const char
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* @reloadgmdb - reloads gm levels from where they are stored (gm_account.txt / mysql database)
|
||||
*------------------------------------------*/
|
||||
int atcommand_reloadgmdb(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||
{
|
||||
nullpo_retr(-1, sd);
|
||||
chrif_reloadGMdb();
|
||||
|
||||
clif_displaymessage(fd, msg_txt(101)); // Login-server asked to reload GM accounts and their level.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* @mapinfo <map name> [0-3] by MC_Cameri
|
||||
* => Shows information about the map [map name]
|
||||
@ -6632,7 +6619,7 @@ int atcommand_adjgmlvl(const int fd, struct map_session_data* sd, const char* co
|
||||
return -1;
|
||||
}
|
||||
|
||||
pc_set_gm_level(pl_sd->status.account_id, newlev);
|
||||
sd->gmlevel = newlev;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -8191,7 +8178,7 @@ int atcommand_request(const int fd, struct map_session_data* sd, const char* com
|
||||
}
|
||||
|
||||
sprintf(atcmd_output, msg_txt(278), message); // (@request): %s
|
||||
intif_wis_message_to_gm(sd->status.name, lowest_gm_level, atcmd_output);
|
||||
intif_wis_message_to_gm(sd->status.name, battle_config.lowest_gm_level, atcmd_output);
|
||||
clif_disp_onlyself(sd, atcmd_output, strlen(atcmd_output));
|
||||
clif_displaymessage(sd->fd,msg_txt(279)); // @request sent.
|
||||
return 0;
|
||||
@ -8400,7 +8387,6 @@ AtCommandInfo atcommand_info[] = {
|
||||
{ "reloadmobdb", 99, atcommand_reloadmobdb },
|
||||
{ "reloadskilldb", 99, atcommand_reloadskilldb },
|
||||
{ "reloadscript", 99, atcommand_reloadscript },
|
||||
{ "reloadgmdb", 99, atcommand_reloadgmdb },
|
||||
{ "reloadatcommand", 99, atcommand_reloadatcommand },
|
||||
{ "reloadbattleconf", 99, atcommand_reloadbattleconf },
|
||||
{ "reloadstatusdb", 99, atcommand_reloadstatusdb },
|
||||
|
@ -3395,6 +3395,7 @@ static const struct _battle_data {
|
||||
{ "guild_max_castles", &battle_config.guild_max_castles, 0, 0, INT_MAX, },
|
||||
{ "guild_skill_relog_delay", &battle_config.guild_skill_relog_delay, 0, 0, 1, },
|
||||
{ "emergency_call", &battle_config.emergency_call, 11, 0, 31, },
|
||||
{ "lowest_gm_level", &battle_config.lowest_gm_level, 1, 0, 99, },
|
||||
{ "atcommand_gm_only", &battle_config.atc_gmonly, 0, 0, 1, },
|
||||
{ "atcommand_spawn_quantity_limit", &battle_config.atc_spawn_quantity_limit, 100, 0, INT_MAX, },
|
||||
{ "atcommand_slave_clone_limit", &battle_config.atc_slave_clone_limit, 25, 0, INT_MAX, },
|
||||
|
@ -141,6 +141,7 @@ extern struct Battle_Config
|
||||
int monster_max_aspd;
|
||||
int view_range_rate;
|
||||
int chase_range_rate;
|
||||
int lowest_gm_level;
|
||||
int atc_gmonly;
|
||||
int atc_spawn_quantity_limit;
|
||||
int atc_slave_clone_limit;
|
||||
|
127
src/map/chrif.c
127
src/map/chrif.c
@ -36,7 +36,7 @@ static const int packet_len_table[0x3d] = { // U - used, F - free
|
||||
60, 3,-1,27,10,-1, 6,-1, // 2af8-2aff: U->2af8, U->2af9, U->2afa, U->2afb, U->2afc, U->2afd, U->2afe, U->2aff
|
||||
6,-1,18, 7,-1,35,30,-1, // 2b00-2b07: U->2b00, U->2b01, U->2b02, U->2b03, U->2b04, U->2b05, U->2b06, F->2b07
|
||||
6,30,-1,-1,86, 7,44,34, // 2b08-2b0f: U->2b08, U->2b09, F->2b0a, F->2b0b, U->2b0c, U->2b0d, U->2b0e, U->2b0f
|
||||
11,10,10, 6,11,-1,266,10, // 2b10-2b17: U->2b10, U->2b11, U->2b12, U->2b13, U->2b14, U->2b15, U->2b16, U->2b17
|
||||
11,10,10, 6,11,-1,266,10, // 2b10-2b17: U->2b10, U->2b11, U->2b12, U->2b13, U->2b14, F->2b15, U->2b16, U->2b17
|
||||
2,10, 2,-1,-1,-1, 2, 7, // 2b18-2b1f: U->2b18, U->2b19, U->2b1a, U->2b1b, U->2b1c, U->2b1d, U->2b1e, U->2b1f
|
||||
-1,10, 8, 2, 2,14,19,19, // 2b20-2b27: U->2b20, U->2b21, U->2b22, U->2b23, U->2b24, U->2b25, U->2b26, U->2b27
|
||||
};
|
||||
@ -71,7 +71,7 @@ static const int packet_len_table[0x3d] = { // U - used, F - free
|
||||
//2b12: Incoming, chrif_divorceack -> 'divorce chars
|
||||
//2b13: Incoming, chrif_accountdeletion -> 'Delete acc XX, if the player is on, kick ....'
|
||||
//2b14: Incoming, chrif_accountban -> 'not sure: kick the player with message XY'
|
||||
//2b15: Incoming, chrif_recvgmaccounts -> 'receive gm accs from charserver (seems to be incomplete !)'
|
||||
//2b15: FREE
|
||||
//2b16: Outgoing, chrif_ragsrvinfo -> 'sends motd / rates ....'
|
||||
//2b17: Outgoing, chrif_char_offline -> 'tell the charserver that the char is now offline'
|
||||
//2b18: Outgoing, chrif_char_reset_offline -> 'set all players OFF!'
|
||||
@ -512,56 +512,58 @@ int chrif_scdata_request(int account_id, int char_id)
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* new auth system [Kevin]
|
||||
* Request auth confirmation
|
||||
*------------------------------------------*/
|
||||
void chrif_authreq(struct map_session_data *sd)
|
||||
{
|
||||
struct auth_node *node= chrif_search(sd->bl.id);
|
||||
|
||||
if(!node) {
|
||||
//request data from char server and store current auth info
|
||||
WFIFOHEAD(char_fd,19);
|
||||
WFIFOW(char_fd,0) = 0x2b26;
|
||||
WFIFOL(char_fd,2) = sd->status.account_id;
|
||||
WFIFOL(char_fd,6) = sd->status.char_id;
|
||||
WFIFOL(char_fd,10) = sd->login_id1;
|
||||
WFIFOB(char_fd,14) = sd->status.sex;
|
||||
WFIFOL(char_fd,15) = htonl(session[sd->fd]->client_addr);
|
||||
WFIFOSET(char_fd,19);
|
||||
chrif_sd_to_auth(sd, ST_LOGIN);
|
||||
if( node != NULL )
|
||||
{
|
||||
set_eof(sd->fd);
|
||||
return;
|
||||
} else { //char already online? kick connect request and tell char server that this person is online
|
||||
//This case shouldn't happen in an ideal system
|
||||
pc_authfail(sd);
|
||||
chrif_char_online(sd);
|
||||
}
|
||||
return;
|
||||
|
||||
WFIFOHEAD(char_fd,19);
|
||||
WFIFOW(char_fd,0) = 0x2b26;
|
||||
WFIFOL(char_fd,2) = sd->status.account_id;
|
||||
WFIFOL(char_fd,6) = sd->status.char_id;
|
||||
WFIFOL(char_fd,10) = sd->login_id1;
|
||||
WFIFOB(char_fd,14) = sd->status.sex;
|
||||
WFIFOL(char_fd,15) = htonl(session[sd->fd]->client_addr);
|
||||
WFIFOSET(char_fd,19);
|
||||
chrif_sd_to_auth(sd, ST_LOGIN);
|
||||
}
|
||||
|
||||
//character selected, insert into auth db
|
||||
/*==========================================
|
||||
* Auth confirmation ack
|
||||
*------------------------------------------*/
|
||||
void chrif_authok(int fd)
|
||||
{
|
||||
int account_id;
|
||||
uint32 login_id1;
|
||||
time_t expiration_time;
|
||||
uint32 login_id2;
|
||||
time_t expiration_time;
|
||||
int gmlevel;
|
||||
struct mmo_charstatus* status;
|
||||
int char_id;
|
||||
struct auth_node *node;
|
||||
TBL_PC* sd;
|
||||
|
||||
//Check if both servers agree on the struct's size
|
||||
if( RFIFOW(fd,2) - 20 != sizeof(struct mmo_charstatus) )
|
||||
if( RFIFOW(fd,2) - 24 != sizeof(struct mmo_charstatus) )
|
||||
{
|
||||
ShowError("chrif_authok: Data size mismatch! %d != %d\n", RFIFOW(fd,2) - 20, sizeof(struct mmo_charstatus));
|
||||
ShowError("chrif_authok: Data size mismatch! %d != %d\n", RFIFOW(fd,2) - 24, sizeof(struct mmo_charstatus));
|
||||
return;
|
||||
}
|
||||
|
||||
account_id = RFIFOL(fd,4);
|
||||
login_id1 = RFIFOL(fd,8);
|
||||
expiration_time = (time_t)(int32)RFIFOL(fd,12);
|
||||
login_id2 = RFIFOL(fd,16);
|
||||
status = (struct mmo_charstatus*)RFIFOP(fd,20);
|
||||
login_id2 = RFIFOL(fd,12);
|
||||
expiration_time = (time_t)(int32)RFIFOL(fd,16);
|
||||
gmlevel = RFIFOL(fd,20);
|
||||
status = (struct mmo_charstatus*)RFIFOP(fd,24);
|
||||
|
||||
char_id = status->char_id;
|
||||
|
||||
//Check if we don't already have player data in our server
|
||||
@ -569,33 +571,35 @@ void chrif_authok(int fd)
|
||||
if ((sd = map_id2sd(account_id)) != NULL)
|
||||
return;
|
||||
|
||||
if ((node = chrif_search(account_id)))
|
||||
{ //Is the character already awaiting authorization?
|
||||
if (node->state != ST_LOGIN)
|
||||
return; //character in logout phase, do not touch that data.
|
||||
if (node->sd)
|
||||
{
|
||||
sd = node->sd;
|
||||
if(node->char_dat == NULL &&
|
||||
node->account_id == account_id &&
|
||||
node->char_id == char_id &&
|
||||
node->login_id1 == login_id1 )
|
||||
{ //Auth Ok
|
||||
if (pc_authok(sd, login_id2, expiration_time, status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
} else { //Auth Failed
|
||||
pc_authfail(sd);
|
||||
}
|
||||
chrif_char_offline(sd); //Set client offline
|
||||
chrif_auth_delete(account_id, char_id, ST_LOGIN);
|
||||
return;
|
||||
}
|
||||
if ((node = chrif_search(account_id)) == NULL)
|
||||
return; // should not happen
|
||||
|
||||
if (node->state != ST_LOGIN)
|
||||
return; //character in logout phase, do not touch that data.
|
||||
|
||||
if (node->sd == NULL)
|
||||
{
|
||||
/*
|
||||
//When we receive double login info and the client has not connected yet,
|
||||
//discard the older one and keep the new one.
|
||||
chrif_auth_delete(node->account_id, node->char_id, ST_LOGIN);
|
||||
*/
|
||||
return; // should not happen
|
||||
}
|
||||
|
||||
sd = node->sd;
|
||||
if(node->char_dat == NULL &&
|
||||
node->account_id == account_id &&
|
||||
node->char_id == char_id &&
|
||||
node->login_id1 == login_id1 )
|
||||
{ //Auth Ok
|
||||
if (pc_authok(sd, login_id2, expiration_time, gmlevel, status))
|
||||
return;
|
||||
} else { //Auth Failed
|
||||
pc_authfail(sd);
|
||||
}
|
||||
chrif_char_offline(sd); //Set him offline, the char server likely has it set as online already.
|
||||
chrif_auth_delete(account_id, char_id, ST_LOGIN);
|
||||
}
|
||||
|
||||
// client authentication failed
|
||||
@ -1035,30 +1039,6 @@ int chrif_disconnectplayer(int fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* Request to reload GM accounts and their levels: send to char-server by [Yor]
|
||||
*------------------------------------------*/
|
||||
int chrif_reloadGMdb(void)
|
||||
{
|
||||
chrif_check(-1);
|
||||
|
||||
WFIFOHEAD(char_fd,2);
|
||||
WFIFOW(char_fd,0) = 0x2af7;
|
||||
WFIFOSET(char_fd,2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* Receiving GM accounts and their levels from char-server by [Yor]
|
||||
*------------------------------------------*/
|
||||
int chrif_recvgmaccounts(int fd)
|
||||
{
|
||||
int nAccounts = pc_read_gm_account(fd);
|
||||
ShowInfo("From login-server: receiving information of '"CL_WHITE"%d"CL_RESET"' GM accounts.\n", nAccounts);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* Request/Receive top 10 Fame character list
|
||||
*------------------------------------------*/
|
||||
@ -1454,7 +1434,6 @@ int chrif_parse(int fd)
|
||||
case 0x2b12: chrif_divorceack(RFIFOL(fd,2), RFIFOL(fd,6)); break;
|
||||
case 0x2b13: chrif_accountdeletion(fd); break;
|
||||
case 0x2b14: chrif_accountban(fd); break;
|
||||
case 0x2b15: chrif_recvgmaccounts(fd); break;
|
||||
case 0x2b1b: chrif_recvfamelist(fd); break;
|
||||
case 0x2b1d: chrif_load_scdata(fd); break;
|
||||
case 0x2b1e: chrif_update_ip(fd); break;
|
||||
|
@ -44,7 +44,6 @@ int chrif_changemapserver(struct map_session_data* sd, uint32 ip, uint16 port);
|
||||
int chrif_searchcharid(int char_id);
|
||||
int chrif_changeemail(int id, const char *actual_email, const char *new_email);
|
||||
int chrif_char_ask_name(int acc, const char* character_name, unsigned short operation_type, int year, int month, int day, int hour, int minute, int second);
|
||||
int chrif_reloadGMdb(void);
|
||||
int chrif_updatefamelist(struct map_session_data *sd);
|
||||
int chrif_buildfamelist(void);
|
||||
int chrif_save_scdata(struct map_session_data *sd);
|
||||
|
@ -79,8 +79,6 @@ Sql* logmysql_handle;
|
||||
|
||||
#endif /* not TXT_ONLY */
|
||||
|
||||
int lowest_gm_level = 1;
|
||||
|
||||
// This param using for sending mainchat
|
||||
// messages like whispers to this nick. [LuzZza]
|
||||
char main_chat_nick[16] = "Main";
|
||||
@ -2955,13 +2953,8 @@ int inter_config_read(char *cfgName)
|
||||
i=sscanf(line,"%[^:]: %[^\r\n]",w1,w2);
|
||||
if(i!=2)
|
||||
continue;
|
||||
if(strcmpi(w1,"party_share_level")==0){
|
||||
party_share_level = config_switch(w2);
|
||||
} else if(strcmpi(w1,"lowest_gm_level")==0){
|
||||
lowest_gm_level = atoi(w2);
|
||||
|
||||
/* Main chat nick [LuzZza] */
|
||||
} else if(strcmpi(w1, "main_chat_nick")==0){
|
||||
|
||||
if(strcmpi(w1, "main_chat_nick")==0){
|
||||
strcpy(main_chat_nick, w2);
|
||||
|
||||
#ifndef TXT_ONLY
|
||||
@ -3068,37 +3061,6 @@ int log_sql_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*=============================================
|
||||
* Does a mysql_ping to all connection handles
|
||||
*---------------------------------------------*/
|
||||
int map_sql_ping(int tid, unsigned int tick, int id, intptr data)
|
||||
{
|
||||
ShowInfo("Pinging SQL server to keep connection alive...\n");
|
||||
Sql_Ping(mmysql_handle);
|
||||
if (log_config.sql_logs)
|
||||
Sql_Ping(logmysql_handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sql_ping_init(void)
|
||||
{
|
||||
uint32 connection_timeout, connection_ping_interval;
|
||||
|
||||
// set a default value
|
||||
connection_timeout = 28800; // 8 hours
|
||||
|
||||
// ask the mysql server for the timeout value
|
||||
Sql_GetTimeout(mmysql_handle, &connection_timeout);
|
||||
if (connection_timeout < 60)
|
||||
connection_timeout = 60;
|
||||
|
||||
// establish keepalive
|
||||
connection_ping_interval = connection_timeout - 30; // 30-second reserve
|
||||
add_timer_func_list(map_sql_ping, "map_sql_ping");
|
||||
add_timer_interval(gettick() + connection_ping_interval*1000, map_sql_ping, 0, 0, connection_ping_interval*1000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* not TXT_ONLY */
|
||||
|
||||
int map_db_final(DBKey k,void *d,va_list ap)
|
||||
@ -3436,8 +3398,6 @@ int do_init(int argc, char *argv[])
|
||||
#ifndef TXT_ONLY /* mail system [Valaris] */
|
||||
if (log_config.sql_logs)
|
||||
log_sql_init();
|
||||
|
||||
sql_ping_init();
|
||||
#endif /* not TXT_ONLY */
|
||||
|
||||
npc_event_do_oninit(); // npc‚ÌOnInitƒCƒxƒ“ƒg?<3F>s
|
||||
|
@ -633,7 +633,6 @@ typedef struct homun_data TBL_HOM;
|
||||
( ((bl) == (struct block_list*)NULL || (bl)->type != (type_)) ? (T ## type_ *)NULL : (T ## type_ *)(bl) )
|
||||
|
||||
|
||||
extern int lowest_gm_level;
|
||||
extern char main_chat_nick[16];
|
||||
|
||||
#ifndef TXT_ONLY
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "pc.h" // struct map_session_data
|
||||
#include "script.h" // set_var()
|
||||
|
||||
#include "pcre.h"
|
||||
#include <pcre.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
|
||||
static DBMap* party_db; // int party_id -> struct party_data*
|
||||
int party_share_level = 10;
|
||||
int party_send_xy_timer(int tid, unsigned int tick, int id, intptr data);
|
||||
|
||||
/*==========================================
|
||||
|
@ -31,8 +31,6 @@ struct party_data {
|
||||
};
|
||||
|
||||
|
||||
extern int party_share_level;
|
||||
|
||||
void do_init_party(void);
|
||||
void do_final_party(void);
|
||||
struct party_data* party_search(int party_id);
|
||||
|
54
src/map/pc.c
54
src/map/pc.c
@ -6,7 +6,7 @@
|
||||
#include "../common/malloc.h"
|
||||
#include "../common/nullpo.h"
|
||||
#include "../common/showmsg.h"
|
||||
#include "../common/socket.h" // RFIFO*()
|
||||
#include "../common/socket.h" // session[]
|
||||
#include "../common/strlib.h" // safestrncpy()
|
||||
#include "../common/timer.h"
|
||||
#include "../common/utils.h"
|
||||
@ -58,9 +58,6 @@ struct fame_list taekwon_fame_list[MAX_FAME_LIST];
|
||||
|
||||
static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_AMMO};
|
||||
|
||||
static struct gm_account *gm_account = NULL;
|
||||
static int GM_num = 0;
|
||||
|
||||
#define MOTD_LINE_SIZE 128
|
||||
char motd_text[MOTD_LINE_SIZE][256]; // Message of the day buffer [Valaris]
|
||||
|
||||
@ -85,34 +82,7 @@ int pc_class2idx(int class_) {
|
||||
|
||||
int pc_isGM(struct map_session_data* sd)
|
||||
{
|
||||
int i;
|
||||
nullpo_retr(0, sd);
|
||||
|
||||
if( sd->bl.type != BL_PC )
|
||||
return 99;
|
||||
|
||||
ARR_FIND( 0, GM_num, i, gm_account[i].account_id == sd->status.account_id );
|
||||
return ( i < GM_num ) ? gm_account[i].level : 0;
|
||||
}
|
||||
|
||||
int pc_set_gm_level(int account_id, int level)
|
||||
{
|
||||
int i;
|
||||
|
||||
ARR_FIND( 0, GM_num, i, account_id == gm_account[i].account_id );
|
||||
if( i < GM_num )
|
||||
{
|
||||
gm_account[i].level = level;
|
||||
}
|
||||
else
|
||||
{
|
||||
gm_account = (struct gm_account *) aRealloc(gm_account, (GM_num + 1) * sizeof(struct gm_account));
|
||||
gm_account[GM_num].account_id = account_id;
|
||||
gm_account[GM_num].level = level;
|
||||
GM_num++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return sd->gmlevel;
|
||||
}
|
||||
|
||||
static int pc_invincible_timer(int tid, unsigned int tick, int id, intptr data)
|
||||
@ -709,12 +679,13 @@ int pc_isequip(struct map_session_data *sd,int n)
|
||||
* session idに問題無し
|
||||
* char鯖から送られてきたステ?タスを設定
|
||||
*------------------------------------------*/
|
||||
bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, struct mmo_charstatus *st)
|
||||
bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int gmlevel, struct mmo_charstatus *st)
|
||||
{
|
||||
int i;
|
||||
unsigned long tick = gettick();
|
||||
|
||||
sd->login_id2 = login_id2;
|
||||
sd->gmlevel = gmlevel;
|
||||
memcpy(&sd->status, st, sizeof(*st));
|
||||
|
||||
if (st->sex != sd->status.sex) {
|
||||
@ -6925,21 +6896,6 @@ int pc_autosave(int tid, unsigned int tick, int id, intptr data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pc_read_gm_account(int fd)
|
||||
{
|
||||
//FIXME: this implementation is a total failure (direct reading from RFIFO) [ultramage]
|
||||
int i = 0;
|
||||
if (gm_account != NULL)
|
||||
aFree(gm_account);
|
||||
GM_num = 0;
|
||||
gm_account = (struct gm_account *) aMallocA(((RFIFOW(fd,2) - 4) / 5)*sizeof(struct gm_account));
|
||||
for (i = 4; i < RFIFOW(fd,2); i += 5) {
|
||||
gm_account[GM_num].account_id = RFIFOL(fd,i);
|
||||
gm_account[GM_num].level = (int)RFIFOB(fd,i+4);
|
||||
GM_num++;
|
||||
}
|
||||
return GM_num;
|
||||
}
|
||||
static int pc_daynight_timer_sub(struct map_session_data *sd,va_list ap)
|
||||
{
|
||||
if (sd->state.night != night_flag && map[sd->bl.m].flag.nightenabled)
|
||||
@ -7487,8 +7443,6 @@ int pc_read_motd(void)
|
||||
*------------------------------------------*/
|
||||
void do_final_pc(void)
|
||||
{
|
||||
if (gm_account)
|
||||
aFree(gm_account);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,7 @@ struct map_session_data {
|
||||
} special_state;
|
||||
int login_id1, login_id2;
|
||||
unsigned short class_; //This is the internal job ID used by the map server to simplify comparisons/queries/etc. [Skotlex]
|
||||
int gmlevel;
|
||||
|
||||
int packet_ver; // 5: old, 6: 7july04, 7: 13july04, 8: 26july04, 9: 9aug04/16aug04/17aug04, 10: 6sept04, 11: 21sept04, 12: 18oct04, 13: 25oct04 ... 18
|
||||
struct mmo_charstatus status;
|
||||
@ -498,7 +499,7 @@ int pc_setrestartvalue(struct map_session_data *sd,int type);
|
||||
int pc_makesavestatus(struct map_session_data *);
|
||||
void pc_respawn(struct map_session_data* sd, uint8 clrtype);
|
||||
int pc_setnewpc(struct map_session_data*,int,int,int,unsigned int,int,int);
|
||||
bool pc_authok(struct map_session_data*, int, time_t, struct mmo_charstatus *);
|
||||
bool pc_authok(struct map_session_data* sd, int, time_t, int gmlevel, struct mmo_charstatus* status);
|
||||
void pc_authfail(struct map_session_data *);
|
||||
int pc_reg_received(struct map_session_data *sd);
|
||||
|
||||
@ -655,7 +656,6 @@ struct map_session_data *pc_get_child(struct map_session_data *sd);
|
||||
void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick);
|
||||
void pc_regen (struct map_session_data *sd, unsigned int diff_tick);
|
||||
|
||||
int pc_set_gm_level(int account_id, int level);
|
||||
void pc_setstand(struct map_session_data *sd);
|
||||
int pc_candrop(struct map_session_data *sd,struct item *item);
|
||||
|
||||
@ -685,7 +685,6 @@ struct sg_data {
|
||||
};
|
||||
extern const struct sg_data sg_info[3];
|
||||
|
||||
int pc_read_gm_account(int fd);
|
||||
void pc_setinvincibletimer(struct map_session_data* sd, int val);
|
||||
void pc_delinvincibletimer(struct map_session_data* sd);
|
||||
|
||||
|
@ -70,7 +70,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
|
||||
}
|
||||
|
||||
//Fixed. Only real GMs can request trade from far away! [Lupus]
|
||||
if (level < lowest_gm_level && (sd->bl.m != target_sd->bl.m ||
|
||||
if (level < battle_config.lowest_gm_level && (sd->bl.m != target_sd->bl.m ||
|
||||
!check_distance_bl(&sd->bl, &target_sd->bl, TRADE_DISTANCE)
|
||||
)) {
|
||||
clif_tradestart(sd, 0); // too far
|
||||
@ -127,7 +127,7 @@ void trade_tradeack(struct map_session_data *sd, int type)
|
||||
return; //If client didn't send accept, it's a broken packet?
|
||||
|
||||
//Copied here as well since the original character could had warped.
|
||||
if (pc_isGM(tsd) < lowest_gm_level && (sd->bl.m != tsd->bl.m ||
|
||||
if (pc_isGM(tsd) < battle_config.lowest_gm_level && (sd->bl.m != tsd->bl.m ||
|
||||
!check_distance_bl(&sd->bl, &tsd->bl, TRADE_DISTANCE)
|
||||
)) {
|
||||
clif_tradestart(sd, 0); // too far
|
||||
|
@ -1,157 +1,50 @@
|
||||
// (c) eAthena Dev Team - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
#include "../common/mmo.h"
|
||||
#include "../common/core.h"
|
||||
#include "../common/db.h"
|
||||
#include "../common/showmsg.h"
|
||||
#include "../common/sql.h"
|
||||
#include "../common/malloc.h"
|
||||
#define WITH_TXT
|
||||
#define WITH_SQL
|
||||
|
||||
#include "../common/cbasetypes.h"
|
||||
#include "../common/mmo.h" // struct mmo_account
|
||||
#include "../common/core.h"
|
||||
#include "../common/showmsg.h"
|
||||
#include "../login/account.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
char login_account_id[256]="account_id";
|
||||
char login_userid[256]="userid";
|
||||
char login_user_pass[256]="user_pass";
|
||||
char login_db[256]="login";
|
||||
char globalreg_db[256]="global_reg_value";
|
||||
#define LOGIN_CONF_NAME "conf/login_athena.conf"
|
||||
|
||||
static DBMap* gm_account_db=NULL; // int account_id -> struct gm_account*
|
||||
AccountDB* txtdb = NULL;
|
||||
AccountDB* sqldb = NULL;
|
||||
|
||||
int db_server_port = 3306;
|
||||
char db_server_ip[32] = "127.0.0.1";
|
||||
char db_server_id[32] = "ragnarok";
|
||||
char db_server_pw[32] = "ragnarok";
|
||||
char db_server_logindb[32] = "ragnarok";
|
||||
|
||||
#define INTER_CONF_NAME "conf/inter_athena.conf"
|
||||
#define GM_ACCOUNT_NAME "conf/GM_account.txt"
|
||||
#define ACCOUNT_TXT_NAME "save/account.txt"
|
||||
//--------------------------------------------------------
|
||||
|
||||
int isGM(int account_id)
|
||||
{
|
||||
struct gm_account* p = (struct gm_account*)idb_get(gm_account_db,account_id);
|
||||
return( p != NULL ) ? p->level : 0;
|
||||
}
|
||||
|
||||
int read_gm_account()
|
||||
{
|
||||
char line[8192];
|
||||
struct gm_account *p;
|
||||
FILE *fp;
|
||||
int line_counter = 0, gm_counter = 0;
|
||||
|
||||
ShowStatus("Starting reading gm_account\n");
|
||||
|
||||
if( (fp = fopen(GM_ACCOUNT_NAME,"r")) == NULL )
|
||||
return 1;
|
||||
|
||||
gm_account_db = idb_alloc(DB_OPT_RELEASE_DATA);
|
||||
|
||||
while(fgets(line,sizeof(line),fp))
|
||||
{
|
||||
line_counter++;
|
||||
if ((line[0] == '/' && line[1] == '/') || line[0] == '\0' || line[0] == '\n' || line[0] == '\r')
|
||||
continue;
|
||||
|
||||
p = (struct gm_account*)aMalloc(sizeof(struct gm_account));
|
||||
if(p==NULL){
|
||||
ShowFatalError("gm_account: out of memory!\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if(sscanf(line,"%d %d",&p->account_id,&p->level) != 2 || p->level <= 0) {
|
||||
ShowWarning("gm_account: unsupported data format [conf/GM_account.txt] on line %d\n", line_counter);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if(p->level > 99)
|
||||
p->level = 99;
|
||||
p = (struct gm_account*)idb_put(gm_account_db,p->account_id,p);
|
||||
if( p )
|
||||
aFree(p);// old entry replaced
|
||||
gm_counter++;
|
||||
ShowInfo("GM ID: %d Level: %d\n",p->account_id,p->level);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
ShowStatus("%d ID of gm_accounts read.\n", gm_counter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int convert_login(void)
|
||||
{
|
||||
Sql* mysql_handle;
|
||||
SqlStmt* stmt;
|
||||
int line_counter = 0;
|
||||
FILE *fp;
|
||||
int account_id, logincount, user_level, state, n, i;
|
||||
char line[2048], userid[2048], pass[2048], lastlogin[2048], sex, email[2048], error_message[2048], last_ip[2048], memo[2048];
|
||||
int unban_time, expiration_time;
|
||||
char dummy[2048];
|
||||
AccountDBIterator* iter;
|
||||
struct mmo_account acc;
|
||||
|
||||
mysql_handle = Sql_Malloc();
|
||||
if ( SQL_ERROR == Sql_Connect(mysql_handle, db_server_id, db_server_pw, db_server_ip, db_server_port, db_server_logindb) )
|
||||
if( !txtdb->init(txtdb) || !sqldb->init(sqldb) )
|
||||
{
|
||||
Sql_ShowDebug(mysql_handle);
|
||||
Sql_Free(mysql_handle);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
ShowStatus("Connect: Success!\n");
|
||||
|
||||
ShowStatus("Convert start...\n");
|
||||
fp = fopen(ACCOUNT_TXT_NAME,"r");
|
||||
if(fp == NULL)
|
||||
ShowFatalError("Initialization failed, unable to start conversion.\n");
|
||||
return 0;
|
||||
|
||||
while(fgets(line,sizeof(line),fp) != NULL)
|
||||
{
|
||||
line_counter++;
|
||||
if(line[0]=='/' && line[1]=='/')
|
||||
continue;
|
||||
|
||||
i = sscanf(line, "%d\t%[^\t]\t%[^\t]\t%[^\t]\t%c\t%d\t%d\t%[^\t]\t%[^\t]\t%d\t%[^\t]\t%[^\t]\t%d\t%[^\r\n]%n",
|
||||
&account_id, userid, pass, lastlogin, &sex, &logincount, &state,
|
||||
email, error_message, &expiration_time, last_ip, memo, &unban_time, dummy, &n);
|
||||
|
||||
if (i < 13) {
|
||||
ShowWarning("Skipping incompatible data on line %d\n", line_counter);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i > 13)
|
||||
ShowWarning("Reading login account variables is not implemented, data will be lost! (line %d)\n", line_counter);
|
||||
|
||||
user_level = isGM(account_id);
|
||||
ShowInfo("Converting user (id: %d, name: %s, gm level: %d)\n", account_id, userid, user_level);
|
||||
|
||||
stmt = SqlStmt_Malloc(mysql_handle);
|
||||
if( SQL_ERROR == SqlStmt_Prepare(stmt,
|
||||
"REPLACE INTO `login` "
|
||||
"(`account_id`, `userid`, `user_pass`, `lastlogin`, `sex`, `logincount`, `email`, `level`, `error_message`, `expiration_time`, `last_ip`, `memo`, `unban_time`, `state`) "
|
||||
"VALUES "
|
||||
"(%d, ?, ?, '%s', '%c', %d, '%s', %d, '%s', %d, '%s', '%s', %d, %d)",
|
||||
account_id, lastlogin, sex, logincount, email, user_level, error_message, expiration_time, last_ip, memo, unban_time, state)
|
||||
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_STRING, userid, strnlen(userid, 255))
|
||||
|| SQL_ERROR == SqlStmt_BindParam(stmt, 1, SQLDT_STRING, pass, strnlen(pass, 32))
|
||||
|| SQL_ERROR == SqlStmt_Execute(stmt) )
|
||||
{
|
||||
SqlStmt_ShowDebug(stmt);
|
||||
}
|
||||
SqlStmt_Free(stmt);
|
||||
|
||||
//TODO: parse the rest of the line to read the login-stored account variables, and import them to `global_reg_value`
|
||||
// then remove the 'dummy' buffer
|
||||
}
|
||||
fclose(fp);
|
||||
Sql_Free(mysql_handle);
|
||||
|
||||
ShowStatus("Convert end...\n");
|
||||
ShowStatus("Conversion started...\n");
|
||||
//TODO: do some counting & statistics
|
||||
|
||||
iter = txtdb->iterator(txtdb);
|
||||
while( iter->next(iter, &acc) )
|
||||
{
|
||||
ShowInfo("Converting user (id: %d, name: %s, gm level: %d)...", acc.account_id, acc.userid, acc.level);
|
||||
if( sqldb->create(sqldb, &acc) )
|
||||
ShowMessage(CL_GREEN "success.\n");
|
||||
else
|
||||
ShowMessage(CL_RED "failed!\n");
|
||||
}
|
||||
iter->destroy(iter);
|
||||
|
||||
ShowStatus("Conversion finished.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -162,7 +55,7 @@ int login_config_read(const char* cfgName)
|
||||
char line[1024], w1[1024], w2[1024];
|
||||
FILE *fp;
|
||||
|
||||
ShowStatus("Start reading interserver configuration: %s\n", cfgName);
|
||||
ShowStatus("Start reading login server configuration: %s\n", cfgName);
|
||||
|
||||
fp=fopen(cfgName,"r");
|
||||
if(fp==NULL){
|
||||
@ -179,56 +72,40 @@ int login_config_read(const char* cfgName)
|
||||
if(i!=2)
|
||||
continue;
|
||||
|
||||
//add for DB connection
|
||||
if(strcmpi(w1,"db_server_ip")==0){
|
||||
strcpy(db_server_ip, w2);
|
||||
ShowStatus("set db_server_ip : %s\n",w2);
|
||||
}
|
||||
else if(strcmpi(w1,"db_server_port")==0){
|
||||
db_server_port=atoi(w2);
|
||||
ShowStatus("set db_server_port : %s\n",w2);
|
||||
}
|
||||
else if(strcmpi(w1,"db_server_id")==0){
|
||||
strcpy(db_server_id, w2);
|
||||
ShowStatus("set db_server_id : %s\n",w2);
|
||||
}
|
||||
else if(strcmpi(w1,"db_server_pw")==0){
|
||||
strcpy(db_server_pw, w2);
|
||||
ShowStatus("set db_server_pw : %s\n",w2);
|
||||
}
|
||||
else if(strcmpi(w1,"db_server_logindb")==0){
|
||||
strcpy(db_server_logindb, w2);
|
||||
ShowStatus("set db_server_logindb : %s\n",w2);
|
||||
}
|
||||
txtdb->set_property(txtdb, w1, w2);
|
||||
sqldb->set_property(sqldb, w1, w2);
|
||||
|
||||
//support the import command, just like any other config
|
||||
else if(strcmpi(w1,"import")==0){
|
||||
if( strcmpi(w1,"import") == 0 )
|
||||
login_config_read(w2);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
ShowStatus("End reading interserver configuration...\n");
|
||||
ShowStatus("End reading login server configuration...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int do_init(int argc, char** argv)
|
||||
{
|
||||
int input;
|
||||
login_config_read( (argc > 1) ? argv[1] : INTER_CONF_NAME );
|
||||
read_gm_account();
|
||||
|
||||
txtdb = account_db_txt();
|
||||
sqldb = account_db_sql();
|
||||
|
||||
login_config_read( (argc > 1) ? argv[1] : LOGIN_CONF_NAME );
|
||||
|
||||
ShowInfo("\nWarning : Make sure you backup your databases before continuing!\n");
|
||||
ShowInfo("\nDo you wish to convert your Login Database to SQL? (y/n) : ");
|
||||
input = getchar();
|
||||
|
||||
if(input == 'y' || input == 'Y')
|
||||
convert_login();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void do_final(void)
|
||||
{
|
||||
if( gm_account_db )
|
||||
{
|
||||
db_destroy(gm_account_db);
|
||||
gm_account_db = NULL;
|
||||
}
|
||||
txtdb->destroy(txtdb);
|
||||
sqldb->destroy(sqldb);
|
||||
}
|
||||
|
@ -1,204 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
#=========================================================================
|
||||
# addaccount.cgi ver.1.00
|
||||
# ladminをラップした、アカウントを作成するCGI。
|
||||
# ladmin ver.1.04での動作を確認。
|
||||
#
|
||||
# ** 設定方法 **
|
||||
#
|
||||
# - 下の$ladmin変数にladminへのパスを設定すること。
|
||||
# - UNIX系OSで使用する場合はladminと共に改行コードを変換すること、また
|
||||
# ファイル先頭行をperlの正しいパスにすること。例> $ which perl
|
||||
# - サーバープログラムやブラウザによっては $cgiuri にこのファイルへの
|
||||
# 完全なURIをセットしなければならない場合もある。
|
||||
# - perlにパスが通っていない場合は $perl をperlへの正しいパスにすること。
|
||||
# - 他は普通のCGIと同じです。(実行権やcgi-binフォルダなど)
|
||||
#
|
||||
# ** その他 **
|
||||
# addaccount.cgi をブラウザで開くとサンプルHTML(そのまま使えます)が
|
||||
# 開きます。また、このcgiはブラウザから送られるAccept-Languageが
|
||||
# jaで始まっていればメッセージの一部を日本語に変換します。
|
||||
# (IEならインターネットオプションの言語設定で一番上に日本語を置く)
|
||||
# それ以外の場合は英語のまま出力します。
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
my($ladmin) = "../ladmin"; # ladminのパス(おそらく変更が必要)
|
||||
|
||||
my($cgiuri) = "./addaccount.cgi"; # このファイルのURI
|
||||
my($perl) = "perl"; # perlのコマンド名
|
||||
|
||||
|
||||
|
||||
#--------------------------- 設定ここまで --------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
use strict;
|
||||
use CGI;
|
||||
|
||||
my($cgi)= new CGI;
|
||||
my(%langconv)=(
|
||||
'Athena login-server administration tool.*' => '',
|
||||
'logged on.*' => '',
|
||||
);
|
||||
|
||||
# ----- 日本語環境なら変換テーブルをセット -----
|
||||
if($ENV{'HTTP_ACCEPT_LANGUAGE'}=~/^ja/){
|
||||
my(%tmp)=(
|
||||
'Account \[(.+)\] is successfully created.*'
|
||||
=> 'アカウント "$1" を作成しました.',
|
||||
'Account \[(.+)\] creation failed\. same account exists.*'
|
||||
=> 'アカウント "$1" は既に存在します.',
|
||||
'Illeagal charactor found in UserID.*'
|
||||
=> 'IDの中に不正な文字があります.',
|
||||
'Illeagal charactor found in Password.*'
|
||||
=> 'Passwordの中に不正な文字があります.',
|
||||
'input UserID 4-24 bytes.'
|
||||
=> 'IDは半角4~24文字で入力してください.',
|
||||
'input Password 4-24 bytes.'
|
||||
=> 'Passwordは半角4~24文字で入力してください.',
|
||||
'Illeagal gender.*'
|
||||
=> '性別がおかしいです.',
|
||||
'Cant connect to login server.*'
|
||||
=> 'ログインサーバーに接続できません.',
|
||||
'login error.*'
|
||||
=> 'ログインサーバーへの管理者権限ログインに失敗しました',
|
||||
"Can't execute ladmin.*"
|
||||
=> 'ladminの実行に失敗しました',
|
||||
'UserID "(.+)" is already used.*'
|
||||
=> 'ID "$1" は既に使用されています.',
|
||||
'You can use UserID \"(.+)\".*'
|
||||
=> 'ID "$1" は使用可能です.',
|
||||
|
||||
'account making' =>'アカウント作成',
|
||||
'\>UserID' =>'>ID',
|
||||
'\>Password' =>'>パスワード',
|
||||
'\>Gender' =>'>性別',
|
||||
'\>Male' =>'>男性',
|
||||
'\>Female' =>'>女性',
|
||||
'\"Make Account\"' =>'"アカウント作成"',
|
||||
'\"Check UserID\"' =>'"IDのチェック"',
|
||||
);
|
||||
map { $langconv{$_}=$tmp{$_}; } keys (%tmp);
|
||||
}
|
||||
|
||||
# ----- 追加 -----
|
||||
if( $cgi->param("addaccount") ){
|
||||
my($userid)= $cgi->param("userid");
|
||||
my($passwd)= $cgi->param("passwd");
|
||||
my($gender)= lc(substr($cgi->param("gender"),0,1));
|
||||
if(length($userid)<4 || length($userid)>24){
|
||||
HttpError("input UserID 4-24 bytes.");
|
||||
}
|
||||
if(length($passwd)<4 || length($passwd)>24){
|
||||
HttpError("input Password 4-24 bytes.");
|
||||
}
|
||||
if($userid=~/[^0-9A-Za-z\@\_\-\']/){
|
||||
HttpError("Illeagal charactor found in UserID.");
|
||||
}
|
||||
if($passwd=~/[\x00-\x1f\x80-\xff\']/){
|
||||
HttpError("Illeagal charactor found in Password.");
|
||||
}
|
||||
if($gender!~/[mf]/){
|
||||
HttpError("Gender error.");
|
||||
}
|
||||
open PIPE,"$perl $ladmin --add $userid $gender $passwd |"
|
||||
or HttpError("Can't execute ladmin.");
|
||||
my(@msg)=<PIPE>;
|
||||
close PIPE;
|
||||
HttpMsg(@msg);
|
||||
}
|
||||
# ----- 存在チェック -----
|
||||
elsif( $cgi->param("check") ){
|
||||
my($userid)= $cgi->param("userid");
|
||||
if(length($userid)<4 || length($userid)>24){
|
||||
HttpError("input UserID 4-24 bytes.");
|
||||
}
|
||||
if($userid=~/[^0-9A-Za-z\@\_\-\']/){
|
||||
HttpError("Illeagal charactor found in UserID.");
|
||||
}
|
||||
open PIPE,"$perl $ladmin --search --regex \\b$userid\\b |"
|
||||
or HttpError("Can't execute ladmin.");
|
||||
my(@msg)=<PIPE>;
|
||||
close PIPE;
|
||||
if(scalar(@msg)==6 && (split /[\s\0]+/,substr($msg[4],11,24))[0] eq $userid){
|
||||
HttpMsg("NG : UserID \"$userid\" is already used.");
|
||||
}elsif(scalar(@msg)==5){
|
||||
HttpMsg("OK : You can use UserID \"$userid\"");
|
||||
}
|
||||
HttpError("ladmin error ?\n---output---\n",@msg);
|
||||
}
|
||||
|
||||
# ----- フォーム -----
|
||||
else{
|
||||
print LangConv( <<"EOM" );
|
||||
Content-type: text/html\n
|
||||
<html>
|
||||
<head>
|
||||
<title>Athena account making cgi</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Athena account making cgi</h1>
|
||||
<form action="$cgiuri" method="post">
|
||||
<table border=2>
|
||||
<tr>
|
||||
<th>UserID</th>
|
||||
<td><input name="userid" size=24 maxlength=24></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Password</th>
|
||||
<td><input name="passwd" size=24 maxlength=24 type="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Gender</th>
|
||||
<td>
|
||||
<input type="radio" name="gender" value="male">Male
|
||||
<input type="radio" name="gender" value="female">Female
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<input type="submit" name="addaccount" value="Make Account">
|
||||
<input type="submit" name="check" value="Check UserID">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
EOM
|
||||
exit;
|
||||
}
|
||||
|
||||
sub LangConv {
|
||||
my(@lst)= @_;
|
||||
my($a,$b,@out)=();
|
||||
foreach $a(@lst){
|
||||
foreach $b(keys %langconv){
|
||||
$a=~s/$b/$langconv{$b}/g;
|
||||
my($rep1)=$1;
|
||||
$a=~s/\$1/$rep1/g;
|
||||
}
|
||||
push @out,$a;
|
||||
}
|
||||
return @out;
|
||||
}
|
||||
|
||||
sub HttpMsg {
|
||||
my($msg)=join("", LangConv(@_));
|
||||
$msg=~s/\n/<br>\n/g;
|
||||
print LangConv("Content-type: text/html\n\n"),$msg;
|
||||
exit;
|
||||
}
|
||||
|
||||
sub HttpError {
|
||||
my($msg)=join("", LangConv(@_));
|
||||
$msg=~s/\n/<br>\n/g;
|
||||
print LangConv("Content-type: text/html\n\n"),$msg;
|
||||
exit;
|
||||
}
|
||||
|
3793
tools/ladmin
3793
tools/ladmin
File diff suppressed because it is too large
Load Diff
@ -1,270 +1,270 @@
|
||||
# Microsoft Developer Studio Project File - Name="char_sql" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=char_sql - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "char-server_sql.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "char-server_sql.mak" CFG="char_sql - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "char_sql - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\src\common" /I "..\src\mysql" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32" /D "__WIN32" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/char_sql/char-server_sql.pch" /YX /Fo"tmp/char_sql/" /Fd"tmp/char_sql/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 wsock32.lib libmysql.lib zdll.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/char_sql/char-server_sql.pdb" /machine:I386 /out:"../char-server_sql.exe" /libpath:"../lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "char_sql - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "char_sql"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\char.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\char.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_auction.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_auction.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_guild.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_guild.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_homun.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_homun.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_mail.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_mail.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_party.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_party.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_pet.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_storage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_storage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_quest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_quest.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\inter.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\inter.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Microsoft Developer Studio Project File - Name="char_sql" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=char_sql - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "char-server_sql.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "char-server_sql.mak" CFG="char_sql - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "char_sql - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\3rdparty\mysql\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32" /D "__WIN32" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/char_sql/char-server_sql.pch" /YX /Fo"tmp/char_sql/" /Fd"tmp/char_sql/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 wsock32.lib libmysql.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/char_sql/char-server_sql.pdb" /machine:I386 /out:"../char-server_sql.exe" /libpath:"..\3rdparty\mysql\lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "char_sql - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "char_sql"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\char.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\char.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_auction.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_auction.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_guild.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_guild.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_homun.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_homun.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_mail.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_mail.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_party.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_party.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_pet.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_quest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_quest.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_storage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\int_storage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\inter.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char_sql\inter.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
|
@ -1,246 +1,246 @@
|
||||
# Microsoft Developer Studio Project File - Name="char_txt" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=char_txt - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "char-server_txt.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "char-server_txt.mak" CFG="char_txt - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "char_txt - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\src\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32" /D "TXT_ONLY" /D "__WIN32" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/char_txt/char-server_txt.pch" /YX /Fo"tmp/char_txt/" /Fd"tmp/char_txt/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 wsock32.lib zdll.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/char-txt/char-server_txt.pdb" /machine:I386 /out:"../char-server_txt.exe" /libpath:"../lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "char_txt - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "char"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\char.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\char.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_guild.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_guild.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_homun.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_homun.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_party.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_party.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_pet.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_status.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_status.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_storage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_storage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\inter.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\inter.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Microsoft Developer Studio Project File - Name="char_txt" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=char_txt - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "char-server_txt.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "char-server_txt.mak" CFG="char_txt - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "char_txt - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32" /D "TXT_ONLY" /D "__WIN32" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/char_txt/char-server_txt.pch" /YX /Fo"tmp/char_txt/" /Fd"tmp/char_txt/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 wsock32.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/char-txt/char-server_txt.pdb" /machine:I386 /out:"../char-server_txt.exe"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "char_txt - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "char"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\char.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\char.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_guild.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_guild.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_homun.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_homun.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_party.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_party.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_pet.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_status.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_status.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_storage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\int_storage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\inter.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\char\inter.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
|
@ -1,210 +1,238 @@
|
||||
# Microsoft Developer Studio Project File - Name="login_sql" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=login_sql - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "login-server_sql.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "login-server_sql.mak" CFG="login_sql - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "login_sql - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\src\common" /I "..\src\mysql" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_WIN32" /D PACKETVER=6 /D "__WIN32" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/login_sql/login-server_sql.pch" /YX /Fo"tmp/login_sql/" /Fd"tmp/login_sql/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 WSOCK32.lib libmysql.lib zdll.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/login_sql/login-server_sql.pdb" /machine:I386 /out:"../login-server_sql.exe" /libpath:"../lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "login_sql - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\md5calc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\md5calc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\svnversion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "login_sql"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login_sql\login.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login_sql\login.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Microsoft Developer Studio Project File - Name="login_sql" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=login_sql - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "login-server_sql.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "login-server_sql.mak" CFG="login_sql - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "login_sql - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\3rdparty\mysql\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_WIN32" /D PACKETVER=6 /D "__WIN32" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /D "WITH_SQL" /Fp"tmp/login_sql/login-server_sql.pch" /YX /Fo"tmp/login_sql/" /Fd"tmp/login_sql/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 WSOCK32.lib libmysql.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/login_sql/login-server_sql.pdb" /machine:I386 /out:"../login-server_sql.exe" /libpath:"..\3rdparty\mysql\lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "login_sql - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\md5calc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\md5calc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\svnversion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "login_sql"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\account.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\account_sql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\admin.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\ipban.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\ipban_sql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\login.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\login.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\loginlog.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\loginlog_sql.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
|
@ -1,202 +1,230 @@
|
||||
# Microsoft Developer Studio Project File - Name="login_txt" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=login_txt - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "login-server_txt.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "login-server_txt.mak" CFG="login_txt - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "login_txt - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\src\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_WIN32" /D "TXT_ONLY" /D "__WIN32" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/login_txt/login-server_txt.pch" /YX /Fo"tmp/login_txt/" /Fd"tmp/login_txt/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 WSOCK32.lib zdll.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/login_txt/login-server_txt.pdb" /machine:I386 /out:"../login-server_txt.exe" /libpath:"../lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "login_txt - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\md5calc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\svnversion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "login"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\admin.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\login.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\login.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Microsoft Developer Studio Project File - Name="login_txt" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=login_txt - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "login-server_txt.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "login-server_txt.mak" CFG="login_txt - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "login_txt - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_WIN32" /D "__WIN32" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /D "WITH_TXT" /D "ACCOUNTDB_ENGINE_0=rj" /Fp"tmp/login_txt/login-server_txt.pch" /YX /Fo"tmp/login_txt/" /Fd"tmp/login_txt/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 WSOCK32.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/login_txt/login-server_txt.pdb" /machine:I386 /out:"../login-server_txt.exe"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "login_txt - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\md5calc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\svnversion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "login"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\account.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\account_rj.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\account_txt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\admin.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\ipban.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\ipban_txt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\login.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\login.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\loginlog.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\login\loginlog_txt.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
|
@ -1,450 +1,434 @@
|
||||
# Microsoft Developer Studio Project File - Name="map_sql" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=map_sql - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "map-server_sql.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "map-server_sql.mak" CFG="map_sql - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "map_sql - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\src\common" /I "..\src\zlib" /I "..\src\mysql" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32" /D "__WIN32" /D "PCRE_SUPPORT" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/map_sql/map-server_sql.pch" /YX /Fo"tmp/map_sql/" /Fd"tmp/map_sql/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 WSOCK32.lib libmysql.lib pcre.lib zdll.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/map_sql/map-server_sql.pdb" /machine:I386 /out:"../map-server_sql.exe" /libpath:"../lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "map_sql - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\grfio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\grfio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\svnversion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "map"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\atcommand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\atcommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\battle.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\battle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\charcommand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\charcommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chat.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chat.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chrif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chrif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\clif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\clif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\date.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\date.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\guild.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\guild.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\intif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\intif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\irc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\irc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\itemdb.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\itemdb.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\log.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\log.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mail.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mail.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\map.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\map.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mercenary.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mercenary.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mob.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mob.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc_chat.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\party.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\party.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\path.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\path.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pcre.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pet.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\script.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\script.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\skill.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\skill.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\status.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\status.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\storage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\storage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\trade.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\trade.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\unit.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\vending.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\vending.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\quest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\quest.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "zlib"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\zlib\zconf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\zlib\zlib.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Microsoft Developer Studio Project File - Name="map_sql" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=map_sql - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "map-server_sql.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "map-server_sql.mak" CFG="map_sql - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "map_sql - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\3rdparty\mysql\include" /I "..\3rdparty\zlib\include" /I "..\3rdparty\pcre\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32" /D "__WIN32" /D "PCRE_SUPPORT" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/map_sql/map-server_sql.pch" /YX /Fo"tmp/map_sql/" /Fd"tmp/map_sql/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 WSOCK32.lib libmysql.lib zdll.lib pcre.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/map_sql/map-server_sql.pdb" /machine:I386 /out:"../map-server_sql.exe" /libpath:"..\3rdparty\mysql\lib" /libpath:"..\3rdparty\zlib\lib" /libpath:"..\3rdparty\pcre\lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "map_sql - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\grfio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\grfio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\sql.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\svnversion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "map"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\atcommand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\atcommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\battle.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\battle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\charcommand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\charcommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chat.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chat.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chrif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chrif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\clif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\clif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\date.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\date.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\guild.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\guild.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\intif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\intif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\irc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\irc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\itemdb.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\itemdb.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\log.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\log.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mail.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mail.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\map.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\map.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mercenary.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mercenary.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mob.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mob.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc_chat.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\party.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\party.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\path.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\path.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pet.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\quest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\quest.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\script.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\script.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\skill.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\skill.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\status.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\status.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\storage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\storage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\trade.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\trade.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\unit.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\vending.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\vending.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
|
@ -1,446 +1,430 @@
|
||||
# Microsoft Developer Studio Project File - Name="map_txt" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=map_txt - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "map-server_txt.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "map-server_txt.mak" CFG="map_txt - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "map_txt - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\src\common" /I "..\src\zlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32" /D "TXT_ONLY" /D "__WIN32" /D "PCRE_SUPPORT" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/map_txt/map-server_txt.pch" /YX /Fo"tmp/map_txt/" /Fd"tmp/map_txt/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 WSOCK32.lib pcre.lib zdll.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/map_txt/map-server_txt.pdb" /machine:I386 /out:"../map-server_txt.exe" /libpath:"../lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "map_txt - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\grfio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\grfio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\svnversion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "map"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\atcommand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\battle.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\charcommand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chat.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chrif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\clif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\date.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\guild.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\intif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\irc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\itemdb.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\log.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mail.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\map.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mercenary.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mob.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc_chat.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\party.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\path.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pet.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\script.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\skill.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\status.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\storage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\trade.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\unit.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\vending.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\atcommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\battle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\charcommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chat.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chrif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\clif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\date.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\guild.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\intif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\irc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\itemdb.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\log.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mail.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\map.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mercenary.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mob.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\party.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\path.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pcre.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\script.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\skill.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\status.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\storage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\trade.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\unit.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\vending.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\quest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\quest.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "zlib"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\zlib\zconf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\zlib\zlib.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Microsoft Developer Studio Project File - Name="map_txt" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=map_txt - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "map-server_txt.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "map-server_txt.mak" CFG="map_txt - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "map_txt - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W2 /GX /O2 /I "..\3rdparty\zlib\include" /I "..\3rdparty\pcre\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32" /D "TXT_ONLY" /D "__WIN32" /D "PCRE_SUPPORT" /D FD_SETSIZE=4096 /D "DB_MANUAL_CAST_TO_UNION" /Fp"tmp/map_txt/map-server_txt.pch" /YX /Fo"tmp/map_txt/" /Fd"tmp/map_txt/" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 WSOCK32.lib zdll.lib pcre.lib ws2_32.lib /nologo /subsystem:console /pdb:"tmp/map_txt/map-server_txt.pdb" /machine:I386 /out:"../map-server_txt.exe" /libpath:"..\3rdparty\zlib\lib" /libpath:"..\3rdparty\pcre\lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "map_txt - Win32 Release"
|
||||
# Begin Group "common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\cbasetypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\core.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\db.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\ers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\grfio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\grfio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\lock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\malloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mapindex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\mmo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\nullpo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\plugins.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\showmsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\strlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\svnversion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\utils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\common\version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "map"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\atcommand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\battle.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\charcommand.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chat.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chrif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\clif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\date.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\guild.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\intif.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\irc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\itemdb.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\log.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mail.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\map.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mercenary.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mob.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc_chat.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\party.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\path.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pet.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\quest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\script.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\skill.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\status.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\storage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\trade.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\unit.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\vending.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\atcommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\battle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\charcommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chat.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\chrif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\clif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\date.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\guild.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\intif.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\irc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\itemdb.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\log.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mail.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\map.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mercenary.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\mob.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\npc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\party.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\path.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\quest.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\script.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\skill.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\status.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\storage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\trade.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\unit.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\map\vending.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
|
@ -20,7 +20,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
AdditionalIncludeDirectories="..\3rdparty\mysql\include"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_DEBUG;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="TRUE"
|
||||
@ -39,10 +39,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib libmysql.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib libmysql.lib"
|
||||
OutputFile="$(OutDir)\char-server_sql.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories="..\3rdparty\mysql\lib"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
|
||||
@ -88,7 +88,7 @@
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
AdditionalIncludeDirectories="..\3rdparty\mysql\include"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;NDEBUG;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="3"
|
||||
@ -102,10 +102,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib libmysql.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib libmysql.lib"
|
||||
OutputFile="$(OutDir)\char-server_sql.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories="..\3rdparty\mysql\lib"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
@ -185,18 +185,18 @@
|
||||
<File
|
||||
RelativePath="..\src\char_sql\int_pet.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\char_sql\int_storage.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\char_sql\int_storage.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\char_sql\int_quest.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\char_sql\int_quest.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\char_sql\int_storage.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\char_sql\int_storage.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\char_sql\inter.c">
|
||||
</File>
|
||||
|
@ -20,7 +20,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_DEBUG;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="TRUE"
|
||||
@ -39,10 +39,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib"
|
||||
OutputFile="$(OutDir)\char-server.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories=""
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)\char-server.pdb"
|
||||
@ -88,7 +88,7 @@
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;NDEBUG;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="3"
|
||||
@ -102,10 +102,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib"
|
||||
OutputFile="$(OutDir)\char-server.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories=""
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)\char-server.pdb"
|
||||
|
@ -19,8 +19,8 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_DEBUG;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
AdditionalIncludeDirectories="..\3rdparty\mysql\include"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_DEBUG;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION;WITH_SQL"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="TRUE"
|
||||
ExceptionHandling="FALSE"
|
||||
@ -38,10 +38,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib libmysql.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib libmysql.lib"
|
||||
OutputFile="$(OutDir)\login-server_sql.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories="..\3rdparty\mysql\lib"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
|
||||
@ -87,8 +87,8 @@
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;NDEBUG;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
AdditionalIncludeDirectories="..\3rdparty\mysql\include"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;NDEBUG;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION;WITH_SQL"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="3"
|
||||
DefaultCharIsUnsigned="FALSE"
|
||||
@ -103,10 +103,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib libmysql.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib libmysql.lib"
|
||||
OutputFile="$(OutDir)\login-server_sql.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories="..\3rdparty\mysql\lib"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
@ -145,10 +145,31 @@
|
||||
Name="login_sql"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\src\login_sql\login.c">
|
||||
RelativePath="..\src\login\account.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login_sql\login.h">
|
||||
RelativePath="..\src\login\account_sql.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\admin.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\ipban.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\ipban_sql.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\login.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\login.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\loginlog.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\loginlog_sql.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
@ -19,8 +19,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_DEBUG;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_DEBUG;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION;WITH_TXT;ACCOUNTDB_ENGINE_0=rj"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="TRUE"
|
||||
ExceptionHandling="FALSE"
|
||||
@ -43,11 +42,11 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="$(OutDir)\login-server.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories=""
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)\login-server.pdb"
|
||||
@ -93,8 +92,7 @@
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;NDEBUG;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;NDEBUG;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION;WITH_TXT;ACCOUNTDB_ENGINE_0=rj"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="3"
|
||||
DefaultCharIsUnsigned="FALSE"
|
||||
@ -107,10 +105,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib"
|
||||
OutputFile="$(OutDir)\login-server.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories=""
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)\login-server.pdb"
|
||||
@ -147,15 +145,36 @@
|
||||
<Filter
|
||||
Name="login_txt"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\src\login\account.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\account_rj.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\account_txt.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\admin.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\ipban.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\ipban_txt.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\login.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\login.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\loginlog.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\login\loginlog_txt.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="common"
|
||||
|
@ -21,7 +21,7 @@
|
||||
AdditionalOptions="/wd4018
|
||||
/wd4100"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
AdditionalIncludeDirectories="..\3rdparty\mysql\include;..\3rdparty\zlib\include;..\3rdparty\pcre\include"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_DEBUG;PCRE_SUPPORT;MAPREGSQL;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="TRUE"
|
||||
@ -41,10 +41,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib libmysql.lib pcre.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib libmysql.lib zdll.lib pcre.lib"
|
||||
OutputFile="$(OutDir)\map-server_sql.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories="..\3rdparty\mysql\lib;..\3rdparty\zlib\lib;..\3rdparty\pcre\lib"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
@ -93,7 +93,7 @@
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
AdditionalIncludeDirectories="..\3rdparty\mysql\include;..\3rdparty\zlib\include;..\3rdparty\pcre\include"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;NDEBUG;PCRE_SUPPORT;MAPREGSQL;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="3"
|
||||
@ -107,10 +107,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib libmysql.lib pcre.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib libmysql.lib zdll.lib pcre.lib"
|
||||
OutputFile="$(OutDir)\map-server_sql.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories="..\3rdparty\mysql\lib;..\3rdparty\zlib\lib;..\3rdparty\pcre\lib"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
@ -271,15 +271,18 @@
|
||||
<File
|
||||
RelativePath="..\src\map\pc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\pcre.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\pet.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\pet.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\quest.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\quest.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\script.c">
|
||||
</File>
|
||||
@ -322,12 +325,6 @@
|
||||
<File
|
||||
RelativePath="..\src\map\vending.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\quest.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\quest.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="common"
|
||||
@ -435,16 +432,6 @@
|
||||
RelativePath="..\src\common\version.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="zlib"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\src\zlib\zconf.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\zlib\zlib.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
@ -21,7 +21,7 @@
|
||||
AdditionalOptions="/wd4018
|
||||
/wd4100"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
AdditionalIncludeDirectories="..\3rdparty\zlib\include;..\3rdparty\pcre\include"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_DEBUG;PCRE_SUPPORT;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="TRUE"
|
||||
@ -42,10 +42,10 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FIXED:NO"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib pcre.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrtd.lib oldnames.lib ws2_32.lib zdll.lib pcre.lib"
|
||||
OutputFile="$(OutDir)\map-server.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories="..\3rdparty\zlib\lib;..\3rdparty\pcre\lib"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)\map-server.pdb"
|
||||
@ -93,7 +93,7 @@
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
AdditionalIncludeDirectories="..\3rdparty\zlib\include;..\3rdparty\pcre\include"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;NDEBUG;PCRE_SUPPORT;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="3"
|
||||
@ -108,10 +108,10 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib pcre.lib zdll.lib"
|
||||
AdditionalDependencies="msvcrt.lib oldnames.lib ws2_32.lib zdll.lib pcre.lib"
|
||||
OutputFile="$(OutDir)\map-server.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
AdditionalLibraryDirectories="..\3rdparty\zlib\lib;..\3rdparty\pcre\lib"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)\map-server.pdb"
|
||||
@ -271,15 +271,18 @@
|
||||
<File
|
||||
RelativePath="..\src\map\pc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\pcre.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\pet.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\pet.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\quest.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\quest.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\script.c">
|
||||
</File>
|
||||
@ -322,12 +325,6 @@
|
||||
<File
|
||||
RelativePath="..\src\map\vending.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\quest.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\map\quest.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="common"
|
||||
@ -429,16 +426,6 @@
|
||||
RelativePath="..\src\common\version.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="zlib"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\src\zlib\zconf.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\zlib\zlib.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user