war3ft v3.0_RC8,RC9汉化版的错误提示。
一大堆错误提示cstrike\addons\amxmodx\configs\war3ft\war3_error.log的错误如下,有的时候,一个小时就达十几兆。而且服务器经常挂掉。如何解决?官方说不支持NOSTEAM了。01/30/2008 - 10:19:34: Log file started (file "cstrike/addons/amxmodx/configs/war3ft/wc3_error.log") (game "cstrike") (amx "1.8.0.3660")
L 01/30/2008 - 10:19:34: ** Map 'de_dust2' ended
L 01/30/2008 - 10:19:35: ** Map 'de_train' started
L 01/30/2008 - 10:19:35: ** Plugin version: '3.0 RC8'
L 01/30/2008 - 10:25:59: Error in querying database, location: 4
L 01/30/2008 - 10:25:59: Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:25:59: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:25:59: Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:00: Error in querying database, location: 4
L 01/30/2008 - 10:26:00: Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:26:00: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:26:00: Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:01: Error in querying database, location: 4
L 01/30/2008 - 10:26:01: Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:26:01: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:26:01: Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:02: Error in querying database, location: 4
L 01/30/2008 - 10:26:02: Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:26:02: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:26:02: Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:03: Error in querying database, location: 4
L 01/30/2008 - 10:26:03: Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:26:03: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:26:03: Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:04: Error in querying database, location: 4
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
mysql的问题,mysql对特殊字符支持不是很好,所以会出现此问题.修改下源码把所有像这样的SQL语句都修改下,
SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|'ppo';
改成这样:
SELECT `player_id` FROM `wc3_player` WHERE `player_name` =^"%s^",playername;
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
Post by zwfgdlcmysql的问题,mysql对特殊字符支持不是很好,所以会出现此问题.
修改下源码把所有像这样的SQL语句都修改下,
SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|'ppo';
改成这样:
SELECT `player_id` FR...
SQLITE_FetchUniqueID( id )
{
// Make sure our connection is working
if ( !SQLITE_Check_Connection() )
{
return;
}
// Remember how we got this ID
g_iDBPlayerSavedBy = get_pcvar_num( CVAR_wc3_save_by );
new szKey, szKeyName;
DB_GetKey( id, szKey, 65 );
DB_GetKeyName( szKeyName, 31 );
new szQuery;
format( szQuery, 511, "SELECT `player_id` FROM `wc3_player` WHERE `%s` = '%s';", szKeyName, szKey );
new Handle:query = SQL_PrepareQuery( g_DBConn, szQuery );
if ( !SQL_Execute( query ) )
{
SQLITE_Error( query, szQuery, 4 );
return;
}
// If no rows we need to insert!
if ( SQL_NumResults( query ) == 0 )
{
// Free the last handle!
SQL_FreeHandle( query );
// Insert this player!
new szQuery;
format( szQuery, 511, "INSERT INTO `wc3_player` ( `player_id` , `%s` , `time` ) VALUES ( NULL , '%s', julianday('now') );", szKeyName, szKey );
new Handle:query = SQL_PrepareQuery( g_DBConn, szQuery );
if ( !SQL_Execute( query ) )
{
SQLITE_Error( query, szQuery, 5 );
return;
}
g_iDBPlayerUniqueID = SQL_GetInsertId( query );
}
// They have been here before - store their ID
else
{
g_iDBPlayerUniqueID = SQL_ReadResult( query, 0 );
}
// Free the last handle!
SQL_FreeHandle( query );
}
format( szQuery, 511, "SELECT `player_id` FROM `wc3_player` WHERE `%s` = '%s';", szKeyName, szKey );
好像没什么问题,请问该怎么改呢?
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
就是把单引号''改成^"^"这样的形式回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
Post by zwfgdlc就是把单引号''改成^"^"这样的形式
还是这样,日志文件很快就到15M了。
[L 01/30/2008 - 14:30:25: Log file started (file "cstrike/addons/amxmodx/configs/war3ft/wc3_error.log") (game "cstrike") (amx "1.8.0.3660")
L 01/30/2008 - 14:30:25: Error in querying database, location: 4
L 01/30/2008 - 14:30:25: Message: unrecognized token: "\" (1)
L 01/30/2008 - 14:30:25: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
L 01/30/2008 - 14:30:25: Unable to retreive user's (22) Unique ID, trying again...
L 01/30/2008 - 14:30:26: Error in querying database, location: 4
L 01/30/2008 - 14:30:26: Message: unrecognized token: "\" (1)
L 01/30/2008 - 14:30:26: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
L 01/30/2008 - 14:30:26: Unable to retreive user's (22) Unique ID, trying again...
L 01/30/2008 - 14:30:27: Error in querying database, location: 4
L 01/30/2008 - 14:30:27: Message: unrecognized token: "\" (1)
L 01/30/2008 - 14:30:27: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
L 01/30/2008 - 14:30:27: Unable to retreive user's (22) Unique ID, trying again...
L 01/30/2008 - 14:30:28: Error in querying database, location: 4
L 01/30/2008 - 14:30:28: Message: unrecognized token: "\" (1)
L 01/30/2008 - 14:30:28: Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
L 01/30/2008 - 14:30:28: Unable to retreive user's (22) Unique ID, trying again...
L 01/30/2008 - 14:30:29: Error in querying database, location: 4
L 01/30/2008 - 14:30:29: Message: unrecognized token: "\" (1)
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
你没改到SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
还是单引号
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
Post by zwfgdlc你没改到
SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
还是单引号
不,源码不是.sma文件,是cstrike\addons\amxmodx\scripting\war3ft\db\下的db_sqlite.inl文件。我把这个传上来,麻烦你看一下。谢谢。
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
你上传的文件里根本没有SELECT `player_id` FROM `wc3_player` WHERE `player_name` =
这样的SQL语句
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
Post by zwfgdlc你上传的文件里根本没有
SELECT `player_id` FROM `wc3_player` WHERE `player_name` =
这样的SQL语句
有,就在下面的语句里面。
SQLITE_FetchUniqueID( id )
{
// Make sure our connection is working
if ( !SQLITE_Check_Connection() )
{
return;
}
// Remember how we got this ID
g_iDBPlayerSavedBy = get_pcvar_num( CVAR_wc3_save_by );
new szKey, szKeyName;
DB_GetKey( id, szKey, 65 );
DB_GetKeyName( szKeyName, 31 );
new szQuery;
format( szQuery, 511, "SELECT `player_id` FROM `wc3_player` WHERE `%s` = '%s';", szKeyName, szKey );
new Handle:query = SQL_PrepareQuery( g_DBConn, szQuery );
if ( !SQL_Execute( query ) )
{
SQLITE_Error( query, szQuery, 4 );
return;
}
// If no rows we need to insert!
if ( SQL_NumResults( query ) == 0 )
{
// Free the last handle!
SQL_FreeHandle( query );
// Insert this player!
new szQuery;
format( szQuery, 511, "INSERT INTO `wc3_player` ( `player_id` , `%s` , `time` ) VALUES ( NULL , '%s', julianday('now') );", szKeyName, szKey );
new Handle:query = SQL_PrepareQuery( g_DBConn, szQuery );
if ( !SQL_Execute( query ) )
{
SQLITE_Error( query, szQuery, 5 );
return;
}
g_iDBPlayerUniqueID = SQL_GetInsertId( query );
}
// They have been here before - store their ID
else
{
g_iDBPlayerUniqueID = SQL_ReadResult( query, 0 );
}
// Free the last handle!
SQL_FreeHandle( query );
}
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
db_sqlite.inl文件中// The id should be a unique number, so we know what function called it (useful for debugging)
SQLITE_Error( Handle:query, szQuery[], id )
{
new szError;
new iErrNum = SQL_QueryError( query, szError, 255 );
WC3_Log( true, " Error in querying database, location: %d", id );
WC3_Log( true, " Message: %s (%d)", szError, iErrNum );
WC3_Log( true, " Query statement: %s ", szQuery ); //szQuery
// Free the handle
SQL_FreeHandle( query );
}
而
SQLITE_FetchUniqueID( id )
{
// Make sure our connection is working
if ( !SQLITE_Check_Connection() )
{
return;
}
// Remember how we got this ID
g_iDBPlayerSavedBy = get_pcvar_num( CVAR_wc3_save_by );
new szKey, szKeyName;
DB_GetKey( id, szKey, 65 );
DB_GetKeyName( szKeyName, 31 );
new szQuery;
format( szQuery, 511, "SELECT `player_id` FROM `wc3_player` WHERE `%s` = '%s';", szKeyName, szKey );
new Handle:query = SQL_PrepareQuery( g_DBConn, szQuery );
if ( !SQL_Execute( query ) )
{
SQLITE_Error( query, szQuery, 4 ); //错误提示.....
return;
}
....................................
应该就是上面出问题,但不明白怎么回事。
页:
[1]
2