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

Function DestroyMsgFormats

engine/Poseidon/Network/NetworkMessages.cpp:1974–1988  ·  view source on GitHub ↗

Destroy all local (static) message formats

Source from the content-addressed store, hash-verified

1972
1973// Destroy all local (static) message formats
1974void DestroyMsgFormats()
1975{
1976 for (int i = 0; i < NMTN; i++)
1977 {
1978 if (GMsgFormats[i])
1979 {
1980 GMsgFormats[i]->Clear();
1981 }
1982 }
1983 // Reset the init guard so the next InitMsgFormats() repopulates the items. Without
1984 // this, a teardown (e.g. an in-process re-mount) that follows a prior network init
1985 // (e.g. a server-browser enumeration) leaves the formats cleared but curMsgFormat at
1986 // NMTN, so InitMsgFormats() early-returns and every message decodes to zero values.
1987 curMsgFormat = 0;
1988}

Callers 1

ClearMethod · 0.85

Calls 1

ClearMethod · 0.45

Tested by

no test coverage detected