Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Licensing system & API connection #43

Open
1 of 3 tasks
NotCoffee418 opened this issue Mar 11, 2019 · 4 comments
Open
1 of 3 tasks

Licensing system & API connection #43

NotCoffee418 opened this issue Mar 11, 2019 · 4 comments
Assignees

Comments

@NotCoffee418
Copy link
Owner

NotCoffee418 commented Mar 11, 2019

These should all send POST requests to their corresponding API url:
Response is in json array. Just call it, call json deserialize and roll use the output.
All responses look like this:
array(
'result' => array(),
'errors' => array(),
);

check if response contains errors before anything else (errors exists at all rather)
errors: array("error strings", "other error")
call Logger.Log() to display errors to user, or show em in the window

All relevant return data is contained in the "result" variable

  • Trial
  • Check license

/api/validate_license
Post params:
macaddr - mac address string
license_key - (should be 'TRIAL' for trial check, all caps)
request_product_group - should be 1 for MTP

Return
is_active - int (0 or 1) (basically true or false but DB outputs tinyint)
expires_at - time string (DateTime.Parse())
^ Only these return on trial check

for non trial it also adds:
'product_name' => $r->product_name,
'product_description' => $r->product_description,
'first_name' => $r->first_name,
'last_name' => $r->last_name,
'email' => $r->email,
'restrictions' => $restrictions, // described below
'license_status_message' => 'Active license',

restrictions - array ( - not all keys may exist, so check if they do first - they all return as string (probably)
UNLIMITED_COMPUTERS - bool
MAX_STAKE - int of max buyin (Table.BigBlind x 100)
BUILD_TYPE - enum("RELEASE", "INTERNAL", "BETA") (so string basically) - indicates optional access to non-release builds
)

  • Check new version
@NotCoffee418
Copy link
Owner Author

NotCoffee418 commented Mar 14, 2019

/api/get_latest_version/multitable-pro(/beta) output in json:

array(2) {
  ["requested_version"]=>
  object(stdClass)#24 (7) {
    ["version_id"]=>
    string(1) "4"
    ["branch"]=>
    string(7) "RELEASE"
    ["version"]=>
    string(7) "1.0.0.1"
    ["release_date"]=>
    string(19) "2019-03-14 04:29:55"
    ["changelog"]=>
    NULL
    ["product_group_id"]=>
    string(1) "1"
    ["product_group_full_name"]=>
    string(14) "MultiTable Pro"
  }
  ["older_versions"]=>
  array(1) {
    [0]=>
    object(stdClass)#27 (7) {
      ["version_id"]=>
      string(1) "3"
      ["branch"]=>
      string(7) "RELEASE"
      ["version"]=>
      string(7) "1.0.0.0"
      ["release_date"]=>
      string(19) "2019-03-14 10:10:45"
      ["changelog"]=>
      string(4) "test"
      ["product_group_id"]=>
      string(1) "1"
      ["product_group_full_name"]=>
      string(14) "MultiTable Pro"
    }
  }
}

Invalid input or not found simply returns the whole thing as null

@NotCoffee418
Copy link
Owner Author

/download:

/*
 * /Download page
 * $productGroupShort - Null will grab the first product in database
 * $branch - RELEASE, BETA, or INTERNAL (not case sensitive
 * $version - Assembly version eg 1.0.0.5
 * $downloadType -
 * 		"view" display information about the version
 * 		"setup" direct access to the version's setup file
 * 		"update" direct access to the version's update files
 *
 * examples:
 * /download - displays download info for latest release version
 * /download/release/latest/setup - downloads the setup file
 * /download/beta/1.0.1.200 - displays info for a specific beta build if it's available

@deMathias
Copy link
Collaborator

/api/get_latest_version/multitable-pro(/beta) output in json:

array(2) {
  ["requested_version"]=>
  object(stdClass)#24 (7) {
    ["version_id"]=>
    string(1) "4"
    ["branch"]=>
    string(7) "RELEASE"
    ["version"]=>
    string(7) "1.0.0.1"
    ["release_date"]=>
    string(19) "2019-03-14 04:29:55"
    ["changelog"]=>
    NULL
    ["product_group_id"]=>
    string(1) "1"
    ["product_group_full_name"]=>
    string(14) "MultiTable Pro"
  }
  ["older_versions"]=>
  array(1) {
    [0]=>
    object(stdClass)#27 (7) {
      ["version_id"]=>
      string(1) "3"
      ["branch"]=>
      string(7) "RELEASE"
      ["version"]=>
      string(7) "1.0.0.0"
      ["release_date"]=>
      string(19) "2019-03-14 10:10:45"
      ["changelog"]=>
      string(4) "test"
      ["product_group_id"]=>
      string(1) "1"
      ["product_group_full_name"]=>
      string(14) "MultiTable Pro"
    }
  }
}

Invalid input or not found simply returns the whole thing as null

Keep getting 404 not found.

@NotCoffee418
Copy link
Owner Author

@deMathias It's fixed. Happened because there are no published versions.
Added a non-functional build for testing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants