Add version information to the webhook

This commit is contained in:
zontreck 2024-11-23 12:54:23 -07:00
parent ec1f894809
commit 98b1d0c9e4
5 changed files with 16 additions and 3 deletions

View file

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:libac_dart/packets/packets.dart'; import 'package:libac_dart/packets/packets.dart';
import 'package:libac_dart/utils/IOTools.dart'; import 'package:libac_dart/utils/IOTools.dart';
import 'package:servermanager/consts.dart';
import 'package:servermanager/game.dart'; import 'package:servermanager/game.dart';
import 'package:servermanager/packets/ClientPackets.dart'; import 'package:servermanager/packets/ClientPackets.dart';
import 'package:servermanager/structs/SessionData.dart'; import 'package:servermanager/structs/SessionData.dart';
@ -96,6 +97,10 @@ void main() async {
print("Starting up server manager server wrapper"); print("Starting up server manager server wrapper");
print("=".padLeft(20, "="));
print("Conan Exiles Mod Manager\nVersion ${Consts.VERSION}");
print("=".padLeft(20, "="));
while (!SessionData.shutdownPending) { while (!SessionData.shutdownPending) {
try { try {
await PacketServer.start( await PacketServer.start(

3
lib/consts.dart Normal file
View file

@ -0,0 +1,3 @@
class Consts {
static const VERSION = "1.1.112324.1248";
}

View file

@ -7,6 +7,8 @@ import 'package:servermanager/pages/Constants.dart';
import 'package:servermanager/structs/credentials.dart'; import 'package:servermanager/structs/credentials.dart';
import 'package:servermanager/structs/settings.dart'; import 'package:servermanager/structs/settings.dart';
import '../consts.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
Settings settings; Settings settings;
HomePage({super.key, required this.settings}); HomePage({super.key, required this.settings});
@ -34,7 +36,8 @@ class HomePageState extends State<HomePage> {
child: Column( child: Column(
children: [ children: [
Icon(Icons.computer), Icon(Icons.computer),
Text("Conan Exiles Server Manager") Text("Conan Exiles Mod Manager"),
Text("Version ${Consts.VERSION}")
], ],
)), )),
Column( Column(

View file

@ -4,6 +4,7 @@ import 'package:dio/dio.dart';
import 'package:libac_dart/nbt/NbtUtils.dart'; import 'package:libac_dart/nbt/NbtUtils.dart';
import 'package:libac_dart/nbt/impl/CompoundTag.dart'; import 'package:libac_dart/nbt/impl/CompoundTag.dart';
import 'package:libac_dart/nbt/impl/StringTag.dart'; import 'package:libac_dart/nbt/impl/StringTag.dart';
import 'package:servermanager/consts.dart';
class DiscordHookHelper { class DiscordHookHelper {
static Future<void> sendWebHook(DiscordHookProps props, int colorCode, static Future<void> sendWebHook(DiscordHookProps props, int colorCode,
@ -16,7 +17,8 @@ class DiscordHookHelper {
"title": title, "title": title,
"description": content, "description": content,
"color": colorCode, "color": colorCode,
"author": {"name": props.serverName} "author": {"name": props.serverName},
"footer": "CEMM Version ${Consts.VERSION}"
} }
], ],
"attachments": [] "attachments": []

View file

@ -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.1.0+48 version: 1.1.112324+1248
environment: environment:
sdk: ">=3.1.4 <4.0.0" sdk: ">=3.1.4 <4.0.0"