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

Function specialUserOper

jd_cfd.js:396–426  ·  view source on GitHub ↗
(strStoryId, dwType, ddwTriggerDay, StoryList)

Source from the content-addressed store, hash-verified

394
395// 接待贵宾
396function specialUserOper(strStoryId, dwType, ddwTriggerDay, StoryList) {
397 return new Promise((resolve) => {
398 $.get(taskUrl(`story/SpecialUserOper`, `strStoryId=${strStoryId}&dwType=${dwType}&triggerType=0&ddwTriggerDay=${ddwTriggerDay}`), (err, resp, data) => {
399 try {
400 if (err) {
401 console.log(`${JSON.stringify(err)}`)
402 console.log(`${$.name} SpecialUserOper API请求失败,请检查网路重试`)
403 } else {
404 data = JSON.parse(data.replace(/\n/g, "").match(new RegExp(/jsonpCBK.?\((.*);*\)/))[1]);
405 if (dwType === '2') {
406 if (data.iRet === 0 || data.sErrMsg === "success") {
407 console.log(`贵宾'${StoryList.Special.strName}'下船成功`)
408 } else {
409 console.log(`贵宾'${StoryList.Special.strName}'下船失败 ${data.sErrMsg}\n`)
410 }
411 } else if (dwType === '3') {
412 if (data.iRet === 0 || data.sErrMsg === "success") {
413 console.log(`贵宾'${StoryList.Special.strName}'用餐成功:获得${StoryList.Special.ddwCoin}金币\n`)
414 } else {
415 console.log(`贵宾'${StoryList.Special.strName}'用餐失败:${data.sErrMsg}\n`)
416 }
417 }
418 }
419 } catch (e) {
420 $.logErr(e, resp);
421 } finally {
422 resolve();
423 }
424 })
425 })
426}
427
428// 收藏家
429function collectorOper(strStoryId, dwType, ddwTriggerDay) {

Callers 1

cfdFunction · 0.85

Calls 4

taskUrlFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected