New ladder system

New ladder system

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

New ladder system

Post by MelTraX »

There have been several people in the last months who wanted to make a new ladder for Spring since the old one is kinda broken and only supports one mod with 1v1 games.

Since nothing happened for several months, flopflop asked me a few days ago if I could try to make one so he, andy and I discussed a new system and I began to work on it..

The basic features work now and everybody is invited to beta test.

http://www.spring-league.com/

For the time being it is hosted on my own server. This shouldn't be any problem but it is offline half an hour at around 4am German time.

I know that the page is ugly. Wisse is currently working on a better skin.

The next thing I did was to ask Satirik about integration into TASClient. So we discussed a good way to do it and I made an API for lobbies. The SpringLobby guys already said that they will also add support for it but only after basic features have been implemented.

http://www.spring-league.com/ladder/lobby/

edit: changed links to new old domain
Last edited by MelTraX on 07 Sep 2007, 01:03, edited 1 time in total.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Post by BrainDamage »

i'd suggest to allow a range of values for the options

ie.

metal (500-2000)

any could be "too much free" for some type of games, and fixed value too restrictive
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Firstly

- Lobby based registration of new usernames?
- Renaming of accounts?
- How're ladders created? Will a kernel panic ladder be spawned as soon as someone uploads a kernel panic replay?
- Contesting replays?
Getting game settings

Each ladder has a set of pre-defined game settings. They don't have to be enforced by the lobby because it's simply not possible to report games that violate these rules.
A) It is possible, the demo file starts with the script used to start spring which can be parsed and checked
B) No support for custom settings, its assumed that TASServer is being used

But so far its a good attempt, its a shame you dropped this entire system on the lobby developers after it was built without asking any questions of any kind. Past ladder developers have done BA specific ladders replying on demo uploads or simply talked about feature requests, lobby developers werent asked anything despite being the ones who could make or break a ladder system.

Another note, do you support uploading zipped demo files? I'd rather upload the 50kb zip archive than the 50MB demo file it contains.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

AF wrote:Firstly

- Lobby based registration of new usernames?
- Renaming of accounts?
All of those can be done only on the website atm.. I wanted to make the lobby integration as easy as possible. If any lobby wants to support more stuff (like creating accounts or showing top 10), just say so and I will provide the API.
AF wrote:- How're ladders created? Will a kernel panic ladder be spawned as soon as someone uploads a kernel panic replay?
Only superadmins can create new ladders (on the website). If anyone is interested in the admin part, PM me in the lobby and will give you admin rights if I know you. You can't do much harm anyway because the ladder will be reset after beta testing.
AF wrote:- Contesting replays?
My site doesn't host any replays and doesn't need them for game reporting. You can however pass an ID of the replay site on UF.
AF wrote:
Getting game settings

Each ladder has a set of pre-defined game settings. They don't have to be enforced by the lobby because it's simply not possible to report games that violate these rules.
A) It is possible, the demo file starts with the script used to start spring which can be parsed and checked
I don't know what you wanna say with this but the replay doesn't contain the winner (that's why I need infolog.txt). It could replace script.txt but flop said that he thinks it's too much to upload. Also not everyone wants to publish the replay.
AF wrote:B) No support for custom settings, its assumed that TASServer is being used
I don't know what you are refering to here either. But a ladder can have predefined settings for the stuff the server supports and additional textual rules which the lobby can obtain through the API.
AF wrote:But so far its a good attempt, its a shame you dropped this entire system on the lobby developers after it was built without asking any questions of any kind. Past ladder developers have done BA specific ladders replying on demo uploads or simply talked about feature requests, lobby developers werent asked anything despite being the ones who could make or break a ladder system.
I only discussed it with Satirik until now. This is the thread to ask the rest of you what you think and if you have suggestions. So if you think that there's anything missing from the API, here's the place to inform me :).

I started this 3 days ago and I can't really do everything at once ;).
AF wrote:Another note, do you support uploading zipped demo files? I'd rather upload the 50kb zip archive than the 50MB demo file it contains.
As I said above, I don't host the replays myself.
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

But so far its a good attempt, its a shame you dropped this entire system on the lobby developers after it was built without asking any questions of any kind.
Yes, but then again there was some discussion about a tournament system some time ago. Still I agree that some plan/discussion on how to integrate this into the lobby's and (important to me) the site is a very good idea. So lets discuss. :-)

About the site, are you planning to integrate it with the 'new' site? If so, I would suggest to use the translation system. And if so are you planning to use svn for development? Are there other things that need discussion?
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

I was thinking about integrating it into the site.. But I think it would be best if we only add the rankings and maybe the last played game to one site.. There will be a lot of statistics and admin stuff on the actual ladder page so I think a link would be better..

I will also add a tournament feature to easily setup tournaments. I will finish basic ladder features first though and the lobby integration is also more important imho.
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

I don't know if we understand each other here. I don't mean that statistics are shown on the entry page of the new site. I mean that your tournament software becomes a part of the hole site and also part of the site development process.

Feel free to focus on lobby integration at this moment, I'm just discussing the things I like to discuss from my perspective.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

Yeah, I did understand you :)..

For the SVN part: if anyone wants to help developing it, just PM me (or post in here). I can setup an SVN for it in notime..
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

MelTraX wrote:Yeah, I did understand you :)..
Why, would statistics and admin stuff be a problem for integration? User friendlessness? Privacy? Security?
MelTraX wrote:For the SVN part: if anyone wants to help developing it, just PM me (or post in here). I can setup an SVN for it in notime..
Good, I like to help develop it, to be more specific, I like to hack in the site translation system, I don't like to use another svn thou, the current svn is working just fine. Show me the code and get Tobi to grand you commit access. :-) I mean I don't like to push this if there are genuine concerns but to me the thing needs to be part of the Spring site.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

I am listed as a superadmin, if you would like me to set up a ladder tonight for you, I will.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

neddiedrow: making a new ladder is not really important.. get people to play and test it ;)

tim: I have to think about that integration stuff a bit.
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

MelTraX wrote:tim: I have to think about that integration stuff a bit.
Sure, feel free to ask any questions you may have.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

say 2 people join a ladder and do a 1v1, and there are 3 spectators.

All 5 players report the battle. How do you determine which battle is which and distinguish between 5 different battles and 1 battle with 5 players?
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

Everyone of those 5 players/specs can report the game if they want to. The ladder system will only accept the report from the players of the losing team.

If two players of the losing team report the game it will be reported twice atm.. I will prevent that by only allowing to report a game with the exact same players and settings only once every 5 mins. That way the lobby can just report the game for all players. On the other hand this means that players will have to wait if they play two identical games and the latter doesn't last 5 minutes but I don't think that'll be a problem.

This will be implemented this weekend because it has to work before the first lobby with ladder integration is out there.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Or you can add a tag signifying the battleID of the battle the server uses. Any lobby integrating it would autoadd the battleID= tag which you can then use to help distinguish battles.

btw do you think this would work?:

Code: Select all

public class CMeltraxLadder {

    public static void ReportGame() {
        /*
        <form action="https://meltrax.homeip.net/projects/other/spring/ladder/lobby/report.php"
            method="post" enctype="multipart/form-data">

            Username: <input name="username"><br>
            Password: <input name="password" type="password"><br>
            Spring\Infolog.txt: <input name="infolog" type="file"><br>
            Spring\Script.txt: <input name="script" type="file"><br>
            ReplayID from <a href="http://replays.unknown-files.net/">http://replays.unknown-files.net/</a> (optional): <input name="replay"><br>

            <input type="submit">
        </form>
        */
        try {
            // Construct data
            String data = URLEncoder.encode("username", "UTF-8") + "=" + URLEncoder.encode("[]Lobbytest", "UTF-8");
            data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + URLEncoder.encode("mypass", "UTF-8");
            data += "&" + URLEncoder.encode("infolog", "UTF-8") + "=" + URLEncoder.encode(CFSHelper.GetFileContents("infolog.txt"), "UTF-8");
            data += "&" + URLEncoder.encode("script", "UTF-8") + "=" + URLEncoder.encode(CFSHelper.GetFileContents("script.txt"), "UTF-8");

            // Send data
            URL url = new URL("https://meltrax.homeip.net/projects/other/spring/ladder/lobby/report.php");
            URLConnection conn = url.openConnection();
            conn.setDoOutput(true);
            OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
            wr.write(data);
            wr.flush();

            // Get the response
            BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String line;
            while ((line = rd.readLine()) != null) {
                // Process line...
            }
            wr.close();
            rd.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Or is there something horribly obvious going wrong?
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

At first sight it looks like you wanna send the files as normal strings. I don't think that'll work but feel free to prove me wrong..

Other than that it looks fine but I never did any down- or uploading stuff with Java..

I really like that battleID idea though. Are they reset everytime the server restarts or something?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

They rturn to 0 when either the server restarts or the BattleID integer overflows the MAX_INT binary and finally reaches zero (all integers in java are signed)

So unless the server makes several rapid restarts in succession you can be assured that the battleID is unique. That is unless there are several lobby servers being used.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

I can't really help you with the Java POST stuff, sorry..

I will think about adding an optional battleID, but now that I think about it, it probably won't help much..

I wanna implement that delay anyway because it makes writing a script to report fake games a bit harder and because players don't know the ID if they manually report the game. And if it's an 8v8 game there will probably be duplicate reports..
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Adding the battleID to the script should be a very easy 1 liner in any lobby, do you want it added anyway just incase?

Ill keep fiddling with the java post code.

But in the mean time I need a method of registering a username, renaming a user account, and changing the password programatically.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

You wouldn't even have to add it to the script.txt.. It could be another POST variable.. I will think about if I wanna have it ;)..

I will add API stuff for those functions tomorrow (or Sunday or Tuesday)..
Last edited by MelTraX on 02 Sep 2007, 23:16, edited 1 time in total.
Post Reply

Return to “Engine”