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

Method handleIncomingPacket

source/game/StarSystemWorldServer.cpp:287–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287void SystemWorldServer::handleIncomingPacket(ConnectionId, PacketPtr packet) {
288 if (auto objectSpawn = as<SystemObjectSpawnPacket>(packet)) {
289 RandomSource rand = RandomSource();
290 Vec2F position = objectSpawn->position.value(randomObjectSpawnPosition(rand));
291 auto object = make_shared<SystemObject>(systemObjectConfig(objectSpawn->typeName, objectSpawn->uuid), objectSpawn->uuid, position, time(), objectSpawn->parameters);
292 addObject(object, objectSpawn->position.isValid());
293 }
294}
295
296List<PacketPtr> SystemWorldServer::pullOutgoingPackets(ConnectionId clientId) {
297 return take(m_outgoingPackets[clientId]);

Callers

nothing calls this directly

Calls 3

RandomSourceClass · 0.85
isValidMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected