Compare commits
10 Commits
37bfe48e84
...
latest
Author | SHA1 | Date | |
---|---|---|---|
5605760629
|
|||
44fc8e1fcf
|
|||
4f6f24952c
|
|||
52cb4e23bc
|
|||
bcbf1c79c1
|
|||
4d7e9553ea
|
|||
b2db3e7f12
|
|||
354e4e0907
|
|||
610e6f6356
|
|||
d25a7a6821
|
44
.woodpecker.yaml
Normal file
44
.woodpecker.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
steps:
|
||||
- name: build-release
|
||||
image: alpine
|
||||
secrets: [GITEA_TOKEN]
|
||||
when:
|
||||
- event: push
|
||||
- branch: main
|
||||
commands:
|
||||
- apk add openjdk21
|
||||
- apk add wget
|
||||
- apk add tar
|
||||
- wget https://github.com/demonnic/muddler/releases/download/0.13/muddle-shadow-0.13.tar
|
||||
- tar -xvf muddle-shadow-0.13.tar
|
||||
- mv muddle-shadow-0.13/lib/muddle-0.13-all.jar muddle.jar
|
||||
- java -jar muddle.jar
|
||||
|
||||
- name: deploy-build
|
||||
image: alpine
|
||||
when:
|
||||
- event: [push, tag]
|
||||
environment:
|
||||
GITEATKN:
|
||||
from_secret: GITEA_TOKEN
|
||||
GOTOKEN:
|
||||
from_secret: GOTIFY_TOKEN
|
||||
depends_on: build-release
|
||||
commands:
|
||||
- apk add tea
|
||||
- apk add wget
|
||||
- tea login add --name=temp --url=https://git.vertinext.com/ --token=$GITEATKN
|
||||
- tea releases create --asset "build/lotj-ui.mpackage" --asset "build/lotj-ui.xml" --tag latest --title "Latest Compiled Release"
|
||||
- wget "https://gotify.vertinext.com/message?token=$GOTOKEN" --post-data "title=${CI} - ${CI_REPO_NAME}&message=New release ${CI_COMMIT_TAG} built and deployed.&priority=0" -O /dev/null
|
||||
|
||||
- name: notify-on-branch-push
|
||||
image: alpine
|
||||
when:
|
||||
- event: push
|
||||
- status: [success, failure]
|
||||
environment:
|
||||
GOTOKEN:
|
||||
from_secret: GOTIFY_TOKEN
|
||||
commands:
|
||||
- apk add wget
|
||||
- wget "https://gotify.vertinext.com/message?token=$GOTOKEN" --post-data "title=${CI} - ${CI_REPO_NAME}&message=New pipeline running.&priority=0" -O /dev/null
|
@@ -344,11 +344,8 @@ function lotj.mapper.setup()
|
||||
loadMap(getMudletHomeDir().."/@PKGNAME@/starter-map.dat")
|
||||
end
|
||||
|
||||
lotj.mapper.loadShipData()
|
||||
|
||||
lotj.setup.registerEventHandler("sysDataSendRequest", lotj.mapper.handleSentCommand)
|
||||
lotj.setup.registerEventHandler("gmcp.Room.Info", lotj.mapper.onEnterRoom)
|
||||
lotj.setup.registerEventHandler("sysExitEvent", lotj.mapper.saveShipData)
|
||||
end
|
||||
|
||||
function lotj.mapper.teardown()
|
||||
@@ -356,28 +353,11 @@ function lotj.mapper.teardown()
|
||||
geyserMapper:hide()
|
||||
end
|
||||
|
||||
function lotj.mapper.loadShipData()
|
||||
local location = getMudletHomeDir() .. "/lotjmapper_ship.lua"
|
||||
lotj.mapper.shipLastRoom = lotj.mapper.shipLastRoom or {}
|
||||
if io.exists(location) then table.load(location, lotj.mapper.shipLastRoom) end
|
||||
end
|
||||
|
||||
function lotj.mapper.saveShipData()
|
||||
if lotj.mapper.shipLastRoom then
|
||||
local location = getMudletHomeDir() .. "/lotjmapper_ship.lua"
|
||||
table.save(location, lotj.mapper.shipLastRoom)
|
||||
end
|
||||
end
|
||||
|
||||
-- Track the most recent movement command so we know which direction we moved when automapping
|
||||
function lotj.mapper.handleSentCommand(event, cmd)
|
||||
-- If we're not mapping, store the last direction only for ships
|
||||
-- If we're not mapping, don't bother
|
||||
if lotj.mapper.mappingArea == nil then
|
||||
if not gmcp.Room.Info.planet then
|
||||
-- only store movement if we're actually on a ship
|
||||
lotj.mapper.shipMovement = lotj.mapper.shipMovement or {}
|
||||
table.insert(lotj.mapper.shipMovement, dirObj(trim(cmd)))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
@@ -400,32 +380,6 @@ function lotj.mapper.popMoveDir()
|
||||
return result
|
||||
end
|
||||
|
||||
-- Function used to handle virtual ship maps. This will process the room
|
||||
-- as a ship and attempt to position a player on an existing map of the same ship.
|
||||
function lotj.mapper.processCurrentRoomAsShip(roomData, movement)
|
||||
local roomVnum = table.keys(roomData)[1]
|
||||
local matchesMany = #table.keys(roomData)
|
||||
|
||||
if matchesMany == 1 then
|
||||
-- Only one room matched.
|
||||
lotj.mapper.shipLastRoom = {actual = gmcp.Room.Info.vnum, virtual = roomVnum}
|
||||
centerview(roomVnum)
|
||||
elseif matchesMany > 1 then
|
||||
-- Multiple matches
|
||||
if lotj.mapper.shipLastRoom ~= nil and lotj.mapper.shipLastRoom.actual == gmcp.Room.Info.vnum then
|
||||
-- This is likely a reboot. The last room and the current room match.
|
||||
centerview(lotj.mapper.shipLastRoom.virtual)
|
||||
elseif lotj.mapper.shipLastRoom ~= nil and movement then
|
||||
-- position based on movement
|
||||
local nextRoom = getRoomExits(lotj.mapper.shipLastRoom.virtual)
|
||||
if table.contains(nextRoom, movement.long) then
|
||||
lotj.mapper.shipLastRoom = {acutal = gmcp.Room.Info.vnum, virtual = nextRoom[movement.long]}
|
||||
centerview(lotj.mapper.shipLastRoom.virtual)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Function used to handle a room that we've moved into. This will use the data on
|
||||
-- lotj.mapper.current, compared with lotj.mapper.last, to potentially create a new room and
|
||||
@@ -434,25 +388,6 @@ function lotj.mapper.processCurrentRoom()
|
||||
local vnum = lotj.mapper.current.vnum
|
||||
local moveDir = lotj.mapper.popMoveDir()
|
||||
local room = lotj.mapper.getRoomByVnum(vnum)
|
||||
local searchData = searchRoom(gmcp.Room.Info.name, false, true)
|
||||
|
||||
-- Only virtualize ships when we aren't actively mapping
|
||||
if not gmcp.Room.Info.planet and lotj.mapper.mappingArea == nil then
|
||||
if room == nil then
|
||||
-- Don't virtualize if it's actually mapped
|
||||
if not table.is_empty(searchData) then
|
||||
if lotj.mapper.shipMovement then
|
||||
lotj.mapper.processCurrentRoomAsShip(searchData, table.remove(lotj.mapper.shipMovement,1))
|
||||
else
|
||||
lotj.mapper.processCurrentRoomAsShip(searchData, nil)
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
else
|
||||
-- if we're not virtualizing, make sure this is empty
|
||||
lotj.mapper.shipMovement = {}
|
||||
end
|
||||
|
||||
if lotj.mapper.mappingArea == nil and room == nil then
|
||||
lotj.mapper.logDebug("Room not found, but mapper not running.")
|
||||
|
Reference in New Issue
Block a user