diff --git a/addons/sourcemod/plugins/extend/chatlog.smx b/addons/sourcemod/plugins/extend/chatlog.smx index 83abb18dd..669f30e72 100644 Binary files a/addons/sourcemod/plugins/extend/chatlog.smx and b/addons/sourcemod/plugins/extend/chatlog.smx differ diff --git a/addons/sourcemod/plugins/extend/l4d_stats.smx b/addons/sourcemod/plugins/extend/l4d_stats.smx index c7422322d..e8a725bef 100644 Binary files a/addons/sourcemod/plugins/extend/l4d_stats.smx and b/addons/sourcemod/plugins/extend/l4d_stats.smx differ diff --git a/addons/sourcemod/scripting/extend/chatlog.sp b/addons/sourcemod/scripting/extend/chatlog.sp index 2fb0216b8..a93b242d3 100644 --- a/addons/sourcemod/scripting/extend/chatlog.sp +++ b/addons/sourcemod/scripting/extend/chatlog.sp @@ -53,8 +53,8 @@ public void SQL_Connection(Database database, const char[] error, int data) `name` VARCHAR(128) NOT NULL COLLATE 'utf8mb4_general_ci', \ `message_style` TINYINT(2) NULL DEFAULT 0, \ `message` VARCHAR(126) NOT NULL COLLATE 'utf8mb4_general_ci', \ - `server` VARCHAR(126) COLLATE 'utf8mb4_general_ci', \ - `port` TINYINT(2) NULL , \ + `server` varchar(126) DEFAULT NULL COLLATE 'utf8mb4_general_ci', \ + `port` int(11) DEFAULT NULL , \ PRIMARY KEY (`id`) USING BTREE \ ) \ DEFAULT CHARSET='utf8mb4' \ @@ -103,7 +103,7 @@ public Action OnClientSayCommand(int client, const char[] command, const char[] iServerPort = GetConVarInt( FindConVar( "hostport" ) ); GetConVarString(FindConVar("hostname"), szServerName, sizeof(szServerName)); - g_hDatabase.Format(szQuery, sizeof(szQuery), "INSERT INTO chat_log (date, map, steamid, name, message_style, message) VALUES ('%s', '%s', '%s', '%N', '%d', '%s', '%s', '%d')", szTime, szMap, szSteamID, client, iMsgStyle, szArgs, szServerName, iServerPort); + g_hDatabase.Format(szQuery, sizeof(szQuery), "INSERT INTO chat_log (date, map, steamid, name, message_style, message, server, port) VALUES ('%s', '%s', '%s', '%N', '%d', '%s', '%s', '%d')", szTime, szMap, szSteamID, client, iMsgStyle, szArgs, szServerName, iServerPort); g_hDatabase.Query(SQL_Error, szQuery); GetConVarString(chatlog_clearTableDuration, szTimeFunction, sizeof(szTimeFunction)); diff --git a/addons/sourcemod/scripting/extend/l4d_stats.sp b/addons/sourcemod/scripting/extend/l4d_stats.sp index 336de8e14..9c5ddf499 100644 --- a/addons/sourcemod/scripting/extend/l4d_stats.sp +++ b/addons/sourcemod/scripting/extend/l4d_stats.sp @@ -9517,8 +9517,6 @@ public Action L4D_OnFirstSurvivorLeftSafeArea(int client){ if(IsClientInGame(i) && GetClientTeam(i) == 2) ClientEnabled[i] = true; } - if(FastestTime <= 0.0) - GetThisModeBestTime(); return Plugin_Continue; } @@ -11188,7 +11186,7 @@ public StopMapTiming() return; new GameDifficulty = GetCurrentDifficulty(); - + GetThisModeBestTime(); for (i = 1; i <= maxplayers; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsClientBot(i)) @@ -11239,7 +11237,6 @@ public StopMapTiming() { Format(query, sizeof(query), "SELECT time FROM %stimedmaps WHERE map = '%s' AND gamemode = %i AND difficulty = %i AND mutation = '%s' AND steamid = '%s' AND mode = %i", DbPrefix, MapName, CurrentGamemodeID, GameDifficulty, CurrentMutation, ClientID, mode); } - SQL_TQuery(db, UpdateMapTimingStat, query, dp); } } @@ -11252,26 +11249,6 @@ public StopMapTiming() public GetThisModeBestTime() { - if (!MapTimingEnabled() || MapTimingStartTime <= 0.0 || StatsDisabled()) - { - return; - } - if(g_brpgAvailable && !L4D_RPG_GetGlobalValue(INDEX_VALID)) - { - if (GetConVarInt(cvar_AnnounceMode)) - { - StatsPrintToChatAll("此次结果因修改难度或开启高级人机导致 \x04无效 \x01,不记录这张地图游戏时间!"); - } - return; - } - if(!IsNormalMode() && !IsThisRoundValid()) - { - if (GetConVarInt(cvar_AnnounceMode)) - { - StatsPrintToChatAll("此次结果因关闭tank连跳导致 \x04无效 \x01,不记录这张地图游戏时间!"); - } - return; - } decl String:MapName[MAX_LINE_WIDTH], String:query[512]; @@ -11297,8 +11274,9 @@ public GetThisModeBestTime() mode = 5; } Format(query, sizeof(query), "SELECT time FROM %stimedmaps WHERE map = '%s' AND gamemode = %i AND difficulty = %i AND mutation = '%s' AND sinum = %i AND sitime = %i AND anneversion = '%s' AND mode = %i AND usebuy = %i AND auto = %i ORDER BY time LIMIT 1",\ - DbPrefix, MapName, CurrentGamemodeID, GameDifficulty, CurrentMutation, GetAnneInfectedNumber(), GetAnneSISpawnTime(),\ - GetAnneVersion(), mode, g_brpgAvailable && L4D_RPG_GetGlobalValue(INDEX_USEBUY), IsAutoSpawnTime()); + DbPrefix, MapName, CurrentGamemodeID, GameDifficulty, CurrentMutation, GetAnneInfectedNumber(), GetAnneSISpawnTime(),\ + GetAnneVersion(), mode, g_brpgAvailable && L4D_RPG_GetGlobalValue(INDEX_USEBUY), IsAutoSpawnTime()); + LogMessage("GetFastTimequery: %s", query); SQL_TQuery(db, GetFastTime, query); } @@ -11313,17 +11291,18 @@ public GetFastTime(Handle:owner, Handle:hndl, const String:error[], any:dp) SetTimeLabel(FastestTime, TimeLabel, sizeof(TimeLabel)); if (Mode) { - StatsPrintToChatAll2(false, "当前模式该难度不买药最快通关速度为 %s ." ,TimeLabel); + StatsPrintToChatAll("当前模式该难度\x04 [%s使用B数] \x01最快通关速度为\x04 %s \x01." , (g_brpgAvailable && L4D_RPG_GetGlobalValue(INDEX_USEBUY))?"":"不", TimeLabel); } } else{ if (Mode) { - StatsPrintToChatAll2(false, "你来到无人的荒野,当前模式该难度没有最快纪录"); + StatsPrintToChatAll("你来到无人的荒野,当前模式该难度没有最快纪录"); } } } + public UpdateMapTimingStat(Handle:owner, Handle:hndl, const String:error[], any:dp) { int mode = 0; @@ -11370,7 +11349,7 @@ public UpdateMapTimingStat(Handle:owner, Handle:hndl, const String:error[], any: OldTime = SQL_FetchFloat(hndl, 0); if(TotalTime < 30.0) { - StatsPrintToChat(Client, "记录时间小于30s,好像不对,此次记录不进行记录!"); + StatsPrintToChat(Client, "记录时间小于30s,数据应该不对,此次记录不进行记录!"); return; } @@ -11402,7 +11381,7 @@ public UpdateMapTimingStat(Handle:owner, Handle:hndl, const String:error[], any: if (Mode) { SetTimeLabel(TotalTime, TimeLabel, sizeof(TimeLabel)); - StatsPrintToChat(Client, "牛逼,你刷新了你这张图 \x04Anne%s \x01版本该难度的最快完成时间,目前是 \x04%s\x01!", GetAnneVersion(), TimeLabel); + StatsPrintToChat(Client, "牛逼,你刷新了%s这张图 \x04Anne%s \x01版本该难度的最快完成时间,目前是 \x04%s\x01!", FastestTime < TotalTime?"目前":"你", GetAnneVersion(), TimeLabel); }