Members database structure

Discussion in 'Development General' started by coyotte508, Jun 2, 2010.

  1. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I used the Beta Server's database for tests - ~16000 users.

    The database file is 1.6 MB. (roughly 100 bytes per user used).


    Structure

    The file is structured as such:

    Code (text):
    1.  
    2. [Name]%[Last Appearance - 10B]%[Auth][0-Ok/1-Banned][1B Unused (prev for mute)]%[Password's salt - 7B]%[Hashed Password - 32B]%[IP-39B, to not be taken aback by IPv6]
    3. [Name]%[Last Appearance - 10B]%[Auth][0-Ok/1-Banned][1B Unused (prev for  mute)]%[Password's salt - 7B]%[Hashed Password - 32B]%[IP-39B, to not  be taken aback by IPv6]
    4. [Name]%[Last Appearance - 10B]%[Auth][0-Ok/1-Banned][1B Unused (prev for  mute)]%[Password's salt - 7B]%[Hashed Password - 32B]%[IP-39B, to not  be taken aback by IPv6]
    5. ...
    6.  
    An example in the actual file (i've blanked out the salts for security reasons )

    Code (text):
    1.  
    2. hoper%2010-05-10%000%       %                                %xxx.xxx.xxx.xxx                        
    3. hoperreborn%2010-05-01%000%       %                                %xxx.xxx.xxx.xxx                        
    4. hopolita%2010-05-02%000%       %                                %xxx.xxx.xxx.xxx                        
    5. hopolon%2010-06-02%000%       %                                %xxx.xxx.xxx.xxx                        
    6. hopper%2010-04-29%000%       %                                %xxx.xxx.xxx.xxx                        
    7. horatio caine%2010-06-02%000%       %                                %xxx.xxx.xxx.xxx                        
    8. hornet%2010-05-18%000%       %                                %xxx.xxx.xxx.xxx                        
    9. horny%2010-06-01%000%xxxxxxx%0bb3aed5a4806271bd43f082aebeb07b%xxx.xxx.xxx.xxx                        
    10. horo%2010-05-30%000%       %                                %xxx.xxx.xxx.xxx                        
    11. horse%2010-04-19%000%hxm1EJa%                                %xxx.xxx.xxx.xxx                        
    12. horse limonade%2010-05-05%000%       %                                %xxx.xxx.xxx.xxx                        
    13. hoshoyo%2010-04-10%000%       %                                %xxx.xxx.xxx.xxx                        
    14. hot as ice%2010-06-01%000%       %                                %xxx.xxx.xxx.xxx                        
    15. hotbloodedgentleman%2010-06-02%000%       %                                %xxx.xxx.xxx.xxx                        
    16. hotbloodedhero%2010-05-07%000%       %                                %xxx.xxx.xxx.xxx                        
    17. hotbutter%2010-04-04%000%       %                                %xxx.xxx.xxx.xxx                        
    18. hotdogturtle%2010-04-20%000%       %                                %xxx.xxx.xxx.xxx                        
    19. hotie%2010-05-05%000%       %                                %xxx.xxx.xxx.xxx                        
    20. hotkiller%2010-05-13%000%xxxxxxx%97006a26fc69a084f30a98e737eeec5b%xxx.xxx.xxx.xxx                        
    21. hotpot%2010-06-02%000%>tsrtoY%                                %xxx.xxx.xxx.xxx                        
    22. house%2010-05-10%000%       %                                %xxx.xxx.xxx.xxx                        
    23. how is that fair%2010-04-27%000%       %                                %xxx.xxx.xxx.xxx                        
    24. howard%2010-05-19%000%       %                                %xxx.xxx.xxx.xxx                        
    25. howllaz%2010-05-23%000%       %                                %xxx.xxx.xxx.xxx                        
    26. howmanykidsdoieat%2010-05-17%000%       %                                %xxx.xxx.xxx.xxx                        
    27.  
    Now the class managing the members is called SecurityManager.

    Firstly the class SecurityManager has a file constantly open (members.txt), in the form of QFile


    Secondly it has a map (QMap<QString, Member>) containing all the data in the file.

    The Member struct has exactly the different fields for each member in the file, including the name (Having the name twice is redundant)


    Thirdly it has a hash (QHash<QString, int>) containing the positions in the file for the members. Each time a member is updated, the file is updated too, and the position is used to jump to the member's location in the file immediately.

    Here is a view of the main attributes of the classes

    Code (cpp):
    1.  
    2. class SecurityManager
    3. {
    4. public:
    5.     /* The file where the members are */
    6.     static const char * path;
    7.  
    8.     static void init();
    9.  
    10.     /* A member as stored in the file */
    11.     struct Member {
    12.         Member(const QString &name="", const QString &date="", const QString &auth="",
    13.                const QString &salt="", const QString &hash="", const QString &ip="");
    14.         QString name;
    15.         QString date;
    16.         QString auth;
    17.         QString salt;
    18.         QString hash;
    19.         QString ip;
    20.         /* ... */
    21.     }
    22.  
    23. /* ... */
    24.  
    25.  
    26. private:
    27.     static void loadMembers();
    28.     static QMap<QString, Member> members;
    29.     static QHash<QString, int> memberPlaces;
    30.     static QSet<QString> bannedIPs;
    31.     static QSet<QString> bannedMembers;
    32.     static QMultiMap<QString, QString> playersByIp;
    33.     static int lastPlace;
    34.     static QFile memberFile;
    35.     static QNickValidator val;
    36. };
    37.  
    38.  
    (By the way, if anyone knows a good UML editor on Windows, I'd be happy ;) )

    Problems

    • Putting it into words, I noticed all the fields for Member data are stored using QString, only the name should be stored that way, the other fields should be stored using QByteArray to save twice the space regarding them
    • All the database is stored in the RAM. That causes no real problem, right now (for info the beta server is using 55 MB RAM atm), but it would be wise not to, for the future
    • A member is updated at each login -- IP and Last Appearance date are updated every time even if they were the same as before.

    Ways to follow

    Aside from the Member structure change -- using QByteArray instead of QString -- I've thought of keeping in cache the full info of the last 10000 users logged on, and for the others just keep the association name/location in file in memory. Also, instead of having two separate containers, having only one storing all the info (location in file + regular member information).

    That would roughly use 10 times less memory than now, if we exclude the constant 10000 users storage, but still around 400 KB with the current beta server database, and is an upgrade of only x5 with the first, easy change (QByteArray/QString).

    Another solution would be to still have the 10000 last users in cache, but read the other users from the database file. There are several way to do this: use a MySQL database (Nooooo!!!), use a Git-like way of storing users, (meaning 256 files with the two letters corresponding to the two first letters of the hashes (MD5 for speed) of the users name).

    Instead also there could be a sorted file with in memory a fair number of indexes (so that the server doesn't get to browse all the file everytime) , and once per day all the new users would be stored in the file, and the file and the indexes would be updated again.

    Well, I'm a bit clueless about how I shall do the storage of the users. The same is true for the ladder storage. I guess that's why so many people tend to use MySQL database, but I can't help but fear horrible performances if I do so.
     
  2. nmilkosky

    nmilkosky asdf

    Joined:
    Apr 23, 2010
    Messages:
    25
    Likes Received:
    0
    I dunno. I personally like the idea of hashes. MySQL is okay too but I would only use it for web information or information that is not updated frequently.
     
  3. Akusu

    Akusu Guest

    I have to ask if there's any particular reason you're using the Q classes all the time. I'm sure using the std stuff would be faster in general. I also agree that using a text file to shunt these things back and forth is a bad idea.

    If I were designing this, I'd put the onus on the server hosts to store their data. I'd give them a .bak or .sql of a MSSQL database and shunt data back and forth from that. That would give me control over transactions and it would let me put their database information in a property file they can change to match the information of where their database resides. You could even put in something that detects if they put a .txt and handle information that way. If you implemented the ladder this way, you would probably want to make sure that you either limit queries (page worth max for example) or load the ladder into memory every few minutes from the database using an ORDER BY statement.

    It would also prevent you from needing to optimize database handling (much) as accessing information is already optimized.

    MySQL is a bit more user-friendly since you're distributing it, but frankly if you're running a server you should get used to needing to learn some new things hehe.

    Microsoft Visio 2010 is having a free beta right now, that's what I've always used, and MS SQL Server Express Edition is always free and useable.

    Edit: I've learned something new. Salts were never discussed in my Secure Computing course :). Of course apparently you're supposed to store that info elsewhere.... oh well.
     
    Last edited by a moderator: Jun 3, 2010
  4. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I think PostGreSQL is better (Microsoft Visio would also work on linux and be open-source?)

    There's no particular reason for the Q classes, except that for example they have native support of QString (Unicode strings), serialization, ... And I have started the project with Qt so that's why I'm using all the framework.

    Can you explain, I'm not familiar with this?
     
  5. Akusu

    Akusu Guest

    Sorry, a .bak is a backup file of a SQL Database. It would allow you to distribute the structure of your database to the server admins so that they could install a copy on their server.

    I can see what you mean about PostGreSQL. I've never looked into it, but being open-source is a bonus.

    Well, there's a free download of the viewer available. Honestly not sure about Linux compatibility... though that's not usually a huge concern to me.

    Edit: Now that I've looked into PostGreSQL... blegh. It's probably great if you have actual server-machines for your company, but I have concerns that it's not moved forward into Vista/7 yet and would basically be useless for me on my own machine.
     
    Last edited by a moderator: Jun 3, 2010
  6. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    http://www.enterprisedb.com/products/pgbindownload.do

    ^

    Doesn't that install on your computer? They also give a file containing all the extracted binaries, I might actually include this in the server download, to make things easier.

    I may also use SQLite, but from what I've seen operations such as sorting and stuff are not well managed (I have currently a very efficient way of managing the ladders) where as PostGreSQL could do this very efficiently with setting indexes on the right columns - so that I won't need to keep the results in memory. The good point of SQLite is, it only weighs 300 kB and no install would be required for the user. (it would come as a dll with the program)
     
  7. Akusu

    Akusu Guest

    I haven't tried (working) but the specs I read said Windows NT based only, then listed everything but Vista/Win7.

    A distributable database engine definitely sounds good, but since it's the server (relatively few end-users) I'd go with efficiency vs. ease of use.
     
  8. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    So you mean you'd rather PostGreSQL?
     
  9. Akusu

    Akusu Guest

    From the pair you're considering, I'd say yes. That's assuming it can be installed on up-to-date versions of Windows though.
     
  10. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I don't see why it wouldn't work on Vista. Anyway i'll test it on Vista myself.
     
  11. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    I don't like the idea that server depends on external database system. SQLite is ok, MySQL and PostgreSQL are ok if you can choose between them and SQLite backend (most of smaller servers wouldn't need the power of external database system anyway).
     
  12. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Then, default built-in SQLite and possibility to switch to another well known SQL database system? I can do that easily! :D

    But then again I would have to make some work for performances if I use SQLite, which I wouldn't have to do with PostGreSQL.

    W/e, that seems like a good idea.
     
  13. Pokemonexperte-Martin

    Pokemonexperte-Martin Member

    Joined:
    May 15, 2010
    Messages:
    76
    Likes Received:
    0
    * Think big
    * Be prepared for the future
    * Keep it simple and stupid
    * Dont care too much about performance theory
    * Focus on pokemon, not on reinventing the wheel

    Comparing flat text files to relational databases dowdy and it should be clear who is the winner. Even embedded databases provide efficient indexing mechanisms and give you the power of flexibility and extensibility by independence of physical storage, eg you are able to add more fields later easily.

    I estimate the Smogon University Shoddy Battle Server has at least 1 000 000 accounts. Of course most of them are "historical" and not used anymore, but keeping them in memory would increase it up to 100 MB needed.

    There is no need to tie PO to one specific database - use QtDatabase as abstraction layer and let the server administrator provide the connection data. Small servers can use sqlite, big ones can choose a dedicated dbms for convenience.

    Portability and performance will not be a challenge as long as you use ansi sql (and I promise there is no need for anything else than basic select and update statements) and some indexes.
     
  14. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Ok.

    I'm just wondering about the future, if they want to do more than one server with the same database (the load on the server increase following n² - because each user is notified of each user -, where n is the number of users. So having 2 rooms with the same number of user in total would decrease the load by 2), if they want to use a same PostGreSQL database on different computers, then to avoid latencies caused by contacting a distant computer, i should put the database call in threads? Or, they could put both servers on the same computer...

    Anyway, thanks.
     
  15. Pokemonexperte-Martin

    Pokemonexperte-Martin Member

    Joined:
    May 15, 2010
    Messages:
    76
    Likes Received:
    0
    I don't know what you exactly mean - the same datasets for two different PO server instances, or using one database server for different instances with own datasets? In neither case it would increase the load by n²... ?!

    If someone wants to use different hosts for the database server and the PO server, it is their own task to provide stable and fast connections. But I'm sure those people are few and know what they do.
     
  16. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Ok.

    By n², I mean not the load in memory but the load in bandwidth and processor. Anyway, let's go with the SQL database.
     
  17. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Just a feedback, i just realized SQLite was natively included in QtSQL (well it seems so)

    Also, the database i created seems to be persistent, but I've no idea where the database file is stored.
     
  18. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Well...

    The server loads the 15000 users nearly instantly, and inserting them into the SQL database with SQLite takes 163 seconds -- without any index.

    With indexes on name and ip (for bans and maxAuth) it takes 230 seconds.

    By the way the table is like that:

    Code (sql):
    1.  CREATE TABLE IF NOT EXISTS trainers (id INTEGER PRIMARY KEY,
    2.       name VARCHAR(20) UNIQUE, laston CHAR(10), auth INT, banned BOOLEAN,
    3.       salt VARCHAR(7), hash VARCHAR(32), ip VARCHAR(39))
    4.  
    Worrying. Very. I'll install postgresql and test with it.
     
  19. Akusu

    Akusu Guest

    Mass-inserts? I don't see how that's worrying, unless you're using it as a baseline to evaluate it all.

    Are you querying the database to determine the next ID? If you are consider using an Identity field, which will increment the ID appropriately automatically removing the need for the query.
     
  20. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    No, i'm not even touching the id when inserting, SQLite does it automatically. (because it's "integer primary key")

    Also i'm worried, because it takes less than one second to read FROM FILE and insert in my own database structure, but it takes 100* times more using SQLite to read from memory and insert.

    By the way, the inserting loop with all the operations (with the db not connected) is only 0.06 secs, so it's really sqlite that's slow.
     
  21. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    With PostGreSQL (change of syntax required, and hell to get the correct dlls):

    Without indexes: 7.4 seconds
    With indexes: 8.2 seconds

    Awesome. 20 times faster than SQLite. I'm planning to default SQLite, but i'll make a tutorial on how to use PostGreSQL. Also i think that making the database calls in different threads to avoid latencies that would interrupt the server (even if extremely shortly) would be pure nirvana. Comments?
     
  22. Akusu

    Akusu Guest

    Especially since you can use transactions to accomplish this, and it's not critical to gameplay, this makes much sense, just in case something goes wrong. I bet SQLLite is querying itself like I posited... I can't imagine any other reason for it to take so long. Oh well, efficiencies, efficiencies.
     
  23. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Transactions? Details? (for a newb in SQL ^^)

    Also no, when I add the ids manually (with a variable I increment), it's even slower.
     
    Last edited: Jun 10, 2010
  24. Akusu

    Akusu Guest

    Transactions aren't so much a SQL-thing as a working-with-databases thing, and I'll admit to having no idea how to handle them in C++.

    The basic idea though is that if something fails, you roll back all the changes... so if you had to add rows to 3 tables and once, and 1 of those inserts failed, all 3 would be undone. Those rows will still take up an ID in the table, but it won't be queryable.

    That lets you ensure data integrity in the case that something goes wrong or gets disconnected. If you have your own thread for a transaction, it could make a few attempts without affecting the main thread.
     
  25. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I don't think i need this. Anyway SQLite doesn't support transactions.
     
  26. Pokemonexperte-Martin

    Pokemonexperte-Martin Member

    Joined:
    May 15, 2010
    Messages:
    76
    Likes Received:
    0
    Why for gods sake do you want to load and/or save 15000 users at once? I'm afraid that you focus too much on cloning your current persistence. Do a single SELECT on user logins, and do small UPDATEs when ranking etc. changes, but never hold your whole member table in memory.
     
  27. Akusu

    Akusu Guest

    I think he was using it for a baseline comparison... and there's a trade-off. Pull the information every time someone asks for it? Or have it handy for when they do.
     
  28. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    It's just to show SQLite is slow. It takes a whole 1/100 seconds to insert a user, where PostGreSQL takes 20 times less and just keeping the table in memory is way way faster - but not adapted for very big databases, and SQL is nice for websites owners or for compatibility with other means of editing the data. Of course mass insertion will only be done when we switch from file to database. It was just benchmarking. And I think, still, I may cache a few hundreds users for efficiency's sake.
     
  29. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Make sure to use indices thought, they may make inserting slower, but selecting and updating will be faster
     
    Last edited: Jun 11, 2010
  30. Pokemonexperte-Martin

    Pokemonexperte-Martin Member

    Joined:
    May 15, 2010
    Messages:
    76
    Likes Received:
    0
    Of course SQLite is slower than PostGre, its focus is small footprint. But is it really "slow"? No, not for our goals. 230 seconds for 15000 users means that it can insert 65 records/sec, which is only neccesary for a new account. Although a naive assessment of the situation, do you think that amount of users wants to login/register simultaneously? Lets set up an "optimistic realistic" scenario for a "well frequented server" (inspired by watching smogon server, published Smogon Stats, and Pokemonexperte Shoddy stats) ...

    400 users online
    20 logins / minute, 20 logouts / minute
    Average 16 battles / minute = 32 ranking updates / minute ("689,709 individual battles that were fought during the month of April ", see Smogon Stats Topic)
    Approximately 100 battles / minute as maximum peak

    If you select user records on login, cache them during the active session in memory (eg. for ladder matching), and update rankings when a battle finishes, there are 20 SELECTs and 200 UPDATEs per Minute = ~ 35 write operations / sec.

    So SQLite should fit for a big server in theory, therefore even more for a small server. There are other real world bottlenecks (cpu, bandwith, latency, ...).

    Anyway, there should be a non-reset database connection pool, set to size 1 as default for sqlite.
     
  31. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    It still makes me want to thread the functions where database calls are made.
     
  32. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Mmmmh

    It's a good thing to make threads, i'm starting to thinking hard...

    Just what should I thread? The database gathering functions (like calling loadInMemory to the structures that hold the info)? The whole functions that need database calls? Halfway?

    How should I thread? Because, some values (tiers/rating/auth) can be changed by scripts and server itself. That should stack and wait till the threaded function finishes? Or change the parameter, and when the thread function is near end, make a lock and change all in once?

    Maybe I should create an object associated to a player, that holds the info concerning the missing data. That object would query from teh relevant database structures, and have a call back when the database structure has finished its job. And when all is loaded in memory it runs the appropriate function of the player? (that could be passed in parameter :D Yay, function pointers! Fun!)

    Then the player would get the data directly from the server (if the data still isn't in memory, it's queried, and a warning addressed to the developpers is issued because that shall not happen)

    Seems like a good idea :)

    Just throwing it out here, because that helps me think, and this is the developer den after all, no one would disturb us. (and you guys can have useful advices too)
     
  33. Pokemonexperte-Martin

    Pokemonexperte-Martin Member

    Joined:
    May 15, 2010
    Messages:
    76
    Likes Received:
    0
  34. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Thanks a lot, that's helpful.
     
  35. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Wow, finally started to get some steam on a working solution, and one that i like. The first thing, with member only database, should be up tomorrow (or at least on my computer).

    One problem with the solution in the article is that they suppose the main thread is alone, where in my case multiple items in the main thread (players) can call simulatneously a more restricted number of threads -- threads are permanenent as they each hold a DB connection, which causes some problems to know who requested what. Oh well, it was helpful though and helped me clear up some details :)
     
  36. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Damn, just when I wanted to test it, PostGreSql driver seem to not load anymore. That was hellish to succeed the first time... If anyone has working PostGreSQL drivers on windows it'd be cool (with Qt), well i'll try anyway.
     
  37. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    * facepalm *

    Still a weird thing, but the problem is that in order to create the default connection, i used "" instead of nothing as a second parameter.
     
  38. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I got something basic working, in fact, when loading members, threading should be used to load the data in the memory, then act, but if that's not done, or the data is not in memory anymore (only the 10 000 last members are kept in memory) the data is loaded directly, without threading, from the sql db. This is a safety mechanism, and should occur extremely rarely.

    Except, that , for now, only the logging in in the Player class uses prefetching in a different thread, then callback using a slot, i shall do it for changing team, control panel, and stuff.

    A lots of things are broken, like changing team cuz i plan to rewrite it better instead of messy as it is, and when all that will be done i'll post different topic on threading issues - threading with the member database, threading the battles, and threading the ladder structures.

    So, for now, don't update from the SVN, because it's not functional and you won't even get it working except if you get the right drivers for postgresql or edit the source to change the db connection settings. You can also check it out of curiosity.
     
  39. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I uploaded a commit.

    Now the database system is working for members (not yet ladder).

    Threading is used for login/change team, but not for things like alias search, banning, ... because it's complicated and pretty rare. If you want to do threading here though be my guest :)

    You can download without worry, database can be configured and default is SQLite so it should be ok.
     
  40. Steve

    Steve Active Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    491
    Likes Received:
    45
    It's missing sqlconfig.h.

    Edit: Actually, it's missing sqlconfig.cpp too.
     
    Last edited: Jun 20, 2010