+/*
+ * Get user info
+ */
+static int db_getuserinfo( u64 steamid, char *out_username, u32 username_max,
+ i32 *out_type ){
+ sqlite3_stmt *stmt = db_stmt( "SELECT * FROM users WHERE steamid = ?;" );
+ if( !stmt ) return 0;
+
+ sqlite3_bind_int64( stmt, 1, *((i64 *)&steamid) );
+ int fc = sqlite3_step( stmt );
+
+ if( fc != SQLITE_ROW ){
+ log_sqlite3( fc );
+ sqlite3_finalize( stmt );
+ return 0;
+ }
+
+ if( out_username ){
+ const char *name = (const char *)sqlite3_column_text( stmt, 1 );
+ vg_strncpy( name, out_username, username_max, k_strncpy_allow_cutoff );
+ }
+
+ if( out_type )
+ *out_type = sqlite3_column_int( stmt, 2 );
+
+ sqlite3_finalize( stmt );
+ return 1;
+}
+