dongju.jeong Posted July 7, 2021 Share Posted July 7, 2021 I used addRecievePacketCallback instead because the setRecievePacketCallback disappeared after switching from version 13 to 14. However, parameter errors appeared. Is it possible to use only the CigiHostPacket* argument to the marked part of the picture? Link to comment
cash-metall Posted July 7, 2021 Share Posted July 7, 2021 4 hours ago, dongju.jeong said: Is it possible to use only the CigiHostPacket* argument to the marked part of the picture? Yes, sure, this is the right way. We specified type of callbacks for consistency and to avoid mistakes with incorrect casts. All callbacks now receive a pointer to the base class. typedef Unigine::CallbackBase1<Unigine::Plugins::IG::CIGI::CigiHostPacket *> CigiRecvCallback; callback should have void(CigiHostPacket *) interface and inside method you need to cast CigiHostPacket to derived packet void terrestrial_process(CigiHostPacket * packet) { CigiTerrestrialControl * terrestial_packet = dynamic_cast<CigiTerrestrialControl *>(packet); //... do smth } 1 Link to comment
Recommended Posts