Announcement

Collapse
No announcement yet.

Coding for a backend Database. How do I?

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

    Coding for a backend Database. How do I?

    Hi all, my first post here, so please be gentle..

    My question is.

    Without the headers, would it be possible to write functions to allow you save game states to a database.. In this case using Mysql++ API. I'm guessing that unreal script, and from what I have read on UDEwiki, this cannot be done.

    If headers are needed, does anyone know what the procedure is to get them?

    Let me just give you a background story on the reasoning behind the question.. I am making a little personal mod.. for role playing games. and require facility to save character/player details. Yes almost a persistant game world...

    Any suggestions ??
    Thanks in advance
    WhytWulf

    PS... can the maxplayer cap be changed? I can only guess it is part of the core networking subsystem, and again not part of unreal script (only because I have not seen it anywhere, other than the ability to restrict maxplayers to a smaller amount).

    Opps I should have said I don't need assistance with the coding for the API only for the integration between Unreal 2k4 and the Mysql++ API...The topic was a bit missleading, sorry.

    #2
    Im sure there allready is save supposrt in the unreal engine. I just dont know how.

    Comment


      #3
      I think it may actually be possible. There aren't any functions to save data to a database but there are functions for using a TCP link. Using this you could send data to your database server and then you can handle that data in any way you want.

      As for getting the headers, it's not possible without a license for the engine.

      Comment


        #4
        Thanks for the reply..

        I never even thought about trying to send data as TCP, I was looking for the easy hooking into a DLL or coding for native DLLs, and letting the API do the work for me..

        I'll check it out...
        Thanks again, for the pointers

        Comment


          #5
          Let me know how you get on with this, I'd also very much like to access a MySQL database from the game. This opens up a world of possibilites for me

          I looked into a TCP connection and it seems viable, however, I couldn't find any information on what to send over the TCP link. Ie. the raw commands that the MySQL server accepts.

          Comment


            #6
            There is an open source HTTP library for unreal script called libHTTP . It has functions for sending http data. Maybe you could use that to send data to a php script which can then be processed and saved to the database.

            There's more info about it here:http://wiki.beyondunreal.com/wiki/LibHTTP

            Comment


              #7
              I remember reading somewhere that epic was toying around with a .NET Framework version of Unreal. If that is true, it would be very easy to use a database and even many other things that could not have been done before.

              If you happen to have a unreal license, then you prob can check into this, otherwise like the rest of us.... :bulb:

              Comment


                #8
                Originally posted by snake_pliskin
                I remember reading somewhere that epic was toying around with a .NET Framework version of Unreal. If that is true, it would be very easy to use a database and even many other things that could not have been done before.
                Never heard anything about that, and I doubt it's true.
                Epic uses MS Visual Studio .NET 2003 as development environment, that doens't mean they use the .NET framework.

                Comment


                  #9
                  Doing it with SOAP-Webservice from a DLL

                  Originally posted by El_Muerte_[TDS]
                  Never heard anything about that, and I doubt it's true.
                  Epic uses MS Visual Studio .NET 2003 as development environment, that doens't mean they use the .NET framework.
                  Hi,

                  I Think a possible Way is to use implement in the DLL only
                  necessary Things and not the complete Database Engine
                  Client from MySQL or PostgreSQL (its also not verry easy
                  to handle Recordset and c/c++Structs fro, UnrealScript)

                  I think, a perfect Way is, to write a little Webservice
                  DLL-Client, thadt implements a few Remote Functions on your Webserver where the Database is located.


                  Java Part:

                  You only need to have, the J2EE Applicationserver JBoss
                  running on your System, writing a single Enterprise Java
                  Bean (EJB), and Interface and SOAP Descriptor File for
                  Apache AXIS and the Job is done.

                  Hint:
                  In the JBoss Package itselfs, there is an little Java written
                  verry fast SQL Database, called Hypersonic or HSQL. It
                  works fully integrated into JBoss and you dont have
                  other thing to do as using it, but you can also use
                  any other DB on the World thadt has an JDBC-Driver
                  like MySQL, PostgreSQL, Firebird, ORACLE, MS-SQL,
                  Informix, IBM-DB/2, Interbase or many others more.

                  -No stress with implementing SQL Parsers or handling a
                  a Database Structure Recordset in UnrealScript

                  -No Socketterror (Blocking, non Blocking, Multithreded ,
                  personal Firewallthings, e.c.t)

                  -
                  The Job can be done by a eperienced C/C++ and Java
                  J2EE Developer on one Day.

                  The Installatio of needed Things is verry Easy.

                  1.You need a Server (Linux, Unix, Windows, MAC, e.t.c)
                  2.You need a Java JSDK (its free)
                  3.You need JBoss (its free)
                  4.You need a Database (HSQL - its free and inside JBoss)
                  5.You need WebserivceServer (runs in JBoss integrated)
                  6.You need the JBoss IDE for Eclipse Plugin and Eclise (free)
                  to develop the SQL-Methods in Java.
                  7.Youd need a Database Tool (take Squirrel, its free and Java)
                  to create you Tables in you DB.

                  Thads all for the Java-Serverpart:

                  1.
                  Then You need a C/C++ Compiler like MS Visual C/C++
                  (MS C/C++ Commandline Compiler is free for Download
                  at Microsoft.com) or GNU GCC (GCC for Windows MinGW
                  wich is also free)

                  7.
                  You need a SOAP Toolkit Client for Developing Webserivce
                  Clients (gSOAP or AXIS -> both are free)

                  Final:

                  The Workflow is simple.

                  1.
                  A UnrealScript is calling the DLL.
                  (please check if this user is known, or not)

                  2.
                  The DLL Accessed via Port 80 the JBoss Server
                  (DLL asked JBoss, Please JBoss lookup into the DB if
                  this User is known)


                  3.
                  JBoss ask the Database (HSQL, MySQL, what ever)
                  (The Database, yes! I know this People!)

                  4.
                  The DLL gives the Returnvalue of the Remoteoperation
                  (JBoss says to the DLL, ok User is known and this is its
                  UserID Nr.)

                  All things are be done in verry good wanner, wich is
                  scalable, robust, Faulttolerant and the main Intelligence
                  is present at the Server (ThinClient Architecture) and your
                  DLL is only a little Handy DLL (no local on Machine Config
                  Problems)

                  You can service 100.000 and more Peoples with this Solution (:

                  Getting into the Details in C/C++

                  For Example, i have a allready working DLL called "soapeng.dll"

                  and the DLL Hostprogramm calling with the following
                  C/C++ Codesnippet (works on MS Visual C/C++ and
                  GCC / MinGW on Windows or Linux)

                  Here is my Sourcecode of the DLL-Host Application
                  "test123.exe" thadt invokes my "soapeng.dll"

                  #include <stdio.h>
                  #include <windows.h>

                  typedef char* (CALLBACK* LPFNDLLFUNC)();

                  HINSTANCE hDLL; // Handle to DLL
                  LPFNDLLFUNC myDllFunc; // Function pointer

                  char* uReturnVal;

                  int main()
                  {

                  hDLL = LoadLibrary("C:\\projects\\soapeng\release\\soapen g.dll");

                  if (hDLL != NULL)
                  {
                  myDllFunc = (LPFNDLLFUNC1)GetProcAddress(hDLL,"testMain");

                  if (!myDllFunc)
                  {
                  // Handle the Errors if one occurs
                  FreeLibrary(hDLL);
                  }
                  else
                  {
                  // Everything works fine, now do the Remotecall to JBoss
                  uReturnVal = myDllFunc();

                  // Display the JBoss Remotecall result as a Character
                  printf(uReturnVal);
                  }
                  }
                  return(0);
                  }

                  // End of Programm.


                  The Host Applicationpart must be translated to UnrealScript.
                  It invokes my SOAP XML DLL and retrieves the Online Database
                  (mySQL, HSQL, PostgreSQL, ORACLe or what ever DB)

                  The soapeng.dll packed with the UPX Packer has only a Size
                  of 70 KBytes, and need no .NET or anything else like a
                  Servicepack to make it Work on any Win Version.

                  It runs on Win95/98/SE/ME/NT4/2000/XP and with a few Modification (Exporttable it runs also on Linux/Unix , MAC, Solaris.
                  and with a high Performance an minimalistic Memoryfoorprint
                  (thanks to Robert van Englen for its great gSOAP Toolkit!)

                  Greetings from Germany Apoc9009

                  Comment


                    #10
                    the UnrealEngine provides a TCP and UDP socket (e.g. TCPLink and UDP link) for client\server stuff.
                    No need for useless, ugly, error prone, security issue creating, platform depended,etc.. native code. No custom dynamic link libraries required.

                    It would be nice to have some additional functionality in the engine, like a tokenizer or SMGL parser. Doing this from script is really slow. Anyway, new native functionality is only usefull when it comes with the engine, not via a 3rd party addon.

                    Comment


                      #11
                      Hi.

                      A mod team I'm on, the Wanderlust team, are creating a MMORPG using the UT2004 engine. Two of our most experienced programmers have recently developed fully functional database software and a daemon for communication between the database software and ut2004. Preliminary tests have been successful, so you may want to drop by and ask them for advice:

                      http://wanderlust.unrealvortex.com/

                      Comment


                        #12
                        Originally posted by El_Muerte_[TDS]
                        the UnrealEngine provides a TCP and UDP socket (e.g. TCPLink and UDP link) for client\server stuff.
                        No need for useless, ugly, error prone, security issue creating, platform depended,etc.. native code. No custom dynamic link libraries required.

                        It would be nice to have some additional functionality in the engine, like a tokenizer or SMGL parser. Doing this from script is really slow. Anyway, new native functionality is only usefull when it comes with the engine, not via a 3rd party addon.
                        I Think you are missunderstanding the UnrealTechnology.

                        Unreal is a native Software, and UnrealScript has the Option
                        to call a DLL. from UnrealScript why should Peoples dont
                        combine the best Things to make an better overall Soluttion?

                        In C/C++ you can have an better StringTokenizer as in Unreal
                        Script, it is more sophisticated and in Networking Things like
                        TCP/IP you have hugh Ressource into the Internet, many eperienced Developers and the Solution works on any important System.

                        1.Win32-DLL (70 KBytes)
                        2.Linux Shared Object (133) KBytes)
                        3.MAC OS X Shared Object (110 KBytes)

                        Whats your Problem with it?

                        On MAP Download, you can download the Right PlugIn Helper
                        DLL for UnrealScript (UnrealScript can use any 3 Files without
                        Probs).

                        Again:

                        The C/C++ Solution has many Enhancements, and any Platform
                        where Unreal Runs it runs with it side by side.

                        It is a terrible Work, to use a TCP Socket and Implementing
                        a Tokenizer in UnrealScript and after this, you must implement an
                        Database SQL Compliant Access Client (IN UNREAL Script!)

                        Do you know waht SQL is and how it works???

                        The other Thing what do you are recommend (doing things
                        on Server with the Client Data after sending it over an TCP
                        Socket fron UnrealScript)

                        Yes, thadts exactly thadt what i saying.

                        But you dont have the Problem, to write an Own TCP
                        Server on Servermachineside with C/C++, Perl oder
                        what ever -making a Tokenizer, solving Problems on
                        Memorylacks, Memorymanagement, slow Performance
                        and terrible Scalability if many Users are connected.

                        Anyway, my Solution works fine every Day and i can call it
                        in "Reality" from UnrealScript, thadt important, nothing else.


                        Greetings Apcc9009

                        Comment


                          #13
                          Originally posted by MarZer
                          Hi.

                          A mod team I'm on, the Wanderlust team, are creating a MMORPG using the UT2004 engine. Two of our most experienced programmers have recently developed fully functional database software and a daemon for communication between the database software and ut2004. Preliminary tests have been successful, so you may want to drop by and ask them for advice:

                          http://wanderlust.unrealvortex.com/
                          In respect to the Work of your Programmers, iam sorry,
                          it makes no Sense.

                          The Reason.


                          1.
                          If you have an Database, you have to ask the Database
                          Engine (the common way) in Structured Query Language -
                          called SQL)

                          2.
                          Any SQL-Implementation on a Database is diffrent, on Rows,
                          Metadata

                          3.
                          If you write an Software, thadt want connect to the Database
                          SQL Engine, the you must implement (for the one!) the Database
                          API to get the Reuslts and write things ot it.

                          4.
                          Ok, you can use ODBC (Open Database connectivity) but
                          you need a ODBC-Driver to get access to more and the
                          Proeformance is poor and the Driver can cost a lot.

                          5.
                          If you dont use ODBC you are can solve only 1.Database
                          (for Example mySQL ) and you are not able to chage this Issue.

                          6.
                          The Deamon tahdt handles the UnrealCleitn Data must
                          take Care on Serverside, for all Networking Probles, Fault
                          recovery, Security Problems like BufferOverflows!, and
                          other Things and must for any OS new migrated and
                          a diffrent Codebase must be maintained.


                          Thadts the Reaseon why the GlobalPlayers in the Software
                          Indsutrie using 85% Java on Servers. In a Java J2EE Server
                          with a few lines of code, you can write a Middleware
                          PlugIn (selfinstallation and automative Configuration and
                          DB-Setup on a running System / without Reboot!)

                          Enhancement:

                          On Serverside the Operatingsystem is irrelevant you can use
                          Linux, Windows, Mac, Solaris, FreeBSD, what ever, you can
                          easly use any Type of Database and it is ALL free to have
                          an done within 1/2 Days and it is the better overall
                          Solution and can Serveup 100.000 Users and more any
                          Day.

                          Look at ORACLE, SAP, Peoplesoft, IBM, Lotus, Apache BEA,
                          SUN, Borland, Yahoo, eBay, and many other more (exceptionally
                          Microsoft)


                          In the Industrie, Java on Server (J2EE Sepecification) is a
                          Reality and no one uses .NET (only Windows Systems
                          ore the lacking Mono implementations of .NET thadt cannot
                          win against Microsoft)


                          Again: my Solution works fine Everyday.

                          I use it not only for UnrealScript, i using it to implement
                          an ERP-Softwaresystem for the Financial Business on
                          Missioncritical Things.

                          Greetings Apco9009

                          Comment


                            #14
                            Originally posted by Brigand
                            Let me know how you get on with this, I'd also very much like to access a MySQL database from the game. This opens up a world of possibilites for me

                            I looked into a TCP connection and it seems viable, however, I couldn't find any information on what to send over the TCP link. Ie. the raw commands that the MySQL server accepts.
                            You must sending SQL Compliant Command to MySQL,
                            with correct Character Encoding .

                            You need a Tokenizer for SQL Commandosyntax and
                            you must implement some Parts of the MySQL Client
                            Interface (like the MySQL Client does)

                            All Infos you can find at http://www.mysql.com

                            OR:

                            You can use ODBC (thadt work on Linux/Unix and Windows)
                            and you must write a Programm on Webserverside tahdt
                            connects to the ODBC Driver Manager and ask the MySQL
                            ODBC Driver (a little bi more easy but you have to write
                            a native Software)

                            Or you use the HTTPlib from Mr Muerte or you can
                            use Java on Server and SOAP as Standard Protocoll
                            and a Selfbacking DLL to communicate withe your
                            Webserver.

                            Tips on thadt, how you can write your own
                            SOAP Webserice Client in C/C++ and setting up
                            a Java Webservice Service on your Weserver
                            can be found at an other Article in this Forum.

                            Comment


                              #15
                              I'm trying to follow this but it goes over my head a bit (Don't really know the first thing about programming databases and stuff like that). From what I canfigure out you are calling an external dll from unrealscript. How is this possible? I thought the only way to get data out of unreal using unrealscript was using a TCPLink? Or have I misunderstood something.

                              Comment

                              Working...
                              X