|
/**
* 进入副本时获取当前user进入的副本ID
*/
function user_and_dungeon() {
Interceptor.attach(ptr(0x085A0954), {
onEnter: function (args) {
var party = args[0];
var dungeonId = args[1].toInt32();
for (var i = 0; i < 4; i++) {
var user = CParty_get_user(party, i);
if (user != '0x0') {
if (!userObjects.hasOwnProperty(user)) {
userObjects[user] = [];
}
userObjects[user].push(dungeonId);
}
}
}
});
}
/**
* 通过user当前副本ID
*
* @param user
* @returns {*|*[]}
*/
function getDungeonIdsForUser(user) {
if (userObjects.hasOwnProperty(user)) {
return userObjects[user];
} else {
return [];
}
}
/**
* 通过user删除数据
*
* @param user
*/
function deleteUserFromUserObjects(user) {
if (userObjects.hasOwnProperty(user)) {
delete userObjects[user];
} else {
console.log("user", user, "Does not exist in userObjects and does not need to be deleted");
}
}
原文地址:https://tieba.baidu.com/p/9039786611原作者:青梅煮酒¥ |
|