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

Method AddPoints

src/engine/server/databases/mysql.cpp:661–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661bool CMysqlConnection::AddPoints(const char *pPlayer, int Points, char *pError, int ErrorSize)
662{
663 char aBuf[512];
664 str_format(aBuf, sizeof(aBuf),
665 "INSERT INTO %s_points(Name, Points) "
666 "VALUES (?, ?) "
667 "ON DUPLICATE KEY UPDATE Points=Points+?",
668 GetPrefix());
669 if(!PrepareStatement(aBuf, pError, ErrorSize))
670 {
671 return false;
672 }
673 BindString(1, pPlayer);
674 BindInt(2, Points);
675 BindInt(3, Points);
676 int NumUpdated;
677 return ExecuteUpdate(&NumUpdated, pError, ErrorSize);
678}
679
680std::unique_ptr<IDbConnection> CreateMysqlConnection(CMysqlConfig Config)
681{

Callers 2

SaveScoreMethod · 0.45
TEST_PFunction · 0.45

Calls 1

str_formatFunction · 0.85

Tested by 1

TEST_PFunction · 0.36