| 58 | }; |
| 59 | |
| 60 | std::pair<EntityId, EntityId> connectionEntitySpace(ConnectionId connectionId) { |
| 61 | if (connectionId == ServerConnectionId) { |
| 62 | return {MinServerEntityId, MaxServerEntityId}; |
| 63 | } else if (connectionId >= MinClientConnectionId && connectionId <= MaxClientConnectionId) { |
| 64 | EntityId beginIdSpace = (EntityId)connectionId * -65536; |
| 65 | EntityId endIdSpace = beginIdSpace + 65535; |
| 66 | return {beginIdSpace, endIdSpace}; |
| 67 | } else { |
| 68 | throw StarException::format("Invalid connection id in clientEntitySpace({})", connectionId); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | bool entityIdInSpace(EntityId entityId, ConnectionId connectionId) { |
| 73 | auto pair = connectionEntitySpace(connectionId); |
no test coverage detected