我正在开发一个简单的应用程序,它从 wowarmory.com 获取一些数据。 我需要做的是获取角色的声望。 我知道 api 位于哪里:
http://www.wowarmory.com/character-reputation.xml?r=Realm&cn=CharacterName
我可以获取 XML 并将其加载到 SimpleXML 对象中,但我无法弄清楚如何从 XML 中获取每个派系的当前和最大声誉。 下面是一个 XML 示例:
<faction id="69" key="darnassus" name="Darnassus" reputation="35023"/>
<faction id="930" key="exodar" name="Exodar" reputation="26805"/>
<faction id="54" key="gnomereganexiles" name="Gnomeregan Exiles" reputation="23433"/>
<faction id="47" key="ironforge" name="Ironforge" reputation="29410"/>
每个派系只有“声誉”属性。 我如何计算它的最大和当前声誉? 好像缺少属性。
有人能指出我正确的方向吗?
I'm developing a simple application that fetches some data from wowarmory.com. What I need to do is fetch reputations for a character. I know where's the api located:
http://www.wowarmory.com/character-reputation.xml?r=Realm&cn=CharacterName
I can fetch the XML and load it into the SimpleXML object but I'm having trouble figuring out how to get the current and maximum reputation for each faction from the XML. Here's an example of XML:
<faction id="69" key="darnassus" name="Darnassus" reputation="35023"/>
<faction id="930" key="exodar" name="Exodar" reputation="26805"/>
<faction id="54" key="gnomereganexiles" name="Gnomeregan Exiles" reputation="23433"/>
<faction id="47" key="ironforge" name="Ironforge" reputation="29410"/>
There's only the attribute 'reputation' there for each faction. How do I calculate the maximum and current reputation from it though? Seems like there are missing attributes.
Can somebody point me to the right direction?
发布评论
评论(2)
我想我可以回答这个问题,因为我自己也是一名魔兽世界玩家。
Wow的代表系统只是-42,000到42,000范围内的点值。
这个范围被分为对游戏有实际意义的级别。
这意味着某个派系拥有 35,023 名声望的人处于崇敬地位 - 具体来说是 14,024/21,000。
他们的 API 中可能有一个方法可以为您执行此转换,但如果没有该方法,这应该会为您提供所需的数据。
I think I can answer this since I'm a WoW player myself.
Wow's rep system is just a point values in the inclusive range of -42,000 to 42,000.
This range is divided up into levels which have tangible meaning to the game.
That means someone with 35,023 rep for a faction is at Revered - specifically 14,024/21,000.
There may be a method in their API that does this conversion for you, but without that, this should give you the data you need.
值 42999 表示该派系的最高声望。
-42000 的值表示该派系的最大仇恨声誉。
他们使用该派系的声誉总量,并在显示代码中将其分为不同的级别。 请参阅http://www.wowwiki.com/Reputation 了解每个声望级别开始位置的详细信息。
A value of 42999 indicates maximum exalted reputation with that faction.
A value of -42000 indicates maximum hated reputation with that faction.
They use the total amount of reputation with that faction and divide it down into different levels in the display code. Refer to the reputation levels chart at http://www.wowwiki.com/Reputation for details on where each reputation level begins.