summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgigas0022023-05-01 14:39:21 +0900
committergigas0022023-05-01 14:39:21 +0900
commit4c7ca06fc5c9d7f7a485353361536f2097c5c9c4 (patch)
tree94f2ee8def988c9d8aadb05e28f3780fa0486cf7
parent538840ab99ca1989700e8c30d50c86d16c19a733 (diff)
downloadaur-4c7ca06fc5c9d7f7a485353361536f2097c5c9c4.tar.gz
Add temporary patch
-rw-r--r--.SRCINFO2
-rw-r--r--.gitignore14
-rw-r--r--PKGBUILD6
-rw-r--r--server.patch37
4 files changed, 51 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9f2d57d0a7b3..1bd93fad3e33 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = vcmi
pkgdesc = Open-source engine for Heroes of Might and Magic III
pkgver = 1.2.1
- pkgrel = 1
+ pkgrel = 2
url = http://vcmi.eu
install = vcmi.install
arch = i686
diff --git a/.gitignore b/.gitignore
index ee4bf121cc65..b74111c95d9c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,9 @@
-*.swp
-*.pkg.tar.zst
-*.tar.gz
-src/
-pkg/
+# Ignore everything
+*
+
+# But not these files...
+!.gitignore
+!.SRCINFO
+!PKGBUILD
+!server.patch
+!vcmi.install
diff --git a/PKGBUILD b/PKGBUILD
index eda6f29dd678..c9f2919cfc71 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=vcmi
pkgver=1.2.1
-pkgrel=1
+pkgrel=2
pkgdesc="Open-source engine for Heroes of Might and Magic III"
arch=('i686' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
url="http://vcmi.eu"
@@ -17,11 +17,13 @@ optdepends=('innoextract: required by vcmibuilder' 'unshield: required by vcmibu
provides=('vcmi')
conflicts=('vcmi')
install="${pkgname}.install"
-source=(https://github.com/vcmi/${pkgname}/archive/${pkgver}.tar.gz)
+patch="server.patch"
+source=("https://github.com/vcmi/${pkgname}/archive/${pkgver}.tar.gz")
sha256sums=('88ffc13da9b7d6ac8ed294b1b7719e5adc0cdc34a9f0d83d55b5b5c8d02e529a')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -p1 -i ../../$patch
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
diff --git a/server.patch b/server.patch
new file mode 100644
index 000000000000..f90e543484c6
--- /dev/null
+++ b/server.patch
@@ -0,0 +1,37 @@
+diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp
+index b166167a5..640d8837f 100644
+--- a/server/CVCMIServer.cpp
++++ b/server/CVCMIServer.cpp
+@@ -375,10 +375,10 @@ class CVCMIServerPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
+ {
+ private:
+ CVCMIServer & handler;
+- CGameHandler & gh;
++ std::shared_ptr<CGameHandler> gh;
+
+ public:
+- CVCMIServerPackVisitor(CVCMIServer & handler, CGameHandler & gh)
++ CVCMIServerPackVisitor(CVCMIServer & handler, std::shared_ptr<CGameHandler> gh)
+ :handler(handler), gh(gh)
+ {
+ }
+@@ -392,7 +392,9 @@ public:
+
+ virtual void visitForServer(CPackForServer & serverPack) override
+ {
+- gh.handleReceivedPack(&serverPack);
++ if (!gh)
++ throw std::runtime_error("Received game handler pack in lobby!");
++ gh->handleReceivedPack(&serverPack);
+ }
+
+ virtual void visitForClient(CPackForClient & clientPack) override
+@@ -432,7 +434,7 @@ void CVCMIServer::threadHandleClient(std::shared_ptr<CConnection> c)
+ break;
+ }
+
+- CVCMIServerPackVisitor visitor(*this, *this->gh);
++ CVCMIServerPackVisitor visitor(*this, this->gh);
+ pack->visit(visitor);
+ }
+ #ifndef _MSC_VER