Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

UDK - DLLBind: Embedded database (SQLite,MySQL) v3.1.0.2

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Awesome, I think I'll use this for savegames

    Comment


      #32
      @research: I will have a look into this evening, but it looks like the editor doesn't unload the dll properly, thanks for the hint.

      Comment


        #33
        This looks really good. Do you know if it's safe against SQL injection attacks? Or will it all depend on the queries written by the developer?

        Thanks

        Comment


          #34
          the DLL itself do not perform any functions like htmlescape or something like that.

          with the parameterized statements you can perform own checks on every input value before binding it.

          In a multiplayer game, all sql action should be done on server side anyway.

          Comment


            #35
            I guess parameters will take care of most possible problems It's true to say that most sql actions are performed server-side, but what if for example a player search feature was included and the player entered malicious sql in the search string.

            More a curiosity than anything ,great work though!

            Comment


              #36
              in my meaning, this should be handled by the server, to check the players input before performing the SQL command...just passing the values without having a look on first...i dont like this ^^

              Comment


                #37
                My understanding of SQLite might be what's confusing me, but is having an in-memory DB necessary? All I'm trying to do right now is open up an existing db, accounts.s3db (already contains usernames and passwords), add a new entry into the existing table by script, and then overwrite/update the existing accounts.s3db with the new data.

                I tried using your DBMgr and FileMgr along with some exec functions I quickly coded into my PlayerController to try and see if I could achieve this but ran into some problems, particularly with saving.. Basically what I did was set my default ContentDatabase to accounts.s3db, made an exec function DB_CreateNewAccount(string username, string password) that successfully inserted new acc info into the in-memory db. I verified this by running another exec function that ran a select * query and fed all the results to `Log, the newly created account info was there.. but I couldn't figure out how to save the new database as accounts.s3db, in effect overwriting the existing one.. I tried creating a new exec function that used the saveDatabase("accounts.s3db") function; but this didn't work, nor did using the full filepath "C:\UDK....\Content\Data\accounts.s3db".

                Comment


                  #38
                  due to the fact you cannot access the unrealscript varibables from the C++ side, you have to give the whole path to the file you wanna save...
                  like
                  Code:
                  local string lSavePath;
                  lSavePath = mUserCodeRelPathUDKGame $ mDataRootPath $ "\\" $ "accounts.s3db"; // or using a string passed into a function
                  and your right, you could also work directly in opened files instead of in-memory databases, maybe this is an addtion for one of the next versions, but i don't like this approach in this meaning.
                  One of my intentions when i create this DLL was: I want to realize savegames.

                  And for me a Savegame is a game state, so i just save my gameplay database to hard disc, and finished...all changes during gameplay are in-memory and lost if not saved. And writing operations into memory are faster than onto disc, even if SQlite are very handy and there might be any problems commonly used.

                  PS: Check your Bin\Win32\UserCode folder for your saved database (this is the working folder of the DLL). There your saved database should be.

                  Comment


                    #39
                    Originally posted by BlackHornet80 View Post
                    @research: I will have a look into this evening, but it looks like the editor doesn't unload the dll properly, thanks for the hint.
                    The Editor never unloads the dll once it has been loaded. You can verify this by deleting the dll file after the editor has started up. The dll related functions will still work.

                    So maybe you could add a check in C++ to verify if the driver has been initialized or not before, before actually initializing it?

                    Comment


                      #40
                      just updated the sources to version 2.0.1.3 including the fix for this, compiled dll will follow

                      Comment


                        #41
                        Thanks

                        Thanks a lot, its working now

                        Had to remove the following line in CUDKSQLDriverSQLite::execute() to compile:
                        Code:
                        case SQLITE_NULL:
                                lQRIter->second.addValue();

                        Comment


                          #42
                          using the zip or SVN? zip maybe some files not uptodate...will check it

                          Edit....i'm sry for this mistake
                          ------------------
                          Done, zip updated

                          Comment


                            #43
                            I was using the zip file, although the code in your svn also has the same line in it
                            Edit: Thanks a lot, its working fine now

                            Comment


                              #44
                              Wanted to update to my earlier question.. it's all working now! Thanks. My problem was looking to the database.ini's paths for the new accounts rather than the usercode folder, that P.S. you included at the end of your response was a big help =)

                              Comment


                                #45
                                @BlackHornet80

                                Thanks!

                                I have working simple save system now,
                                and thanks to you i can have items, quests , monsters, NPC databases.
                                Everything seems a lot easier now.

                                When I release my game, you will get credited and I will name `item set/ area/ boss` after you.

                                Many thanks!

                                Comment

                                Working...
                                X