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CAAW,CAAC;YACxG,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC1B;QAAC,OAAO,CAAC,EAAE;YACR,OAAO,EAAE,CAAC;SACb;IACL,CAAC;IAPqB,yBAAY,eAOjC,CAAA;IAED,WAAW;IACJ,KAAK,UAAU,aAAa,CAAC,GAAW;QAC3C,IAAI,YAAY,GAAG,eAAG,CAAC,YAAY,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;QAC1C,IAAI,GAAG,GAAG,MAAM,uBAAU,CAAC,YAAY,CAAC,IAAI,CAAC,2BAA2B,EAAE,IAAI,EAAE,SAAS,GAAG,YAAY,eAAG,CAAC,YAAY,EAAG,CAAC,QAAQ,YAAY,uBAAU,CAAC,MAAM,EAAE,EAAE,mCAAmC,CAAC,CAAC;QAC1M,OAAO,IAAI,CAAC,KAAK,CAAC,GAAa,CAAC,CAAC;IACrC,CAAC;IALqB,0BAAa,gBAKlC,CAAA;AACL,CAAC,EA5CgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA4C5B","file":"","sourceRoot":"/","sourcesContent":["import { channel, GameConfig } from \"../../GameConfig\";\nimport { SDK } from \"simba-sdk\";\n\nexport namespace HttpRequests {\n // 检查敏感词\n export async function hasDirtyWords(msg: string) {\n if (channel !== \"dummy\") {\n let data = `game_id=${GameConfig.gameId}&game_channel=${channel}&nickname=${msg}`;\n let ret = JSON.parse(await GameConfig.iwpServerUrl.post(\"/wechat/checknickname\", 5000, data, \"application/x-www-form-urlencoded\") as string);\n // console.log(\"校验返回的数据 \", ret);\n if (ret.code === \"0\") {\n return ret.obj.is_sensitive as boolean;\n } else {\n throw new Error(\"校验错误\");\n }\n } else {\n return false;\n }\n }\n\n // 获取公告\n export async function getNotice() {\n try {\n let str = await GameConfig.cdnServer.get(`/notice/notice_${GameConfig.gameVersion}.json`) as string;\n return JSON.parse(str);\n } catch (e) {\n return \"\";\n }\n }\n\n // 获取新版公告\n export async function getNewNotice() {\n try {\n let str = await GameConfig.cdnServer.get(`/notice/notice_${GameConfig.gameVersion}_new.json`) as string;\n return JSON.parse(str);\n } catch (e) {\n return \"\";\n }\n }\n\n // 兑换 CDKEY\n export async function exchangeCDKEY(key: string) {\n let getLoginInfo = SDK.getLoginInfo();\n console.log('getLoginInfo', getLoginInfo);\n let ret = await GameConfig.iwpServerUrl.post(\"/client/v1/cdkey/exchange\", 5000, `cdkey=${key}&user_id=${SDK.getLoginInfo()!.playerId}&game_id=${GameConfig.gameId}`, \"application/x-www-form-urlencoded\");\n return JSON.parse(ret as string);\n }\n}"]}