| 1186 | } |
| 1187 | |
| 1188 | void afxConstraintMgr::packConstraintNames(NetConnection* conn, BitStream* stream) |
| 1189 | { |
| 1190 | // pack any named constraint names and ghost indices |
| 1191 | if (stream->writeFlag(mNames_on_server.size() > 0)) //-- ANY NAMED CONS_BY_ID? |
| 1192 | { |
| 1193 | stream->write(mNames_on_server.size()); |
| 1194 | for (S32 i = 0; i < mNames_on_server.size(); i++) |
| 1195 | { |
| 1196 | stream->writeString(mNames_on_server[i]); |
| 1197 | NetObject* obj = dynamic_cast<NetObject*>(Sim::findObject(mNames_on_server[i])); |
| 1198 | if (!obj) |
| 1199 | { |
| 1200 | //Con::printf("CONSTRAINT-OBJECT %s does not exist.", names_on_server[i]); |
| 1201 | stream->write((S32)-1); |
| 1202 | } |
| 1203 | else |
| 1204 | { |
| 1205 | S32 ghost_id = conn->getGhostIndex(obj); |
| 1206 | /* |
| 1207 | if (ghost_id == -1) |
| 1208 | Con::printf("CONSTRAINT-OBJECT %s does not have a ghost.", names_on_server[i]); |
| 1209 | else |
| 1210 | Con::printf("CONSTRAINT-OBJECT %s name to server.", names_on_server[i]); |
| 1211 | */ |
| 1212 | stream->write(ghost_id); |
| 1213 | } |
| 1214 | } |
| 1215 | } |
| 1216 | } |
| 1217 | |
| 1218 | void afxConstraintMgr::unpackConstraintNames(BitStream* stream) |
| 1219 | { |
no test coverage detected