diff options
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | .gitignore | 14 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | server.patch | 37 |
4 files changed, 51 insertions, 8 deletions
@@ -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 @@ -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 |