| 1253 | } |
| 1254 | |
| 1255 | bool MpLevelHandler::HandlePlayerPush(Actors::Player* player, float pushSpeedX) |
| 1256 | { |
| 1257 | // TODO: Only called by RemotePlayerOnServer |
| 1258 | if (_isServer) { |
| 1259 | auto* mpPlayer = static_cast<MpPlayer*>(player); |
| 1260 | auto peerDesc = mpPlayer->GetPeerDescriptor(); |
| 1261 | |
| 1262 | if (peerDesc->RemotePeer) { |
| 1263 | MemoryStream packet(8); |
| 1264 | packet.WriteVariableUint32(mpPlayer->_playerIndex); |
| 1265 | packet.WriteValue<std::int32_t>((std::int32_t)(pushSpeedX * 512.0f)); |
| 1266 | _networkManager->SendTo(peerDesc->RemotePeer, NetworkChannel::Main, (std::uint8_t)ServerPacketType::PlayerPush, packet); |
| 1267 | } |
| 1268 | } |
| 1269 | |
| 1270 | return true; |
| 1271 | } |
| 1272 | |
| 1273 | bool MpLevelHandler::HandlePlayerSpring(Actors::Player* player, Vector2f pos, Vector2f force, bool keepSpeedX, bool keepSpeedY) |
| 1274 | { |
no test coverage detected