Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

엔디안의 동작성은 시스템의 엔디안에 따라 달라야 할 것 같습니다. #4

Closed
dimohy opened this issue Mar 25, 2024 · 1 comment

Comments

@dimohy
Copy link
Collaborator

dimohy commented Mar 25, 2024

시스템이 리틀 엔디안이고 패킷을 리틀 엔디안으로 만들어야 한다면 유닛 별 배열 순서를 바꿀 필요가 없습니다.
시스템이 빅 엔디안이고 패킷을 빅 엔디안으로 만들어야 한다면 유닛 별 배열 순서를 바꿀 필요가 없습니다.

즉, 시스템의 엔디안과 만들어야 할 패킷 엔디안이 다를 경우에만 reverse를 하면 될 것 같은데 맞을까요?

시스템의 엔디안은 BitConverter.IsLittleEndian으로 얻을 수 있는 것 같습니다.

@dimohy
Copy link
Collaborator Author

dimohy commented Mar 25, 2024

즉 PacketBuilderConfiguration의 엔디안 설정 (기본값 리틀 엔디언)에 의해서 생성자에서 boolean 으로 시스템과 같은지 다른지를 설정한 후 각 Append에서 boolean 값으로 reverse를 하기 위해 분기하면 될 것 같습니다.

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

No branches or pull requests

2 participants