feat: 강화 결과 채팅으로 모든 클라이언트가 같이 공유
This commit is contained in:
parent
1e922ca3e8
commit
b9c5a22989
3 changed files with 109 additions and 41 deletions
|
|
@ -1,8 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "Packet.h"
|
||||
#include <atomic>
|
||||
#include <boost/asio.hpp>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
using boost::asio::ip::tcp;
|
||||
|
||||
|
|
@ -29,6 +31,10 @@ public:
|
|||
|
||||
bool Login(const std::string &nickname);
|
||||
|
||||
// 비동기 수신 시작
|
||||
void StartReceive();
|
||||
void StopReceive();
|
||||
|
||||
virtual void Run() = 0;
|
||||
|
||||
protected:
|
||||
|
|
@ -37,6 +43,12 @@ protected:
|
|||
uint64_t currentGold_ = 0;
|
||||
std::string nickname_;
|
||||
|
||||
std::jthread receiveThread_;
|
||||
std::atomic<bool> isRunning_{false};
|
||||
|
||||
void ReceiveLoop(std::stop_token stopToken);
|
||||
void HandlePacket(const PacketHeader &header);
|
||||
|
||||
void HandleUpgradeResult();
|
||||
void HandleSellResult();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue