forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
34 changed files
with
1,247 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
name: Analysis - Qodana | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
@@ -20,9 +21,41 @@ jobs: | |
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
|
||
- name: 'Qodana Scan' | ||
uses: JetBrains/[email protected] | ||
- name: Install Linux Dependencies | ||
run: > | ||
sudo apt-get update && sudo apt-get install ccache | ||
linux-headers-$(uname -r) | ||
- name: CCache | ||
uses: hendrikmuhs/ccache-action@main | ||
with: | ||
max-size: "1G" | ||
key: ccache-qodana | ||
|
||
- name: Restore artifacts and install vcpkg | ||
id: vcpkg-step | ||
run: | | ||
vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') | ||
echo "vcpkg commit ID: $vcpkgCommitId" | ||
echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> $GITHUB_ENV | ||
- name: Get vcpkg commit id from vcpkg.json | ||
uses: lukka/run-vcpkg@main | ||
with: | ||
args: --compile-commands,./build/linux-debug/compile_commands.json,--baseline,./qodana.sarif.json | ||
env: | ||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} | ||
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git" | ||
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }} | ||
|
||
- name: Get latest CMake and ninja | ||
uses: lukka/get-cmake@main | ||
|
||
- name: Run CMake | ||
uses: lukka/run-cmake@main | ||
with: | ||
configurePreset: linux-debug | ||
|
||
- name: Qodana Scan | ||
run: | | ||
docker run \ | ||
-v $(pwd):/data/project/ \ | ||
-v $(pwd):$(pwd) \ | ||
-e QODANA_TOKEN="${{ secrets.QODANA_TOKEN }}" \ | ||
jetbrains/qodana-clang:2024.1-eap \ | ||
--compile-commands ./build/linux-debug/compile_commands.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
local function convertIconsToBitValue(iconList) | ||
local bitObj = NewBit(0) | ||
for icon in string.gmatch(iconList, "%d+") do | ||
icon = tonumber(icon) | ||
if icon then | ||
local flag = bit.lshift(1, icon - 1) | ||
bitObj:updateFlag(flag) | ||
end | ||
end | ||
return bitObj:getNumber() | ||
end | ||
|
||
function Player:sendNormalIcons(icons) | ||
local msg = NetworkMessage() | ||
msg:addByte(0xA2) | ||
msg:addU32(icons) | ||
msg:addByte(0) | ||
msg:sendToPlayer(self) | ||
end | ||
|
||
function Player:sendIconBakragore(specialIcon) | ||
local msg = NetworkMessage() | ||
msg:addByte(0xA3) | ||
msg:addU32(specialIcon) | ||
msg:addByte(0) | ||
msg:sendToPlayer(self) | ||
end | ||
|
||
--[[ | ||
Usage (normal icons): | ||
/testicon 1 | ||
/testicon 2 | ||
/testicon 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 | ||
Usage (special icons): | ||
/testicon special, 1 | ||
/testicon special, 2 | ||
]] | ||
|
||
local testIcons = TalkAction("/testicon") | ||
|
||
function testIcons.onSay(player, words, param) | ||
if param == "" then | ||
player:sendCancelMessage("Icon required.") | ||
logger.error("[testIcons.onSay] - Icon number's required") | ||
return true | ||
end | ||
|
||
local split = param:split(",") | ||
local firstParam = split[1]:trim():lower() | ||
|
||
if firstParam == "special" and tonumber(split[2]) then | ||
local specialIcon = tonumber(split[2]) | ||
player:sendIconBakragore(specialIcon) | ||
else | ||
local icons = convertIconsToBitValue(param) | ||
player:sendNormalIcons(icons) | ||
end | ||
|
||
return true | ||
end | ||
|
||
testIcons:separator(" ") | ||
testIcons:setDescription("[Usage]: /testicon {icon1}, {icon2}, {icon3}, ... [Usage2]: /testicon special, {icon}") | ||
testIcons:groupType("god") | ||
testIcons:register() | ||
|
||
local condition = Condition(CONDITION_BAKRAGORE, CONDITIONID_DEFAULT, 0, true) | ||
|
||
local bakragoreIcon = TalkAction("/bakragoreicon") | ||
|
||
function bakragoreIcon.onSay(player, words, param) | ||
if param == "" then | ||
player:sendCancelMessage("Icon number required.") | ||
logger.error("[addBakragoreIcon.onSay] - Icon number's required") | ||
return true | ||
end | ||
|
||
if param == "remove" then | ||
for i = 1, 10 do | ||
if player:hasCondition(CONDITION_BAKRAGORE, i) then | ||
player:removeCondition(CONDITION_BAKRAGORE, i) | ||
end | ||
end | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Removed all Bakragore icons.") | ||
return true | ||
end | ||
|
||
local numParam = tonumber(param) | ||
if numParam then | ||
if player:hasCondition(CONDITION_BAKRAGORE, numParam) then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already have the Bakragore icon.") | ||
return true | ||
end | ||
|
||
condition:setParameter(CONDITION_PARAM_SUBID, numParam) | ||
condition:setParameter(CONDITION_PARAM_TICKS, -1) | ||
player:addCondition(condition) | ||
|
||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Added Bakragore icon with ID: " .. numParam) | ||
end | ||
|
||
return true | ||
end | ||
|
||
bakragoreIcon:separator(" ") | ||
bakragoreIcon:groupType("god") | ||
bakragoreIcon:register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.