예제 #1
0
public static void ValidateGameAttributes(game game)
{
    if (String.IsNullOrWhiteSpace(game.name))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "name");
    }

    if (String.IsNullOrWhiteSpace(game.id))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "id", game.name);
    }

    if (String.IsNullOrWhiteSpace(game.gameurl))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "gameurl", game.name);
    }

    if (String.IsNullOrWhiteSpace(game.version))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "version", game.name);
    }

    if (String.IsNullOrWhiteSpace(game.iconurl))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "iconurl", game.name);
    }

    if (game.scriptVersion == "0.0.0.0")
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "scriptVersion", game.name);
    }
}
예제 #2
0
public static void ValidateGameAttributes(game game)
{
    if (String.IsNullOrWhiteSpace(game.name))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "name");
    }

    if (String.IsNullOrWhiteSpace(game.id))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "id", game.name);
    }

    if (String.IsNullOrWhiteSpace(game.gameurl))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "gameurl", game.name);
    }

    if (String.IsNullOrWhiteSpace(game.version))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "version", game.name);
    }

    if (String.IsNullOrWhiteSpace(game.iconurl))
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "iconurl", game.name);
    }

    //TODO: Some way of automatically retrieving the most current python API version so we don't have to manually change this every time
    var newestPythonVersion = "3.1.0.2";

    if (game.scriptVersion == "0.0.0.0")
    {
        throw GameValidator.GenerateEmptyAttributeException("Game", "scriptVersion", game.name);
    }
    else if (game.scriptVersion != newestPythonVersion)
    {
        GenerateWarningMessage("This game is using an outdated Python Script Version ({0}).\nConsider upgrading to the newest API version {1}", game.scriptVersion, newestPythonVersion);
    }
}