| 97 | }; |
| 98 | |
| 99 | void PathManagerEvent::pack(NetConnection*, BitStream* stream) |
| 100 | { |
| 101 | // Write out the modified path... |
| 102 | stream->write(modifiedPath); |
| 103 | stream->writeFlag(clearPaths); |
| 104 | stream->write(path.totalTime); |
| 105 | stream->write(path.looping); |
| 106 | stream->write(path.positions.size()); |
| 107 | |
| 108 | |
| 109 | // This is here for safety. You can remove it if you want to try your luck at bigger sizes. -- BJG |
| 110 | AssertWarn(path.positions.size() < 1500/40, "Warning! Path size is pretty big - may cause packet overrun!"); |
| 111 | |
| 112 | // Each one of these is about 8 floats and 2 ints |
| 113 | // so we'll say it's about 40 bytes in size, which is where the 40 in the above calc comes from. |
| 114 | for (U32 j = 0; j < path.positions.size(); j++) |
| 115 | { |
| 116 | mathWrite(*stream, path.positions[j]); |
| 117 | mathWrite(*stream, path.rotations[j]); |
| 118 | stream->write(path.msToNext[j]); |
| 119 | stream->write(path.smoothingType[j]); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | void PathManagerEvent::write(NetConnection*nc, BitStream *stream) |
| 124 | { |