Welcome to the new Diaspora forums, please let us know if you see anything broken! Notice: Some users may need to reupload their avatars due to an issue during forum setup!

[Alpha] Time Sharing Between Servers

Nielk1Nielk1 Posts: 252Registered, Administrator
edited April 2011 in Development #1
Before someone else f*cks this up, I work with databases at work and I am doing the sqlite3 portion of a class project for Android phones. I know how these things work. I will look at it in 2 or 4 weeks.

Probable structure:

Basic use of cached data, attempting to sync to server when a person joins. Data since last sync also kept to allow for a delta on both servers to apply to the central storage without issue.

Complexity: minimal
Dev-time: minimal
Tech risk: medium, need to find exactly how lua does DB stuff. I might need to write a custom DLL for this. This could slow down dev time with research time.

Will probably involve replacing UTime entirely. Come up with a name.
Post edited by Unknown User on

Comments

  • AmaroqAmaroq Posts: 451Registered, Administrator
    Problem: DLL's can't be uploaded to boxes that aren't your own.
  • Nielk1Nielk1 Posts: 252Registered, Administrator
    Why not. These are GMOD dlls, not system DLLs.

    I could custom write a front end too and do basic interface over socket if you think that the only option. Many many options.
  • AmaroqAmaroq Posts: 451Registered, Administrator
    Because the servers are programmed to not accept a .dll file.
  • Nielk1Nielk1 Posts: 252Registered, Administrator
    The FTP? What if the LUA of the server renamed it post upload? It seems odd to me. Lots of servers have addons with DLLs.

    I digress, in all likelihood, a DLL is not needed. I will just socket a web interface, authenticate, and get the data that way. Easy as hell.
  • Nielk1Nielk1 Posts: 252Registered, Administrator
    Plan before considering issues and permissions:
    • Server side (web server)
      • Create server side database, steamID as primary key, time as only other column.
      • Set up interface, be sure to cleanse all dynamic input to prevent injection.
      • Build basic front end for admins to set time in the DB directly.
      • Set up basic RMI URL to pass in steam ID and get back time value. Help Fuhrball or Steeveeo to make a custom profile field on the phpbb3 forum where the template uses this specific field to call the RMI url and get the time.
    • Client side (game server)
      • Set up local caching and tracking delta since last sync
      • Set up settings file for DB and password for remote server interaction. Be sure it is only readable by the needed users and no others
      • Set up sync function triggered by map load for all users and join or exit for specific users

    Basics:
    When you join a server, it is keeping track of two values, your base time and delta time. When a sync occurs, the delta time is added to the value in the external server and then set to 0 and the base time is set to what is now the remote value. This means that the base is the cache of the external server and the delta is the change. Another option is to directly write the new value instead of a 'delta', but deltas are better in understanding the concept.
  • viperfan7viperfan7 Posts: 60Registered
    if you send the server owner an email requesting them to install a DLL, and provide them source code/purpose of DLL, some will install them
  • Nielk1Nielk1 Posts: 252Registered, Administrator
    This should be able to be straight LUA and then the server could be using PHP or some other such. I will be working on this on the DEV server once the main server is back online. Of course as the DEV and MAIN had the same base I will have to take the highest of both when this system is first officially activated.
  • Nielk1Nielk1 Posts: 252Registered, Administrator
    OK, I need to know if we have the base hours from our transfer from McBuilds still. If we do, I can actually recover all true hours from both servers unless at some point they were copied. Otherwise I would have to just grab the largest of the two for each given person.

    If this is available, can someone contact me by PM, private admin area, or steam to get it to me? For now I will work on getting the system to expect an online DB that is abstracted out and stubbed to just return their current full total hours from a supplementary read only sqlite3 file. Unless I somehow do it all in one day.

    I will be playing around on DEV with this when I get home. I will need to talk to Paperclip about getting a 2nd DB on this site. I say 2nd so we can prevent a security exploit in one from compromising the other. Both would have their own user with write access and the forum could somehow be given read access to the time db. If I could talk to Paperclip about getting access to said DB to set it up, it would be a great acceleration to this plan rather than doing it though him or another by proxy.
  • viperfan7viperfan7 Posts: 60Registered
    Amaroq wrote:
    Problem: DLL's can't be uploaded to boxes that aren't your own.



    this is only partialy true, you cant upload DLLs yourself, most of the gmod server hosters though will add them for you if you ask them to, just be sure to send them the release thread, and if the source code isn't there, send them a link to the source code aswell

Leave a Comment

bolditalicunderlinestrikecodeimageurlquotespoiler
Drop image/file