MCPcopy Create free account
hub / github.com/Semporia/Scripts / getFriendList

Function getFriendList

jd_dreamFactory.js:872–907  ·  view source on GitHub ↗
(sort = 0)

Source from the content-addressed store, hash-verified

870 }
871}
872function getFriendList(sort = 0) {
873 return new Promise(async resolve => {
874 $.get(taskurl('friend/QueryFactoryManagerList', `sort=${sort}`, `_time,sort,zone`), async (err, resp, data) => {
875 try {
876 if (err) {
877 console.log(`${JSON.stringify(err)}`)
878 console.log(`${$.name} API请求失败,请检查网路重试`)
879 } else {
880 if (safeGet(data)) {
881 data = JSON.parse(data);
882 if (data['ret'] === 0) {
883 data = data['data'];
884 if (data.list && data.list.length <= 0) {
885 // console.log(`查询好友列表完成,共${$.friendList.length}好友,下面开始拾取好友地下的零件\n`);
886 return
887 }
888 let friendsEncryptPins = [];
889 for (let item of data.list) {
890 friendsEncryptPins.push(item);
891 }
892 $.friendList = [...$.friendList, ...friendsEncryptPins];
893 // if (!$.isNode()) return
894 await getFriendList(data.sort);
895 } else {
896 console.log(`QueryFactoryManagerList异常:${JSON.stringify(data)}`)
897 }
898 }
899 }
900 } catch (e) {
901 $.logErr(e, resp)
902 } finally {
903 resolve();
904 }
905 })
906 })
907}
908function getFactoryIdByPin(pin) {
909 return new Promise((resolve, reject) => {
910 // const url = `/dreamfactory/userinfo/GetUserInfoByPin?zone=dream_factory&pin=${pin}&sceneval=2`;

Callers 1

stealFriendFunction · 0.85

Calls 5

taskurlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected