* Makefile deleting .svn in save folder.

* Limited the number of packets parsed per cycle to 3. (packet spammers create less lag)
* Fixed sql login throwing an out-of-place debug message and escaping too much of the name string when creating a new login with _M/F.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11253 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
FlavioJS 2007-09-21 05:22:13 +00:00
parent d2f97b7151
commit 2365e833a4
5 changed files with 29 additions and 12 deletions

View File

@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/09/21 2007/09/21
* Makefile deleting .svn in save folder.
* Limited the number of packets parsed per cycle to 3.
* Fixed sql login throwing an out-of-place debug message and escaping too
much of the name string when creating a new login with _M/F.
* Configure script detects 64bit distributions of MySQL. * Configure script detects 64bit distributions of MySQL.
* Generated the configure script with cygwin's autoconf. [FlavioJS] * Generated the configure script with cygwin's autoconf. [FlavioJS]
2007/09/20 2007/09/20

View File

@ -80,9 +80,11 @@ conf:
# save: # save:
# 1) create save folder # 1) create save folder
# 2) add missing files # 2) add missing files
# 3) remove remaining .svn folder
@echo "building save folder..." @echo "building save folder..."
@if test ! -d save ; then mkdir save ; fi @if test ! -d save ; then mkdir save ; fi
@for f in $$(ls save-tmpl) ; do if test ! -e save/$$f ; then cp save-tmpl/$$f save ; fi ; done @for f in $$(ls save-tmpl) ; do if test ! -e save/$$f ; then cp save-tmpl/$$f save ; fi ; done
@rm -rf save/.svn
clean: clean:
@$(MAKE) -C src/common $@ @$(MAKE) -C src/common $@

2
configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# From configure.in Revision: 11245 . # From configure.in Revision: 11252 .
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61. # Generated by GNU Autoconf 2.61.
# #

View File

@ -411,6 +411,7 @@ int mmo_auth_new(struct mmo_account* account, char sex)
unsigned int tick = gettick(); unsigned int tick = gettick();
char md5buf[32+1]; char md5buf[32+1];
SqlStmt* stmt; SqlStmt* stmt;
int result = 0;
//Account Registration Flood Protection by [Kevin] //Account Registration Flood Protection by [Kevin]
if( DIFF_TICK(tick, new_reg_tick) < 0 && num_regs >= allowed_regs ) if( DIFF_TICK(tick, new_reg_tick) < 0 && num_regs >= allowed_regs )
@ -421,16 +422,18 @@ int mmo_auth_new(struct mmo_account* account, char sex)
// check if the account doesn't exist already // check if the account doesn't exist already
stmt = SqlStmt_Malloc(sql_handle); stmt = SqlStmt_Malloc(sql_handle);
if ( SQL_SUCCESS != SqlStmt_Prepare(stmt, "SELECT `%s` FROM `%s` WHERE `userid` = ?", login_db_userid, login_db) if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "SELECT `%s` FROM `%s` WHERE `userid` = ?", login_db_userid, login_db)
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, account->userid, strnlen(account->userid, NAME_LENGTH)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, account->userid, strnlen(account->userid, NAME_LENGTH))
|| SQL_SUCCESS != SqlStmt_Execute(stmt) || SQL_SUCCESS != SqlStmt_Execute(stmt) )
|| SqlStmt_NumRows(stmt) > 0 )
{ {
SqlStmt_ShowDebug(stmt); SqlStmt_ShowDebug(stmt);
SqlStmt_Free(stmt); result = 1;// error
return 1; // incorrect user/pass
} }
else if( SqlStmt_NumRows(stmt) > 0 )
result = 1;// incorrect user/pass
SqlStmt_Free(stmt); SqlStmt_Free(stmt);
if( result )
return result;// error or incorrect user/pass
// insert new entry into db // insert new entry into db
//TODO: error checking //TODO: error checking
@ -515,8 +518,12 @@ int mmo_auth(struct mmo_account* account, int fd)
account->userid[len-2] == '_' && memchr("FfMm", (unsigned char)account->userid[len-1], 4) ) // _M/_F suffix account->userid[len-2] == '_' && memchr("FfMm", (unsigned char)account->userid[len-1], 4) ) // _M/_F suffix
{ {
int result; int result;
account->userid[len-2] = '\0';// terminate the name. char sex;
result = mmo_auth_new(account, account->userid[len-1]);
len -= 2;
account->userid[len] = '\0';// nul-terminate the name.
sex = account->userid[len+1];
result = mmo_auth_new(account, sex);
if( result ) if( result )
return result;// Failed to make account. [Skotlex]. return result;// Failed to make account. [Skotlex].
} }

View File

@ -11521,8 +11521,12 @@ int clif_parse(int fd)
{ {
int cmd, packet_ver, packet_len, err; int cmd, packet_ver, packet_len, err;
TBL_PC* sd; TBL_PC* sd;
int pnum;
while(1) //TODO apply deplays or disconnect based on packet throughput [FlavioJS]
// Note: "click masters" can do 80+ clicks in 10 seconds
for( pnum = 0; pnum < 3; ++pnum )// Limit max packets per cycle to 3 (delay packet spammers) [FlavioJS]
{ // begin main client packet processing loop { // begin main client packet processing loop
sd = (TBL_PC *)session[fd]->session_data; sd = (TBL_PC *)session[fd]->session_data;