MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / connectionEntitySpace

Function connectionEntitySpace

source/game/StarGameTypes.cpp:60–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60std::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
72bool entityIdInSpace(EntityId entityId, ConnectionId connectionId) {
73 auto pair = connectionEntitySpace(connectionId);

Callers 3

entityIdInSpaceFunction · 0.85
initWorldMethod · 0.85
reloadPlayerMethod · 0.85

Calls 1

formatFunction · 0.50

Tested by

no test coverage detected