MCPcopy Create free account
hub / github.com/ddnet/ddnet / InsertMap

Method InsertMap

src/test/score_test.cpp:63–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 }
62
63 void InsertMap(const char *pName, const char *pMapper, const char *pServer, int Points, int Stars)
64 {
65 char aTimestamp[32];
66 str_timestamp_format(aTimestamp, sizeof(aTimestamp), FORMAT_SPACE);
67 char aBuf[512];
68 str_format(aBuf, sizeof(aBuf),
69 "%s into %s_maps(Map, Server, Mapper, Points, Stars, Timestamp) "
70 "VALUES (\"%s\", \"%s\", \"%s\", %d, %d, %s)",
71 m_pConn->InsertIgnore(), m_pConn->GetPrefix(), pName, pServer, pMapper, Points, Stars, m_pConn->InsertTimestampAsUtc());
72 ASSERT_TRUE(m_pConn->PrepareStatement(aBuf, m_aError, sizeof(m_aError))) << m_aError;
73 m_pConn->BindString(1, aTimestamp);
74 int NumInserted = 0;
75 ASSERT_TRUE(m_pConn->ExecuteUpdate(&NumInserted, m_aError, sizeof(m_aError))) << m_aError;
76 ASSERT_EQ(NumInserted, 1);
77 }
78
79 void InsertRank(float Time = 100.0, bool WithTimeCheckPoints = false)
80 {

Callers

nothing calls this directly

Calls 8

str_timestamp_formatFunction · 0.85
str_formatFunction · 0.85
GetPrefixMethod · 0.80
InsertIgnoreMethod · 0.45
InsertTimestampAsUtcMethod · 0.45
PrepareStatementMethod · 0.45
BindStringMethod · 0.45
ExecuteUpdateMethod · 0.45

Tested by

no test coverage detected