├── .gitattributes ├── .gitignore ├── .gitmodules ├── LICENSE ├── Launcher ├── Config.cpp ├── Config.hpp ├── Launcher.pro ├── MainWindow.ui ├── MinimizeAppPushButton.cpp ├── MinimizeAppPushButton.hpp ├── PatchInfo.cpp ├── PatchInfo.hpp ├── PlayGamePushButton.cpp ├── PlayGamePushButton.hpp ├── QuitAppPushButton.cpp ├── QuitAppPushButton.hpp ├── Utils.cpp ├── Utils.hpp ├── data │ ├── (version) │ ├── Launch.ini │ └── Patch │ │ └── PatchInfo.json └── main.cpp └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Adding 2 | .editorconfig 3 | compile_commands.json 4 | *.exe.bin 5 | *.exe 6 | 7 | # C++ objects and libs 8 | 9 | *.slo 10 | *.lo 11 | *.o 12 | *.a 13 | *.la 14 | *.lai 15 | *.so 16 | *.dll 17 | *.dylib 18 | 19 | # Qt-es 20 | 21 | object_script.*.Release 22 | object_script.*.Debug 23 | *_plugin_import.cpp 24 | .qmake.cache 25 | .qmake.stash 26 | *.pro.user 27 | *.pro.user.* 28 | *.qbs.user 29 | *.qbs.user.* 30 | *.moc 31 | moc_*.cpp 32 | moc_*.h 33 | qrc_*.cpp 34 | ui_*.h 35 | *.qmlc 36 | *.jsc 37 | Makefile* 38 | *build-* 39 | 40 | # Qt unit tests 41 | target_wrapper.* 42 | 43 | # QtCreator 44 | 45 | *.autosave 46 | 47 | # QtCtreator Qml 48 | *.qmlproject.user 49 | *.qmlproject.user.* 50 | 51 | # QtCtreator CMake 52 | CMakeLists.txt.user* 53 | 54 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Dependencies/quazip"] 2 | path = Dependencies/quazip 3 | url = https://github.com/stachenov/quazip.git 4 | [submodule "Dependencies/ee"] 5 | path = Dependencies/ee 6 | url = https://gitlab.com/HadesD-Resources/LaunchTLBB-EE.git 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Hải Lê 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Launcher/Config.cpp: -------------------------------------------------------------------------------- 1 | #include "Config.hpp" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "PatchInfo.hpp" 11 | 12 | namespace Config 13 | { 14 | const int g_launchVersion = 17; 15 | 16 | QVariant getLaunchSetting(const QString& setting, const QVariant &default_value) 17 | { 18 | qDebug() << "CurrentDir:" << QDir::current(); 19 | QSettings m_pLaunchSettings(QDir::current().filePath("Launch.ini"), QSettings::IniFormat); 20 | 21 | return m_pLaunchSettings.value("Launch/" + setting, default_value); 22 | } 23 | 24 | QString getClientVersion() 25 | { 26 | QFile clientVersionFile(QDir::current().filePath("(version)")); 27 | if (!clientVersionFile.open(QIODevice::ReadOnly)) 28 | { 29 | qDebug() << "Error open Client.version"; 30 | return QString(); 31 | } 32 | 33 | QString v = QTextStream(&clientVersionFile).readLine(); 34 | 35 | clientVersionFile.close(); 36 | 37 | return v.split('|').first().trimmed(); 38 | } 39 | 40 | bool isLatestClientVersion() 41 | { 42 | return PatchInfo::getInstance().getLatestVersion() == Config::getClientVersion(); 43 | } 44 | 45 | int getLaunchLatestVersion() 46 | { 47 | return PatchInfo::getInstance().getLaunchObject().value("LatestVersion").toInt(); 48 | } 49 | 50 | QUrl getLaunchNewVersionUrl() 51 | { 52 | return PatchInfo::getInstance().getLaunchObject().value("NewVersionUrl").toString(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Launcher/Config.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_HPP 2 | #define CONFIG_HPP 3 | 4 | #include 5 | 6 | namespace Config 7 | { 8 | extern const int g_launchVersion; 9 | 10 | QVariant getLaunchSetting(const QString& setting, const QVariant& default_value = QVariant()); 11 | QString getClientVersion(); 12 | bool isLatestClientVersion(); 13 | int getLaunchLatestVersion(); 14 | QUrl getLaunchNewVersionUrl(); 15 | } 16 | 17 | #endif // CONFIG_HPP 18 | -------------------------------------------------------------------------------- /Launcher/Launcher.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-10-02T01:33:43 4 | # 5 | #------------------------------------------------- 6 | 7 | VERSION = 1.0.0.0 8 | QMAKE_TARGET_COMPANY = Tian Long Ba Bu 9 | QMAKE_TARGET_PRODUCT = Launch 10 | QMAKE_TARGET_DESCRIPTION = Launcher for game TLBB 11 | QMAKE_TARGET_COPYRIGHT = Tian Long Ba Bu 12 | 13 | QT += core gui 14 | QT += network 15 | QT -= app_bundle 16 | win32: QT += axcontainer 17 | 18 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 19 | 20 | TARGET = Launch 21 | TEMPLATE = app 22 | 23 | # The following define makes your compiler emit warnings if you use 24 | # any feature of Qt which has been marked as deprecated (the exact warnings 25 | # depend on your compiler). Please consult the documentation of the 26 | # deprecated API in order to know how to port your code away from it. 27 | DEFINES += QT_DEPRECATED_WARNINGS 28 | 29 | # You can also make your code fail to compile if you use deprecated APIs. 30 | # In order to do so, uncomment the following line. 31 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 32 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 33 | 34 | CONFIG += static 35 | CONFIG += c++11 36 | 37 | INCLUDEPATH += $$[QT_INSTALL_HEADERS]/QtZlib 38 | INCLUDEPATH += $$PWD/../Dependencies/quazip 39 | DEPENDPATH += $$PWD/../Dependencies/quazip 40 | INCLUDEPATH += $$PWD/../Dependencies/ee/include 41 | DEPENDPATH += $$PWD/../Dependencies/ee/include 42 | 43 | # Variables 44 | EE_DIR = $$PWD/../Dependencies/ee 45 | 46 | static { 47 | DEFINES += QUAZIP_STATIC 48 | } 49 | 50 | win32:!win32-g++:QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01 51 | win32:!win32-g++:LIBS += -L$$EE_DIR/msvc/lib 52 | CONFIG(debug, debug|release) { 53 | win32:!win32-g++:LIBS += -lquazipd 54 | } 55 | else 56 | { 57 | win32:!win32-g++:LIBS += -lquazip 58 | win32 { 59 | # QMAKE#_POST_LINK += mt -nologo -manifest $$PWD/manifest.xml -outputresource:$$OUT_PWD/release/$${TARGET}.exe $$escape_expand(\n\t) 60 | } 61 | } 62 | win32:RC_ICONS += $$EE_DIR/resources/icons/app_icon.ico 63 | 64 | # Build Dir 65 | #DESTDIR = $$OUT_PWD/bin/Launch 66 | #OBJECTS_DIR = .obj 67 | #MOC_DIR = .moc 68 | #RCC_DIR = .rcc 69 | #UI_DIR = .ui 70 | 71 | # After built 72 | DATA_TO_COPY = $$PWD/data 73 | copydata.commands += $(COPY_DIR) $$shell_path($$DATA_TO_COPY) $$shell_path($$DESTDIR/..) 74 | win32:win32-g++:BIN_TO_COPY = $$EE_DIR/bin 75 | copybin.commands += $(COPY_DIR) $$shell_path($$BIN_TO_COPY) $$shell_path($$DESTDIR) 76 | first.depends = $(first) copydata copybin 77 | #export(first.depends) 78 | #export(copydata.commands) 79 | #export(copybin.commands) 80 | #QMAKE_EXTRA_TARGETS += first copydata copybin 81 | 82 | SOURCES += \ 83 | main.cpp \ 84 | MainWindow.cpp \ 85 | InitCopyApp.cpp \ 86 | PlayGamePushButton.cpp \ 87 | Config.cpp \ 88 | QuitAppPushButton.cpp \ 89 | MinimizeAppPushButton.cpp \ 90 | ../Dependencies/ee/src/UtilsEE.cpp \ 91 | ../Dependencies/ee/src/DownloadLaunchExtends.cpp \ 92 | FileDownloader.cpp \ 93 | PatchInfo.cpp \ 94 | Utils.cpp 95 | 96 | HEADERS += \ 97 | MainWindow.hpp \ 98 | InitCopyApp.hpp \ 99 | PlayGamePushButton.hpp \ 100 | Config.hpp \ 101 | QuitAppPushButton.hpp \ 102 | MinimizeAppPushButton.hpp \ 103 | PatchInfo.hpp \ 104 | ../Dependencies/ee/include/UtilsEE.hpp \ 105 | ../Dependencies/ee/include/DownloadLaunchExtends.hpp \ 106 | FileDownloader.hpp \ 107 | Utils.hpp 108 | 109 | FORMS += \ 110 | MainWindow.ui 111 | 112 | DISTFILES += \ 113 | data/Launch.ini \ 114 | data/Patch/PatchInfo.json \ 115 | data/(version) 116 | 117 | RESOURCES += \ 118 | $$EE_DIR/resources/resources.qrc 119 | -------------------------------------------------------------------------------- /Launcher/MainWindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1024 10 | 768 11 | 12 | 13 | 14 | Launcher 15 | 16 | 17 | MainWindow{ 18 | background-image: url(:/resources/images/UI/BKG_320.png); 19 | background-repeat: no-repeat; 20 | background-color: transparent; 21 | } 22 | 23 | 24 | 25 | 26 | 27 | 250 28 | 567 29 | 441 30 | 71 31 | 32 | 33 | 34 | 35 | 36 | 37 | 0 38 | 39 | 40 | Qt::AlignCenter 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 0 51 | 52 | 53 | Qt::AlignCenter 54 | 55 | 56 | Qt::Horizontal 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 255 69 | 255 70 | 255 71 | 72 | 73 | 74 | 75 | 76 | 77 | 0 78 | 0 79 | 0 80 | 81 | 82 | 83 | 84 | 85 | 86 | 255 87 | 255 88 | 255 89 | 90 | 91 | 92 | 93 | 94 | 95 | 255 96 | 255 97 | 255 98 | 99 | 100 | 101 | 102 | 103 | 104 | 127 105 | 127 106 | 127 107 | 108 | 109 | 110 | 111 | 112 | 113 | 170 114 | 170 115 | 170 116 | 117 | 118 | 119 | 120 | 121 | 122 | 0 123 | 0 124 | 0 125 | 126 | 127 | 128 | 129 | 130 | 131 | 255 132 | 255 133 | 255 134 | 135 | 136 | 137 | 138 | 139 | 140 | 0 141 | 0 142 | 0 143 | 144 | 145 | 146 | 147 | 148 | 149 | 0 150 | 0 151 | 0 152 | 153 | 154 | 155 | 156 | 157 | 158 | 0 159 | 0 160 | 0 161 | 162 | 163 | 164 | 165 | 166 | 167 | 0 168 | 0 169 | 0 170 | 171 | 172 | 173 | 174 | 175 | 176 | 255 177 | 255 178 | 255 179 | 180 | 181 | 182 | 183 | 184 | 185 | 255 186 | 255 187 | 220 188 | 189 | 190 | 191 | 192 | 193 | 194 | 0 195 | 0 196 | 0 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 255 206 | 255 207 | 255 208 | 209 | 210 | 211 | 212 | 213 | 214 | 0 215 | 0 216 | 0 217 | 218 | 219 | 220 | 221 | 222 | 223 | 255 224 | 255 225 | 255 226 | 227 | 228 | 229 | 230 | 231 | 232 | 255 233 | 255 234 | 255 235 | 236 | 237 | 238 | 239 | 240 | 241 | 127 242 | 127 243 | 127 244 | 245 | 246 | 247 | 248 | 249 | 250 | 170 251 | 170 252 | 170 253 | 254 | 255 | 256 | 257 | 258 | 259 | 0 260 | 0 261 | 0 262 | 263 | 264 | 265 | 266 | 267 | 268 | 255 269 | 255 270 | 255 271 | 272 | 273 | 274 | 275 | 276 | 277 | 0 278 | 0 279 | 0 280 | 281 | 282 | 283 | 284 | 285 | 286 | 0 287 | 0 288 | 0 289 | 290 | 291 | 292 | 293 | 294 | 295 | 0 296 | 0 297 | 0 298 | 299 | 300 | 301 | 302 | 303 | 304 | 0 305 | 0 306 | 0 307 | 308 | 309 | 310 | 311 | 312 | 313 | 255 314 | 255 315 | 255 316 | 317 | 318 | 319 | 320 | 321 | 322 | 255 323 | 255 324 | 220 325 | 326 | 327 | 328 | 329 | 330 | 331 | 0 332 | 0 333 | 0 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 127 343 | 127 344 | 127 345 | 346 | 347 | 348 | 349 | 350 | 351 | 0 352 | 0 353 | 0 354 | 355 | 356 | 357 | 358 | 359 | 360 | 255 361 | 255 362 | 255 363 | 364 | 365 | 366 | 367 | 368 | 369 | 255 370 | 255 371 | 255 372 | 373 | 374 | 375 | 376 | 377 | 378 | 127 379 | 127 380 | 127 381 | 382 | 383 | 384 | 385 | 386 | 387 | 170 388 | 170 389 | 170 390 | 391 | 392 | 393 | 394 | 395 | 396 | 127 397 | 127 398 | 127 399 | 400 | 401 | 402 | 403 | 404 | 405 | 255 406 | 255 407 | 255 408 | 409 | 410 | 411 | 412 | 413 | 414 | 127 415 | 127 416 | 127 417 | 418 | 419 | 420 | 421 | 422 | 423 | 0 424 | 0 425 | 0 426 | 427 | 428 | 429 | 430 | 431 | 432 | 0 433 | 0 434 | 0 435 | 436 | 437 | 438 | 439 | 440 | 441 | 0 442 | 0 443 | 0 444 | 445 | 446 | 447 | 448 | 449 | 450 | 255 451 | 255 452 | 255 453 | 454 | 455 | 456 | 457 | 458 | 459 | 255 460 | 255 461 | 220 462 | 463 | 464 | 465 | 466 | 467 | 468 | 0 469 | 0 470 | 0 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | Initializing... 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 250 488 | 640 489 | 251 490 | 16 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 194 500 | 194 501 | 194 502 | 503 | 504 | 505 | 506 | 507 | 508 | 0 509 | 0 510 | 0 511 | 512 | 513 | 514 | 515 | 516 | 517 | 255 518 | 255 519 | 255 520 | 521 | 522 | 523 | 524 | 525 | 526 | 255 527 | 255 528 | 255 529 | 530 | 531 | 532 | 533 | 534 | 535 | 127 536 | 127 537 | 127 538 | 539 | 540 | 541 | 542 | 543 | 544 | 170 545 | 170 546 | 170 547 | 548 | 549 | 550 | 551 | 552 | 553 | 0 554 | 0 555 | 0 556 | 557 | 558 | 559 | 560 | 561 | 562 | 255 563 | 255 564 | 255 565 | 566 | 567 | 568 | 569 | 570 | 571 | 0 572 | 0 573 | 0 574 | 575 | 576 | 577 | 578 | 579 | 580 | 0 581 | 0 582 | 0 583 | 584 | 585 | 586 | 587 | 588 | 589 | 0 590 | 0 591 | 0 592 | 593 | 594 | 595 | 596 | 597 | 598 | 0 599 | 0 600 | 0 601 | 602 | 603 | 604 | 605 | 606 | 607 | 255 608 | 255 609 | 255 610 | 611 | 612 | 613 | 614 | 615 | 616 | 255 617 | 255 618 | 220 619 | 620 | 621 | 622 | 623 | 624 | 625 | 0 626 | 0 627 | 0 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 194 637 | 194 638 | 194 639 | 640 | 641 | 642 | 643 | 644 | 645 | 0 646 | 0 647 | 0 648 | 649 | 650 | 651 | 652 | 653 | 654 | 255 655 | 255 656 | 255 657 | 658 | 659 | 660 | 661 | 662 | 663 | 255 664 | 255 665 | 255 666 | 667 | 668 | 669 | 670 | 671 | 672 | 127 673 | 127 674 | 127 675 | 676 | 677 | 678 | 679 | 680 | 681 | 170 682 | 170 683 | 170 684 | 685 | 686 | 687 | 688 | 689 | 690 | 0 691 | 0 692 | 0 693 | 694 | 695 | 696 | 697 | 698 | 699 | 255 700 | 255 701 | 255 702 | 703 | 704 | 705 | 706 | 707 | 708 | 0 709 | 0 710 | 0 711 | 712 | 713 | 714 | 715 | 716 | 717 | 0 718 | 0 719 | 0 720 | 721 | 722 | 723 | 724 | 725 | 726 | 0 727 | 0 728 | 0 729 | 730 | 731 | 732 | 733 | 734 | 735 | 0 736 | 0 737 | 0 738 | 739 | 740 | 741 | 742 | 743 | 744 | 255 745 | 255 746 | 255 747 | 748 | 749 | 750 | 751 | 752 | 753 | 255 754 | 255 755 | 220 756 | 757 | 758 | 759 | 760 | 761 | 762 | 0 763 | 0 764 | 0 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 127 774 | 127 775 | 127 776 | 777 | 778 | 779 | 780 | 781 | 782 | 0 783 | 0 784 | 0 785 | 786 | 787 | 788 | 789 | 790 | 791 | 255 792 | 255 793 | 255 794 | 795 | 796 | 797 | 798 | 799 | 800 | 255 801 | 255 802 | 255 803 | 804 | 805 | 806 | 807 | 808 | 809 | 127 810 | 127 811 | 127 812 | 813 | 814 | 815 | 816 | 817 | 818 | 170 819 | 170 820 | 170 821 | 822 | 823 | 824 | 825 | 826 | 827 | 127 828 | 127 829 | 127 830 | 831 | 832 | 833 | 834 | 835 | 836 | 255 837 | 255 838 | 255 839 | 840 | 841 | 842 | 843 | 844 | 845 | 127 846 | 127 847 | 127 848 | 849 | 850 | 851 | 852 | 853 | 854 | 0 855 | 0 856 | 0 857 | 858 | 859 | 860 | 861 | 862 | 863 | 0 864 | 0 865 | 0 866 | 867 | 868 | 869 | 870 | 871 | 872 | 0 873 | 0 874 | 0 875 | 876 | 877 | 878 | 879 | 880 | 881 | 255 882 | 255 883 | 255 884 | 885 | 886 | 887 | 888 | 889 | 890 | 255 891 | 255 892 | 220 893 | 894 | 895 | 896 | 897 | 898 | 899 | 0 900 | 0 901 | 0 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 250 916 | 310 917 | 501 918 | 251 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 290 931 | 280 932 | 441 933 | 20 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 255 943 | 255 944 | 255 945 | 946 | 947 | 948 | 949 | 950 | 951 | 0 952 | 0 953 | 0 954 | 955 | 956 | 957 | 958 | 959 | 960 | 255 961 | 255 962 | 255 963 | 964 | 965 | 966 | 967 | 968 | 969 | 255 970 | 255 971 | 255 972 | 973 | 974 | 975 | 976 | 977 | 978 | 127 979 | 127 980 | 127 981 | 982 | 983 | 984 | 985 | 986 | 987 | 170 988 | 170 989 | 170 990 | 991 | 992 | 993 | 994 | 995 | 996 | 0 997 | 0 998 | 0 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 255 1006 | 255 1007 | 255 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 0 1015 | 0 1016 | 0 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 0 1024 | 0 1025 | 0 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 0 1033 | 0 1034 | 0 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 0 1042 | 0 1043 | 0 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 255 1051 | 255 1052 | 255 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 255 1060 | 255 1061 | 220 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 0 1069 | 0 1070 | 0 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 255 1080 | 255 1081 | 255 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 0 1089 | 0 1090 | 0 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 255 1098 | 255 1099 | 255 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 255 1107 | 255 1108 | 255 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 127 1116 | 127 1117 | 127 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 170 1125 | 170 1126 | 170 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 0 1134 | 0 1135 | 0 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 255 1143 | 255 1144 | 255 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 0 1152 | 0 1153 | 0 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 0 1161 | 0 1162 | 0 1163 | 1164 | 1165 | 1166 | 1167 | 1168 | 1169 | 0 1170 | 0 1171 | 0 1172 | 1173 | 1174 | 1175 | 1176 | 1177 | 1178 | 0 1179 | 0 1180 | 0 1181 | 1182 | 1183 | 1184 | 1185 | 1186 | 1187 | 255 1188 | 255 1189 | 255 1190 | 1191 | 1192 | 1193 | 1194 | 1195 | 1196 | 255 1197 | 255 1198 | 220 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | 0 1206 | 0 1207 | 0 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | 1215 | 1216 | 127 1217 | 127 1218 | 127 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 0 1226 | 0 1227 | 0 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 255 1235 | 255 1236 | 255 1237 | 1238 | 1239 | 1240 | 1241 | 1242 | 1243 | 255 1244 | 255 1245 | 255 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 127 1253 | 127 1254 | 127 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 170 1262 | 170 1263 | 170 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 127 1271 | 127 1272 | 127 1273 | 1274 | 1275 | 1276 | 1277 | 1278 | 1279 | 255 1280 | 255 1281 | 255 1282 | 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 127 1289 | 127 1290 | 127 1291 | 1292 | 1293 | 1294 | 1295 | 1296 | 1297 | 0 1298 | 0 1299 | 0 1300 | 1301 | 1302 | 1303 | 1304 | 1305 | 1306 | 0 1307 | 0 1308 | 0 1309 | 1310 | 1311 | 1312 | 1313 | 1314 | 1315 | 0 1316 | 0 1317 | 0 1318 | 1319 | 1320 | 1321 | 1322 | 1323 | 1324 | 255 1325 | 255 1326 | 255 1327 | 1328 | 1329 | 1330 | 1331 | 1332 | 1333 | 255 1334 | 255 1335 | 220 1336 | 1337 | 1338 | 1339 | 1340 | 1341 | 1342 | 0 1343 | 0 1344 | 0 1345 | 1346 | 1347 | 1348 | 1349 | 1350 | 1351 | 1352 | Version: Checking... 1353 | 1354 | 1355 | 1356 | 1357 | 1358 | 761 1359 | 290 1360 | 121 1361 | 251 1362 | 1363 | 1364 | 1365 | 1366 | 0 1367 | 1368 | 1369 | 1370 | 1371 | #chargePushButton { 1372 | background-image:url(:/resources/images/UI/BTN_320_Charge_Nor.bmp); 1373 | background-repeat: no-repeat; 1374 | border:0px; 1375 | width: 100%; 1376 | padding: 20px 0; 1377 | background-position: center; 1378 | } 1379 | #chargePushButton:hover:!pressed { 1380 | background-image:url(:/resources/images/UI/BTN_320_Charge_Hov.bmp); 1381 | } 1382 | #chargePushButton:pressed { 1383 | background-image:url(:/resources/images/UI/BTN_320_Charge_Psh.bmp); 1384 | } 1385 | 1386 | 1387 | 1388 | 1389 | 1390 | 1391 | 1392 | 1393 | 1394 | #repairPushButton { 1395 | background-image:url(:/resources/images/UI/BTN_320_Repair_Nor.bmp); 1396 | background-repeat: no-repeat; 1397 | border:0px; 1398 | width: 100%; 1399 | padding: 20px 0; 1400 | background-position: center; 1401 | } 1402 | #repairPushButton:hover:!pressed { 1403 | background-image:url(:/resources/images/UI/BTN_320_Repair_Hov.bmp); 1404 | } 1405 | #repairPushButton:pressed { 1406 | background-image:url(:/resources/images/UI/BTN_320_Repair_Psh.bmp); 1407 | } 1408 | 1409 | 1410 | 1411 | 1412 | 1413 | 1414 | 1415 | 1416 | 1417 | #registPushButton { 1418 | background-image:url(:/resources/images/UI/BTN_320_Regist_Nor.bmp); 1419 | background-repeat: no-repeat; 1420 | border:0px; 1421 | width: 100%; 1422 | padding: 20px 0; 1423 | background-position: center; 1424 | } 1425 | #registPushButton:hover:!pressed { 1426 | background-image:url(:/resources/images/UI/BTN_320_Regist_Hov.bmp); 1427 | } 1428 | #registPushButton:pressed { 1429 | background-image:url(:/resources/images/UI/BTN_320_Regist_Psh.bmp); 1430 | } 1431 | 1432 | 1433 | 1434 | 1435 | 1436 | 1437 | 1438 | 1439 | 1440 | #settingPushButton { 1441 | background-image:url(:/resources/images/UI/Btn_320_Setting_Nor.bmp); 1442 | background-repeat: no-repeat; 1443 | border:0px; 1444 | width: 100%; 1445 | padding: 20px 0; 1446 | background-position: center; 1447 | } 1448 | 1449 | #settingPushButton:hover:!pressed { 1450 | background-image:url(:/resources/images/UI/Btn_320_Setting_Hov.bmp); 1451 | } 1452 | 1453 | #settingPushButton:pressed { 1454 | background-image:url(:/resources/images/UI/Btn_320_Setting_Psh.bmp); 1455 | } 1456 | 1457 | 1458 | 1459 | 1460 | 1461 | 1462 | 1463 | 1464 | 1465 | #exitPushButton { 1466 | background-image:url(:/resources/images/UI/BTN_320_Exit_Nor.bmp); 1467 | background-repeat: no-repeat; 1468 | border:0px; 1469 | width: 100%; 1470 | padding: 20px 0; 1471 | background-position: center; 1472 | } 1473 | 1474 | #exitPushButton:hover:!pressed { 1475 | background-image:url(:/resources/images/UI/BTN_320_Exit_Hov.bmp); 1476 | } 1477 | 1478 | #exitPushButton:!pressed { 1479 | background-image:url(:/resources/images/UI/BTN_320_Exit_Psh.bmp); 1480 | } 1481 | 1482 | 1483 | 1484 | 1485 | 1486 | 1487 | 1488 | 1489 | 1490 | 1491 | 1492 | 810 1493 | 231 1494 | 41 1495 | 41 1496 | 1497 | 1498 | 1499 | #minimizeAppPushButton { 1500 | background-image: url(:/resources/images/UI/BTN_320_Min_Nor.bmp); 1501 | background-repeat: no-repeat; 1502 | background-color: transparent; 1503 | background-position:center; 1504 | } 1505 | 1506 | #minimizeAppPushButton:hover:!pressed { 1507 | background-image: url(:/resources/images/UI/BTN_320_Min_Hov.bmp); 1508 | } 1509 | 1510 | #minimizeAppPushButton:hover:pressed { 1511 | background-image: url(:/resources/images/UI/BTN_320_Min_Psh.bmp); 1512 | } 1513 | 1514 | 1515 | 1516 | 1517 | 1518 | 1519 | 1520 | 1521 | 1522 | 850 1523 | 240 1524 | 41 1525 | 41 1526 | 1527 | 1528 | 1529 | #quitAppPushButton { 1530 | background-image: url(:/resources/images/UI/BTN_320_Close_Nor.bmp); 1531 | background-repeat: no-repeat; 1532 | background-color: transparent; 1533 | background-position:center; 1534 | } 1535 | 1536 | #quitAppPushButton:hover:!pressed { 1537 | background-image: url(:/resources/images/UI/BTN_320_Close_Hov.bmp); 1538 | } 1539 | 1540 | #quitAppPushButton:hover:pressed { 1541 | background-image: url(:/resources/images/UI/BTN_320_Close_Psh.bmp); 1542 | } 1543 | 1544 | 1545 | 1546 | 1547 | 1548 | 1549 | 1550 | 1551 | 720 1552 | 553 1553 | 151 1554 | 151 1555 | 1556 | 1557 | 1558 | #playGamePushButton { 1559 | background-repeat: no-repeat; 1560 | background-color: transparent; 1561 | background-image: url(:/resources/images/UI/BTN_320_Big_Nor.bmp); 1562 | background-position:center; 1563 | } 1564 | 1565 | #playGamePushButton[isClickAble="true"]:hover:!pressed { 1566 | background-image: url(:/resources/images/UI/BTN_320_Big_Hov.bmp); 1567 | } 1568 | 1569 | #playGamePushButton[isClickAble="true"]:pressed { 1570 | background-image: url(:/resources/images/UI/BTN_320_Big_Psh.bmp); 1571 | } 1572 | 1573 | #playGamePushButton[isClickAble="false"] { 1574 | background-image: url(:/resources/images/UI/BTN_320_Big_Dis.bmp); 1575 | } 1576 | 1577 | 1578 | 1579 | 1580 | 1581 | 1582 | 1583 | 1584 | 1585 | 1586 | QAxWidget 1587 | QWidget 1588 |
qaxwidget.h
1589 |
1590 | 1591 | MinimizeAppPushButton 1592 | QPushButton 1593 |
MinimizeAppPushButton.hpp
1594 |
1595 | 1596 | PlayGamePushButton 1597 | QPushButton 1598 |
PlayGamePushButton.hpp
1599 |
1600 | 1601 | QuitAppPushButton 1602 | QPushButton 1603 |
QuitAppPushButton.hpp
1604 |
1605 |
1606 | 1607 | 1608 |
1609 | -------------------------------------------------------------------------------- /Launcher/MinimizeAppPushButton.cpp: -------------------------------------------------------------------------------- 1 | #include "MinimizeAppPushButton.hpp" 2 | 3 | #include 4 | 5 | MinimizeAppPushButton::MinimizeAppPushButton(QWidget *parent) : QPushButton(parent) 6 | { 7 | connect(this, &QPushButton::clicked, [parent](){ 8 | static auto mainWindow = dynamic_cast(parent->parent()); 9 | mainWindow->setWindowState(mainWindow->windowState() | Qt::WindowMinimized); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /Launcher/MinimizeAppPushButton.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MINIMIZEAPPPUSHBUTTON_HPP 2 | #define MINIMIZEAPPPUSHBUTTON_HPP 3 | 4 | #include 5 | 6 | class MinimizeAppPushButton : public QPushButton 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit MinimizeAppPushButton(QWidget* parent = nullptr); 11 | 12 | signals: 13 | 14 | public slots: 15 | }; 16 | 17 | #endif // MINIMIZEAPPPUSHBUTTON_HPP 18 | -------------------------------------------------------------------------------- /Launcher/PatchInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "PatchInfo.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #include "Config.hpp" 12 | 13 | PatchInfo::PatchInfo() 14 | { 15 | if (!this->load()) 16 | { 17 | qDebug() << "Error when load PatchInfo.json"; 18 | } 19 | } 20 | 21 | bool PatchInfo::load() 22 | { 23 | QFile jsonFile("Patch/PatchInfo.json"); 24 | if (jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) 25 | { 26 | QJsonDocument dataDocument; 27 | 28 | m_data = dataDocument.fromJson(QString(jsonFile.readAll()).toUtf8()).object(); 29 | } 30 | else 31 | { 32 | qDebug() << "Error open PatchInfo"; 33 | } 34 | 35 | jsonFile.close(); 36 | 37 | return !m_data.isEmpty(); 38 | } 39 | 40 | PatchInfo& PatchInfo::getInstance() 41 | { 42 | static PatchInfo s_instance; 43 | 44 | return s_instance; 45 | } 46 | 47 | QString PatchInfo::getLatestVersion() const 48 | { 49 | return m_data.value("LatestVersion").toString(); 50 | } 51 | 52 | QJsonArray PatchInfo::getPatches() const 53 | { 54 | return m_data.value("Patches").toArray(); 55 | } 56 | 57 | int PatchInfo::getIndexOfPatch(const QString& versionType, const QString& version) const 58 | { 59 | const auto &p = this->getPatches(); 60 | int index = p.size(); 61 | 62 | for (int i = 0; i < p.size(); i++) 63 | { 64 | if (p.at(i).toObject().value(versionType).toString() == version) 65 | { 66 | index = i; 67 | break; 68 | } 69 | } 70 | 71 | return index; 72 | } 73 | 74 | QVector& PatchInfo::getNewVersionList() const 75 | { 76 | static QVector urlList; 77 | 78 | if (urlList.isEmpty()) 79 | { 80 | QString versionFrom = Config::getClientVersion(); 81 | int index; 82 | 83 | while (true) 84 | { 85 | index = this->getIndexOfPatch("VersionFrom", versionFrom); 86 | if (index >= this->getPatches().size()) 87 | { 88 | break; 89 | } 90 | 91 | const auto &found = this->getPatches().at(index); 92 | versionFrom = found.toObject().value("VersionTo").toString(); 93 | QUrl url = found.toObject().value("Url").toString(); 94 | 95 | if (url.isEmpty() || versionFrom.isEmpty()) 96 | { 97 | break; 98 | } 99 | 100 | urlList.push_back(url); 101 | 102 | if (versionFrom == this->getLatestVersion()) 103 | { 104 | break; 105 | } 106 | } 107 | } 108 | 109 | return urlList; 110 | } 111 | 112 | QJsonObject PatchInfo::getLaunchObject() const 113 | { 114 | return m_data.value("Launch").toObject(); 115 | } 116 | 117 | QUrl PatchInfo::getLoginServerUrl() const 118 | { 119 | return m_data.value("LoginServerUrl").toString(); 120 | } 121 | -------------------------------------------------------------------------------- /Launcher/PatchInfo.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PATCHINFO_HPP 2 | #define PATCHINFO_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class PatchInfo final 11 | { 12 | private: 13 | PatchInfo(); 14 | 15 | public: 16 | bool load(); 17 | 18 | public: 19 | static PatchInfo& getInstance(); 20 | QString getLatestVersion() const; 21 | QJsonArray getPatches() const; 22 | QVector& getNewVersionList() const; 23 | 24 | /** 25 | * @brief getIndexOfPatch 26 | * @param versionType 27 | * @param version 28 | * @return 29 | */ 30 | int getIndexOfPatch(const QString& versionType, const QString& version) const; 31 | bool getIsLatest() const; 32 | std::size_t getDownloadLeft(); 33 | QJsonObject getLaunchObject() const; 34 | QUrl getLoginServerUrl() const; 35 | 36 | private: 37 | QJsonObject m_data; 38 | bool m_isLatest; 39 | }; 40 | 41 | #endif // PATCHINFO_HPP 42 | -------------------------------------------------------------------------------- /Launcher/PlayGamePushButton.cpp: -------------------------------------------------------------------------------- 1 | #include "PlayGamePushButton.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include "Config.hpp" 13 | #include "Utils.hpp" 14 | #include "UtilsEE.hpp" 15 | 16 | PlayGamePushButton::PlayGamePushButton(QWidget *parent) : QPushButton(parent) 17 | { 18 | //this->resize(parent->size()); 19 | qDebug() << "PlayButton size:" << this->size(); 20 | 21 | connect(this, &QPushButton::clicked, [&](){ 22 | if (!m_isClickAble) 23 | { 24 | return; 25 | } 26 | auto execAppFileName = Config::getLaunchSetting("GameExe").toString(); 27 | QDir dir(QDir::currentPath()); 28 | 29 | QFile file(dir.filePath(execAppFileName)); 30 | if (!file.exists()) 31 | { 32 | QMessageBox::warning(this, "Error", "File not exists: " + execAppFileName); 33 | return; 34 | } 35 | 36 | dir.setPath(dir.filePath(execAppFileName)); 37 | dir.cdUp(); 38 | 39 | QProcess::startDetached( 40 | file.fileName(), { "-fl" }, dir.path(), nullptr 41 | ); 42 | 43 | QApplication::activeWindow()->hide(); 44 | UtilsEE::onStartButtonClicked(); 45 | }); 46 | 47 | this->setIsClickAble(false); 48 | 49 | } 50 | 51 | void PlayGamePushButton::setIsClickAble(bool isClickAble) 52 | { 53 | m_isClickAble = isClickAble; 54 | 55 | // Reset Attr 56 | this->setProperty("isClickAble", m_isClickAble); 57 | this->style()->unpolish(this); 58 | this->style()->polish(this); 59 | } 60 | -------------------------------------------------------------------------------- /Launcher/PlayGamePushButton.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PLAYGAMEPUSHBUTTON_HPP 2 | #define PLAYGAMEPUSHBUTTON_HPP 3 | 4 | #include 5 | 6 | class PlayGamePushButton final : public QPushButton 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit PlayGamePushButton(QWidget *parent = nullptr); 11 | 12 | public: 13 | void setIsClickAble(bool isClickAble); 14 | 15 | private: 16 | bool m_isClickAble; 17 | 18 | signals: 19 | 20 | public slots: 21 | 22 | }; 23 | 24 | #endif // PLAYGAMEPUSHBUTTON_HPP 25 | -------------------------------------------------------------------------------- /Launcher/QuitAppPushButton.cpp: -------------------------------------------------------------------------------- 1 | #include "QuitAppPushButton.hpp" 2 | 3 | #include 4 | 5 | QuitAppPushButton::QuitAppPushButton(QWidget *parent) : QPushButton(parent) 6 | { 7 | connect(this, &QPushButton::clicked, [](){ 8 | qApp->quit(); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /Launcher/QuitAppPushButton.hpp: -------------------------------------------------------------------------------- 1 | #ifndef QUITAPPPUSHBUTTON_HPP 2 | #define QUITAPPPUSHBUTTON_HPP 3 | 4 | #include 5 | 6 | class QuitAppPushButton final : public QPushButton 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit QuitAppPushButton(QWidget *parent = nullptr); 11 | 12 | signals: 13 | 14 | public slots: 15 | }; 16 | 17 | #endif // QUITAPPPUSHBUTTON_HPP 18 | -------------------------------------------------------------------------------- /Launcher/Utils.cpp: -------------------------------------------------------------------------------- 1 | #include "Utils.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace Utils 13 | { 14 | QString basename(const QUrl& fullFilePath) 15 | { 16 | return fullFilePath.fileName(); 17 | } 18 | 19 | QString humanSize(const qint64 realSize) 20 | { 21 | auto size = static_cast(realSize); 22 | 23 | static QStringList sizeList{ 24 | "KB", "MB", "GB", "TB" 25 | }; 26 | 27 | static QString unit("B"); 28 | 29 | for (const auto& sizeText : sizeList) 30 | { 31 | unit = sizeText; 32 | if ((size /= 1024.f) < 1024.f) 33 | { 34 | break; 35 | } 36 | } 37 | 38 | return QString().setNum(size, 'f', 2) + unit; 39 | } 40 | 41 | QString getFileSHA256(const QString& fileName) 42 | { 43 | QFile file(fileName); 44 | if (!file.open(QFile::ReadOnly)) 45 | { 46 | return QString(); 47 | } 48 | 49 | QCryptographicHash hash(QCryptographicHash::Sha256); 50 | if (!hash.addData(&file)) 51 | { 52 | return QString(); 53 | } 54 | return hash.result().toHex().toUpper(); 55 | } 56 | 57 | void killProcess(const QString& processName) 58 | { 59 | HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0); 60 | PROCESSENTRY32 pEntry; 61 | pEntry.dwSize = sizeof(pEntry); 62 | BOOL hRes = Process32First(hSnapShot, &pEntry); 63 | while (hRes) 64 | { 65 | if (processName.toStdWString() == pEntry.szExeFile) 66 | { 67 | HANDLE hProcess = OpenProcess( 68 | PROCESS_TERMINATE, 0, 69 | static_cast(pEntry.th32ProcessID) 70 | ); 71 | if (hProcess && (pEntry.th32ProcessID != ::GetCurrentProcessId())) 72 | { 73 | qDebug() << "Killing:" << processName; 74 | TerminateProcess(hProcess, 9); 75 | CloseHandle(hProcess); 76 | } 77 | } 78 | hRes = ::Process32Next(hSnapShot, &pEntry); 79 | } 80 | CloseHandle(hSnapShot); 81 | } 82 | 83 | QString getSystemDir() 84 | { 85 | char lpBuffer[MAX_PATH]; 86 | ::SHGetSpecialFolderPathA(nullptr, lpBuffer, CSIDL_SYSTEMX86, false); 87 | return lpBuffer; 88 | } 89 | 90 | bool isElevated() 91 | { 92 | bool fRet = false; 93 | HANDLE hToken = nullptr; 94 | if( OpenProcessToken( GetCurrentProcess( ),TOKEN_QUERY,&hToken ) ) { 95 | TOKEN_ELEVATION Elevation; 96 | DWORD cbSize = sizeof( TOKEN_ELEVATION ); 97 | if( GetTokenInformation( hToken, TokenElevation, &Elevation, sizeof( Elevation ), &cbSize ) ) { 98 | fRet = static_cast(Elevation.TokenIsElevated); 99 | } 100 | } 101 | if( hToken ) { 102 | CloseHandle( hToken ); 103 | } 104 | return fRet; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Launcher/Utils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HELPERS_HPP 2 | #define HELPERS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace Utils 8 | { 9 | QString basename(const QUrl& fullFilePath); 10 | 11 | QString humanSize(const qint64 realSize); 12 | 13 | QString getFileSHA256(const QString& fileName); 14 | 15 | void killProcess(const QString& processName); 16 | 17 | QString getSystemDir(); 18 | 19 | QByteArray fileGetContent(); 20 | 21 | bool isElevated(); 22 | } 23 | 24 | #endif // HELPERS_HPP 25 | -------------------------------------------------------------------------------- /Launcher/data/(version): -------------------------------------------------------------------------------- 1 | 1.0000.0000| 2 | -------------------------------------------------------------------------------- /Launcher/data/Launch.ini: -------------------------------------------------------------------------------- 1 | [Launch] 2 | ; Web Site Notice 3 | Help_URL = https://github.com/HadesD 4 | 5 | # Patches Settings 6 | PatchInfo = https://github.com/PatchInfo.json 7 | 8 | GameExe = Bin/Game.exe 9 | ;GameConfig = Bin\System.cfg 10 | ;LoginServer = 11 | ;FairyResources = Bin\FairyResources.cfg 12 | ;NewLauncher = 13 | ;RepairServer = 14 | RegURL = 15 | ChoiceURL = 16 | -------------------------------------------------------------------------------- /Launcher/data/Patch/PatchInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "Launch": { 3 | "LatestVersion": 2, 4 | "NewVersionUrl": "https://github.com/KyNiemTLBB/ClientPatch-Test/releases/download/1.0000.0005/Launch.zip" 5 | }, 6 | "LatestVersion": "1.0000.0000", 7 | "Patches": [ 8 | { 9 | "VersionFrom": "", 10 | "VersionTo": "", 11 | "Url": "" 12 | }, 13 | { 14 | "VersionFrom": "", 15 | "VersionTo": "", 16 | "Url": "" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /Launcher/main.cpp: -------------------------------------------------------------------------------- 1 | #include "MainWindow.hpp" 2 | 3 | #include 4 | 5 | #ifndef QT_DEBUG 6 | # include "InitCopyApp.hpp" 7 | #endif 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | QApplication a(argc, argv); 12 | 13 | #ifndef QT_DEBUG 14 | InitCopyApp(); 15 | #endif 16 | 17 | MainWindow w; 18 | w.show(); 19 | 20 | return a.exec(); 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Launcher 2 | 3 | A Launcher for Game TLBB 4 | 5 | ## Feature 6 | 7 | - GUI 8 | - Network for Update 9 | - Support self auto Update 10 | - SSL supported 11 | - Support Windows(XpSp3 and later), Linux, MacOS 12 | - Base on Qt 13 | - News box (ActiveX Web browser) 14 | - Transparent background 15 | 16 | ## Demo: 17 | 18 | ![Launch demo](https://i.imgur.com/LFuUk2d.png) 19 | 20 | ## Installaion: 21 | 22 | - Qt 5.5.1 (MingW/MSVC for windows) 23 | 24 | ## Roadmap 25 | 26 | - Make Stand Alone app 27 | - Extract .axp file 28 | - Use `command` file for launch to read the work 29 | - More... 30 | 31 | ## License 32 | 33 | - MIT License 34 | 35 | Copyright (c) Hai Le (a.k.a Dark.Hades) 36 | 37 | - Under Qt 's License 38 | --------------------------------------------------------------------------------