-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps-dev): bump elliptic from 6.5.4 to 6.5.7 in /voice-ui
- Loading branch information
1 parent
b4c1481
commit 861bde3
Showing
25 changed files
with
6,081 additions
and
5,087 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
server-data/resources/[phone]/pma-voice/.github/CHANGELOG.md
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,13 @@ | ||
# Changelog | ||
|
||
<!-- ⚠⚠ Please follow the format provided ⚠⚠ --> | ||
<!-- Always use "1." at the start instead of "2. " or "X. " as GitHub will auto renumber everything. --> | ||
<!-- Use the following format below --> | ||
<!-- 1. [Changed Area] Title of changes - @github username --> | ||
|
||
1. [voice-ui/pnpm-lock.yaml]: chore: (deps-dev) bump url-parse + bump minimatch + bump terser @bitpredator | ||
2. [client/module/phone.lua]: fix(phone): fix getting re-added to radios if perfectly hit | ||
3. [client/init/main.lua]: fix(radio): fix oversight with function call | ||
4. [workflows/dependency-review.yml]: chore(deps): bump actions/checkout from 3 to 4 | ||
5. [voice-ui/pnpm-lock.yaml]: chore(deps-dev): bump follow-redirects in /voice-ui | ||
6. [voice-ui/pnpm-lock.yaml]: chore(deps-dev): bump browserify-sign from 4.2.1 to 4.2.2 in /voice-ui |
32 changes: 32 additions & 0 deletions
32
server-data/resources/[phone]/pma-voice/.github/ISSUE_TEMPLATE/bug_report.md
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,32 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Did you read the README?**: There's a lot of information in the README, if you ask a question that is answered in the README, you will be told to "Read the README" | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See an error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Server Info:** | ||
- Server Version: [e.g. 3456] | ||
- Client Version: [e.g. production|canary] | ||
- Client Build: [e.g. b1604|b2060|b2189|b2372] | ||
- Game: [e.g. FiveM|RedM] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
20 changes: 20 additions & 0 deletions
20
server-data/resources/[phone]/pma-voice/.github/dependabot.yml
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,20 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: '/' | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 99 | ||
labels: | ||
- 'dependencies' | ||
|
||
# Dependencies npm | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'daily' | ||
# Disable version updates for npm dependencies | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates#overriding-the-default-behavior-with-a-configuration-file | ||
open-pull-requests-limit: 99 | ||
labels: | ||
- 'dependencies' |
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,18 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 30 | ||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 7 | ||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
- todo | ||
# Label to use when marking an issue as stale | ||
staleLabel: wontfix | ||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false |
20 changes: 20 additions & 0 deletions
20
server-data/resources/[phone]/pma-voice/.github/workflows/dependency-review.yml
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,20 @@ | ||
# Dependency Review Action | ||
# | ||
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. | ||
# | ||
# Source repository: https://github.com/actions/dependency-review-action | ||
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement | ||
name: 'Dependency Review' | ||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
dependency-review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout Repository' | ||
uses: actions/checkout@v4 | ||
- name: 'Dependency Review' | ||
uses: actions/dependency-review-action@v4 |
122 changes: 59 additions & 63 deletions
122
server-data/resources/[phone]/pma-voice/client/commands.lua
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,87 +1,83 @@ | ||
local wasProximityDisabledFromOverride = false | ||
disableProximityCycle = false | ||
RegisterCommand("setvoiceintent", function(source, args) | ||
if GetConvarInt("voice_allowSetIntent", 1) == 1 then | ||
local intent = args[1] | ||
if intent == "speech" then | ||
MumbleSetAudioInputIntent(`speech`) | ||
elseif intent == "music" then | ||
MumbleSetAudioInputIntent(`music`) | ||
end | ||
LocalPlayer.state:set("voiceIntent", intent, true) | ||
end | ||
RegisterCommand('setvoiceintent', function(source, args) | ||
if GetConvarInt('voice_allowSetIntent', 1) == 1 then | ||
local intent = args[1] | ||
if intent == 'speech' then | ||
MumbleSetAudioInputIntent(`speech`) | ||
elseif intent == 'music' then | ||
MumbleSetAudioInputIntent(`music`) | ||
end | ||
LocalPlayer.state:set('voiceIntent', intent, true) | ||
end | ||
end) | ||
TriggerEvent("chat:addSuggestion", "/setvoiceintent", "Sets the players voice intent", { | ||
{ | ||
name = "intent", | ||
help = "speech is default and enables noise suppression & high pass filter, music disables both of these.", | ||
}, | ||
TriggerEvent('chat:addSuggestion', '/setvoiceintent', 'Sets the players voice intent', { | ||
{ | ||
name = "intent", | ||
help = "speech is default and enables noise suppression & high pass filter, music disables both of these." | ||
}, | ||
}) | ||
|
||
-- TODO: Better implementation of this? | ||
RegisterCommand("vol", function(_, args) | ||
if not args[1] then | ||
return | ||
end | ||
setVolume(tonumber(args[1])) | ||
RegisterCommand('vol', function(_, args) | ||
if not args[1] then return end | ||
setVolume(tonumber(args[1])) | ||
end) | ||
TriggerEvent("chat:addSuggestion", "/vol", "Sets the radio/phone volume", { | ||
{ name = "volume", help = "A range between 1-100 on how loud you want them to be" }, | ||
TriggerEvent('chat:addSuggestion', '/vol', 'Sets the radio/phone volume', { | ||
{ name = "volume", help = "A range between 1-100 on how loud you want them to be" }, | ||
}) | ||
|
||
exports("setAllowProximityCycleState", function(state) | ||
type_check({ state, "boolean" }) | ||
disableProximityCycle = state | ||
exports('setAllowProximityCycleState', function(state) | ||
type_check({ state, "boolean" }) | ||
disableProximityCycle = state | ||
end) | ||
|
||
function setProximityState(proximityRange, isCustom) | ||
local voiceModeData = Cfg.voiceModes[mode] | ||
MumbleSetTalkerProximity(proximityRange + 0.0) | ||
LocalPlayer.state:set("proximity", { | ||
index = mode, | ||
distance = proximityRange, | ||
mode = isCustom and "Custom" or voiceModeData[2], | ||
}, true) | ||
sendUIMessage({ | ||
-- JS expects this value to be - 1, "custom" voice is on the last index | ||
voiceMode = isCustom and #Cfg.voiceModes or mode - 1, | ||
}) | ||
local voiceModeData = Cfg.voiceModes[mode] | ||
MumbleSetTalkerProximity(proximityRange + 0.0) | ||
LocalPlayer.state:set('proximity', { | ||
index = mode, | ||
distance = proximityRange, | ||
mode = isCustom and "Custom" or voiceModeData[2], | ||
}, true) | ||
sendUIMessage({ | ||
-- JS expects this value to be - 1, "custom" voice is on the last index | ||
voiceMode = isCustom and #Cfg.voiceModes or mode - 1 | ||
}) | ||
end | ||
|
||
exports("overrideProximityRange", function(range, disableCycle) | ||
type_check({ range, "number" }) | ||
setProximityState(range, true) | ||
if disableCycle then | ||
disableProximityCycle = true | ||
wasProximityDisabledFromOverride = true | ||
end | ||
type_check({ range, "number" }) | ||
setProximityState(range, true) | ||
if disableCycle then | ||
disableProximityCycle = true | ||
wasProximityDisabledFromOverride = true | ||
end | ||
end) | ||
|
||
exports("clearProximityOverride", function() | ||
local voiceModeData = Cfg.voiceModes[mode] | ||
setProximityState(voiceModeData[1], false) | ||
if wasProximityDisabledFromOverride then | ||
disableProximityCycle = false | ||
end | ||
local voiceModeData = Cfg.voiceModes[mode] | ||
setProximityState(voiceModeData[1], false) | ||
if wasProximityDisabledFromOverride then | ||
disableProximityCycle = false | ||
end | ||
end) | ||
|
||
RegisterCommand("cycleproximity", function() | ||
-- Proximity is either disabled, or manually overwritten. | ||
if GetConvarInt("voice_enableProximityCycle", 1) ~= 1 or disableProximityCycle then | ||
return | ||
end | ||
local newMode = mode + 1 | ||
RegisterCommand('cycleproximity', function() | ||
-- Proximity is either disabled, or manually overwritten. | ||
if GetConvarInt('voice_enableProximityCycle', 1) ~= 1 or disableProximityCycle then return end | ||
local newMode = mode + 1 | ||
|
||
-- If we're within the range of our voice modes, allow the increase, otherwise reset to the first state | ||
if newMode <= #Cfg.voiceModes then | ||
mode = newMode | ||
else | ||
mode = 1 | ||
end | ||
-- If we're within the range of our voice modes, allow the increase, otherwise reset to the first state | ||
if newMode <= #Cfg.voiceModes then | ||
mode = newMode | ||
else | ||
mode = 1 | ||
end | ||
|
||
setProximityState(Cfg.voiceModes[mode][1], false) | ||
TriggerEvent("pma-voice:setTalkingMode", mode) | ||
setProximityState(Cfg.voiceModes[mode][1], false) | ||
TriggerEvent('pma-voice:setTalkingMode', mode) | ||
end, false) | ||
if gameVersion == "fivem" then | ||
RegisterKeyMapping("cycleproximity", "Cycle Proximity", "keyboard", GetConvar("voice_defaultCycle", "F11")) | ||
if gameVersion == 'fivem' then | ||
RegisterKeyMapping('cycleproximity', 'Cycle Proximity', 'keyboard', GetConvar('voice_defaultCycle', 'F11')) | ||
end |
56 changes: 29 additions & 27 deletions
56
server-data/resources/[phone]/pma-voice/client/events.lua
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,42 +1,44 @@ | ||
function handleInitialState() | ||
local voiceModeData = Cfg.voiceModes[mode] | ||
MumbleSetTalkerProximity(voiceModeData[1] + 0.0) | ||
MumbleClearVoiceTarget(voiceTarget) | ||
MumbleSetVoiceTarget(voiceTarget) | ||
MumbleSetVoiceChannel(LocalPlayer.state.assignedChannel) | ||
local voiceModeData = Cfg.voiceModes[mode] | ||
MumbleSetTalkerProximity(voiceModeData[1] + 0.0) | ||
MumbleClearVoiceTarget(voiceTarget) | ||
MumbleSetVoiceTarget(voiceTarget) | ||
MumbleSetVoiceChannel(LocalPlayer.state.assignedChannel) | ||
|
||
while MumbleGetVoiceChannelFromServerId(playerServerId) ~= LocalPlayer.state.assignedChannel do | ||
Wait(250) | ||
MumbleSetVoiceChannel(LocalPlayer.state.assignedChannel) | ||
end | ||
while MumbleGetVoiceChannelFromServerId(playerServerId) ~= LocalPlayer.state.assignedChannel do | ||
Wait(250) | ||
MumbleSetVoiceChannel(LocalPlayer.state.assignedChannel) | ||
end | ||
|
||
MumbleAddVoiceTargetChannel(voiceTarget, LocalPlayer.state.assignedChannel) | ||
MumbleAddVoiceTargetChannel(voiceTarget, LocalPlayer.state.assignedChannel) | ||
|
||
addNearbyPlayers() | ||
addNearbyPlayers() | ||
end | ||
|
||
AddEventHandler("mumbleConnected", function(address, isReconnecting) | ||
logger.info("Connected to mumble server with address of %s, is this a reconnect %s", GetConvarInt("voice_hideEndpoints", 1) == 1 and "HIDDEN" or address, isReconnecting) | ||
AddEventHandler('mumbleConnected', function(address, isReconnecting) | ||
logger.info('Connected to mumble server with address of %s, is this a reconnect %s', | ||
GetConvarInt('voice_hideEndpoints', 1) == 1 and 'HIDDEN' or address, isReconnecting) | ||
|
||
logger.log("Connecting to mumble, setting targets.") | ||
-- don't try to set channel instantly, we're still getting data. | ||
local voiceModeData = Cfg.voiceModes[mode] | ||
LocalPlayer.state:set("proximity", { | ||
index = mode, | ||
distance = voiceModeData[1], | ||
mode = voiceModeData[2], | ||
}, true) | ||
logger.log('Connecting to mumble, setting targets.') | ||
-- don't try to set channel instantly, we're still getting data. | ||
local voiceModeData = Cfg.voiceModes[mode] | ||
LocalPlayer.state:set('proximity', { | ||
index = mode, | ||
distance = voiceModeData[1], | ||
mode = voiceModeData[2], | ||
}, true) | ||
|
||
handleInitialState() | ||
handleInitialState() | ||
|
||
logger.log("Finished connection logic") | ||
logger.log('Finished connection logic') | ||
end) | ||
|
||
AddEventHandler("mumbleDisconnected", function(address) | ||
logger.info("Disconnected from mumble server with address of %s", GetConvarInt("voice_hideEndpoints", 1) == 1 and "HIDDEN" or address) | ||
AddEventHandler('mumbleDisconnected', function(address) | ||
logger.info('Disconnected from mumble server with address of %s', | ||
GetConvarInt('voice_hideEndpoints', 1) == 1 and 'HIDDEN' or address) | ||
end) | ||
|
||
-- TODO: Convert the last Cfg to a Convar, while still keeping it simple. | ||
AddEventHandler("pma-voice:settingsCallback", function(cb) | ||
cb(Cfg) | ||
AddEventHandler('pma-voice:settingsCallback', function(cb) | ||
cb(Cfg) | ||
end) |
Oops, something went wrong.