搜索
查看: 4358|回复: 13

war3ft v3.0_RC8,RC9汉化版的错误提示。

[复制链接]
发表于 2008-1-30 11:02:56 | 显示全部楼层 |阅读模式 来自 中国–广东–东莞
一大堆错误提示cstrike\addons\amxmodx\configs\war3ft\war3_error.log的错误如下,有的时候,一个小时就达十几兆。而且服务器经常挂掉。如何解决?官方说不支持NOSTEAM了。

[php] 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: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 10:25:59: [SQLITE] Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:25:59: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:25:59: [ERROR] Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:00: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 10:26:00: [SQLITE] Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:26:00: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:26:00: [ERROR] Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:01: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 10:26:01: [SQLITE] Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:26:01: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:26:01: [ERROR] Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:02: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 10:26:02: [SQLITE] Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:26:02: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:26:02: [ERROR] Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:03: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 10:26:03: [SQLITE] Message: near "ppo": syntax error (1)
L 01/30/2008 - 10:26:03: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|\'ppo';
L 01/30/2008 - 10:26:03: [ERROR] Unable to retreive user's (10) Unique ID, trying again...
L 01/30/2008 - 10:26:04: [SQLITE] Error in querying database, location: 4[/php]
发表于 2008-1-30 12:06:27 | 显示全部楼层 来自 中国–广东–惠州

回复: 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;
回复

使用道具 举报

 楼主| 发表于 2008-1-30 12:54:34 | 显示全部楼层 来自 中国–广东–东莞

回复: war3ft v3.0_RC8,RC9汉化版的错误提示。

Post by zwfgdlc
mysql的问题,mysql对特殊字符支持不是很好,所以会出现此问题.
修改下源码把所有像这样的SQL语句都修改下,
SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|'ppo';
改成这样:
SELECT `player_id` FR...
[PHP]SQLITE_FetchUniqueID( id )
{
// Make sure our connection is working
if ( !SQLITE_Check_Connection() )
{
  return;
}
// Remember how we got this ID
g_iDBPlayerSavedBy[id] = get_pcvar_num( CVAR_wc3_save_by );
new szKey[66], szKeyName[32];
DB_GetKey( id, szKey, 65 );
DB_GetKeyName( szKeyName, 31 );
new szQuery[512];
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[512];
  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[id] = SQL_GetInsertId( query );
}
// They have been here before - store their ID
else
{
  g_iDBPlayerUniqueID[id] = SQL_ReadResult( query, 0 );
}
// Free the last handle!
SQL_FreeHandle( query );
}[/PHP]
format( szQuery, 511, "SELECT `player_id` FROM `wc3_player` WHERE `%s` = '%s';", szKeyName, szKey );
好像没什么问题,请问该怎么改呢?
回复

使用道具 举报

发表于 2008-1-30 13:04:03 | 显示全部楼层 来自 中国–广东–惠州

回复: war3ft v3.0_RC8,RC9汉化版的错误提示。

就是把单引号''改成^"^"这样的形式
回复

使用道具 举报

 楼主| 发表于 2008-1-30 15:13:43 | 显示全部楼层 来自 中国–广东–东莞

回复: war3ft v3.0_RC8,RC9汉化版的错误提示。

Post by zwfgdlc
就是把单引号''改成^"^"这样的形式
还是这样,日志文件很快就到15M了。

[php][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: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 14:30:25: [SQLITE] Message: unrecognized token: "\" (1)
L 01/30/2008 - 14:30:25: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
L 01/30/2008 - 14:30:25: [ERROR] Unable to retreive user's (22) Unique ID, trying again...
L 01/30/2008 - 14:30:26: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 14:30:26: [SQLITE] Message: unrecognized token: "\" (1)
L 01/30/2008 - 14:30:26: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
L 01/30/2008 - 14:30:26: [ERROR] Unable to retreive user's (22) Unique ID, trying again...
L 01/30/2008 - 14:30:27: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 14:30:27: [SQLITE] Message: unrecognized token: "\" (1)
L 01/30/2008 - 14:30:27: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
L 01/30/2008 - 14:30:27: [ERROR] Unable to retreive user's (22) Unique ID, trying again...
L 01/30/2008 - 14:30:28: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 14:30:28: [SQLITE] Message: unrecognized token: "\" (1)
L 01/30/2008 - 14:30:28: [SQLITE] Query statement: SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
L 01/30/2008 - 14:30:28: [ERROR] Unable to retreive user's (22) Unique ID, trying again...
L 01/30/2008 - 14:30:29: [SQLITE] Error in querying database, location: 4
L 01/30/2008 - 14:30:29: [SQLITE] Message: unrecognized token: "\" (1)
[/PHP]
回复

使用道具 举报

发表于 2008-1-30 15:27:15 | 显示全部楼层 来自 中国–广东–惠州

回复: war3ft v3.0_RC8,RC9汉化版的错误提示。

你没改到
SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '\'\'';
还是单引号
回复

使用道具 举报

 楼主| 发表于 2008-1-30 15:51:30 | 显示全部楼层 来自 中国–广东–东莞

回复: 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文件。我把这个传上来,麻烦你看一下。谢谢。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2008-1-30 16:07:00 | 显示全部楼层 来自 中国–广东–惠州–惠城区

回复: war3ft v3.0_RC8,RC9汉化版的错误提示。

你上传的文件里根本没有
SELECT `player_id` FROM `wc3_player` WHERE `player_name` =
这样的SQL语句
回复

使用道具 举报

 楼主| 发表于 2008-1-30 17:06:08 | 显示全部楼层 来自 中国–广东–东莞

回复: war3ft v3.0_RC8,RC9汉化版的错误提示。

Post by zwfgdlc
你上传的文件里根本没有
SELECT `player_id` FROM `wc3_player` WHERE `player_name` =
这样的SQL语句
有,就在下面的语句里面。
[PHP]

SQLITE_FetchUniqueID( id )
{
// Make sure our connection is working
if ( !SQLITE_Check_Connection() )
{
  return;
}
// Remember how we got this ID
g_iDBPlayerSavedBy[id] = get_pcvar_num( CVAR_wc3_save_by );
new szKey[66], szKeyName[32];
DB_GetKey( id, szKey, 65 );
DB_GetKeyName( szKeyName, 31 );
new szQuery[512];
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[512];
  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[id] = SQL_GetInsertId( query );
}
// They have been here before - store their ID
else
{
  g_iDBPlayerUniqueID[id] = SQL_ReadResult( query, 0 );
}
// Free the last handle!
SQL_FreeHandle( query );
}

[/PHP]
回复

使用道具 举报

 楼主| 发表于 2008-1-30 17:24:29 | 显示全部楼层 来自 中国–广东–东莞

回复: war3ft v3.0_RC8,RC9汉化版的错误提示。

db_sqlite.inl文件中

[php]
// 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[256];
new iErrNum = SQL_QueryError( query, szError, 255 );
WC3_Log( true, "[SQLITE] Error in querying database, location: %d", id );
WC3_Log( true, "[SQLITE] Message: %s (%d)", szError, iErrNum );
WC3_Log( true, "[SQLITE] Query statement: %s ", szQuery ); //szQuery
// Free the handle
SQL_FreeHandle( query );
}

[/php]

[php]
SQLITE_FetchUniqueID( id )
{
// Make sure our connection is working
if ( !SQLITE_Check_Connection() )
{
return;
}
// Remember how we got this ID
g_iDBPlayerSavedBy[id] = get_pcvar_num( CVAR_wc3_save_by );
new szKey[66], szKeyName[32];
DB_GetKey( id, szKey, 65 );
DB_GetKeyName( szKeyName, 31 );
new szQuery[512];
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;
}
....................................
[/php]
应该就是上面出问题,但不明白怎么回事。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表