作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有兴趣使用 PHP 构建一个解析器来享受我的乐趣。我需要知道什么?你对我有什么建议?我什至如何使用 PHP 打开星际争霸 2 重播?
最佳答案
SC 回放文件实际上是一个 MPQ 存档文件。此 MPQ 存档包含几个不同的文件(如 .zip 文件)。
在这个文件中,MPQ 文件中的每种数据类型都有单独的文件。(例如,一个文件用于游戏事件,另一个文件用于 UI 事件)。
网上有大量关于如何处理 MPQ 文件的文档。现在,MPQ 中的单个文件有点棘手。
如果您想从回放中获取信息(玩家是谁以及他们玩过的 map ),您可以使用这些工具。 (我假设是一个类似 Unix 的 Web 服务器)。
1) 下载并构建 libmpq 和 mpq-tools ( https://libmpq.org/ )
2) 运行以下脚本
您可以通过 system() 调用运行这些,然后运行一些拆分命令来获取玩家和比赛。
将其另存为 info.sh。像命令 shell 一样运行它,并将重播文件作为参数传递。
#!/bin/bash
# Save this file as info.sh
# This extracts the individual files from the MPQ archive (the replay
# file)
mpq-extract -e $1 > /dev/null
cat file000000.xxx | strings | ruby info.rb
这是一个 ruby 脚本。将其另存为 info.rb
# This *kinda* extracts the file info from a header file. I don't
# really know how it works yet, so I'm just extracting strings.
#
# Save this file as info.rb
lines = STDIN.readlines
puts "%s:%s|%s:%s" % [(lines[0].strip), (lines[1].strip), (lines[2].strip), (lines[3].strip)]
希望这对您有所帮助!
关于php - 我如何查看星际争霸 2 重播?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3853594/
假设有两个需要按顺序执行的 API 异步请求。第一个请求的结果是字典,第二个请求使用它来获得最终字典。Interstellar ( https://github.com/JensRavens/Inte
我是一名优秀的程序员,十分优秀!