[Build System] - Integrate 'sqlite3' and 'sqlite_modern_cpp' using FetchContent. - Enabled 'C' language to allow compilation of 'sqlite3' lib. [Persistance] - Adds a 'DatabaseManager' class to handle all SQLite operations. - Creates a 'players' table on server startup. - Server uses separate database for single-player 'bettola_sp.db' and 'bettola.db' [UI] - Adds a new 'LoginScreen' UI. - Game flow is now MainMenu -> LoginScreen -> bootSequence -> Desktop. - 'LoginScreen' has interactive tabs to switch between "Login" and "Create Account" 'modes'. - Full client-server communication for creating accounts and authentication. [Server] - Refactor 'NetworkManager' to handle an 'AUTHENTICATING' state for new connectiosn. - Player state is only set to 'ACTIVE' after a successful login
		
			
				
	
	
		
			24 lines
		
	
	
		
			524 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			524 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#pragma once
 | 
						|
 | 
						|
#include <string>
 | 
						|
 | 
						|
#include "db.h"
 | 
						|
 | 
						|
class DatabaseManager {
 | 
						|
public:
 | 
						|
  DatabaseManager(const std::string& db_path);
 | 
						|
  ~DatabaseManager(void);
 | 
						|
 | 
						|
  void init(void);
 | 
						|
 | 
						|
  /* Return true on success, false if user already exists. */
 | 
						|
  bool create_player(const std::string& username, const std::string& password,
 | 
						|
                     const std::string& hostname);
 | 
						|
 | 
						|
  /* Return true if creds are valid. */
 | 
						|
  bool auth_player(const std::string& username, const std::string& password);
 | 
						|
 | 
						|
private:
 | 
						|
  sqlite::database _db;
 | 
						|
};
 |