I'm FanJae.

[Two Faced Poker] Day 7. Game Logic 처리 II 본문

Toy Project/Two Faced Poker

[Two Faced Poker] Day 7. Game Logic 처리 II

FanJae 2024. 11. 4. 23:51

1. 주요 구현 로직 (Server)

- 게임 시작

- 칩 정보 업데이트 및 기본 베팅 처리

- 카드 배분

- 베팅 처리


2. Server 처리 (게임 시작 Event)

2-1. 게임 시작

if (roomManager->All_User_Start_Ready_State())
{
	send_message = GAME_CLIENT_EVENT + START + DONE;
	roomManager->broadcast_Message(send_message, socket, TargetType::ALL);

	gameInit(socket, InitType::INIT);

	send_message = GAME_CLIENT_EVENT + GAME_INIT;
	roomManager->broadcast_Message(send_message, socket, TargetType::ALL);

	send_message = GAME_CLIENT_EVENT + TURN + MY;
	roomManager->broadcast_Message(send_message, socket, TargetType::SELF);

	send_message = GAME_CLIENT_EVENT + TURN + OTHER;
	roomManager->broadcast_Message(send_message, socket, TargetType::OTHERS);

	giveBasicBetting(socket,GameType::BET);
}
else
{
	send_message = GAME_CLIENT_EVENT + START + READY;
	roomManager->broadcast_Message(send_message, socket, TargetType::ALL);
}
bool Room_Manager::All_User_Start_Ready_State()
{
	bool start = true;
	for (auto user : users)
	{
		if (user.second->getisReady() == false)
		{
			start = false;
		}
	}
	return start;
}

- Room_Manager에서 전체 준비 상태를 체크 후 게임이 시작된다.

- Logic이 확정되면 Lock처리가 필요할 것 같다.

void Game_Manager::Handle_Game_Start(const SOCKET socket)
{
	std::cout << "[System] : Game_Start Event " << std::endl;
	std::string send_message;
	if (roomManager->All_User_Start_Ready_State())
	{
		send_message = GAME_CLIENT_EVENT + START + DONE;
		roomManager->broadcast_Message(send_message, socket, TargetType::ALL);

		gameInit(socket, InitType::INIT);

		send_message = GAME_CLIENT_EVENT + GAME_INIT;
		roomManager->broadcast_Message(send_message, socket, TargetType::ALL);

		send_message = GAME_CLIENT_EVENT + TURN + MY;
		roomManager->broadcast_Message(send_message, socket, TargetType::SELF);

		send_message = GAME_CLIENT_EVENT + TURN + OTHER;
		roomManager->broadcast_Message(send_message, socket, TargetType::OTHERS);

		giveBasicBetting(socket,GameType::BET);
	}
	else
	{
		send_message = GAME_CLIENT_EVENT + START + READY;
		roomManager->broadcast_Message(send_message, socket, TargetType::ALL);
	}
}

- 게임 시작이 되면, 게임 초기화 작업이 진행된다.

- 초기화 작업은 해당 유저의 베팅 정보를 리셋하고, 기본칩 셋팅(30개)로 셋팅해준다.

void Game_Manager::gameInit(const SOCKET socket, InitType init_type)
{
	roomManager->resetAllUsers(init_type);
}
void Room_Manager::resetAllUsers(InitType init_type) 
{
	std::lock_guard<std::mutex> lock(roomMutex); 
	for (auto& pair : users) {
		auto& user = pair.second;
		if (init_type == InitType::INIT) {
			user->setChips(DEFAULT_CHIPS); 
		}
		user->setFrontBet(0);
		user->setBackBet(0);
		user->setFrontCard(0);
		user->setBackCard(0);
	}
}

2-2. 기본 베팅 시작

void Game_Manager::giveBasicBetting(const SOCKET socket, GameType game_type)
{
	std::cout << "[System] Basic Betting Started\n";
	std::string send_message;

	if (game_type == GameType::DRAW)
	{
		giveCards(socket, GameType::INIT);
	}
	else
	{
		roomManager->setdealerchips(2);

		send_message = GAME_CLIENT_EVENT + BASIC_BETTING;
		roomManager->broadcast_Message(send_message, socket, TargetType::ALL);

		roomManager->updateChips(socket, GameType::INIT, 1);
		giveCards(socket, GameType::INIT);
	}
}

- 이후, 게임을 하는 유저들은 1개의 칩을 베팅한다. (기본 베팅)

- 예외적으로 전판이 무승부인 상황일때는 칩을 걸지 않는다.

 

2-2-1. 딜러 칩 설정

void Room_Manager::setdealerchips(int value)
{
	this->dealerChips = value;
}

- 기본 베팅으로 얻는 2개의 칩 또는 무승부로 딜러가 다음 경기 승자가 결정될때까지 칩을 가진 경우에만 발생한다.

- 일반적인 setter이다.

 

2-3. 칩 정보 업데이트 updateChips() 함수

void Room_Manager::updateChips(const SOCKET socket, GameType game_type, int chipCount)
{
	std::lock_guard<std::mutex> lock(roomMutex);
	std::string send_message;
	std::shared_ptr<User> user_data[2];

	int myChip = 0;
	int otherChip = 0;
	int user_chip_info[2] = { 0 };
	int vs_chip_info[2] = { 0 };
	int dealerChip = this->dealerChips;

	for (auto& pair : users) 
	{
		auto& user = pair.second;
		if (pair.first == getUserNumberFromSocket(socket))
		{
			user_data[0] = user;
			if (game_type == GameType::INIT)
			{
				myChip = user->getChips();
				myChip--;
				user->setChips(myChip);
				user->setBetType(BetType::NONE);
			}
			if (game_type == GameType::BET)
			{
				myChip = user->getChips();
				myChip -= chipCount;
				user->setChips(myChip);
			}
			if (game_type != GameType::INIT && game_type != GameType::BET)
			{
				myChip = user->getChips();
				user_chip_info[0] = user->getFrontBet();
				user_chip_info[1] = user->getBackBet();
				user->setFrontBet(0);
				user->setBackBet(0);
				continue;
			}

			send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(myChip);
			broadcast_Message(send_message, socket, TargetType::SELF);

			send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(myChip);
			broadcast_Message(send_message, socket, TargetType::OTHERS);
		}
		else
		{
			user_data[1] = user;
			if (game_type == GameType::INIT)
			{
				otherChip = user->getChips();
				otherChip--;
				user->setChips(otherChip); 
				user->setBetType(BetType::NONE);
			}
			if (game_type == GameType::BET)
			{
				continue;
			}
			if (game_type != GameType::INIT && game_type != GameType::BET)
			{
				otherChip = user->getChips();
				vs_chip_info[0] = user->getFrontBet();
				vs_chip_info[1] = user->getBackBet();
				user->setFrontBet(0);
				user->setBackBet(0);
				continue;
			}

			send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(otherChip);
			broadcast_Message(send_message, socket, TargetType::OTHERS);

			send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(otherChip);
			broadcast_Message(send_message, socket, TargetType::SELF);
		}
	}
	
	if (game_type == GameType::WIN)
	{
		myChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1] + dealerChip;
		user_data[0]->setChips(myChip);

		send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(myChip);
		broadcast_Message(send_message, socket, TargetType::SELF);

		send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(myChip);
		broadcast_Message(send_message, socket, TargetType::OTHERS);
	}
	else if (game_type == GameType::LOSE)
	{
		otherChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1] + dealerChip;
		user_data[1]->setChips(otherChip);

		send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(otherChip);
		broadcast_Message(send_message, socket, TargetType::OTHERS);

		send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(otherChip);
		broadcast_Message(send_message, socket, TargetType::SELF);
	}
	else if (game_type == GameType::DRAW)
	{
		dealerChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1];
		setdealerchips(dealerChip);

		send_message = GAME_CLIENT_EVENT + DEALER + CHIP_UPDATE + std::to_string(dealerChip);
		broadcast_Message(send_message, socket, TargetType::ALL);
	}
	else if (game_type == GameType::BOTHWIN)
	{
		myChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1] + dealerChip + 10;
		user_data[0]->setChips(myChip);

		otherChip -= 10;
		user_data[1]->setChips(otherChip);

		send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(myChip);
		broadcast_Message(send_message, socket, TargetType::SELF);

		send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(myChip);
		broadcast_Message(send_message, socket, TargetType::OTHERS);

		send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(otherChip);
		broadcast_Message(send_message, socket, TargetType::OTHERS);

		send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(otherChip);
		broadcast_Message(send_message, socket, TargetType::SELF);
	}
	else if (game_type == GameType::BOTHLOSE)
	{
		myChip -= 10;
		user_data[0]->setChips(myChip);

		otherChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1] + dealerChip + 10;
		user_data[1]->setChips(otherChip);

		send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(myChip);
		broadcast_Message(send_message, socket, TargetType::SELF);

		send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(myChip);
		broadcast_Message(send_message, socket, TargetType::OTHERS);

		send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(otherChip);
		broadcast_Message(send_message, socket, TargetType::OTHERS);

		send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(otherChip);
		broadcast_Message(send_message, socket, TargetType::SELF);
	}
}

- 추후 리팩토링을 진행한다면, 가장 먼저 리팩토링이 되어야 할 것 같다.

- ChipUpdate를 담당하는 함수이다.

- GAME_EVENT 상황에 따라서 로직이 상이하다.

 

2-3-1. 주요 로직 요약

- 기본적으로 이 게임은 CALL한 유저가 기준이되기 때문에, 그 유저를 기준으로 삼아서 로직을 처리헀다.

- 기본 베팅(INIT)인 경우 -> 칩1개씩 감소.

- 플레이어가 베팅(BET)인 경우 -> 해당 유저만 베팅한 칩 개수 감소.

- 위 2가지 케이스가 아닌 경우, 우선 유저가 걸었던 칩 정보를 저장해두고 0으로 셋팅했다.

if (game_type == GameType::INIT)
{
	myChip = user->getChips();
	myChip--;
	user->setChips(myChip);
	user->setBetType(BetType::NONE);
}
if (game_type == GameType::BET)
{
	myChip = user->getChips();
	myChip -= chipCount;
	user->setChips(myChip);
}
if (game_type != GameType::INIT && game_type != GameType::BET)
{
	myChip = user->getChips();
	user_chip_info[0] = user->getFrontBet();
	user_chip_info[1] = user->getBackBet();
	user->setFrontBet(0);
	user->setBackBet(0);
	continue;
}

- 내가 이긴 경우 -> 베팅된 칩을 모두 가져옴. (딜러칩 포함)

- 내가 짐 -> 베팅된 모든 칩을 다줘야함. (딜러칩 포함)

- 비김 -> 딜러가 임시로 해당 칩을 보유. (다음판 승자가 가져가야함)

- 양면베팅 승리 -> 베팅된 칩을 모두 가져옴 + 칩 10개를 추가로 가져옴.

- 양면베팅 패배 -> 베팅된 모든 칩을 다줘야함 + 칩 10개를 추가로 빼앗김.

if (game_type == GameType::WIN)
{
	myChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1] + dealerChip;
	user_data[0]->setChips(myChip);

	send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(myChip);
	broadcast_Message(send_message, socket, TargetType::SELF);

	send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(myChip);
	broadcast_Message(send_message, socket, TargetType::OTHERS);
}
else if (game_type == GameType::LOSE)
{
	otherChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1] + dealerChip;
	user_data[1]->setChips(otherChip);

	send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(otherChip);
	broadcast_Message(send_message, socket, TargetType::OTHERS);

	send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(otherChip);
	broadcast_Message(send_message, socket, TargetType::SELF);
}
else if (game_type == GameType::DRAW)
{
	dealerChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1];
	setdealerchips(dealerChip);

	send_message = GAME_CLIENT_EVENT + DEALER + CHIP_UPDATE + std::to_string(dealerChip);
	broadcast_Message(send_message, socket, TargetType::ALL);
}
else if (game_type == GameType::BOTHWIN)
{
	myChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1] + dealerChip + 10;
	user_data[0]->setChips(myChip);

	otherChip -= 10;
	user_data[1]->setChips(otherChip);

	send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(myChip);
	broadcast_Message(send_message, socket, TargetType::SELF);

	send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(myChip);
	broadcast_Message(send_message, socket, TargetType::OTHERS);

	send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(otherChip);
	broadcast_Message(send_message, socket, TargetType::OTHERS);

	send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(otherChip);
	broadcast_Message(send_message, socket, TargetType::SELF);
}
else if (game_type == GameType::BOTHLOSE)
{
	myChip -= 10;
	user_data[0]->setChips(myChip);

	otherChip += user_chip_info[0] + user_chip_info[1] + vs_chip_info[0] + vs_chip_info[1] + dealerChip + 10;
	user_data[1]->setChips(otherChip);

	send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(myChip);
	broadcast_Message(send_message, socket, TargetType::SELF);

	send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(myChip);
	broadcast_Message(send_message, socket, TargetType::OTHERS);

	send_message = GAME_CLIENT_EVENT + MY + CHIP_UPDATE + std::to_string(otherChip);
	broadcast_Message(send_message, socket, TargetType::OTHERS);

	send_message = GAME_CLIENT_EVENT + OTHER + CHIP_UPDATE + std::to_string(otherChip);
	broadcast_Message(send_message, socket, TargetType::SELF);
}

 

 

2-4. 카드 배분 로직

void Game_Manager::giveCards(const SOCKET socket, GameType game_type)
{
	std::string send_message;
	std::pair <int, int> card_data[2];
	if (deck.cardEmpty())
	{
		deck.resupplyCard();
	}
	else
	{
		card_data[0] = deck.DealCard();
		card_data[1] = deck.DealCard();
		roomManager->updateCards(socket, game_type, card_data);
	}
}

- GameManager가 Deck 정보를 가지고 있다. 따라서, Deck으로 부터 받아서 이를 Room에 업데이트하는 방식이다.

 

2-4-1. Deck 관련 주요 구현 정보

void Deck::shuffleCard()
{
	std::cout << "[Game] Now ShuffleCard\n" << std::endl;

	std::vector<Card> vec(cards.begin(), cards.end());

	unsigned seed = std::chrono::system_clock::now().time_since_epoch().count(); // 현재 시각 기반 시드 생성
	std::shuffle(vec.begin(), vec.end(), std::default_random_engine(seed));

	cards.assign(vec.begin(), vec.end());
}

void Deck::resupplyCard()
{
	for (int i = 1; i <= 10; i++)
	{
		for (int j = 1; j <= 10; j++)
		{
			if (i == j) continue; // 서로 앞 뒷면 서로 숫자
			cards.push_back(Card(i, j));
		}
	}
	shuffleCard();
	std::cout << "Cards Initalization done.\n";
}

std::pair<int, int> Deck::DealCard()
{
	std::pair<int, int> data;
	data.first = getFrontCard();
	data.second = getBackCard();

	std::cout << "<Card> : Front : " << getFrontCard() << "Back : " << getBackCard() << std::endl;
	cards.pop_front();
	return data;
}

- Deck은 기본적으로, 1부터 10까지 앞 뒷면이 서로 다른 숫자 90개를 만든다.

- 이를 Random 하게 섞어서 배분해준다.

 

2-5. 베팅 처리

void Game_Manager::betUser(const SOCKET socket, const std::string& message)
{
	std::string type[5] = { FRONT,BOTH,BACK,DIE,SPECIAL};
	int bet_message;
	int bet_count;
	for (int i = 0; i < 5; i++)
	{
		if (type[i] == message.substr(0,type[i].length()))
		{
			bet_message = i;
			if (type[i] != DIE && type[i] != SPECIAL)
			{
				bet_count = stoi(message.substr(type[i].length()));
			}
			else
			{
				bet_count = 0;
			}
		}
	}
	std::cout << "bet_message : " << bet_message << "bet_count : " << bet_count << std::endl;
	betChip(socket, bet_count,static_cast<BetType>(bet_message));
}

- 베팅일때는 포기(DIE)인 경우와 특수 케이스(상대가 더이상 베팅할 수 없는 경우)를 제외하면 베팅한 칩 개수가 온다.

 

2-5-1. betChip() 함수

void Game_Manager::betChip(const SOCKET socket, int bet_count, BetType bet_type)
{
	std::string send_message;
	GameType game_type = GameType::IMPOSSIBLE;
	GameType result_type = GameType::IMPOSSIBLE;
	GameType check_win = GameType::IMPOSSIBLE;
	if (bet_type != BetType::DIE && bet_type != BetType::SPECIAL)
	{
		game_type = roomManager->betChips(socket, bet_count, bet_type);
	}
	else
	{
		if (bet_type == BetType::SPECIAL)
		{
			roomManager->specialCase(socket);
		}
		game_type = GameType::CALL;
	}
}

- 베팅도 나를 기준으로 주요 로직을 처리하였다.

- 포기한 경우나 더이상 베팅이 불가능한 경우가 아니면 칩 정보를 베팅 처리한다.

 

2-5-2. RoomManager->betChips() 함수

GameType Room_Manager::betChips(const SOCKET socket, int count, BetType bet_type)
{
	std::string send_message = "";
	std::shared_ptr<User> my_data;

	BetType user_bet_type = { BetType::NONE };
	int user_chip_info[2] = { 0 };
	int vs_chip_info[2] = { 0 };

	for (auto& pair : users) 
	{
		auto& user = pair.second;
		if (pair.first == getUserNumberFromSocket(socket))
		{
			my_data = user;
			user_bet_type = user->getBetType();
			user_chip_info[0] = max(user->getFrontBet(), user->getBackBet());	
			user_chip_info[1] = user->getChips();
		}
		else
		{
			vs_chip_info[0] = max(user->getFrontBet(), user->getBackBet());
			vs_chip_info[1] = user->getChips();
		}
	}

	if ((count > user_chip_info[1]) || (count + user_chip_info[0] > vs_chip_info[1] + vs_chip_info[0]))
	{
		std::cout << "IMPOSSIBLE case1" << std::endl;
		send_message = GAME_CLIENT_EVENT + BETTING + IMPOSSIBLE;
		broadcast_Message(send_message, socket, TargetType::SELF);
		return GameType::IMPOSSIBLE;
	}
	else if (bet_type == BetType::BOTH && ((count * 2 > user_chip_info[1]) || (count + user_chip_info[0] > vs_chip_info[0] + vs_chip_info[1])))
	{
		std::cout << "IMPOSSIBLE case2" << std::endl;
		send_message = GAME_CLIENT_EVENT + BETTING + IMPOSSIBLE;
		broadcast_Message(send_message, socket, TargetType::SELF);
		return GameType::IMPOSSIBLE;
	}
	else if (count + user_chip_info[0] < vs_chip_info[0])
	{
		std::cout << "IMPOSSIBLE case3" << std::endl;
		send_message = GAME_CLIENT_EVENT + BETTING + IMPOSSIBLE;
		broadcast_Message(send_message, socket, TargetType::SELF);
		return GameType::IMPOSSIBLE;
	}
	else if (user_bet_type != BetType::NONE && user_bet_type != bet_type)
	{
		std::cout << "IMPOSSIBLE case4" << std::endl;
		send_message = GAME_CLIENT_EVENT + BETTING + IMPOSSIBLE;
		broadcast_Message(send_message, socket, TargetType::SELF);
		return GameType::IMPOSSIBLE;
	}

	if (bet_type == BetType::BOTH)
	{
		updateChips(socket, GameType::BET, count * 2);
	}
	else
	{
		updateChips(socket, GameType::BET, count);
	}
	
	
	updateBetInfo(socket, count, bet_type);
	if (count + user_chip_info[0] > vs_chip_info[0])
	{
		return GameType::RAISE;
	}
	else if(count + user_chip_info[0] == vs_chip_info[0])
	{
		return GameType::CALL;
	}
	return GameType::IMPOSSIBLE;
}

- 실질적인, 칩에 대한 정보를 얻어서 처리한다. 

- 클라에서 1차적으로 검증을 하지만 서버에서 한번 더 검증을 진행한다.

- 내가 가진 칩 개수보다 많은 칩을 내진 않았는지, 상대가 낼 수 없는 만큼의 칩을 내진 않았는지 등을 검증해서 처리한다.

- 이상이 없으면, 내가 가진 칩 정보를 업데이트한다. -> updateChips() 함수

- 테이블에 깔리는 베팅 정보도 업데이트 해준다.

void Room_Manager::updateBetInfo(const SOCKET socket, int count, BetType bet_type)
{
	std::string send_message = "";
	for (auto& pair : users)
	{
		auto& user = pair.second;
		if (pair.first == getUserNumberFromSocket(socket))
		{
			user->setBetType(bet_type);
			if (BetType::FRONT == bet_type || BetType::BOTH == bet_type)
			{
				user->setFrontBet(user->getFrontBet() + count);
				send_message = GAME_CLIENT_EVENT + MY + BET_UPDATE + FRONT + std::to_string(user->getFrontBet());
				broadcast_Message(send_message, socket, TargetType::SELF);

				send_message = GAME_CLIENT_EVENT + OTHER + BET_UPDATE + FRONT + std::to_string(user->getFrontBet());
				broadcast_Message(send_message, socket, TargetType::OTHERS);
			}
			if (BetType::BACK == bet_type || BetType::BOTH == bet_type)
			{
				user->setBackBet(user->getBackBet() + count);
				send_message = GAME_CLIENT_EVENT + MY + BET_UPDATE + BACK + std::to_string(user->getBackBet());
				broadcast_Message(send_message, socket, TargetType::SELF);

				send_message = GAME_CLIENT_EVENT + OTHER + BET_UPDATE + BACK + std::to_string(user->getBackBet());
				broadcast_Message(send_message, socket, TargetType::OTHERS);
			}
			if (BetType::BOTH == bet_type)
			{
				send_message = GAME_CLIENT_EVENT + MY + BET_UPDATE + BOTH;
				broadcast_Message(send_message, socket, TargetType::SELF);

				send_message = GAME_CLIENT_EVENT + OTHER + BET_UPDATE + BOTH;
				broadcast_Message(send_message, socket, TargetType::OTHERS);
			}
		}
	}
}

양면이 아니면, 앞이냐 뒤냐에 따라서 베팅 정보를 설정한다.

- 단, 양면 베팅이라면, 앞 뒤 모두에 대해서 테이블 업데이트를 진행해줘야한다.


3. TODO

- 카드 비교 로직

- CALL, RAISE 상황에 따른 처리 필요

Comments