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

Function InitMsgFormats

engine/Poseidon/Network/NetworkMessages.cpp:1937–1971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1935#define NMT_DEFINE_FORMAT(macro, class, name, description, group) macro(class, name);
1936
1937void InitMsgFormats()
1938{
1939 if (curMsgFormat > 0)
1940 {
1941 return;
1942 }
1943 NETWORK_MESSAGE_TYPES(NMT_DEFINE_FORMAT)
1944 NET_ERROR(curMsgFormat == NMTN);
1945
1946#if DOCUMENT_MSG_FORMATS
1947 QOFStream out("messages.xml");
1948 WriteF(out, 0, "<?xml version=\"1.0\"?>");
1949 WriteF(out, 0, "<?xml-stylesheet href=\"messages.xsl\" type=\"text/xsl\"?>");
1950
1951 WriteF(out, 0, "");
1952 WriteF(out, 0, "<root>");
1953
1954 WriteF(out, 1, "<types>");
1955 for (int i = 0; i < sizeof(ItemTypeNames) / sizeof(*ItemTypeNames); i++)
1956 {
1957 WriteF(out, 2, "<type name=\"%s\" id=\"%d\">", ItemTypeNames[i], i);
1958 WriteF(out, 2, ItemTypeDescriptions[i]);
1959 WriteF(out, 2, "</type>");
1960 }
1961 WriteF(out, 1, "</types>");
1962
1963 WriteF(out, 1, "<messages>");
1964 for (int i = 0; i < NMTN; i++)
1965 DocumentFormat(out, i);
1966 WriteF(out, 1, "</messages>");
1967
1968 WriteF(out, 0, "</root>");
1969 out.close();
1970#endif
1971}
1972
1973// Destroy all local (static) message formats
1974void DestroyMsgFormats()

Callers 4

LLVMFuzzerInitializeFunction · 0.85
InitMethod · 0.85
CreateDedicatedServerFunction · 0.85

Calls 3

WriteFFunction · 0.85
DocumentFormatFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected