Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	freeroam-extended/client/html/index.html
#	freeroam-extended/server/freeroam-extended/Commands.cs
#	freeroam-extended/server/freeroam-extended/EventHandler.cs
#	freeroam-extended/server/freeroam-extended/Freeroam-Extended.csproj
#	freeroam-extended/server/freeroam-extended/Misc.cs
  • Loading branch information
emcifuntik committed Sep 25, 2023
2 parents 731fb59 + 83de57f commit 0ed3555
Show file tree
Hide file tree
Showing 27 changed files with 1,493 additions and 1,063 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/cdn-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ jobs:
runs-on: ubuntu-20.04
if: "contains(github.event.head_commit.message, 'Bump version')"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: montudor/action-zip@v1
with:
args: 'zip -r ./resources.zip . -i ./*/* -x ./.*/*'
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 18.x
- run: npm i -D @altmp/upload-tool
- run: |
mkdir ./dist
mv ./resources.zip ./dist/
- run: npx alt-upload dist example-resources 1.0.0
env:
CI_UPLOAD_URL: ${{ secrets.CI_UPLOAD_URL }}
CI_DEPLOY_TOKEN: ${{ secrets.CI_DEPLOY_TOKEN }}
AWS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
CF_CACHE_PURGE_TOKEN: ${{ secrets.CF_CACHE_PURGE_TOKEN }}
CF_CACHE_ZONE_ID: ${{ secrets.CF_CACHE_ZONE_ID }}
CF_CACHE_PURGE_URL: ${{ secrets.CF_CACHE_PURGE_URL }}
VERSION: ${{ steps.version.outputs.VERSION }}
17 changes: 15 additions & 2 deletions chat/client/html/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,29 @@ let msgInputLine = null;

if (window.alt === undefined) {
window.alt = {
emit: () => {},
on: () => {},
emit: () => { },
on: () => { },
};
}

function escapeString(str) {
if (typeof str !== "string") return str;

return str
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
}

function colorify(text) {
let matches = [];
let m = null;
let curPos = 0;

text = escapeString(text);

do {
m = /\{[A-Fa-f0-9]{3}\}|\{[A-Fa-f0-9]{6}\}/g.exec(text.substr(curPos));

Expand Down
21 changes: 17 additions & 4 deletions freeroam-extended/client/html/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,25 @@ let msgInputLine = null;

if (window.alt === undefined) {
window.alt = {
emit: () => {},
on: () => {},
emit: () => { },
on: () => { },
};
}

function escapeString(str) {
if (typeof str !== "string") return str;

return str
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
}

function colorify(text) {
text = escapeString(text);

let matches = [];
let m = null;
let curPos = 0;
Expand Down Expand Up @@ -205,7 +218,7 @@ function setVoiceConnectionState(state) {
el.classList.remove(".voice-connection-status-connecting");

let stateText = "Disconnected"
switch(state) {
switch (state) {
case 0:
stateText = "Disconnected"
el.classList.add(".voice-connection-status-disconnected")
Expand All @@ -223,7 +236,7 @@ function setVoiceConnectionState(state) {
}

alt.on("addString", (text) => addString(colorify(text)));
alt.on("addMessage", (name, text) => addString("<b>" + name + ": </b>" + colorify(text)));
alt.on("addMessage", (name, text) => addString("<b>" + colorify(name) + ": </b>" + colorify(text)));
alt.on("openChat", openChat);
alt.on("closeChat", closeChat);
alt.on("updatePlayersOnline", updatePlayersOnline);
Expand Down
6 changes: 4 additions & 2 deletions freeroam-extended/client/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

<body>
<div class="stress-test-label">
Public Stress Test - v15. Powered by Avoro.eu
<div class="watermark">
Public Stress Test - v15
</div>
</div>
<div class="info">
<div class="players-online">
Expand Down Expand Up @@ -38,7 +40,7 @@

<li><span class="help-keys-command">/tp</span> &lt;1 to 22&gt; (Teleport)</li>
<li><span class="help-keys-command">/model</span> (Change your model between male and female)</li>
<li><span class="help-keys-command">/outfit [outfit_name]</span> (Change outfit to random or entered value)</li>
<li><span class="help-keys-command">/outfit</span> &lt;outfitName&gt; (Change outfit to random or entered value)</li>
<li><span class="help-keys-command">/veh</span> &lt;modelName&gt; (Spawn a vehicle)</li>
<li><span class="help-keys-command">/clearvehicles</span> (Clear your vehicles)</li>
<li><span class="help-keys-command">/tune</span> &lt;index> &lt;value&gt; (Tune vehicle)</li>
Expand Down
27 changes: 19 additions & 8 deletions freeroam-extended/client/html/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,7 @@ body {
}

.stress-test-label {
top: .2em;
left: 50%;
transform: translateX(-50%);
text-align: center;
width: 100%;
font-size: .8em;
position: absolute;
color: rgba(255, 255, 255, 0.628);
font-size: 16px;
}

.weapons-enabled > * {
Expand Down Expand Up @@ -307,3 +300,21 @@ body {
.streamed-in > * {

}

.watermark {
pointer-events: none;
position: fixed;
color: rgba(255, 255, 255, 0.75);
font-weight: 500;
padding: 1em;
font-size: 0.9em;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
z-index: 201;
opacity: 1;

font-family: 'Inter';
top: 0;
left: 50%;
transform: translateX(-50%);
text-align: center;
}
6 changes: 3 additions & 3 deletions freeroam-extended/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@altv/types-client": "^2.9.2",
"@altv/types-client": "^2.9.7",
"@altv/types-natives": "^1.5.4",
"@altv/types-server": "^2.9.5",
"@altv/types-shared": "^1.6.0",
"@altv/types-server": "^3.0.1",
"@altv/types-shared": "^1.6.5",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"altv-esbuild": "^0.4.3",
Expand Down
5 changes: 2 additions & 3 deletions freeroam-extended/client/src/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ view.on("chatloaded", () => {
})

view.on("chatmessage", (text: string) => {
if (playerData.chatState)
alt.emitServer("chat:message", text)
alt.emitServer("chat:message", text)

alt.toggleGameControls(true)
view.unfocus()
Expand All @@ -65,4 +64,4 @@ view.on("chatmessage", (text: string) => {
}, 200)
})

pushLine("<b>alt:V Multiplayer has started</b>")
pushLine("alt:V Multiplayer has started")
18 changes: 9 additions & 9 deletions freeroam-extended/client/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ alt.on("connectionComplete", () => {
}, 1000)
})

alt.on("localMetaChange", (key: string, newValue: any) => {
if (key == "godmode")
native.setEntityInvincible(alt.Player.local, newValue);
})

alt.onServer("airport_state", setWeaponsUsage)

alt.onServer("chat:message", chat.pushMessage)

alt.onServer("noclip", toggleNoclip)

alt.onServer("set_chat_state", (state: boolean) => {
playerData.chatState = state
})

alt.onServer("draw_dmzone", (
centerX: number,
centerY: number,
radius: number,
count: number,
radius: number
) => {
drawDMZone(centerX, centerY, radius, count)
drawDMZone(centerX, centerY, radius)
})

alt.onServer("announce", (header: string, body: string, time: number) => {
Expand Down Expand Up @@ -84,9 +84,9 @@ alt.on("keyup", (key) => {
})

alt.onServer("get_pos", () => {
const state = alt.getPermissionState(Permission.ClipboardAccess)
const state = alt.getPermissionState(Permission.CLIPBOARD_ACCESS)

if (state !== PermissionState.Allowed) {
if (state !== PermissionState.ALLOWED) {
alt.log("get_pos clipboard access is not allowed, state:", state)
return
}
Expand Down
17 changes: 6 additions & 11 deletions freeroam-extended/client/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,13 @@ export function drawDMZone(
centerX: number,
centerY: number,
radius: number,
count: number,
): void {
const steps = 2 * Math.PI / count
for (let i = 0; i < count; i++) {
const blipX = radius * Math.cos(steps * i) + centerX
const blipY = radius * Math.sin(steps * i) + centerY

const blip = new alt.PointBlip(blipX, blipY, 0)
blip.sprite = 310
blip.shortRange = true
native.setBlipHiddenOnLegend(blip.scriptID, true)
}
const blip = new alt.RadiusBlip(centerX, centerY, 0, radius);
blip.sprite = 10;
blip.shortRange = true;
blip.color = 5;
blip.isHiddenOnLegend = false;
blip.name = "DM zone";
}

let adminMessageEveryTick: number | null = null
Expand Down
24 changes: 12 additions & 12 deletions freeroam-extended/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
# yarn lockfile v1


"@altv/types-client@^2.9.2":
version "2.9.2"
resolved "https://registry.npmjs.org/@altv/types-client/-/types-client-2.9.2.tgz"
integrity sha512-LMGD1EBebN6BjFohhvPijR1Rq8BnU24IGdPb2It7NGFhHXxX/688XnlfX+tquIKlUkQPR8D54imNzZKBUG+BWA==
"@altv/types-client@^2.9.7":
version "2.9.7"
resolved "https://registry.yarnpkg.com/@altv/types-client/-/types-client-2.9.7.tgz#9082db1af8dbd7f04bc5f33e8ad67adcf6d9afba"
integrity sha512-VCuo56pzGLJedu6oiesAoKtFc7O5ZhAHH7W/WOX1dGU+PXWIM0B6OYbYuIOr6AOLwTCVTv+QpUrKgkN+38WCyA==

"@altv/types-natives@^1.5.4":
version "1.5.4"
resolved "https://registry.npmjs.org/@altv/types-natives/-/types-natives-1.5.4.tgz"
integrity sha512-N4jtJ4f8KFOCi0sxlVvTWF7I7Nz/ylq136sIJMpsHIcBWIlysWF6zdJFdBW5bkquDGWgY8aBYPQ4TU+ayQhukw==

"@altv/types-server@^2.9.5":
version "2.9.5"
resolved "https://registry.npmjs.org/@altv/types-server/-/types-server-2.9.5.tgz"
integrity sha512-Io4UkkJcbo9e6XqQd/dtQyQfOucko+vYmivQPJC/WemCCrQuMBWd4teqW3AUxcpT81psOnnJkHEVxfth386zmw==
"@altv/types-server@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@altv/types-server/-/types-server-3.0.1.tgz#83b41032cab2522cc62ffc6441c5fef08440229e"
integrity sha512-dVEGQUCj/IiFAw2oC1jQ3Iiacqtk5ciA2BNXJIETFcY2tz0uVaNMFAszR4B4xNBctWnXY12RDCJRrrvcxrPTMg==

"@altv/types-shared@^1.6.0":
version "1.6.0"
resolved "https://registry.npmjs.org/@altv/types-shared/-/types-shared-1.6.0.tgz"
integrity sha512-OURm829uVVxKFMPtWx/ZUR9K7cw7ZISCt5qdFzRO0MUdd+HAX3hymJqyy3euksTkxlBpGQXox432I0Sk02aurg==
"@altv/types-shared@^1.6.5":
version "1.6.5"
resolved "https://registry.yarnpkg.com/@altv/types-shared/-/types-shared-1.6.5.tgz#f3cd941a2706065e284cd0b053936fc0d0856024"
integrity sha512-gOil0Is/T26XCAJ+96H3qEjq7zLc9sG7vGp14UVZD09Vn0ClxUx3EG1xapJcobUuJHUd1uI24j1ODSzZ/pSMtA==

"@esbuild/[email protected]":
version "0.14.53"
Expand Down
Loading

0 comments on commit 0ed3555

Please sign in to comment.