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

Method PublicVariable

engine/Poseidon/Network/NetworkClientActions.cpp:1937–1959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1935 SendMsg(&msg, NMFGuaranteed);
1936}
1937
1938void NetworkClient::PublicVariable(RString name)
1939{
1940 GameState* gstate = GWorld->GetGameState();
1941 GameValuePar var = gstate->VarGet(name);
1942 if (var.GetNil())
1943 {
1944 return;
1945 }
1946
1947 QOStream out;
1948 if (!Poseidon::SerializeScriptValue(out, var))
1949 {
1950 Fail("publicVariable: unsupported type");
1951 return;
1952 }
1953
1954 PublicVariableMessage msg;
1955 msg._name = name;
1956 int size = out.pcount();
1957 msg._value.Resize(size);
1958 memcpy(msg._value.Data(), out.str(), size);
1959 SendMsg(&msg, NMFGuaranteed);
1960}
1961
1962void NetworkClient::GroupSynchronization(AIGroup* grp, int synchronization, bool active)

Callers

nothing calls this directly

Calls 8

SerializeScriptValueFunction · 0.85
pcountMethod · 0.80
strMethod · 0.80
GetGameStateMethod · 0.45
VarGetMethod · 0.45
GetNilMethod · 0.45
ResizeMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected