【发布时间】:2014-01-02 00:40:45
【问题描述】:
我希望使用激战 2 中的内存映射文件,该文件旨在链接到 Mumble 以获取位置音频。该文件包含有关字符坐标和其他有用信息的信息。
我已经能够使用此脚本访问坐标信息,
import mmap
import struct
last=[]
while True:
shmem = mmap.mmap(0, 20, "MumbleLink", mmap.ACCESS_READ)
coord=struct.unpack("IL3f", shmem)[2:5]
shmem.close()
if last!=coord:
print(coord)
last = coord
X = coord[2]
Y = coord[0]
Z = coord[1])
我的问题是我很难弄清楚如何从文件中获取更多信息。我将如何访问存储的其他信息,例如角色名称和相机位置。
这里有文件信息:
https://forum-en.guildwars2.com/forum/community/api/Map-API-Mumble-Mashup
http://mumble.sourceforge.net/Link
任何帮助将不胜感激。
干杯, 编。
【问题讨论】:
标签: python struct mmap memory-mapped-files