🛰️외부 API 통신하기
httpGet
// 플레이어가 입장할 때 동작하는 함수
App.onJoinPlayer.Add(function (player) {
App.httpGet(
"https://nickname.hwanmoo.kr/?format=json&count=1&max_length=6&whitespace=_",
null,
function (res) {
// 응답 결과를 JSON 오브젝트로 변경
let response = JSON.parse(res);
player.name = response.words[0];
player.sendUpdated();
}
);
});httpPost
Last updated
Was this helpful?
