Skip to content

Conversation

@giftof
Copy link
Collaborator

@giftof giftof commented Nov 16, 2022

네트워크 요청 할수 있도록 간단하게 만들어두었습니다.
NetworkModuleTest 에서 사용법 확인하실수 있습니다.

IO는
public void Request(string uri, UnityAction<(bool, string)> callback = null)
처럼 만들어 두었습니다.

uri에는 주소 넣으시면 되구요.
callback은 tuple로 인자 받게 하시면 됩니다.

  • bool은 요청 성공 실패를 의미합니다.
  • string에는 payload를 담고 있습니다.

궁금하신 부분 있으면 설명 요청해주세요.

post를 추가했습니다.

    public void RequestGet(string uri, UnityAction<(bool, string)> callback = null)
    public void RequestPost(string uri, UnityAction<(bool, string)> callback = null, params KeyValuePair<string, string>[] data)
    public void RequestPost(string uri, UnityAction<(bool, string)> callback = null, Dictionary<string, string> data = null)

post에는 key, value방식으로 값이 들어가므로, 일단 이렇게 해두었고,
나중에 데이터 양식이 정해시면, 좀 더 편하게 처리될 수 있도록 수정하겠습니다. (요청이 있으면요)

@giftof giftof linked an issue Nov 16, 2022 that may be closed by this pull request
2 tasks
@giftof
Copy link
Collaborator Author

giftof commented Nov 20, 2022

NetworkModule안에 통으로 있는것을
networkHandler로 옮겼습니다.
module은 network관련 더 큰 범주의 일을 하게 되지않을까... 싶습니다.

@giftof giftof merged commit 4c7421b into main Nov 20, 2022
@giftof giftof deleted the 89-network-module branch November 20, 2022 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Network module

5 participants