Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3c6450b0c | ||
|
|
2bce1985e2 |
@@ -253,13 +253,6 @@
|
|||||||
To make an airbase buildable add a text box inside of the trigger zone and name it: <code-inline>buildable_[freeform]</code-inline> <br/>
|
To make an airbase buildable add a text box inside of the trigger zone and name it: <code-inline>buildable_[freeform]</code-inline> <br/>
|
||||||
Then in the text box type amount of kilo's you want to be transfered before the logistisc mission is complete. <br/>
|
Then in the text box type amount of kilo's you want to be transfered before the logistisc mission is complete. <br/>
|
||||||
|
|
||||||
<br>
|
|
||||||
To add a custom briefing for a buildable zone, include a text box inside the trigger zone and name it: <code-inline>supplybriefing_[freeform]</code-inline>.
|
|
||||||
<code-inline>{{coords}}</code-inline> is highly recommended for the players.<br>
|
|
||||||
Additionally, the amount of kilos required and delivered are always shown on the bottom, as well as a note to not land in the construction zone.
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
The base or zone will slowly build up with each crate giving both a nice view of it happening AND it's good for performance as there's not a big addition of objects at once. <br/>
|
The base or zone will slowly build up with each crate giving both a nice view of it happening AND it's good for performance as there's not a big addition of objects at once. <br/>
|
||||||
Right now a crate takes 15 seconds to unpack per 500kg. Meaning 2 crates of 1000kg will be faster than 1 crate of 2000kg. <br/>
|
Right now a crate takes 15 seconds to unpack per 500kg. Meaning 2 crates of 1000kg will be faster than 1 crate of 2000kg. <br/>
|
||||||
|
|||||||
@@ -4,13 +4,14 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- develop
|
||||||
paths:
|
paths:
|
||||||
- '.docs/**'
|
- '.docs/**'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_REGISTRY: registry.dutchie031.net
|
DOCKER_REGISTRY: registry.dutchie031.net
|
||||||
DOCKER_IMAGE: spearhead-docs
|
DOCKER_IMAGE: spearhead-docs
|
||||||
DOCKER_TAG: latest
|
DOCKER_TAG: ${{ github.ref_name == 'main' && 'latest' || 'beta' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
## Run replacements and cleanups on the docs
|
## Run replacements and cleanups on the docs
|
||||||
@@ -36,7 +37,7 @@ jobs:
|
|||||||
sed -i '/@@API_CODE@@/d' .docs/web/pages/spearheadapi.html
|
sed -i '/@@API_CODE@@/d' .docs/web/pages/spearheadapi.html
|
||||||
rm .docs/web/pages/temp_api_code.html
|
rm .docs/web/pages/temp_api_code.html
|
||||||
|
|
||||||
- name: Highlight API code and update HTML
|
- name: Highlight Config code and update HTML
|
||||||
run: |
|
run: |
|
||||||
pygmentize -f html -l lua -O noclasses,style=monokai ./config.lua > .docs/web/pages/temp_config_code.html
|
pygmentize -f html -l lua -O noclasses,style=monokai ./config.lua > .docs/web/pages/temp_config_code.html
|
||||||
# Insert the highlighted code into the placeholder in spearheadapi.html
|
# Insert the highlighted code into the placeholder in spearheadapi.html
|
||||||
@@ -105,15 +106,30 @@ jobs:
|
|||||||
chmod 600 $HOME/.kube/config
|
chmod 600 $HOME/.kube/config
|
||||||
cat $HOME/.kube/config
|
cat $HOME/.kube/config
|
||||||
|
|
||||||
- name: Run Helm upgrade/install
|
- name: Run Helm upgrade/install spearhead-docs (main)
|
||||||
|
if: github.ref_name == 'main'
|
||||||
run: |
|
run: |
|
||||||
helm upgrade --install spearhead-docs .helm \
|
helm upgrade --install spearhead-docs .helm \
|
||||||
--namespace spearhead-docs \
|
--namespace spearhead-docs \
|
||||||
--create-namespace \
|
--create-namespace \
|
||||||
|
-f .helm/values.yaml \
|
||||||
--set image.repository=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }} \
|
--set image.repository=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }} \
|
||||||
--set image.tag=${{ env.DOCKER_TAG }} \
|
--set image.tag=${{ env.DOCKER_TAG }} \
|
||||||
--wait
|
--wait
|
||||||
|
|
||||||
|
- name: Run Helm upgrade/install spearhead-docs (develop)
|
||||||
|
if: github.ref_name == 'develop'
|
||||||
|
run: |
|
||||||
|
helm upgrade --install spearhead-docs-beta .helm \
|
||||||
|
--namespace spearhead-docs \
|
||||||
|
--create-namespace \
|
||||||
|
-f .helm/values.yaml \
|
||||||
|
-f .helm/values.beta.yaml \
|
||||||
|
--set image.repository=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }} \
|
||||||
|
--set image.tag=${{ env.DOCKER_TAG }} \
|
||||||
|
--wait
|
||||||
|
|
||||||
|
|
||||||
# - name: 'Deploy'
|
# - name: 'Deploy'
|
||||||
# uses: deliverybot/helm@v1
|
# uses: deliverybot/helm@v1
|
||||||
# with:
|
# with:
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ sources:
|
|||||||
maintainers:
|
maintainers:
|
||||||
- name: Spearhead Team
|
- name: Spearhead Team
|
||||||
|
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ spec:
|
|||||||
type: RuntimeDefault
|
type: RuntimeDefault
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Values.app }}
|
- name: {{ .Values.app }}
|
||||||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: {{ .Values.ports.containerPort }}
|
- containerPort: {{ .Values.ports.containerPort }}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ spec:
|
|||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Values.app }}-ingress
|
name: "{{ .Values.app }}-ingress"
|
||||||
namespace: spearhead-docs
|
namespace: spearhead-docs
|
||||||
annotations:
|
annotations:
|
||||||
kubernetes.io/tls-acme: "true"
|
kubernetes.io/tls-acme: "true"
|
||||||
@@ -22,28 +22,21 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: nginx
|
||||||
rules:
|
rules:
|
||||||
- host: spearhead.dutchie031.com
|
{{- range .Values.ingress.hosts }}
|
||||||
|
- host: {{ . }}
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
backend:
|
backend:
|
||||||
service:
|
service:
|
||||||
name: {{ .Values.app }}
|
name: {{ $.Values.app }}
|
||||||
port:
|
port:
|
||||||
number: {{ .Values.ports.servicePort }}
|
number: {{ $.Values.ports.servicePort }}
|
||||||
- host: spearhead.rocks
|
{{- end }}
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
pathType: Prefix
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: {{ .Values.app }}
|
|
||||||
port:
|
|
||||||
number: {{ .Values.ports.servicePort }}
|
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- spearhead.dutchie031.com
|
{{- range .Values.ingress.hosts }}
|
||||||
- spearhead.rocks
|
- {{ . }}
|
||||||
secretName: spearhead-docs-tls
|
{{- end }}
|
||||||
|
secretName: "{{ .Values.app }}-docs-tls"
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
app: spearhead-docs-beta
|
||||||
|
|
||||||
|
image:
|
||||||
|
tag: "beta"
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
hosts:
|
||||||
|
- beta.spearhead.rocks
|
||||||
@@ -8,3 +8,8 @@ image:
|
|||||||
ports:
|
ports:
|
||||||
servicePort: 80
|
servicePort: 80
|
||||||
containerPort: 80
|
containerPort: 80
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
hosts:
|
||||||
|
- spearhead.dutchie031.com
|
||||||
|
- spearhead.rocks
|
||||||
@@ -58,7 +58,6 @@ local CustomDrawing = require("classes.stageClasses.drawings.CustomDrawing")
|
|||||||
---@class BlueSamData
|
---@class BlueSamData
|
||||||
---@field groups Array<string>
|
---@field groups Array<string>
|
||||||
---@field buildingKilos number?
|
---@field buildingKilos number?
|
||||||
---@field briefing string?
|
|
||||||
|
|
||||||
---@class MissionZoneData
|
---@class MissionZoneData
|
||||||
---@field ZoneName string
|
---@field ZoneName string
|
||||||
@@ -75,7 +74,6 @@ local CustomDrawing = require("classes.stageClasses.drawings.CustomDrawing")
|
|||||||
---@field padNames Array<string>
|
---@field padNames Array<string>
|
||||||
---@field buildingKilos number?
|
---@field buildingKilos number?
|
||||||
---@field supplyHubNames Array<string>
|
---@field supplyHubNames Array<string>
|
||||||
---@field briefing string?
|
|
||||||
|
|
||||||
---@class Database
|
---@class Database
|
||||||
---@field private _tables DatabaseTables
|
---@field private _tables DatabaseTables
|
||||||
@@ -616,27 +614,6 @@ function Database:loadBlueSamUnits()
|
|||||||
local number = tonumber(kvPair.value)
|
local number = tonumber(kvPair.value)
|
||||||
if number and number > 0 then
|
if number and number > 0 then
|
||||||
samData.buildingKilos = number
|
samData.buildingKilos = number
|
||||||
|
|
||||||
if env.mission.drawings and env.mission.drawings.layers then
|
|
||||||
for i, layer in pairs(env.mission.drawings.layers) do
|
|
||||||
if string.lower(layer.name) == "author" then
|
|
||||||
for key, layer_object in pairs(layer.objects) do
|
|
||||||
|
|
||||||
local vec2 = { x = layer_object.mapX, y = layer_object.mapY }
|
|
||||||
if triggerZone and Util.is2dPointInZone(vec2, triggerZone) then
|
|
||||||
if layer_object.name and Util.startswith(layer_object.name, "supplybriefing_", true) then
|
|
||||||
local description = layer_object.text
|
|
||||||
if description and description ~= "" then
|
|
||||||
samData.briefing = description
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
MissionEditorWarnings.Add("Buildable number for " .. blueSamZone .. " is invalid")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -771,31 +748,7 @@ function Database:loadFarpData()
|
|||||||
local number = tonumber(kvPair.value)
|
local number = tonumber(kvPair.value)
|
||||||
if number and number > 0 then
|
if number and number > 0 then
|
||||||
farpzoneData.buildingKilos = number
|
farpzoneData.buildingKilos = number
|
||||||
|
|
||||||
-- check briefings
|
|
||||||
if env.mission.drawings and env.mission.drawings.layers then
|
|
||||||
for i, layer in pairs(env.mission.drawings.layers) do
|
|
||||||
if string.lower(layer.name) == "author" then
|
|
||||||
for key, layer_object in pairs(layer.objects) do
|
|
||||||
|
|
||||||
local vec2 = { x = layer_object.mapX, y = layer_object.mapY }
|
|
||||||
if triggerZone and Util.is2dPointInZone(vec2, triggerZone) then
|
|
||||||
if layer_object.name and Util.startswith(layer_object.name, "supplybriefing_", true) then
|
|
||||||
local description = layer_object.text
|
|
||||||
if description and description ~= "" then
|
|
||||||
farpzoneData.briefing = description
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
MissionEditorWarnings.Add("Buildable number for " .. farpZone .. " is invalid.")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ function BlueSam.New(database, logger, zoneName, spawnManager)
|
|||||||
|
|
||||||
local zone = DcsUtil.getZoneByName(zoneName)
|
local zone = DcsUtil.getZoneByName(zoneName)
|
||||||
if zone then
|
if zone then
|
||||||
BuildableZone.New(self, zone, self._buildableCrateKilos or 0, "SAM_CRATE", self._blueGroups, logger, database, blueSamData.briefing)
|
BuildableZone.New(self, zone, self._buildableCrateKilos or 0, "SAM_CRATE", self._blueGroups, logger, database)
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ function FarpZone.New(database, logger, zoneName, spawnManager)
|
|||||||
local zone = DcsUtil.getZoneByName(zoneName)
|
local zone = DcsUtil.getZoneByName(zoneName)
|
||||||
if zone then
|
if zone then
|
||||||
self._logger:debug("Creating Buildable zone: " .. zoneName .. " with " .. (farpData.buildingKilos or "nil") .. " kilos")
|
self._logger:debug("Creating Buildable zone: " .. zoneName .. " with " .. (farpData.buildingKilos or "nil") .. " kilos")
|
||||||
BuildableZone.New(self, zone, farpData.buildingKilos or 0, "FARP_CRATE", self._groups, logger, database, farpData.briefing)
|
BuildableZone.New(self, zone, farpData.buildingKilos or 0, "FARP_CRATE", self._groups, logger, database)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:Deactivate()
|
self:Deactivate()
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ BuildableZone.__index = BuildableZone
|
|||||||
---@param database Database
|
---@param database Database
|
||||||
---@param crateType SupplyType
|
---@param crateType SupplyType
|
||||||
---@param logger Logger
|
---@param logger Logger
|
||||||
---@param briefing string?
|
function BuildableZone:New(targetZone, kilosRequired, crateType, buildableGroups, logger, database)
|
||||||
function BuildableZone:New(targetZone, kilosRequired, crateType, buildableGroups, logger, database, briefing)
|
|
||||||
self._targetZone = targetZone
|
self._targetZone = targetZone
|
||||||
self._requiredKilos = kilosRequired or 0
|
self._requiredKilos = kilosRequired or 0
|
||||||
self._buildableGroups = buildableGroups or {}
|
self._buildableGroups = buildableGroups or {}
|
||||||
@@ -70,7 +69,7 @@ function BuildableZone:New(targetZone, kilosRequired, crateType, buildableGroup
|
|||||||
|
|
||||||
local noLandingZone = self:GetNoLandingZone()
|
local noLandingZone = self:GetNoLandingZone()
|
||||||
if kilosRequired and kilosRequired > 0 then
|
if kilosRequired and kilosRequired > 0 then
|
||||||
self._buildableMission = BuildableMission.new(database, logger, targetZone, noLandingZone, kilosRequired, crateType, briefing)
|
self._buildableMission = BuildableMission.new(database, logger, targetZone, noLandingZone, kilosRequired, crateType)
|
||||||
self._buildableMission:AddOnCrateDroppedOfListener(self)
|
self._buildableMission:AddOnCrateDroppedOfListener(self)
|
||||||
else
|
else
|
||||||
self._buildableMission = nil
|
self._buildableMission = nil
|
||||||
|
|||||||
@@ -21,18 +21,9 @@ local DrawingHelper = require("classes.stageClasses.drawings.helper.DrawingHelpe
|
|||||||
---@field private _dropOffZone SpearheadTriggerZone?
|
---@field private _dropOffZone SpearheadTriggerZone?
|
||||||
---@field private _noLandingZoneDrawing CustomDrawing?
|
---@field private _noLandingZoneDrawing CustomDrawing?
|
||||||
---@field private _dropOffZoneDrawing CustomDrawing?
|
---@field private _dropOffZoneDrawing CustomDrawing?
|
||||||
---@field private _briefing string?
|
|
||||||
local BuildableMission = {}
|
local BuildableMission = {}
|
||||||
BuildableMission.__index = BuildableMission
|
BuildableMission.__index = BuildableMission
|
||||||
|
|
||||||
|
|
||||||
local function getDefaultBriefing(siteType, coords)
|
|
||||||
return "We've dispatched forward units to find a proper spot for a new " .. siteType .. "." ..
|
|
||||||
"\nYou will need to drop off supplies so they can start building." ..
|
|
||||||
"\nThe coords are: " .. coords ..
|
|
||||||
"\n\n"
|
|
||||||
end
|
|
||||||
|
|
||||||
---@class OnCrateDroppedListener
|
---@class OnCrateDroppedListener
|
||||||
---@field OnCrateDroppedOff fun(self:OnCrateDroppedListener, mission:BuildableMission, kilos:number)
|
---@field OnCrateDroppedOff fun(self:OnCrateDroppedListener, mission:BuildableMission, kilos:number)
|
||||||
|
|
||||||
@@ -42,8 +33,7 @@ end
|
|||||||
---@param requiredCrateType SupplyType
|
---@param requiredCrateType SupplyType
|
||||||
---@param noLandingZone SpearheadTriggerZone?
|
---@param noLandingZone SpearheadTriggerZone?
|
||||||
---@param logger Logger
|
---@param logger Logger
|
||||||
---@param briefing string?
|
function BuildableMission.new(database, logger, targetZone, noLandingZone, requiredKilos, requiredCrateType)
|
||||||
function BuildableMission.new(database, logger, targetZone, noLandingZone, requiredKilos, requiredCrateType, briefing)
|
|
||||||
|
|
||||||
setmetatable(BuildableMission, Mission)
|
setmetatable(BuildableMission, Mission)
|
||||||
|
|
||||||
@@ -53,7 +43,6 @@ function BuildableMission.new(database, logger, targetZone, noLandingZone, requi
|
|||||||
self._database = database
|
self._database = database
|
||||||
self._requiredKilos = requiredKilos
|
self._requiredKilos = requiredKilos
|
||||||
self._droppedKilos = 0
|
self._droppedKilos = 0
|
||||||
self._briefing = briefing
|
|
||||||
|
|
||||||
self._noLandingZone = noLandingZone
|
self._noLandingZone = noLandingZone
|
||||||
|
|
||||||
@@ -75,13 +64,7 @@ function BuildableMission.new(database, logger, targetZone, noLandingZone, requi
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.code = tostring(database:GetNewMissionCode())
|
self.code = tostring(database:GetNewMissionCode())
|
||||||
|
self.name = "Resupply"
|
||||||
local splitTargetZoneName = Util.split_string(targetZone.name, "_")
|
|
||||||
if splitTargetZoneName and #splitTargetZoneName[3] then
|
|
||||||
self.name = splitTargetZoneName[3]
|
|
||||||
else
|
|
||||||
self.name = "Resupply"
|
|
||||||
end
|
|
||||||
|
|
||||||
local type = "site"
|
local type = "site"
|
||||||
if requiredCrateType == "SAM_CRATE" then
|
if requiredCrateType == "SAM_CRATE" then
|
||||||
@@ -98,6 +81,7 @@ function BuildableMission.new(database, logger, targetZone, noLandingZone, requi
|
|||||||
self._supplyUnitsTracker = SupplyUnitsTracker.getOrCreate()
|
self._supplyUnitsTracker = SupplyUnitsTracker.getOrCreate()
|
||||||
self._state = "NEW"
|
self._state = "NEW"
|
||||||
|
|
||||||
|
|
||||||
self.location = targetZone.location
|
self.location = targetZone.location
|
||||||
|
|
||||||
self.missionType = "LOGISTICS"
|
self.missionType = "LOGISTICS"
|
||||||
@@ -132,16 +116,11 @@ function BuildableMission:ShowBriefing(groupID)
|
|||||||
siteType = "airbase"
|
siteType = "airbase"
|
||||||
end
|
end
|
||||||
|
|
||||||
local briefingPart = self._briefing
|
|
||||||
if briefingPart then
|
|
||||||
briefingPart = Util.replaceString(briefingPart, "{{coords}}", coords)
|
|
||||||
else
|
|
||||||
briefingPart = getDefaultBriefing(siteType, coords)
|
|
||||||
end
|
|
||||||
|
|
||||||
local briefing = "Mission [" .. self.code .. "] " .. self.name ..
|
local briefing = "Mission [" .. self.code .. "] " .. self.name ..
|
||||||
"\n \n" ..
|
"\n \n" ..
|
||||||
briefingPart ..
|
"We've dispatched forward units to find a proper spot for a new " .. siteType .. "." ..
|
||||||
|
"\nYou will need to drop off supplies so they can start building." ..
|
||||||
|
"\nThe coords are: " .. coords ..
|
||||||
"\n\n" ..
|
"\n\n" ..
|
||||||
"\nKilos still required: " .. self._requiredKilos - self._droppedKilos ..
|
"\nKilos still required: " .. self._requiredKilos - self._droppedKilos ..
|
||||||
"\n\n" ..
|
"\n\n" ..
|
||||||
|
|||||||
Reference in New Issue
Block a user