Attempt to patch php patch method.
This commit is contained in:
parent
845e35fe74
commit
3756383fa8
5 changed files with 36 additions and 12 deletions
|
@ -9,7 +9,7 @@ class TTConsts {
|
||||||
static get SESSION_SERVER =>
|
static get SESSION_SERVER =>
|
||||||
"https://api.zontreck.com/timetrack/$UPDATE_CHANNEL/timetrack.php";
|
"https://api.zontreck.com/timetrack/$UPDATE_CHANNEL/timetrack.php";
|
||||||
|
|
||||||
static const VERSION = "1.0.0-beta.35";
|
static const VERSION = "1.0.0-beta.36";
|
||||||
|
|
||||||
static bool UPDATE_AVAILABLE = false;
|
static bool UPDATE_AVAILABLE = false;
|
||||||
static UpdateChannel UPDATE_CHANNEL = UpdateChannel.beta;
|
static UpdateChannel UPDATE_CHANNEL = UpdateChannel.beta;
|
||||||
|
|
|
@ -237,7 +237,7 @@ class SessionData {
|
||||||
androidConfig: androidConfig,
|
androidConfig: androidConfig,
|
||||||
);
|
);
|
||||||
|
|
||||||
FlutterBackground.enableBackgroundExecution();
|
if (success) FlutterBackground.enableBackgroundExecution();
|
||||||
WakelockPlus.enable();
|
WakelockPlus.enable();
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
@ -314,15 +314,14 @@ class SessionData {
|
||||||
FlutterBackground.disableBackgroundExecution();
|
FlutterBackground.disableBackgroundExecution();
|
||||||
WakelockPlus.disable();
|
WakelockPlus.disable();
|
||||||
|
|
||||||
var saveData = await _serializeToNBT();
|
//var saveData = await _serializeToNBT();
|
||||||
ResetAppSession();
|
//ResetAppSession();
|
||||||
print(SnbtIo.writeToString(saveData));
|
//print(SnbtIo.writeToString(saveData));
|
||||||
Uint8List nbtData = await NbtIo.writeToStream(saveData);
|
//Uint8List nbtData = await NbtIo.writeToStream(saveData);
|
||||||
|
|
||||||
Trips = [];
|
_performPatch();
|
||||||
positions = [];
|
|
||||||
|
|
||||||
_upload(nbtData);
|
//_upload(nbtData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// v2 Create function.
|
/// v2 Create function.
|
||||||
|
@ -367,7 +366,7 @@ class SessionData {
|
||||||
|
|
||||||
/// Deprecated: This function uploads using the v1 API, and is intended to be called at the conclusion of data recording.
|
/// Deprecated: This function uploads using the v1 API, and is intended to be called at the conclusion of data recording.
|
||||||
@Deprecated(
|
@Deprecated(
|
||||||
"This function utilizes the Protocol v1 Create method, which has been replaced by createv2 and patch. This function will be removed.",
|
"This function utilizes the Protocol v1 Create method, which has been replaced by createv2 and patch. This function will be removed. DO NOT USE",
|
||||||
)
|
)
|
||||||
static Future<void> _upload(List<int> nbtData) async {
|
static Future<void> _upload(List<int> nbtData) async {
|
||||||
Dio dio = Dio();
|
Dio dio = Dio();
|
||||||
|
|
|
@ -16,6 +16,8 @@ class HomePage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HomePageState extends State<HomePage> {
|
class _HomePageState extends State<HomePage> {
|
||||||
|
int UPLOAD_STATE = -1;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
@ -421,6 +423,8 @@ class _HomePageState extends State<HomePage> {
|
||||||
|
|
||||||
SessionData.DirtyState = true;
|
SessionData.DirtyState = true;
|
||||||
SessionData.ActionPerformed();
|
SessionData.ActionPerformed();
|
||||||
|
|
||||||
|
ShowUploadProgress();
|
||||||
},
|
},
|
||||||
child: Text("Yes"),
|
child: Text("Yes"),
|
||||||
),
|
),
|
||||||
|
@ -446,6 +450,26 @@ class _HomePageState extends State<HomePage> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> ShowUploadProgress() async {
|
||||||
|
UPLOAD_STATE = 0;
|
||||||
|
_advanceUpload();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _advanceUpload() async {
|
||||||
|
if (UPLOAD_STATE == 0) {
|
||||||
|
// We're now going to show the modal indicating the data is being compiled to NBT
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (buildx) {
|
||||||
|
return AlertDialog.adaptive(
|
||||||
|
title: Text("Upload in progress"),
|
||||||
|
content: Column(children: [Text("Compiling NBT Session Data...")]),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Widget GetLoggedInWidgets() {
|
Widget GetLoggedInWidgets() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
|
|
|
@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.0-beta.35
|
version: 1.0.0-beta.36
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.7.2
|
sdk: ^3.7.2
|
||||||
|
|
|
@ -90,8 +90,9 @@ function update_version($DB, $sesisonId, $newVer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushNewData($DB, $sessionId, $data) {
|
function pushNewData($DB, $sessionId, $data) {
|
||||||
|
$null = NULL;
|
||||||
$stmt = $DB->prepare("UPDATE `data` SET `SessionData` = ? WHERE `ID` = ?");
|
$stmt = $DB->prepare("UPDATE `data` SET `SessionData` = ? WHERE `ID` = ?");
|
||||||
$stmt->bind_param("bs", NULL, $sessionId);
|
$stmt->bind_param("bs", $null, $sessionId);
|
||||||
$stmt->send_long_data(0, $data);
|
$stmt->send_long_data(0, $data);
|
||||||
if(!$stmt->execute()) {
|
if(!$stmt->execute()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue