Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Extensions » My wheels are turning (A different approach to Stars! management)
Re: My wheels are turning Fri, 18 April 2014 21:14 Go to previous messageGo to previous message
CrazyBS is currently offline CrazyBS

 
Petty Officer 1st Class

Messages: 68
Registered: November 2010
Location: Portland, OR
Quote:
The rest of your post indicates that you mean to provide a way to "create" or "play" turns, not "submit" turns. (I don't mean to quibble. But I do think that a project of this scope benefits from having as clear a mission statement as possible.)


Yeah, I agree with that. I'll clarify that, we certainly want to be able to work on a turn without using the client.

Quote:
From there I'm guessing we could reconstruct most or even all of the files' internals, which would lead to all kinds of great tools, including anti-cheating. Cool


Since the submission of turn data would be in JSON form to the server, there would be a requirement to ensure that the turn data passes sanity tests. We would know about the race of the player and their current research levels/technology through the race file and the M file. So it's all theoretically possible.

The main point of contention is that we will need to be able to get to and from a valid Stars! file to a representation of the data. The idea is this:

public interface StarsGeneratedTurn
{
  // Could be streams
  public StarsGeneratedTurn(byte[] fileData); 

  // Represents the same byte[] array passed in.  This is the .M file
  public byte[] tokenize(); 

  // StarsYearData would be a POJO filled with all the information needed to view the yearly details
  public StarsYearData getYearData();
}

public interface StarsTurn
{
  // Creates a new turn definition from a generated turn
  public StarsTurn(StarsGeneratedTurn generatedTurn); // Creates a new turn definition from a generated turn

  // Opens up a previously tokenized turn.
  // I'm not sure if we actually need the generated turn here, but could be useful for validation rules
  public StarsTurn(StarsGeneratedTurn generatedTurn, byte[] tokenizedTurn); 

  // This will be the .X file representing the current state of the turn.
  public byte[] tokenize(); 

  // StarsTurnData is a simple POJO with a collection of turn information
  public StarsTurnData getTurnData();

  // The provided data would have edits, additions or deletions from the getTurnData().
  // Validation 
  public List<ValidationErrors> setTurnData(StarsTurnData turnData); 

  // Validates a turn and returns the results
  public List<ValidationErrors> validateTurn(StarsTurnData turnData);
}


As a first stab at it.. that looks pretty good. Now we just have to get the right people to agree to implement it or provide the information to me to do so myself.

The more I think about this project, the more this would be better as a "upgrade" to SAH version 2.0. Mainly adding additional features that allow the players to click on their turn and view it, edit it and submit when they are satisfied. That way the sensitive source code for these files doesn't get into the wrong hands. However, with the JSON representation being the interface to the data, I can build on top of those interfaces and build a useful app to compliment SAH.



--------------------------
Brenton Pyl
Technical Lead
Catalyst IT Services, Inc.

Report message to a moderator

 
Read Message icon3.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: m and h files merger tool
Next Topic: "message pane" scraper
Goto Forum:
  


Current Time: Tue Jun 11 20:00:43 EDT 2024