성댕쓰 똑똑한 생활

고정 헤더 영역

글 제목

메뉴 레이어

성댕쓰 똑똑한 생활

메뉴 리스트

  • 홈
  • 태그
  • 방명록
  • 분류 전체보기 (172)
    • 똑똑한 재테크 (1)
      • 올웨더 자산배분 (1)
    • 똑똑한 개발 (170)
      • Hazel 게임엔진개발 (0)
      • Algorithm 과 Data Structure (51)
      • C++ (18)
      • C# (8)
      • 개발로그 (0)
      • Image Processing (2)
      • C++ 게임개발 (60)
      • 컴퓨터 그래픽스 (10)
      • 수학 (13)
      • 영어 (8)

검색 레이어

성댕쓰 똑똑한 생활

검색 영역

컨텐츠 검색

전체 글

  • Unicode

    2023.05.07 by 성댕쓰

  • PacketHandler

    2023.05.06 by 성댕쓰

  • Buffer Helpers

    2023.04.19 by 성댕쓰

  • Packet Session

    2023.04.16 by 성댕쓰

  • SendBuffer Pooling

    2023.04.05 by 성댕쓰

  • DllMain 정리

    2022.08.24 by 성댕쓰

  • Strand 정리

    2022.08.23 by 성댕쓰

  • 부사 더 쓰기

    2022.08.15 by 성댕쓰

  • Although, I would've liked, I feel like + could've

    2022.08.15 by 성댕쓰

  • Having met, having lived, having been

    2022.08.07 by 성댕쓰

Unicode

가변길이 데이터 중 문자열을 보내는 방법에 대해 알아보자. char sendData[1000] = "가"; // CP949 char sendData[1000] = u8"가"; // UTF-8 Unicode (한글 3바이트 + 로마 1바이트) WCHAR sendData[1000] = L"가"; // UTF-16 (한글, 로마 2바이트) TCHAR sendData[1000] = _T("가"); ClientPacketHandler.cpp struct S_TEST { uint64 id; uint32 hp; uint16 attack; // 가변 데이터 // 1) 문자열 (ex. name) // 2) 그냥 바이트 배열 (ex. 길드 이미지) // 3) 일반 리스트 vector buffs; wstring name; ..

똑똑한 개발/C++ 게임개발 2023. 5. 7. 00:26

PacketHandler

이전 시간에 만든 Packet을 쓰거나 읽을 때 필요한 공통적인 부분을 모듈화 해보자 ServerPacketHandler.h, ServerPacketHandler.cpp #pragma once enum { S_TEST = 1 }; struct BuffData { uint64 buffId; float remainTime; }; class ServerPacketHandler { public: static void HandlePacket(BYTE* buffer, int32 len); static SendBufferRef Make_S_TEST(uint64 id, uint32 hp, uint16 attack, vector buffs); }; #include "pch.h" #include "ServerPacketH..

똑똑한 개발/C++ 게임개발 2023. 5. 6. 00:27

Buffer Helpers

버퍼에 데이터 쓰고 읽는데 도움주는 클래스를 만들어 보자. BufferReader.h, BufferReader.cpp #pragma once /*-------------------- BufferReader --------------------*/ class BufferReader { public: BufferReader(); BufferReader(BYTE* buffer, uint32 size, uint32 pos = 0); ~BufferReader(); BYTE* Buffer() { return _buffer; } uint32 Size() { return _size; } uint32 ReadSize() { return _pos; } uint32 FreeSize() { return _size - _pos..

똑똑한 개발/C++ 게임개발 2023. 4. 19. 22:38

Packet Session

Session.h, Session.cpp ... /*---------------- PacketSession ----------------*/ struct PacketHeader { uint16 size; uint16 id; // 프로토콜ID (ex. 1=로그인, 2=이동요청) }; // [size(2)][id(2)][data...]...[size(2)][id(2)][data...] class PacketSession : public Session { public: PacketSession(); virtual ~PacketSession(); PacketSessionRef GetPacketSessionRef() { return static_pointer_cast(shared_from_this()); } pr..

똑똑한 개발/C++ 게임개발 2023. 4. 16. 21:25

SendBuffer Pooling

Sendbuffer를 Pooling 하여 사용하도록 바꿔보자 CoreTLS.h, CoreTLS.cpp #pragma once #include extern thread_local uint32 LThreadId; extern thread_local std::stack LLockStack; extern thread_local SendBufferChunkRef LSendBufferChunk; #include "pch.h" #include "CoreTLS.h" thread_local uint32 LThreadId = 0; thread_local std::stack LLockStack; thread_local SendBufferChunkRef LSendBufferChunk; SendBuffer.h, SendBuff..

똑똑한 개발/C++ 게임개발 2023. 4. 5. 22:54

DllMain 정리

DllMain Dynamic link library로 링크할 경우, DllMain이 진입점 함수로 불린다. 기본 함수 모양은 다음과 같다. 함수 이름은 대소문자 구별하므로 주의하자. BOOL WINAPI DllMain( HINSTANCE hinstDLL, // handle to DLL module DWORD fdwReason, // reason for calling function LPVOID lpvReserved ) // reserved { // Perform actions based on the reason for calling. switch( fdwReason ) { case DLL_PROCESS_ATTACH: // Initialize once for each new process. // Retur..

똑똑한 개발/C++ 2022. 8. 24. 15:13

Strand 정리

Strands 란 event handler 순차 실행을 보장하는 api. 이를 활용하면, 멀티 쓰레드 환경에서 명시적 lock없이 코드를 만들 수 있다. strand는 application code와 handler 실행 사이에 layer를 제공한다. worker thread가 직접 handler를 호출하지 않고 strand queue에 쌓는다. Strand Implementation Strand가 보장해야 할 기능은 다음과 같다. 동시에 핸들러를 실행하지 않는다. 이를 만족하기 위해, worker 스레드가 strand를 실행하고 있는지 확인할 수 있어야 한다. strand는 queue를 가지고 handler를 queuing 한다. 핸들러는 worker 스레드에서만 실행된다.(boost 용어로 io_ser..

똑똑한 개발/C++ 2022. 8. 23. 14:54

부사 더 쓰기

definitely It's definitely better. It's definitely lighter. That's definitely fake. carefully I read through the instructions very carefully many times. I carefully asked him how old he was. I carefully asked her if she was married. thoroughly do a thorough job Wow they did a real thorough job. He thoroughly went over every single detail during the meeting. During the meeting, the boss went thro..

똑똑한 개발/영어 2022. 8. 15. 11:57

Although, I would've liked, I feel like + could've

It's okay / It's all right. Although, it's a little slow-paced for me. Plus, it's all text and I really would've liked to see visual aids here and there. And, I feel like it could've been written in plainer language. I'm finding some parts very difficult to understand. It was good. Although, it was a little too bland for me. Plus, I would've liked to have some options with the sauce. And I feel ..

똑똑한 개발/영어 2022. 8. 15. 10:12

Having met, having lived, having been

I moved to my current place in October last year. I had a lot of initial concerns back then because, well you know, there are certain things about a place you just can't know for sure until you actually start living there, like neighbors. But now having lived there for almost 6 months, I can pretty confidently say that i'm very satisfied with the place. I started teaching English straight out of..

똑똑한 개발/영어 2022. 8. 7. 11:47

추가 정보

인기글

최신글

페이징

이전
1 2 3 4 ··· 18
다음
TISTORY
성댕쓰 똑똑한 생활 © Magazine Lab
페이스북 트위터 인스타그램 유투브 메일

티스토리툴바