SQC-15_online #1
| @@ -50,12 +50,8 @@ sockaddr_in* Connection::getAddr() const { return (sockaddr_in*)&m_addr; } | |||||||
| void Connection::getPacks(SOCKET sock) { | void Connection::getPacks(SOCKET sock) { | ||||||
| 	std::vector<char*> lsPck; | 	std::vector<char*> lsPck; | ||||||
| 	Input in; | 	Input in; | ||||||
| 	while (true) { |  | ||||||
| 		lsPck = recvPacksFrom(sock, &m_buf, m_addr); | 		lsPck = recvPacksFrom(sock, &m_buf, m_addr); | ||||||
|  |  | ||||||
| 		if (lsPck.empty() && !m_buf.tmp) |  | ||||||
| 			break; |  | ||||||
|  |  | ||||||
| 		for (auto& pck : lsPck) { | 		for (auto& pck : lsPck) { | ||||||
| 			uint32_t bsize = m_buf.len - (pck - m_buf.ptr); | 			uint32_t bsize = m_buf.len - (pck - m_buf.ptr); | ||||||
| 			switch (netprot::getType(pck, 1)) { | 			switch (netprot::getType(pck, 1)) { | ||||||
| @@ -70,7 +66,6 @@ void Connection::getPacks(SOCKET sock) { | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		lsPck.clear(); | 		lsPck.clear(); | ||||||
| 	} |  | ||||||
| } | } | ||||||
|  |  | ||||||
| void Connection::sendPacks(SOCKET sock, std::unordered_map<uint64_t, Connection*> conns) { | void Connection::sendPacks(SOCKET sock, std::unordered_map<uint64_t, Connection*> conns) { | ||||||
|   | |||||||
| @@ -108,7 +108,7 @@ private: | |||||||
|  |  | ||||||
|     //Menu |     //Menu | ||||||
|     enum class GameState: uint8_t { MAIN_MENU, OPTIONS, QUIT, NEWG, PLAY, PAUSE }; |     enum class GameState: uint8_t { MAIN_MENU, OPTIONS, QUIT, NEWG, PLAY, PAUSE }; | ||||||
|     GameState m_gamestate = GameState::MAIN_MENU; |     GameState m_gamestate = GameState::PLAY; | ||||||
|     Texture MenuTitleTexture; |     Texture MenuTitleTexture; | ||||||
|     Texture MenuBGTexture; |     Texture MenuBGTexture; | ||||||
|     Texture MenuStartTexture; |     Texture MenuStartTexture; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user