wtf?!
This commit is contained in:
@@ -1102,14 +1102,11 @@ void Engine::Render(float elapsedTime) {
|
||||
}
|
||||
|
||||
if (m_networkgame) {
|
||||
static char* buf = new char[BUFFER_LENGTH];
|
||||
uint32_t buflen = BUFFER_LENGTH;
|
||||
netprot::Input input;
|
||||
//sockaddr_in addr = m_conn.m_srvsockaddr;
|
||||
|
||||
input.direction = m_player.GetDirection();
|
||||
input.sid = m_conn.getId();
|
||||
input.timestamp = 12345;
|
||||
input.direction = m_player.GetDirection();
|
||||
input.timestamp = 12345; // TODO: Implémenter
|
||||
input.keys.forward = m_keyW;
|
||||
input.keys.backward = m_keyS;
|
||||
input.keys.left = m_keyA;
|
||||
@@ -1118,10 +1115,7 @@ void Engine::Render(float elapsedTime) {
|
||||
input.keys.block = m_mouseR;
|
||||
input.keys.shoot = m_mouseL;
|
||||
|
||||
//netprot::Serialize(&input, &buf, &buflen);
|
||||
//sendto(m_conn.m_sock_udp, buf, buflen, 0, (sockaddr*)&addr, sizeof(addr));
|
||||
|
||||
netprot::sendPackTo<netprot::Input>(m_conn.m_sock_udp, &input, &buf, &buflen, &m_conn.m_srvsockaddr);
|
||||
netprot::sendPackTo<netprot::Input>(m_conn.m_sock_udp, &input, &m_buf, &m_conn.m_srvsockaddr);
|
||||
}
|
||||
}
|
||||
else if (m_gamestate == GameState::MAIN_MENU || m_gamestate == GameState::OPTIONS)
|
||||
|
@@ -88,6 +88,7 @@ private:
|
||||
Bullet* m_bullets[MAX_BULLETS];
|
||||
|
||||
std::map<uint64_t, Player*> m_players;
|
||||
netprot::Buffer m_buf;
|
||||
|
||||
//Menu
|
||||
enum class GameState: uint8_t { MAIN_MENU, OPTIONS, QUIT, NEWG, PLAY };
|
||||
|
Reference in New Issue
Block a user