Steamworks 文献库
ICheatReportingService 接口
此服务允许您的游戏向 VAC 系统举报作弊行为和作弊者,并提供游戏封禁 系统背后的工具集。 它启用了两个独立的工作流程来检测和管理游戏中的作弊行为:
  • 收集有关作弊的社区报告,并根据此信息请求封禁/暂时禁用。
  • 将有关已知作弊软件的详细信息提交给 VAC 系统。 一经处理,此信息将用于自动检测和封禁使用已知作弊程序的玩家。

要使用此接口,您必须首先选择启用 VAC 支持。 您可以通过“应用管理员”面板的反作弊配置页面进行操作。

注意: 这是服务接口,此接口中的方法应使用 input_json 参数调用。

请参见Web API 概览,对如何使用 Steamworks Web API 了解更多。

ReportPlayerCheating

POST https://partner.steam-api.com/ICheatReportingService/ReportPlayerCheating/v1/
名称类型是否必需描述
keystringSteamworks Web API 发行商验证密钥。
steamiduint64被举报有作弊行为的用户的 Steam ID。
appiduint32游戏的 App ID。
steamidreporteruint64(可选)举报作弊行为的用户或游戏服务器的 Steam ID。
appdatauint64(可选)由开发者设置的关于作弊类型的特定于某一应用的数据 (例如 1 = Aimbot(自瞄作弊), 2 = Wallhack(穿墙作弊), 3 = Griefing(骚扰))。
heuristicbool(可选)关于作弊来源的附加信息 - 是否为启发式。
detectionbool(可选)关于作弊来源的附加信息 - 是否为检测。
playerreportbool(可选)关于作弊来源的附加信息 - 是否为用户举报。
noreportidbool(可选)不返回 reportid。 仅在您不打算基于此举报实施封禁的情况下,才应传入。
gamemodeuint32(可选)关于游戏状态的附加信息 - 是否为特定类型的游戏玩法或游戏模式。 (0 = 通用)
suspicionstarttimeuint32(可选)附加信息,表明游戏认为对此用户的怀疑自何时起。 使用 Unix 时间戳(从 1970 年 1 月 1 日起)。
severityuint32(可选)被举报的不良行为的严重程度。 等级由开发者设置。

ReportPlayerCheating 旨在收集社区关于作弊的举报,即在游戏中一个玩家举报另一个玩家。

此 API 针对来自游戏中其他玩家的不可靠数据(非完全信任的来源)。 举报数据的后端应确保双方都经过身份验证,但是数据本身被视为未经证实的消息。 可选参数可用于对嫌疑作弊类型或附加证据进行编码(指向匹配/试玩的标识符,以便进行进一步核查)。

注意: 此调用需要发行商 API 密钥才能使用此方法。 因此,此 API 必须通过安全服务器调用,且绝不能由客户端直接调用!

RequestPlayerGameBan

POST https://partner.steam-api.com/ICheatReportingService/RequestPlayerGameBan/v1/
名称类型是否必需描述
keystringSteamworks Web API 发行商验证密钥。
steamiduint64被举报有作弊行为的用户的 Steam ID。
appiduint32游戏的 appid。
reportiduint64最初用于举报作弊的 reportid。
cheatdescriptionstring描述作弊违规的文本。
durationuint32请求封禁的秒数。 (时长为 0 将会施加无限期封禁 - 短于一年为暂时禁用,且在个人资料上不可见)。
delaybanbool根据默认封禁延迟规则延迟封禁。
flagsuint32关于封禁请求的附加信息。 (未使用)

请求对某一特定玩家实施游戏封禁。

在审核过 ReportPlayerCheating 的事件并确认作弊行为之后使用。

注意: 此调用需要发行商 API 密钥才能使用此方法。 因此,此 API 必须通过安全服务器调用,且绝不能由客户端直接调用!

RemovePlayerGameBan

POST https://partner.steam-api.com/ICheatReportingService/RemovePlayerGameBan/v1/
名称类型是否必需描述
keystringSteamworks Web API 发行商验证密钥。
steamiduint64要移除其游戏封禁的用户的 Steam ID。
appiduint32游戏的 App ID。

移除对某一玩家的游戏封禁。

在游戏封禁被确定为误判时使用。

注意: 此调用需要发行商 API 密钥才能使用此方法。 因此,此 API 必须通过安全服务器调用,且绝不能由客户端直接调用!

GetCheatingReports

GET https://partner.steam-api.com/ICheatReportingService/GetCheatingReports/v1/
名称类型是否必需描述
keystringSteamworks Web API 发行商验证密钥。
appiduint32游戏的 App ID。
timeenduint32时间范围的结束。 使用 Unix 时间戳格式(从 1970 年 1 月 1 日起)。
timebeginuint32时间范围的开始。 使用 Unix 时间戳格式(从 1970 年 1 月 1 日起)。
reportidminuint64要包含的最小 reportID。 (可传入 0 - 上次举报范围的结束)。
includereportsbool(可选)是否包括举报。 若为 false,includebans 必须为 true。
includebansbool(可选)是否包括封禁请求。 若为 false,includereports 必须为 true。
steamiduint64(可选) 仅为此 Steam ID 查询。

获取就此应用提交的作弊举报的列表。

用于收集作弊举报,以便对举报进行审查并作出决定。

注意: 此调用需要发行商 API 密钥才能使用此方法。 因此,此 API 必须通过安全服务器调用,且绝不能由客户端直接调用!

ReportCheatData

POST https://api.steampowered.com/ICheatReportingService/ReportCheatData/v1/
名称类型是否必需描述
keystringSteamworks Web API 用户验证密钥。
steamiduint64运行且举报作弊程序的用户的 Steam ID。
appiduint32游戏的 App ID。
pathandfilenamestring作弊可执行文件的路径和文件名。
webcheaturlstring发现和下载作弊的 Web url。
time_nowuint64实时本地系统时间。 64 位 windows 系统时间。
time_starteduint64作弊进程开始时的本地系统时间 (若尚未运行,为 0。)64 位 windows 系统时间。
time_stoppeduint64作弊进程停止时的本地系统时间 (若仍在运行,为 0。)64 位 windows 系统时间。
cheatnamestring作弊的描述性名称。
game_process_iduint32正在运行的游戏的 Process ID。
cheat_process_iduint32已运行的作弊进程的 Process ID。
cheat_param_1uint64额外作弊数据。
cheat_param_2uint64额外作弊数据。

举报作弊数据。 仅用于运行该游戏的测试帐号,而不在多人游戏会话中使用。

用于向 VAC 系统举报具体作弊行为。 运行作弊程序和游戏后调用此 web api 即可完成。
注意:鉴于此,您只能在您网络之外的一台可支配计算机上,使用一个测试帐户。 您也必须在该测试帐户上使用一个从 http://steamcommunity.com/developer 获得的标准 Web API 密钥,而非合作伙伴 Web API 密钥。 此调用之后,该系统应闲置至少半个小时,以便 VAC 彻底扫描整个系统。 该测试帐户将被标记,并且不允许在未来多人游戏中进行身份验证,所以请确定始终使用一个仅用于作弊举报的测试帐户。

若此调用未报告成功,则该举报已被忽略。

调用示例:
#需要 python 2.7 import sys, os, time if sys.version_info >= ( 2, 7 ): #导入 argparse print "Found python 2.7 or greater" else: print "Must use python 2.7 or greater" exit() import urllib import urllib2 import json g_mapUniverseToWebapiServer = { 'public' : { 'host' : 'api.steampowered.com', 'port_http' : 80, 'port_https' : 443, }, } g_bReadied = False #准备发出 webapi 请求 def readyAPIRequest( universe ): global g_bReadied #如需代理,在此启用 #警告:不建议在您的局域网内使用此方法 #因为这意味着您在局域网中运行作弊程序 proxyneeded = 0 if proxyneeded == 1: urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( {"http":"http://proxy.valvesoftware.com:80"} ) ) ) else: urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler({}) ) ) g_bReadied = True #执行一个 webapi 请求 - 当前假设响应为 JSON # #您必须传入 # universe - 字符串 # interface - 您调用的是哪个接口 # request - 方法的名称 # #可选参数 # method - GET 或 PUT # protocol - http 或 https # version - 默认为 0001 # timeout - 默认为 120 # # 所提供的其他关键字参数被用作 webapi 的参数,如,使用 # webapi 密钥,'key=0123456' def issueWebAPIRequest( universe=None, interface=None, request=None, method='GET', protocol='http', version='0001', timeout=120, **kwargs ): if not universe or not request or not interface: raise NameError( 'Need universe, interface, and request' ) if not g_bReadied: raise RuntimeError( 'call readyAPIRequest first to ensure the proxy is set' ) entry = g_mapUniverseToWebapiServer[] server = entry[] port = entry[] url = '%s://%s:%s/%s/%s/v%s/' % ( protocol, server, port, interface, request, version ) if method == 'GET': sep = '?' for kw in kwargs: url = url + sep + kw + '=' + str( kwargs[] ) sep = '&' rf = urllib2.urlopen( url, timeout=timeout ) else: rf = urllib2.urlopen( url, urllib.urlencode( kwargs ), timeout=timeout ) return json.load( rf ) def sendcheatreport(): readyAPIRequest( 'public' ) print "Current time is ",int(time.time()) #填入默认值 # steamid 应类似于 7XXXXXXXXXXXXXXX steamid = 0 #密钥应为一个十六进制字符串 key = '' #填入您的 appid gameappid = 0 # init vars cheatprocid = 0 timecheatran = 0 cheatterminated = 0 timecheatstopped = 0 if steamid == 0: steamid = raw_input( 'Input steam ID: ' ) if not key: key = raw_input( 'Input web api key: ' ) if gameappid == 0: gameappid = raw_input( 'Input game appid: ' ) cheatnamestring = raw_input( 'Input cheat descriptive name: ' ) cheatpathstring = raw_input( 'Input full path to cheat file: ' ) webcheaturlstring = raw_input( 'Input full URL to cheat download page (optional): ' ) cheatfiletype = int(raw_input( 'Input 1 if .exe or input 2 if other file type: ' )) if cheatfiletype == 1: cheatprocid = raw_input( 'Input cheat process id (Input 0 if stopped or unsure): ' ) timecheatran = int(time.time()) cheatterminated = int(raw_input( 'Input 1 if cheat is still running or input 0 if it has stopped: ' )) timecheatstopped = int(time.time()) if cheatterminated == 1: timecheatstopped = 0 gameprocid = raw_input( 'Input game process id: ' ) print "sending webapi data now " print "steamid: ", steamid print "key: ", key print "gameappid: ", gameappid print "cheatnamestring: ", cheatnamestring print "cheatpathstring: ", cheatpathstring print "webcheaturlstring: ", webcheaturlstring print "cheatprocid: ", cheatprocid print "timecheatran: ", timecheatran print "timecheatstopped: ", timecheatstopped print "gameprocid: ", gameprocid #准备就绪! results = issueWebAPIRequest( universe='public', interface='icheatreportingservice', request='reportcheatdata', key=key, protocol='https', method='POST', cheatname=cheatnamestring, appid=gameappid, game_process_id=gameprocid, cheat_process_id=cheatprocid, pathandfilename=cheatpathstring, webcheaturl=webcheaturlstring, time_now=int(time.time()), time_started=timecheatran, time_stopped=timecheatstopped, steamid=steamid ) print "webapi results:", results #清除 def main(): sendcheatreport() if __name__ == '__main__': 0> main()

RequestVacStatusForUser

POST https://partner.steam-api.com/ICheatReportingService/RequestVacStatusForUser/v1/
名称类型是否必需描述
keystringSteamworks Web API 发行商验证密钥。
steamiduint64用户的 Steam ID。
appiduint32用户正在玩的游戏的 App ID。
session_iduint64从调用 StartSecureMultiplayerSession 获得的会话 ID。

检查用户的 VAC 封禁状态并验证用户的 VAC 会话状态。 若验证失败,则勿让该用户匹配到一个安全游戏。

这在用户进行匹配或加入游戏之前使用。 如果玩家以某种方式屏蔽了 VAC 且 VAC 无法扫描计算机中的作弊行为,将报告“success = true”,且“session_verified = false”。 检查此 web api 能让您阻止用户进行匹配或者加入服务器后迅速被 VAC 踢出(使用来自验证回调的 k_EAuthSessionResponseVACCheckTimedOut 结果)。 VAC 系统或许无法始终有时间完全判定客户端系统是否合作,如果是这样,将报告“success = false”。 玩家系统也有可能通过初步检查,但之后没有响应,在这种情况下,验证将会成功,但随后可能会发出 k_EAuthSessionResponseVACCheckTimedOut


注意: 此调用需要发行商 API 密钥才能使用此方法。 因此,此 API 必须通过安全服务器调用,且绝不能由客户端直接调用!

Web API 会话

注意:集成了 Steam 验证的游戏不应使用下列 API 调用, 而是应该使用 ISteamUser 接口 P2P 或游戏服务器设置。 对下列调用集的访问必须由 Valve 手动启用,且只能用于完全不依赖 Steam 对用户进行验证的游戏。

StartSecureMultiplayerSession

POST https://partner.steam-api.com/ICheatReportingService/StartSecureMultiplayerSession/v1/
名称类型是否必需描述
keystringSteamworks Web API 发行商验证密钥。
steamiduint64用户的 Steam ID。
appiduint32游戏的 App ID。

通知 VAC 服务器,一个安全的多人游戏会话已经开始了。

注意: 此调用需要发行商 API 密钥才能使用此方法。 因此,此 API 必须通过安全服务器调用,且绝不能由客户端直接调用!

EndSecureMultiplayerSession

POST https://partner.steam-api.com/ICheatReportingService/EndSecureMultiplayerSession/v1/
名称类型是否必需描述
keystringSteamworks Web API 发行商验证密钥。
steamiduint64用户的 Steam ID。
appiduint32游戏的 App ID。
session_iduint64从调用 StartSecureMultiplayerSession 获得的会话 ID。

通知 VAC 服务器,一个安全的多人游戏会话已经结束了。

注意: 此调用需要发行商 API 密钥才能使用此方法。 因此,此 API 必须通过安全服务器调用,且绝不能由客户端直接调用!

响应:
[
{
"name": "success",
"type": "bool",
"description": ""
}
]