[WIP] System Sharing

Discussion in 'Mod Discussions' started by cptconundrum, January 30, 2014.

  1. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    I'll probably work on the unit names theme stuff first but I plan on writing it eventually.
  2. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I have started work on a java server for google app engine. I think this is more important than a PA Stats server, since it is more general and useful in more situations. Also, mods that attach a server with addServer() but do not provide a save_url will allow read-only access to the database. This could be useful for tournaments or leagues if tournament officials have write access through a hidden url. Deleting systems will probably need to be done through the gApps dashboard.
  3. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Sweet! You could also add a web-ui with edit/delete access given to those who sign in with a set gmail account. Authentication through google accounts is very easy to do in app engine. Could you make a repo for it in the PAMM org? That way I can work on it too and maybe set up that web ui.
  4. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Sure, I'll make a repo for it. I just want to get it to a reasonable state before I put the code out there. Messy code is messy.
  5. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    I completely understand. I can't wait to get my hands on the code though because I love app engine and I already have lots of ideas for the web-side UI and such. :D
    cptconundrum likes this.
  6. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Then I'll probably just re-create my php server in java, since I'm the one that defined the save/search interface anyway. Once I have a "working" server, I'll leave the code in your hands for administrative improvements. Things like obfuscated save urls, IP bans, rate limits, automatic mod creation (More on this below), system deletion, and edits are all good ideas but not required for it to work.

    For automatic mod creation, I have an idea that the server admin console could automatically create a mod zip file with nothing but the addServer code. People that want to connect to that server would just have to unzip it and drop it in the mods folder. It could also be made to create a zipped mod for admins to use, which will contain the obfuscated save url for servers with save disabled for normal users. This seems pointless to us, but it would actually take quite a bit of work out of starting a server for people that can't program.
  7. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    That works for me! Why don't you just make a server list item in settings for your mod? It seams like the easiest way to deal with multiple servers.

    I'll also write a guide for setting it up on app engine for n00bs, and do you want to use an install of this as the main server or still go with PA Stats?
  8. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I could put it in settings, but it starts to get complicated with two or three attributes per server. If we go that route though, it's not a problem. The mod can be extended to read all the saved servers out of localStorage at startup, and then just call addServer() on each. Adding this in wouldn't take very much work if we decide it's something we want.

    I think for now we can just point the main server to an install of this. If we ever get around to PA Stats integration (so much to do!), we can just export the database and then import into the PA Stats server.

    *Edit*
    I really want to get this all up and running at least at a basic level before the next tournament. I'd like to be able to set them up with their own server for official esports league systems. This is the main reason why I need to support read-only servers and obfuscated save urls for admins.
  9. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    I'd push for settings instead of custom mods but I get what you're saying. We could also integrate it with PA Stats by just adding hooks in the main server for it. I'm ready to help as soon as it's on GitHub.
  10. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    A custom mod is just one that does this;

    Code:
    cShareSystems.addServer({
        "name" : "Clan Server",
        "save_url" : "http://example.com/save",
        "search_url" : "http://example.com/search"
    });
    
    while reading from settings could probably just do something like this;

    Code:
    (function() {
        var savedServers = decode(localStorage.settings.cSharedSystems_savedServers);
    
        for(server in savedServers) {
           cShareSystems.addServer(server);
        }
    });
    
    It would probably also be able to work alongside custom mods. The bigger question is going to be how to display all that in settings without getting too confusing.
  11. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    True...
  12. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    So, I've been trying out this mod, and I really like it! Keep up the good work!
  13. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I'm surprised it still works for you. I think there were some changes to the server, and I would have expected that to break the version of the client you have. When we get the new server working, I will be shutting off the old one and leaving you with a broken client.
  14. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    Nope. I can still access all of the systems on there. Good to know that you'll be making a dedicated server though. Don't forget to update the client as well! ;)
  15. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    The one you have is just for testing. When LavaSnake and I get a working server on google apps, I'll release a newer client to PAMM.
    emraldis and LavaSnake like this.
  16. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    sweet.
  17. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    ok, now your client is broken. ;)
  18. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    gee thanks! :mad:


    just kidding
    LavaSnake likes this.
  19. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Uploading the release candidate here. I want to play around with it a little more before putting it up on PAMM just to be sure. This version has a Default Server that anyone can save to and a PA Matches server. Only Brian can save to PA Matches, so he will be using it to create a list of recommended PA Matches systems. If anyone else wants to run a server like that, let me know.

    One change you might notice is that searching by system name or creator is no longer a true fulltext search. This is a side effect of switching from mysql to the Google App engine datastore. Unfortunately, the datastore only tokenizes search terms by word instead of by character.

    If any clans want to run a private server, you can send me a PM. I'll give you a mod that clan members need installed to view or save to your server.

    Attached Files:

    Last edited: February 7, 2014
    emraldis likes this.

Share This Page