Skip to content

Commit

Permalink
Fix patch paths
Browse files Browse the repository at this point in the history
  • Loading branch information
th3-z committed Sep 25, 2019
1 parent fbaba57 commit c3cbc9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion admin_patches/admin_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def run(target=None):
.format(server_path), pause=True)

info("Validating files...")
target_path = path.join(server_path, "KFGame/Web/ServerAdmin/")
target_path = path.join(server_path, "KFGame/Web/ServerAdmin")
if not validate_files(target_path):
die("Server file validation failed, possible reasons:"
"\n\t - Game update"
Expand All @@ -56,6 +56,7 @@ def run(target=None):

info("Patching files...")
patches_path = find_data_file(PATCHES_PATH)

if not patch_files(target_path, patches_path):
die("Patching failed")
else:
Expand Down
10 changes: 5 additions & 5 deletions admin_patches/patches/header_base.inc.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/ServerAdmin/header_base.inc b/ServerAdmin/header_base.inc
index 217a460..9b085bd 100755
--- a/ServerAdmin/header_base.inc
+++ b/ServerAdmin/header_base.inc
diff --git a/header_base.inc b/header_base.inc
index 217a460..9e2fe92 100755
--- a/header_base.inc
+++ b/header_base.inc
@@ -1,6 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
+ <!-- KF2-MA-INSTALLED-FLAG -->
+ <!-- KF2-MA-INSTALLED-FLAG -->
<title>Killing Floor 2 WebAdmin - <%page.title%></title>
<link rel="stylesheet" type="text/css" href="/images/kf2.css?gzip" />
<link rel="stylesheet" type="text/css" href="/images/kf2modern.css?gzip" />
6 changes: 4 additions & 2 deletions admin_patches/utils/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from hashlib import md5

from checksums import ORIG_MD5
from utils import find_data_file, info
from utils import find_data_file, info, warning
from utils.patch import fromfile


Expand Down Expand Up @@ -37,5 +37,7 @@ def patch_files(target_path, patches_path):
info("Applying {}".format(filename + ".patch"))

patch = fromfile(patch_path)
patch.apply(0, target_path)
success = patch.apply(0, target_path)
if not success:
warning("Patch failed to apply successfully")
return True

0 comments on commit c3cbc9e

Please sign in to comment.