From 7bdfe03c922fcd92a306871b5a7a59ec476af640 Mon Sep 17 00:00:00 2001
From: jokoho48
Date: Sun, 9 Aug 2015 02:19:34 +0200
Subject: [PATCH 01/66] Code cleanup of Concertina_wire module
---
addons/concertina_wire/XEH_init.sqf | 5 ++-
.../concertina_wire/functions/fnc_deploy.sqf | 35 ++++++++++---------
.../functions/fnc_dismount.sqf | 8 ++---
.../functions/fnc_dismountSuccess.sqf | 22 ++++++------
.../functions/fnc_handleDamage.sqf | 9 ++---
.../functions/fnc_handleKilled.sqf | 8 ++---
.../functions/fnc_vehicleDamage.sqf | 12 +++----
7 files changed, 45 insertions(+), 54 deletions(-)
diff --git a/addons/concertina_wire/XEH_init.sqf b/addons/concertina_wire/XEH_init.sqf
index dbce4a9b92..dc6424f172 100644
--- a/addons/concertina_wire/XEH_init.sqf
+++ b/addons/concertina_wire/XEH_init.sqf
@@ -1,4 +1,3 @@
#include "script_component.hpp"
-
-PARAMS_1(_wire);
-_wire addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}];
\ No newline at end of file
+params ["_wire"];
+_wire addEventHandler ["HandleDamage", FUNC(handleDamage)];
diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf
index 5548cad649..aedc8b9608 100644
--- a/addons/concertina_wire/functions/fnc_deploy.sqf
+++ b/addons/concertina_wire/functions/fnc_deploy.sqf
@@ -8,10 +8,9 @@
* 1: unit
Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 9921bf3fc6..6f45df8b81 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -17,8 +17,11 @@
-
-
+
+
+
+
+
Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit
diff --git a/docs/README_PL.md b/docs/README_PL.md
index aa7023a9e4..bf31f0e3b9 100644
--- a/docs/README_PL.md
+++ b/docs/README_PL.md
@@ -17,8 +17,11 @@
-
-
+
+
+
+
+
Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit
From 7efcc3b8d180f95e2a99abd1b19eff056a34f05b Mon Sep 17 00:00:00 2001
From: jonpas
Date: Thu, 8 Oct 2015 20:33:20 +0200
Subject: [PATCH 50/66] Update version and download size
---
README.md | 2 +-
docs/README_DE.md | 4 ++--
docs/README_PL.md | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index c3d4c1389f..f5a5e5a948 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
-
+
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 6f45df8b81..849a75a692 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -3,10 +3,10 @@
-
+
-
+
diff --git a/docs/README_PL.md b/docs/README_PL.md
index bf31f0e3b9..b623d90c11 100644
--- a/docs/README_PL.md
+++ b/docs/README_PL.md
@@ -3,10 +3,10 @@
-
+
-
+
From 7c101bde8757a48d9df44644168799d971c18d78 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Thu, 8 Oct 2015 21:01:06 +0200
Subject: [PATCH 51/66] Change build badge tooltip
---
README.md | 2 +-
docs/README_DE.md | 2 +-
docs/README_PL.md | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index f5a5e5a948..fc02b56898 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@
-
+
Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 849a75a692..97dd500019 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -21,7 +21,7 @@
-
+
Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit
diff --git a/docs/README_PL.md b/docs/README_PL.md
index b623d90c11..13ec07b395 100644
--- a/docs/README_PL.md
+++ b/docs/README_PL.md
@@ -21,7 +21,7 @@
-
+
Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit
From 01a39e7db5438ed7413de77046bf0c3f7441c02d Mon Sep 17 00:00:00 2001
From: jonpas
Date: Thu, 8 Oct 2015 23:53:21 +0200
Subject: [PATCH 52/66] Update badges
---
README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index fc02b56898..3aa6ae6af7 100644
--- a/README.md
+++ b/README.md
@@ -6,22 +6,22 @@
-
+
-
+
-
+
-
+
Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit
From e5a7516ec14137f12f992bec07fdcc4d7829405e Mon Sep 17 00:00:00 2001
From: jonpas
Date: Thu, 8 Oct 2015 23:54:44 +0200
Subject: [PATCH 53/66] Non-English as well
---
docs/README_DE.md | 8 ++++----
docs/README_PL.md | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 97dd500019..5c82cc5097 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -6,22 +6,22 @@
-
+
-
+
-
+
-
+
Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit
diff --git a/docs/README_PL.md b/docs/README_PL.md
index 13ec07b395..6447e4b5b9 100644
--- a/docs/README_PL.md
+++ b/docs/README_PL.md
@@ -6,22 +6,22 @@
-
+
-
+
-
+
-
+
Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit
From 36895d2e305de104e14f217e769b52601e330f0c Mon Sep 17 00:00:00 2001
From: jonpas
Date: Fri, 9 Oct 2015 00:23:36 +0200
Subject: [PATCH 54/66] Update more version numbers
---
docs/README_DE.md | 2 +-
docs/README_PL.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 5c82cc5097..24be427392 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -5,7 +5,7 @@
-
+
diff --git a/docs/README_PL.md b/docs/README_PL.md
index 6447e4b5b9..b12f574b6f 100644
--- a/docs/README_PL.md
+++ b/docs/README_PL.md
@@ -5,7 +5,7 @@
-
+
From 33be10126ee7e74411b1b542b095b37414f8e6c6 Mon Sep 17 00:00:00 2001
From: Glowbal
Date: Sun, 11 Oct 2015 15:01:02 +0200
Subject: [PATCH 55/66] Improve travis yml
- Add slack integration
- Change the deploy.py to only run on pushes to the master branch
- Change email notifications to only mail once on failure
---
.travis.yml | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 0aadd9cd0b..0506cc0952 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,13 +3,26 @@ branches:
- master
language: python
python:
- - "3.4"
+- '3.4'
before_script:
- - pip install pygithub
- - pip install pygithub3
+- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
+ pip install pygithub;
+ pip install pygithub3;
+ fi
script:
- - python3 tools/deploy.py
- - python3 tools/sqf_validator.py
+- python3 tools/sqf_validator.py
+- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
+ python3 tools/deploy.py;
+ fi
env:
global:
- - secure: "KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg="
+ - secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=
+notifications:
+ slack:
+ secure: aWYF/YX7vxEdXJ5w1jhYJQ2TtTP2NRdnXzJDMYXTv2dlXYhO9qp2qjxDGW3dezuPY7B1mPBgebfSKRx3Robkt1rAfEwPWivOiEztL30rwzOy+5Q1wpORv1JkvTC/q2wqQzxQCU/FPVjD2GkF1wtq1Rnx3ESWD8gbvzYoMNdIw1g=
+ on_success: change
+ on_failure: always
+ on_start: never
+ email:
+ on_success: never
+ on_failure: change
From 8e9c2754fdb2e1bc72384bf5adf36c7330e6d86f Mon Sep 17 00:00:00 2001
From: Glowbal
Date: Sun, 11 Oct 2015 15:01:31 +0200
Subject: [PATCH 56/66] Change translation guide link in translations issue to
markdown
- Change from @Jonpas
---
tools/deploy.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/deploy.py b/tools/deploy.py
index 0b3a730470..2bc894176d 100755
--- a/tools/deploy.py
+++ b/tools/deploy.py
@@ -16,8 +16,7 @@ from pygithub3 import Github
TRANSLATIONISSUE = 367
-TRANSLATIONBODY = """**How to translate ACE3:**
-http://ace3mod.com/wiki/development/how-to-translate-ace3.html
+TRANSLATIONBODY = """**[ACE3 Translation Guide](http://ace3mod.com/wiki/development/how-to-translate-ace3.html)**
{}
"""
From fe7f8e66f73268f9f33491f174a41e3aedb41cef Mon Sep 17 00:00:00 2001
From: Glowbal
Date: Sun, 11 Oct 2015 15:23:22 +0200
Subject: [PATCH 57/66] Add slack notification for ace3public dev channel
---
.travis.yml | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 0506cc0952..6063d59b34 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,19 +1,16 @@
branches:
only:
- - master
+ - master
language: python
python:
- '3.4'
before_script:
-- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
- pip install pygithub;
- pip install pygithub3;
- fi
+- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}"
+ == "false" ]; then pip install pygithub; pip install pygithub3; fi
script:
- python3 tools/sqf_validator.py
-- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
- python3 tools/deploy.py;
- fi
+- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}"
+ == "false" ]; then python3 tools/deploy.py; fi
env:
global:
- secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=
@@ -23,6 +20,8 @@ notifications:
on_success: change
on_failure: always
on_start: never
+ rooms:
+ secure: MvxmqL1NGwiGTVv6uIVTM7jeNLQH95KYtTgSWlXaSw4jdjnf4cmrb/ofHQ3FHhhNVdhRN6W8n0cJfTC3DBZ90bionVh+528qw2mDnDbKljVdIwmoFSexBcH7H1uTLF3gsEz0tbrHtLcnAyTMxdjsdIXDLZ5hwxABNmW5/03jOgs=
email:
on_success: never
on_failure: change
From 51c4b2b89518ccf58bba7610c2826d179e7dbd7d Mon Sep 17 00:00:00 2001
From: Glowbal
Date: Sun, 11 Oct 2015 15:26:06 +0200
Subject: [PATCH 58/66] Fix formatting of script
---
.travis.yml | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 6063d59b34..313b0a11c7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,12 +5,15 @@ language: python
python:
- '3.4'
before_script:
-- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}"
- == "false" ]; then pip install pygithub; pip install pygithub3; fi
+- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
+ pip install pygithub;
+ pip install pygithub3;
+ fi
script:
- python3 tools/sqf_validator.py
-- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}"
- == "false" ]; then python3 tools/deploy.py; fi
+- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
+ python3 tools/deploy.py;
+ fi
env:
global:
- secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=
From afb28d01eab012adbd81b32f4a110254894a5cf4 Mon Sep 17 00:00:00 2001
From: Glowbal
Date: Sun, 11 Oct 2015 17:25:53 +0200
Subject: [PATCH 59/66] Improve sqf validator
- fix not all string cases were caught
- add basic semi column validation after code blocks
- Improve print output
- Fix a dot in file path when reporting an error
---
tools/sqf_validator.py | 94 +++++++++++++++++++++++++++++++++---------
1 file changed, 75 insertions(+), 19 deletions(-)
diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py
index e4af90f50f..7d1780c5e0 100644
--- a/tools/sqf_validator.py
+++ b/tools/sqf_validator.py
@@ -6,6 +6,16 @@ import ntpath
import sys
import argparse
+def validKeyWordAfterCode(content, index):
+ keyWords = ["for", "do", "count", "each", "forEach", "else", "and", "not", "isEqualTo", "in", "call", "spawn", "execVM", "catch"];
+ for word in keyWords:
+ try:
+ subWord = content.index(word, index, index+len(word))
+ return True;
+ except:
+ pass
+ return False
+
def check_sqf_syntax(filepath):
bad_count_file = 0
def pushClosing(t):
@@ -17,61 +27,96 @@ def check_sqf_syntax(filepath):
with open(filepath, 'r') as file:
content = file.read()
+
+ # Store all brackets we find in this file, so we can validate everything on the end
brackets_list = []
+ # To check if we are in a comment block
isInCommentBlock = False
checkIfInComment = False
+ # Used in case we are in a line comment (//)
ignoreTillEndOfLine = False
+ # Used in case we are in a comment block (/* */). This is true if we detect a * inside a comment block.
+ # If the next character is a /, it means we end our comment block.
checkIfNextIsClosingBlock = False
- isInString = False
+ # We ignore everything inside a string
+ isInString = False
+ # Used to store the starting type of a string, so we can match that to the end of a string
+ inStringType = '';
+
+ lastIsCurlyBrace = False
+ checkForSemiColumn = False
+
+ # Extra information so we know what line we find errors at
lineNumber = 0
+ indexOfCharacter = 0
+ # Parse all characters in the content of this file to search for potential errors
for c in content:
- if c == '\n':
+ if (lastIsCurlyBrace):
+ lastIsCurlyBrace = False
+ checkForSemiColumn = True
+
+ if c == '\n': # Keeping track of our line numbers
lineNumber += 1 # so we can print accurate line number information when we detect a possible error
- if (isInString):
+ if (isInString): # while we are in a string, we can ignore everything else, except the end of the string
if (c == inStringType):
isInString = False
- elif (isInCommentBlock == False): # if we are not in a comment block, we will check if we are at the start of one or count the () {} and []
- if (checkIfInComment): # This means we have encountered a /, so we are now checking if this is an inline comment or a comment block
+ # if we are not in a comment block, we will check if we are at the start of one or count the () {} and []
+ elif (isInCommentBlock == False):
+
+ # This means we have encountered a /, so we are now checking if this is an inline comment or a comment block
+ if (checkIfInComment):
checkIfInComment = False
if c == '*': # if the next character after / is a *, we are at the start of a comment block
isInCommentBlock = True
- if (c == '/'): # Otherwise, will check if we are in an line comment
+ elif (c == '/'): # Otherwise, will check if we are in an line comment
ignoreTillEndOfLine = True # and an line comment is a / followed by another / (//) We won't care about anything that comes after it
+
if (isInCommentBlock == False):
if (ignoreTillEndOfLine): # we are in a line comment, just continue going through the characters until we find an end of line
if (c == '\n'):
ignoreTillEndOfLine = False
- else:
- if (c == '"'):
+ else: # validate brackets
+ if (c == '"' or c == "'"):
isInString = True
inStringType = c
+ elif (c == '#'):
+ ignoreTillEndOfLine = True
elif (c == '/'):
checkIfInComment = True
elif (c == '('):
brackets_list.append('(')
elif (c == ')'):
if (brackets_list[-1] in ['{', '[']):
- print("Possible missing round bracket ')' detected at {0} Line number: {1}".format(filepath,lineNumber))
+ print("ERROR: Possible missing round bracket ')' detected at {0} Line number: {1}".format(filepath,lineNumber))
bad_count_file += 1
brackets_list.append(')')
elif (c == '['):
brackets_list.append('[')
elif (c == ']'):
if (brackets_list[-1] in ['{', '(']):
- print("Possible missing square bracket ']' detected at {0} Line number: {1}".format(filepath,lineNumber))
+ print("ERROR: Possible missing square bracket ']' detected at {0} Line number: {1}".format(filepath,lineNumber))
bad_count_file += 1
brackets_list.append(']')
elif (c == '{'):
brackets_list.append('{')
elif (c == '}'):
+ lastIsCurlyBrace = True
if (brackets_list[-1] in ['(', '[']):
- print("Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath,lineNumber))
+ print("ERROR: Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath,lineNumber))
bad_count_file += 1
brackets_list.append('}')
- else:
+
+ if (checkForSemiColumn):
+ if (c not in [' ', '\t', '\n', '/']): # keep reading until no white space or comments
+ checkForSemiColumn = False
+ if (c not in [']', ')', '}', ';', ',', '&', '!', '|', '='] and not validKeyWordAfterCode(content, indexOfCharacter)): # , 'f', 'd', 'c', 'e', 'a', 'n', 'i']):
+ print("ERROR: Possible missing semi-column ':' detected at {0} Line number: {1}".format(filepath,lineNumber))
+ bad_count_file += 1
+
+ else: # Look for the end of our comment block
if (c == '*'):
checkIfNextIsClosingBlock = True;
elif (checkIfNextIsClosingBlock):
@@ -79,39 +124,50 @@ def check_sqf_syntax(filepath):
isInCommentBlock = False
elif (c != '*'):
checkIfNextIsClosingBlock = False
+ indexOfCharacter += 1
if brackets_list.count('[') != brackets_list.count(']'):
- print("A possible missing square bracket [ or ] in file {0} [ = {1} ] = {2}".format(filepath,brackets_list.count('['),brackets_list.count(']')))
+ print("ERROR: A possible missing square bracket [ or ] in file {0} [ = {1} ] = {2}".format(filepath,brackets_list.count('['),brackets_list.count(']')))
bad_count_file += 1
if brackets_list.count('(') != brackets_list.count(')'):
- print("A possible missing round bracket ( or ) in file {0} ( = {1} ) = {2}".format(filepath,brackets_list.count('('),brackets_list.count(')')))
+ print("ERROR: A possible missing round bracket ( or ) in file {0} ( = {1} ) = {2}".format(filepath,brackets_list.count('('),brackets_list.count(')')))
bad_count_file += 1
if brackets_list.count('{') != brackets_list.count('}'):
- print("A possible missing curly brace {{ or }} in file {0} {{ = {1} }} = {2}".format(filepath,brackets_list.count('{'),brackets_list.count('}')))
+ print("ERROR: A possible missing curly brace {{ or }} in file {0} {{ = {1} }} = {2}".format(filepath,brackets_list.count('{'),brackets_list.count('}')))
bad_count_file += 1
return bad_count_file
def main():
print("#########################")
- print("# Validate SQF files missing brackets #")
+ print("# Validate SQF #")
print("#########################")
sqf_list = []
bad_count = 0
parser = argparse.ArgumentParser()
- parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".")
+ parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="")
args = parser.parse_args()
- for root, dirnames, filenames in os.walk('../addons' + '/' + args.module):
+ # Allow running from root directory as well as from inside the tools directory
+ rootDir = "../addons"
+ if (os.path.exists("addons")):
+ rootDir = "addons"
+
+ for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.sqf'):
sqf_list.append(os.path.join(root, filename))
for filename in sqf_list:
bad_count = bad_count + check_sqf_syntax(filename)
- print("Bad Count {0}".format(bad_count))
+ print("Checked {0} files. Errors detected {1}.".format(len(sqf_list), bad_count))
+ if (bad_count == 0):
+ print("Sqf validation passed")
+ else:
+ print("Sqf validation failed")
+
return bad_count
if __name__ == "__main__":
From d6ab43d77ea7467abc3ed709f3b39d34f0132cb9 Mon Sep 17 00:00:00 2001
From: Glowbal
Date: Sun, 11 Oct 2015 17:35:55 +0200
Subject: [PATCH 60/66] Possible fix for travis build failure
---
tools/sqf_validator.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py
index 7d1780c5e0..6cfa3e4db3 100644
--- a/tools/sqf_validator.py
+++ b/tools/sqf_validator.py
@@ -25,7 +25,7 @@ def check_sqf_syntax(filepath):
def popClosing():
closing << closingStack.pop()
- with open(filepath, 'r') as file:
+ with open(filepath, 'r', encoding='utf-8', errors='ignore') as file:
content = file.read()
# Store all brackets we find in this file, so we can validate everything on the end
From b524c28d53cfd3accc2120fab30947d8fc2eb844 Mon Sep 17 00:00:00 2001
From: Glowbal
Date: Sun, 11 Oct 2015 18:31:39 +0200
Subject: [PATCH 61/66] Improved output text
- Capitalized SQF everywhere
- Break checked files and errors into multiple lines
- Add a break by line between reported errors and result
- Fix incorrect report message for semi-columns
- Change excessive usage of # prints on start
---
tools/sqf_validator.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py
index 6cfa3e4db3..d76434f81d 100644
--- a/tools/sqf_validator.py
+++ b/tools/sqf_validator.py
@@ -113,7 +113,7 @@ def check_sqf_syntax(filepath):
if (c not in [' ', '\t', '\n', '/']): # keep reading until no white space or comments
checkForSemiColumn = False
if (c not in [']', ')', '}', ';', ',', '&', '!', '|', '='] and not validKeyWordAfterCode(content, indexOfCharacter)): # , 'f', 'd', 'c', 'e', 'a', 'n', 'i']):
- print("ERROR: Possible missing semi-column ':' detected at {0} Line number: {1}".format(filepath,lineNumber))
+ print("ERROR: Possible missing semi-column ';' detected at {0} Line number: {1}".format(filepath,lineNumber))
bad_count_file += 1
else: # Look for the end of our comment block
@@ -139,9 +139,7 @@ def check_sqf_syntax(filepath):
def main():
- print("#########################")
- print("# Validate SQF #")
- print("#########################")
+ print("Validating SQF")
sqf_list = []
bad_count = 0
@@ -162,11 +160,12 @@ def main():
for filename in sqf_list:
bad_count = bad_count + check_sqf_syntax(filename)
- print("Checked {0} files. Errors detected {1}.".format(len(sqf_list), bad_count))
+
+ print("------\nChecked {0} files\nErrors detected: {1}".format(len(sqf_list), bad_count))
if (bad_count == 0):
- print("Sqf validation passed")
+ print("SQF validation PASSED")
else:
- print("Sqf validation failed")
+ print("SQF validation FAILED")
return bad_count
From d926a4a52a6ac1acf0341f0d8d92f14e44855d61 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sun, 11 Oct 2015 23:20:56 +0200
Subject: [PATCH 62/66] Add shebang line to specify python version to SQF
validator and replace slash with backslash
---
tools/sqf_validator.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py
index d76434f81d..8af8e08a61 100644
--- a/tools/sqf_validator.py
+++ b/tools/sqf_validator.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
import fnmatch
import os
@@ -149,11 +150,11 @@ def main():
args = parser.parse_args()
# Allow running from root directory as well as from inside the tools directory
- rootDir = "../addons"
+ rootDir = "..\\addons"
if (os.path.exists("addons")):
rootDir = "addons"
- for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
+ for root, dirnames, filenames in os.walk(rootDir + '\\' + args.module):
for filename in fnmatch.filter(filenames, '*.sqf'):
sqf_list.append(os.path.join(root, filename))
From 7062f60f0a667cc3a3e59859d75eaca4e2bd4d35 Mon Sep 17 00:00:00 2001
From: PabstMirror
Date: Mon, 12 Oct 2015 01:07:20 -0500
Subject: [PATCH 63/66] Fix UBC from #2726
---
addons/cargo/CfgVehicles.hpp | 6 ------
1 file changed, 6 deletions(-)
diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp
index 1fae56749f..111c4d9956 100644
--- a/addons/cargo/CfgVehicles.hpp
+++ b/addons/cargo/CfgVehicles.hpp
@@ -222,12 +222,6 @@ class CfgVehicles {
class B_supplyCrate_F: ReammoBox_F {
GVAR(size) = 6;
};
- class O_supplyCrate_F: ReammoBox_F {
- GVAR(size) = 6;
- };
- class I_supplyCrate_F: ReammoBox_F {
- GVAR(size) = 6;
- };
class IG_supplyCrate_F: ReammoBox_F {
GVAR(size) = 6;
};
From 5d76395914271470ed09b22ccc31676902ffab67 Mon Sep 17 00:00:00 2001
From: PabstMirror
Date: Mon, 12 Oct 2015 11:27:38 -0500
Subject: [PATCH 64/66] #2734 - Map effects / flashlights for TrippleHead
---
addons/map/functions/fnc_simulateMapLight.sqf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/map/functions/fnc_simulateMapLight.sqf b/addons/map/functions/fnc_simulateMapLight.sqf
index 9554409e15..ec08f14d4c 100644
--- a/addons/map/functions/fnc_simulateMapLight.sqf
+++ b/addons/map/functions/fnc_simulateMapLight.sqf
@@ -22,7 +22,7 @@ _hmd = hmd ACE_player;
_flashlight = GVAR(flashlightInUse);
//map width (on screen) in pixels
-_screenSize = 640 * safeZoneW;
+_screenSize = 640 * safeZoneWAbs;
//resolution params (every frame in case resolution change)
getResolution params ["_resX", "_resY", "_viewPortX", "_viewPortY", "", "_uiScale"];
@@ -58,7 +58,7 @@ if (_flashlight == "") then {
if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"};
_size = getNumber (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Size");
_flashTex = format[QUOTE(PATHTOF_SYS(ace,flashlights,UI\Flashlight_Beam_%1_ca.paa)), _colour];
- _beamSize = _screenSize / _size;
+ _beamSize = (safeZoneW/safeZoneWAbs) * _screenSize / _size;
//after 5x zoom, it's simulated to be fixed (it actually gets bigger relative to zoom)
if (_mapScale < 0.2) then {_beamSize = _beamSize / (_mapScale * (1 / 0.2))};
From 3e4906fa7e1768ff974e48fafc338dbbca333e4a Mon Sep 17 00:00:00 2001
From: Glowbal
Date: Mon, 12 Oct 2015 21:29:50 +0200
Subject: [PATCH 65/66] Revert the backslash in sqf validator
- Use a forward slash in path for travis to work properly
---
tools/sqf_validator.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py
index 8af8e08a61..7e7c0183d6 100644
--- a/tools/sqf_validator.py
+++ b/tools/sqf_validator.py
@@ -150,11 +150,11 @@ def main():
args = parser.parse_args()
# Allow running from root directory as well as from inside the tools directory
- rootDir = "..\\addons"
+ rootDir = "../addons"
if (os.path.exists("addons")):
rootDir = "addons"
- for root, dirnames, filenames in os.walk(rootDir + '\\' + args.module):
+ for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.sqf'):
sqf_list.append(os.path.join(root, filename))
From f7fe0c08e0af57d2529731d348b31ffd5e64caa6 Mon Sep 17 00:00:00 2001
From: PabstMirror
Date: Wed, 14 Oct 2015 11:15:44 -0500
Subject: [PATCH 66/66] #2391 - Use AGL for sitting setPos
---
addons/sitting/functions/fnc_sit.sqf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf
index 5e9c36947e..b6c853f645 100644
--- a/addons/sitting/functions/fnc_sit.sqf
+++ b/addons/sitting/functions/fnc_sit.sqf
@@ -58,8 +58,8 @@ _sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber
// Set direction and position
_player setDir _sitDirection;
-// No need for ATL/ASL as modelToWorld returns in format position
-_player setPos (_seat modelToWorld _sitPosition);
+//modelToWorld returns AGL
+_player setPosASL (AGLtoASL (_seat modelToWorld _sitPosition));
// Set variables
_player setVariable [QGVAR(isSitting), true];