diff --git a/stockskis/lib/src/gamemodes.dart b/stockskis/lib/src/gamemodes.dart index f501419..4d9ddb1 100644 --- a/stockskis/lib/src/gamemodes.dart +++ b/stockskis/lib/src/gamemodes.dart @@ -16,16 +16,16 @@ import 'package:stockskis/src/types.dart'; final List GAMES = [ - LocalGame(id: -1, name: "Naprej", playsThree: true, worth: 0), - LocalGame(id: 0, name: "Tri", playsThree: true, worth: 10), - LocalGame(id: 1, name: "Dva", playsThree: true, worth: 20), - LocalGame(id: 2, name: "Ena", playsThree: true, worth: 30), - LocalGame(id: 3, name: "Solo tri", playsThree: false, worth: 40), - LocalGame(id: 4, name: "Solo dva", playsThree: false, worth: 50), - LocalGame(id: 5, name: "Solo ena", playsThree: false, worth: 60), - LocalGame(id: 6, name: "Berač", playsThree: true, worth: 70), - LocalGame(id: 7, name: "Solo brez", playsThree: true, worth: 80), - LocalGame(id: 8, name: "Odprti berač", playsThree: true, worth: 90), - LocalGame(id: 9, name: "Barvni valat", playsThree: false, worth: 250), - LocalGame(id: 10, name: "Valat", playsThree: true, worth: 500), + LocalGame(id: -1, name: "onward", playsThree: true, worth: 0), + LocalGame(id: 0, name: "three", playsThree: true, worth: 10), + LocalGame(id: 1, name: "two", playsThree: true, worth: 20), + LocalGame(id: 2, name: "one", playsThree: true, worth: 30), + LocalGame(id: 3, name: "solo_three", playsThree: false, worth: 40), + LocalGame(id: 4, name: "solo_two", playsThree: false, worth: 50), + LocalGame(id: 5, name: "solo_one", playsThree: false, worth: 60), + LocalGame(id: 6, name: "beggar", playsThree: true, worth: 70), + LocalGame(id: 7, name: "solo_without", playsThree: true, worth: 80), + LocalGame(id: 8, name: "open_beggar", playsThree: true, worth: 90), + LocalGame(id: 9, name: "color_valat", playsThree: false, worth: 250), + LocalGame(id: 10, name: "valat", playsThree: true, worth: 500), ]; diff --git a/stockskis/lib/src/stockskis_base.dart b/stockskis/lib/src/stockskis_base.dart index aecb87c..40f84b1 100644 --- a/stockskis/lib/src/stockskis_base.dart +++ b/stockskis/lib/src/stockskis_base.dart @@ -1294,7 +1294,8 @@ class StockSkis { // evaluation inspect(modes); - bool isMandatory = userPositions.last == userId; + bool isMandatory = + userPositions.isEmpty ? canLicitateThree : userPositions.last == userId; List toRemove = []; for (int i = 0; i < modes.length; i++) { if (modes[i] == -1) continue; diff --git a/tarok/lib/constants.dart b/tarok/lib/constants.dart index 083c162..a4090e5 100644 --- a/tarok/lib/constants.dart +++ b/tarok/lib/constants.dart @@ -13,6 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +import 'package:dart_discord_rpc/dart_discord_rpc.dart'; import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -26,6 +27,10 @@ import 'package:tarok/lobby/lobby_controller.dart'; part 'constants.g.dart'; +DiscordRPC rpc = DiscordRPC( + applicationId: '1175161862086721616', +); + const BACKEND_URL = kReleaseMode ? "https://palcka.si/api" : "http://localhost:8080"; const WS_URL = diff --git a/tarok/lib/game/game.dart b/tarok/lib/game/game.dart index 9dcc876..fdbca68 100644 --- a/tarok/lib/game/game.dart +++ b/tarok/lib/game/game.dart @@ -454,7 +454,7 @@ class Game extends StatelessWidget { "player": controller.userHasKing.value })), Text("stashed_cards".trParams({ - "cards": + "stashed": jsonEncode(controller.stashAmount.value) })), Text("talon_picked".trParams({ @@ -743,7 +743,8 @@ class Game extends StatelessWidget { : stockskis .GAMES[ user.licitiral + 1] - .name, + .name + .tr, style: const TextStyle( fontSize: 18, ), @@ -771,35 +772,8 @@ class Game extends StatelessWidget { mainAxisSpacing: 10, crossAxisCount: 4, childAspectRatio: 3, - children: [ - ...controller.games.map((e) { - if (controller.users.length == 3 && - !e.playsThree) { - return const SizedBox(); - } - return SizedBox( - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: controller - .suggestions - .contains(e.id) - ? Colors.purpleAccent.shade400 - : null, - textStyle: TextStyle( - fontSize: fullHeight / 35, - ), - ), - onPressed: () async { - await controller - .licitiranjeSend(e); - }, - child: Text( - e.name, - ), - ), - ); - }) - ], + children: + controller.gameListAssemble(fullHeight), ), ), ], @@ -947,7 +921,7 @@ class Game extends StatelessWidget { label: Expanded( child: Text("game".trParams({ "type": - "(${stockskis.GAMES[controller.currentPredictions.value!.gamemode + 1].name == "Naprej" ? "Klop" : stockskis.GAMES[controller.currentPredictions.value!.gamemode + 1].name})" + "(${stockskis.GAMES[controller.currentPredictions.value!.gamemode + 1].name == "onward" ? "klop".tr : stockskis.GAMES[controller.currentPredictions.value!.gamemode + 1].name.tr})" })), ), ), @@ -1069,7 +1043,7 @@ class Game extends StatelessWidget { -1)) DataRow( cells: [ - DataCell(Text("Kralji".tr)), + DataCell(Text("kings".tr)), if (controller.myPredictions.value != null && controller @@ -1599,7 +1573,8 @@ class Game extends StatelessWidget { const SizedBox( height: 10, ), - if (controller.zaruf.value) Text("zaruf".tr), + if (controller.zaruf.value && !isWebMobile) + Text("zaruf".tr), ElevatedButton( onPressed: () { controller.showTalon.value = false; @@ -1829,7 +1804,10 @@ class Game extends StatelessWidget { if (e.showGamemode) DataRow( cells: [ - DataCell(Text("game".tr)), + DataCell(Text("game".trParams({ + "type": + "(${stockskis.GAMES[controller.results.value!.predictions.gamemode + 1].name == "onward" ? "klop".tr : stockskis.GAMES[controller.results.value!.predictions.gamemode + 1].name.tr})" + }))), DataCell(Text( '${pow(2, e.kontraIgra)}x')), DataCell(Text( @@ -2329,8 +2307,7 @@ class Game extends StatelessWidget { .value.worth .round() .toString(), - "pointstext": e.value - .worth == + "ptext": e.value.worth == 3 || e.value.worth == 4 diff --git a/tarok/lib/game/game_controller.dart b/tarok/lib/game/game_controller.dart index 12ad883..8e96e7e 100644 --- a/tarok/lib/game/game_controller.dart +++ b/tarok/lib/game/game_controller.dart @@ -18,9 +18,11 @@ import 'dart:async'; import 'dart:convert'; import 'dart:developer'; +import 'dart:io'; import 'dart:math'; import 'dart:typed_data'; +import 'package:dart_discord_rpc/dart_discord_rpc.dart'; import 'package:flutter/material.dart'; import 'package:flutter_initicon/flutter_initicon.dart'; import 'package:get/get.dart'; @@ -124,6 +126,17 @@ class GameController extends GetxController { playingCount.value = playing; bots = bbots; + if (Platform.isLinux || Platform.isWindows) { + rpc.updatePresence( + DiscordPresence( + details: 'Igra igro ${bots ? "z boti" : "z igralci"}', + startTimeStamp: DateTime.now().millisecondsSinceEpoch, + largeImageKey: 'palcka_logo', + largeImageText: 'Tarok Palčka', + ), + ); + } + // BOTI - OFFLINE if (bots) { playerId.value = "player"; @@ -141,9 +154,20 @@ class GameController extends GetxController { } @override - void dispose() { + void onClose() { controller.value.dispose(); + if (Platform.isLinux || Platform.isWindows) { + rpc.updatePresence( + DiscordPresence( + details: 'Gleda na začetni zaslon', + startTimeStamp: DateTime.now().millisecondsSinceEpoch, + largeImageKey: 'palcka_logo', + largeImageText: 'Tarok Palčka', + ), + ); + } + try { socket.close(); } catch (e) {} @@ -170,6 +194,51 @@ class GameController extends GetxController { ); } + List gameListAssemble(double fullHeight) { + List gameListAssembly = []; + if (games.isEmpty) return gameListAssembly; + + int missingGames = games.length < 2 ? 0 : games[1].id; + + debugPrint("missing games $missingGames"); + + for (int i = 0; i < games.length; i++) { + var e = games[i]; + if (users.length == 3 && !e.playsThree) { + continue; + } + gameListAssembly.add( + SizedBox( + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: suggestions.contains(e.id) + ? Colors.purpleAccent.shade400 + : null, + textStyle: TextStyle( + fontSize: fullHeight / 35, + ), + ), + onPressed: () async { + await licitiranjeSend(e); + }, + child: Text( + e.name.tr, + ), + ), + ), + ); + if (e.id == -1) { + for (int i = 0; i < missingGames; i++) { + gameListAssembly.add(const SizedBox()); + } + } + if (e.id == 2 || e.id == 5 || e.id == 8) { + gameListAssembly.add(const SizedBox()); + } + } + return gameListAssembly; + } + void resetPredictions() { kontraIgra.value = false; kontraPagat.value = false; @@ -831,6 +900,14 @@ class GameController extends GetxController { } } + stockskis.SimpleUser getPlayer() { + for (int i = 0; i < users.length; i++) { + if (users[i].id != playerId.value) continue; + return users[i]; + } + throw Exception("Could not find user"); + } + void listen() { socket.messages.listen( (data) async { @@ -1073,6 +1150,7 @@ class GameController extends GetxController { zaruf.value = false; requestedGameEnd.value = false; talon.value = []; + suggestions.value = []; currentPredictions.value = Messages.Predictions(); copyGames(); @@ -1192,6 +1270,32 @@ class GameController extends GetxController { imaPrednost: obvezen, ); licitiram.value = true; + + var user = getPlayer(); + + var ss = stockskis.StockSkis( + predictions: PredictionsCompLayer.messagesToStockSkis( + currentPredictions.value!), + users: { + userId: stockskis.User( + user: user, + cards: cards + .map((element) => + stockskis.Card(card: element, user: userId)) + .toList(), + playing: false, + secretlyPlaying: false, + botType: "player", + licitiral: false, + ), + }, + stihiCount: 48 ~/ users.length, + ); + suggestions.value = ss.suggestModes( + userId, + canLicitateThree: obvezen, + ); + debugPrint(jsonEncode(suggestions)); } } else if (msg.hasClearDesk()) { stih.value = []; diff --git a/tarok/lib/internationalization/languages.dart b/tarok/lib/internationalization/languages.dart index eddaa93..e6b7a3a 100644 --- a/tarok/lib/internationalization/languages.dart +++ b/tarok/lib/internationalization/languages.dart @@ -222,7 +222,7 @@ class Messages extends Translations { "točko": "point", "točki": "points", "točke": "points", - "trick_is_worth": "Trick is worth @points @pointstext.", + "trick_is_worth": "Trick is worth @points @ptext.", "trick_picked_up_by": "Trick was picked up by @player", "close_results": "Close results overview", "thanks_game": "Thanks for the game", @@ -233,6 +233,30 @@ class Messages extends Translations { "User profile hasn't been confirmed or is already confirmed.", "customize_bots": "Customize bots", "language": "Language", + "onward": "Onward", + "three": "Three", + "two": "Two", + "one": "One", + "solo_three": "Solo three", + "solo_two": "Solo two", + "solo_one": "Solo one", + "solo_without": "Solo without", + "open_beggar": "Open beggar", + "klop": "Klop", + "password_reset": "Password reset", + "password_reset_request": "Request a password reset link", + "password_reset_success": "Password reset", + "password_reset_success_desc": + "In case of entering the correct e-mail address, you should've received an e-mail containing the link to reset your password.", + "password_reset_change_success": "Password reset successful", + "password_reset_change_success_desc": + "Your password was successfully changed.", + "password_reset_change_failure": "Password reset failure", + "password_reset_change_failure_desc": + "Your password was NOT successfully changed. Please retry the procedure or contact the developers to check what's going on.", + "password_reset_procedure": + "This procedure will sign you out of all your devices", + "password_reset_change": "Change your password", }, 'sl_SI': { "login": "Prijava", @@ -456,7 +480,7 @@ class Messages extends Translations { "točko": "točko", "točki": "točki", "točke": "točke", - "trick_is_worth": "Štih je (zaokroženo) vreden @points @pointstext.", + "trick_is_worth": "Štih je (zaokroženo) vreden @points @ptext.", "trick_picked_up_by": "Štih je pobral @player", "close_results": "Zapri vpogled v rezultate", "thanks_game": "Hvala za igro", @@ -464,6 +488,30 @@ class Messages extends Translations { "leave_game": "Zapusti igro", "customize_bots": "Prilagodi računalniške igralce", "language": "Jezik", + "onward": "Naprej", + "three": "Tri", + "two": "Dva", + "one": "Ena", + "solo_three": "Solo tri", + "solo_two": "Solo dva", + "solo_one": "Solo ena", + "solo_without": "Solo brez", + "open_beggar": "Odprti berač", + "klop": "Klop", + "password_reset": "Ponastavitev gesla", + "password_reset_request": "Zahtevajte povezavo za ponastavitev gesla", + "password_reset_success": "Ponastavitev gesla", + "password_reset_success_desc": + "V primeru, da ste vpisali pravi elektronski naslov, bi morali prejeti e-pošto s povezavo do strani za resetiranje vašega gesla.", + "password_reset_change_success": + "Ponastavitev gesla je bila uspešno izvedena", + "password_reset_change_success_desc": + "Vaše geslo je bilo uspešno spremenjeno.", + "password_reset_change_failure": "Napaka pri ponastavitvi gesla", + "password_reset_change_failure_desc": + "Vaše geslo se ni spremenilo. Prosimo, ponovite postopek, ali kontaktirajte razvijalce, da se razčisti o možnih težavah.", + "password_reset_procedure": "Postopek vas bo izpisal iz vseh naprav", + "password_reset_change": "Spremenite svoje geslo", } }; } diff --git a/tarok/lib/login/login.dart b/tarok/lib/login/login.dart index e02880b..25b16a2 100644 --- a/tarok/lib/login/login.dart +++ b/tarok/lib/login/login.dart @@ -98,6 +98,16 @@ class Login extends StatelessWidget { const SizedBox( height: 20, ), + ElevatedButton( + onPressed: () async { + await Get.toNamed("/account/reset"); + }, + child: Text("password_reset".tr, + style: const TextStyle(fontSize: 20)), + ), + const SizedBox( + height: 20, + ), const Divider(), const SizedBox( height: 20, diff --git a/tarok/lib/login/login_controller.dart b/tarok/lib/login/login_controller.dart index 48604cd..258be30 100644 --- a/tarok/lib/login/login_controller.dart +++ b/tarok/lib/login/login_controller.dart @@ -57,6 +57,59 @@ class LoginController extends GetxController { await Get.toNamed("/"); } + Future passwordResetRequest() async { + final response = await dio.post( + "$BACKEND_URL/password/reset_request", + data: FormData.fromMap({"email": email.value.text}), + options: Options(validateStatus: (status) { + return status != null; + }), + ); + debugPrint(response.statusCode.toString()); + Get.snackbar( + "password_reset_success".tr, + "password_reset_success_desc".tr, + ); + } + + Future passwordResetChange() async { + if (password1.value.text != password2.value.text) { + Get.snackbar( + "password_mismatch".tr, + "account_login_unknown_error_desc".tr, + ); + return; + } + + String resetCode = Get.parameters["resetCode"]!; + String email = Get.parameters["email"]!; + + final response = await dio.post( + "$BACKEND_URL/password/reset", + data: FormData.fromMap({ + "email": email, + "newPassword": password1.value.text, + "resetCode": resetCode, + }), + options: Options(validateStatus: (status) { + return status != null; + }), + ); + if (response.statusCode == 200) { + Get.snackbar( + "password_reset_change_success".tr, + "password_reset_change_success_desc".tr, + ); + await storage.delete(key: "token"); + await Get.toNamed("/login"); + return; + } + Get.snackbar( + "password_reset_change_failure".tr, + "password_reset_change_failure_desc".tr, + ); + } + Future register() async { if (password1.value.text != password2.value.text) { Get.dialog( diff --git a/tarok/lib/login/password_login_change.dart b/tarok/lib/login/password_login_change.dart new file mode 100644 index 0000000..3b9e2c1 --- /dev/null +++ b/tarok/lib/login/password_login_change.dart @@ -0,0 +1,78 @@ +// Tarok Palčka - a simple tarock program. +// Copyright (C) 2023 Mitja Ševerkar +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:get/get.dart' hide FormData; +import 'package:tarok/login/login_controller.dart'; + +class PasswordLoginChange extends StatelessWidget { + const PasswordLoginChange({super.key}); + + @override + Widget build(BuildContext context) { + LoginController controller = Get.put(LoginController()); + + return Scaffold( + body: Center( + child: ListView( + shrinkWrap: true, + padding: const EdgeInsets.all(20.0), + children: [ + Text( + "password_reset".tr, + style: const TextStyle(fontSize: 45, fontWeight: FontWeight.bold), + ), + const SizedBox( + height: 20, + ), + SizedBox( + width: 350, + child: TextField( + obscureText: true, + controller: controller.password1.value, + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: "new_password".tr, + ), + ), + ), + const SizedBox( + height: 20, + ), + SizedBox( + width: 350, + child: TextField( + obscureText: true, + controller: controller.password2.value, + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: "repeat_password".tr, + ), + ), + ), + const SizedBox( + height: 20, + ), + ElevatedButton( + onPressed: controller.passwordResetChange, + child: Text("password_reset_change".tr, + style: const TextStyle(fontSize: 20)), + ), + ], + ), + ), + ); + } +} diff --git a/tarok/lib/login/password_reset_request.dart b/tarok/lib/login/password_reset_request.dart new file mode 100644 index 0000000..3ad0ebd --- /dev/null +++ b/tarok/lib/login/password_reset_request.dart @@ -0,0 +1,89 @@ +// Tarok Palčka - a simple tarock program. +// Copyright (C) 2023 Mitja Ševerkar +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +import 'package:flutter/material.dart'; +import 'package:get/get.dart' hide FormData; +import 'package:tarok/login/login_controller.dart'; + +class PasswordResetRequest extends StatelessWidget { + const PasswordResetRequest({super.key}); + + @override + Widget build(BuildContext context) { + LoginController controller = Get.put(LoginController()); + + return Scaffold( + appBar: AppBar( + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + title: Text("palcka".tr), + automaticallyImplyLeading: false, + actions: [ + IconButton( + icon: const Icon(Icons.settings), + onPressed: () async { + await Get.toNamed("/settings"); + }, + ), + ], + ), + body: Center( + child: ListView( + shrinkWrap: true, + padding: const EdgeInsets.all(20.0), + children: [ + Text( + "password_reset".tr, + style: const TextStyle(fontSize: 45, fontWeight: FontWeight.bold), + ), + const SizedBox( + height: 20, + ), + SizedBox( + width: 350, + child: TextField( + controller: controller.email.value, + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: "email".tr, + ), + ), + ), + const SizedBox( + height: 20, + ), + Text("password_reset_procedure".tr), + const SizedBox( + height: 20, + ), + ElevatedButton( + onPressed: controller.passwordResetRequest, + child: Text("password_reset_request".tr, + style: const TextStyle(fontSize: 20)), + ), + const SizedBox( + height: 20, + ), + ElevatedButton( + onPressed: () async { + await Get.toNamed("/login"); + }, + child: Text("login".tr, style: const TextStyle(fontSize: 20)), + ), + ], + ), + ), + ); + } +} diff --git a/tarok/lib/main.dart b/tarok/lib/main.dart index 45b891c..3bda453 100644 --- a/tarok/lib/main.dart +++ b/tarok/lib/main.dart @@ -13,6 +13,9 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +import 'dart:io'; + +import 'package:dart_discord_rpc/dart_discord_rpc.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_inapp_notifications/flutter_inapp_notifications.dart'; @@ -29,6 +32,8 @@ import 'package:tarok/lobby/friends.dart'; import 'package:tarok/lobby/lobby.dart'; import 'package:tarok/lobby/replays.dart'; import 'package:tarok/login/login.dart'; +import 'package:tarok/login/password_login_change.dart'; +import 'package:tarok/login/password_reset_request.dart'; import 'package:tarok/login/register.dart'; import 'package:tarok/replay.dart'; import 'package:tarok/settings.dart'; @@ -38,6 +43,20 @@ import 'package:url_strategy/url_strategy.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); + + if (Platform.isLinux || Platform.isWindows) { + DiscordRPC.initialize(); + rpc.start(autoRegister: true); + rpc.updatePresence( + DiscordPresence( + details: 'Gleda na začetni zaslon', + startTimeStamp: DateTime.now().millisecondsSinceEpoch, + largeImageKey: 'palcka_logo', + largeImageText: 'Tarok Palčka', + ), + ); + } + setPathUrlStrategy(); //binding.addPostFrameCallback((_) async { @@ -112,6 +131,10 @@ void main() async { GetPage(name: '/replays', page: () => const Replays()), GetPage(name: '/users', page: () => const Users()), GetPage(name: '/profile', page: () => const Profile()), + GetPage( + name: '/account/reset', page: () => const PasswordResetRequest()), + GetPage( + name: '/password/reset', page: () => const PasswordLoginChange()), GetPage( name: '/replay/:id', page: () => FutureBuilder( diff --git a/tarok/linux/flutter/generated_plugin_registrant.cc b/tarok/linux/flutter/generated_plugin_registrant.cc index f13016c..9db164c 100644 --- a/tarok/linux/flutter/generated_plugin_registrant.cc +++ b/tarok/linux/flutter/generated_plugin_registrant.cc @@ -6,11 +6,15 @@ #include "generated_plugin_registrant.h" +#include #include #include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) dart_discord_rpc_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "DartDiscordRpcPlugin"); + dart_discord_rpc_plugin_register_with_registrar(dart_discord_rpc_registrar); g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); diff --git a/tarok/linux/flutter/generated_plugins.cmake b/tarok/linux/flutter/generated_plugins.cmake index ec4ca65..88eb792 100644 --- a/tarok/linux/flutter/generated_plugins.cmake +++ b/tarok/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + dart_discord_rpc flutter_secure_storage_linux media_kit_libs_linux url_launcher_linux diff --git a/tarok/pubspec.lock b/tarok/pubspec.lock index 4b4463b..a34373f 100644 --- a/tarok/pubspec.lock +++ b/tarok/pubspec.lock @@ -201,6 +201,15 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" + dart_discord_rpc: + dependency: "direct main" + description: + path: "." + ref: HEAD + resolved-ref: "2b522657c2a1ac97741950904aac19db2fc578bf" + url: "https://github.com/alexmercerind/dart_discord_rpc" + source: git + version: "0.0.1" dart_style: dependency: transitive description: @@ -238,10 +247,10 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "13a6ccf6a459a125b3fcdb6ec73bd5ff90822e071207c663bfd1f70062d51d18" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "1.2.1" file: dependency: transitive description: @@ -637,10 +646,10 @@ packages: dependency: transitive description: name: path_provider_windows - sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + sha256: a34ecd7fb548f8e57321fd8e50d865d266941b54e6c3b7758cf8f37c24116905 url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.0.7" petitparser: dependency: transitive description: @@ -1073,10 +1082,10 @@ packages: dependency: transitive description: name: win32 - sha256: "9e82a402b7f3d518fb9c02d0e9ae45952df31b9bf34d77baf19da2de03fc2aaa" + sha256: c0e3a4f7be7dae51d8f152230b86627e3397c1ba8c3fa58e63d44a9f3edc9cef url: "https://pub.dev" source: hosted - version: "5.0.7" + version: "2.6.1" xdg_directories: dependency: transitive description: diff --git a/tarok/pubspec.yaml b/tarok/pubspec.yaml index 5ae81c9..ca7ffe5 100644 --- a/tarok/pubspec.yaml +++ b/tarok/pubspec.yaml @@ -38,6 +38,9 @@ dependencies: get: url_strategy: ^0.2.0 flutter_inapp_notifications: ^1.0.0 + dart_discord_rpc: + git: + url: https://github.com/alexmercerind/dart_discord_rpc dev_dependencies: flutter_test: diff --git a/tarok/windows/flutter/generated_plugin_registrant.cc b/tarok/windows/flutter/generated_plugin_registrant.cc index 9b6573f..73e4c70 100644 --- a/tarok/windows/flutter/generated_plugin_registrant.cc +++ b/tarok/windows/flutter/generated_plugin_registrant.cc @@ -6,11 +6,14 @@ #include "generated_plugin_registrant.h" +#include #include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + DartDiscordRpcPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("DartDiscordRpcPlugin")); FlutterSecureStorageWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); MediaKitLibsWindowsAudioPluginCApiRegisterWithRegistrar( diff --git a/tarok/windows/flutter/generated_plugins.cmake b/tarok/windows/flutter/generated_plugins.cmake index 3a006e9..695268a 100644 --- a/tarok/windows/flutter/generated_plugins.cmake +++ b/tarok/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + dart_discord_rpc flutter_secure_storage_windows media_kit_libs_windows_audio url_launcher_windows