| 20 | using namespace SEGSEvents; |
| 21 | |
| 22 | MapLinkEvent *MapEventFactory::EventFromStream(BitStream &bs) |
| 23 | { |
| 24 | size_t read_pos = bs.GetReadPos(); |
| 25 | |
| 26 | MapLinkEvent *ev = CRUD_EventFactory::EventFromStream(bs); |
| 27 | if(ev) // base class created the event |
| 28 | return ev; |
| 29 | |
| 30 | bs.SetReadPos(read_pos); // rewind the stream and retry |
| 31 | |
| 32 | uint16_t opcode = bs.GetPackedBits(1); |
| 33 | |
| 34 | switch(opcode) // this is the actual clientside packet Opcode |
| 35 | { |
| 36 | case 1: return new ConnectRequest; |
| 37 | case 2: return new RecvInputState; |
| 38 | case 3: return new SceneRequest; |
| 39 | case 4: return new ShortcutsRequest; |
| 40 | case 5: return new EntitiesRequest; |
| 41 | case 6: return new CookieRequest; |
| 42 | case 7: return new ClientQuit; |
| 43 | case 9: return new NewEntity; |
| 44 | case 11: return new InitiateMapXfer; |
| 45 | case 12: return new MapXferComplete; |
| 46 | // default: return new MapUnknownRequest; |
| 47 | } |
| 48 | qCWarning(logMapEvents, "Unhandled event type %d", opcode); |
| 49 | return nullptr; |
| 50 | } |
| 51 | |
| 52 | MapLinkEvent *MapEventFactory::CommandEventFromStream(BitStream & bs) |
| 53 | { |
nothing calls this directly
no test coverage detected