MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / GetNetworkId

Function GetNetworkId

engine/Poseidon/Game/Commands/GameStateExtWorld.cpp:1388–1410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1386}
1387
1388GameValue GetNetworkId(const GameState* state, GameValuePar oper1)
1389{
1390 Object* obj = GetObject(oper1);
1391 if (!obj)
1392 {
1393 return NOTHING;
1394 }
1395
1396 if (GWorld->GetMode() != GModeNetware)
1397 {
1398 return GameArrayType();
1399 }
1400
1401 NetworkId id = obj->GetNetworkId();
1402
1403 GameValue value = state->CreateGameValue(GameArray);
1404 GameArrayType& array = value;
1405 array.Resize(2);
1406 array[0] = Format("%d", id.creator);
1407 array[1] = float(id.id);
1408
1409 return array;
1410}
1411
1412GameValue GetUnitById(const GameState* state, GameValuePar oper1)
1413{

Callers 6

GetNetworkIdMethod · 0.85
LocalDammageMethod · 0.85
~AIGroupMethod · 0.85
~AIUnitMethod · 0.85
~AISubgroupMethod · 0.85
TransferMsgMethod · 0.85

Calls 6

CreateGameValueMethod · 0.80
GetObjectFunction · 0.70
FormatFunction · 0.50
GetModeMethod · 0.45
GetNetworkIdMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected