| 659 | } |
| 660 | |
| 661 | bool 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 | |
| 680 | std::unique_ptr<IDbConnection> CreateMysqlConnection(CMysqlConfig Config) |
| 681 | { |