Skip to content

Commit 3ce9ee3

Browse files
authored
Merge pull request #118 from boltgolt/dev
version 1.6.0
2 parents a6c31f5 + 3602329 commit 3ce9ee3

File tree

23 files changed

+182
-57
lines changed

23 files changed

+182
-57
lines changed

src/config/config.json5

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// without making changes here. This makes your config a lot more portable.
55

66
{
7-
"_version": "1.5.2",
7+
"_version": "1.6.0",
88

99
// Settings related to the Boltobserv window
1010
"window": {
@@ -73,6 +73,11 @@
7373
// Show Boltobserv, Simple Radar and Lexogrine logos
7474
"showLogos": true,
7575

76+
// When the bomb is planted, show how far away players have to be to survive the blast, options are:
77+
// "never" disable this feature
78+
// "active" shown when bomb countdown under 10s, distance every player has to run to survive
79+
"showBlastRadius": "active",
80+
7681
// Show the player name on the dot, options are:
7782
// "never" only show the spec number (observer slot)
7883
// "both" show the name of the player under the dot
@@ -137,7 +142,7 @@
137142
"minZoom": 1.3
138143
},
139144

140-
// Settings related to the CSGO game
145+
// Settings related to the game client
141146
"game": {
142147
// Seconds of inactivity before considering a connection to the game client as lost
143148
// Set to -1 to never timeout
@@ -146,7 +151,7 @@
146151
// The port GSI will try to connect to
147152
"networkPort": 36363,
148153

149-
// Tries to detect the CSGO game on the machine and prompts to install the CFG file if it hasn't already
154+
// Tries to detect the game files on the machine and prompts to install the CFG file if it hasn't already
150155
"installCfg": true,
151156

152157
// The hostname for the GSI server to listen on

src/css/map.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ body {
3636
transition: opacity .4s;
3737
}
3838

39-
#smokes, #entities, #flashbangs, #projectiles, #trails {
39+
#blasts, #smokes, #entities, #flashbangs, #projectiles, #trails {
4040
position: absolute;
4141
height: 100%;
4242
width: 100%;
@@ -220,6 +220,25 @@ div.label span {
220220
}
221221
}
222222

223+
#blasts > svg {
224+
position: absolute;
225+
height: 100%;
226+
width: 100%;
227+
stroke: rgba(255, 255, 255, 0.4);
228+
stroke-width: .5px;
229+
stroke-linecap: round;
230+
}
231+
232+
#blasts > div {
233+
position: absolute;
234+
border-radius: 100%;
235+
opacity: .6;
236+
transform-origin: center;
237+
overflow: hidden;
238+
border: .6vmin solid #757575;
239+
transform: translate(-50%, 50%);
240+
}
241+
223242
#smokes > div {
224243
position: absolute;
225244
border-radius: 100%;

src/gamestate_integration_boltobserv.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"Boltobserv integration v3 | https://github.com/boltgolt/boltobserv"
1+
"Boltobserv integration v4 | https://github.com/boltgolt/boltobserv"
22
{
33
"uri" "http://localhost:36363"
44
"timeout" "0.1"
@@ -12,6 +12,7 @@
1212
"bomb" "1"
1313
"round" "1"
1414
"player_id" "1"
15+
"player_state" "1"
1516
"allplayers_id" "1"
1617
"allplayers_state" "1"
1718
"allplayers_weapons" "1"

src/gsi.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ function handleRequest(req, res) {
2525

2626
// On end if packet data
2727
req.on("end", () => {
28-
// Send back empty response immediatly
28+
// Send back empty response immediately
2929
res.end("")
3030

31-
// Patch incomming JSON to convert large integers to strings
31+
// Patch incoming JSON to convert large integers to strings
3232
body = body.replace(/"owner": ([0-9]{10,})/g, '"owner": "$1"')
3333
// Parse JSON packet
3434
let game = JSON.parse(body)
@@ -38,10 +38,8 @@ function handleRequest(req, res) {
3838
status: "up"
3939
}
4040

41-
if (game.player) {
42-
if (game.player.activity != "playing") {
43-
connObject.player = game.player.name
44-
}
41+
if (game.player && game.player.activity != "playing") {
42+
connObject.player = game.player.name
4543
}
4644

4745
process.send({
@@ -105,6 +103,7 @@ function handleRequest(req, res) {
105103
name: player.name,
106104
team: player.team,
107105
health: player.state.health,
106+
armor: player.state.armor,
108107
active: isActive,
109108
flashed: player.state.flashed,
110109
bomb: hasBomb,
@@ -242,6 +241,7 @@ function handleRequest(req, res) {
242241
data: {
243242
state: game.bomb.state,
244243
player: game.bomb.player,
244+
countdown: game.bomb.countdown ? parseFloat(game.bomb.countdown) : Infinity,
245245
position: {
246246
x: parseFloat(pos[0]),
247247
y: parseFloat(pos[1]),

src/html/map.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</div>
1919

2020
<!-- Lowest layer: Area of effect -->
21+
<div id="blasts"></div>
2122
<div id="smokes"></div>
2223
<div id="infernos"></div>
2324
<div id="flashbangs"></div>

src/keybinds.js

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,33 @@ function executeAction(subject, command) {
3535
key: subject,
3636
value: effects[subject]
3737
}
38+
3839
})
3940

41+
4042
switch (subject) {
4143
case "window.fullscreen":
4244
win.setFullScreen(effects[subject])
4345
break
4446
case "window.mousePassthrough":
4547
win.setIgnoreMouseEvents(effects[subject])
4648
break
49+
4750
}
4851
}
4952

5053

5154
function parseBind(binds) {
52-
function nextBind(binds) {
53-
if (binds.length > 0) parseBind(binds)
55+
// If binds is not an array, convert it to one
56+
if (!Array.isArray(binds)) {
57+
binds = [binds]
5458
}
5559

56-
let bind = binds
60+
// If there are no more binds to process, return
61+
if (binds.length === 0) return
5762

58-
if (typeof binds == "object") {
59-
bind = binds[0]
60-
binds.shift()
61-
}
63+
// Get the current bind and remove it from the array
64+
let bind = binds.shift()
6265

6366
let actionRegex = /([\w\.]*?)\s?->\s?(\w*)/
6467
let functionRegex = /([\w\.]*?)\((.*?)\)/
@@ -67,6 +70,7 @@ function parseBind(binds) {
6770
let parsed = actionRegex.exec(bind)
6871
executeAction(parsed[1], parsed[2])
6972

73+
// Process remaining binds
7074
if (binds.length > 0) parseBind(binds)
7175
}
7276
else if (bind.match(functionRegex)) {
@@ -94,22 +98,29 @@ function parseBind(binds) {
9498
break
9599

96100
case "window.width":
97-
win.setSize(Math.min(0, argument), win.getSize()[1])
98-
return nextBind(binds)
101+
win.setSize(Math.max(0, parseInt(argument)), win.getSize()[1])
102+
if (binds.length > 0) parseBind(binds)
103+
break
104+
99105
case "window.height":
100-
win.setSize(win.getSize()[0], Math.min(0, argument))
101-
return nextBind(binds)
106+
win.setSize(win.getSize()[0], Math.max(0, parseInt(argument)))
107+
if (binds.length > 0) parseBind(binds)
108+
break
102109

103110
case "window.left":
104111
win.setBounds({x: parseInt(argument)})
105-
return nextBind(binds)
112+
if (binds.length > 0) parseBind(binds)
113+
break
114+
106115
case "window.top":
107116
win.setBounds({y: parseInt(argument)})
108-
return nextBind(binds)
117+
if (binds.length > 0) parseBind(binds)
118+
break
109119

110120
default:
111-
console.warn(`WARNING: Unkown keybind function in keybind "${bind}"`)
112-
return
121+
console.warn(`WARNING: Unknown keybind function in keybind "${bind}"`)
122+
if (binds.length > 0) parseBind(binds)
123+
break
113124
}
114125
}
115126
}

src/maps/de_ancient/meta.json5

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"version": {
33
// The version of this meta file
4-
"radar": 2,
4+
"radar": 3,
55
// The object format version this file is using
6-
"format": 3
6+
"format": 4
77
},
88

99
// The amount of in-game units per pixel of the 1024px radar image
@@ -28,5 +28,9 @@
2828
"zRange": {
2929
"min": -95,
3030
"max": 220
31-
}
31+
},
32+
33+
// Distance in units from bomb explosion that a player can survive, depending on health
34+
// The first value is the distance at 1 health, the second at 5 health, then 10, etc
35+
"survivableDistance": [615, 574, 549, 527, 507, 490, 473, 458, 443, 429, 398, 403, 391, 380, 368, 358, 347, 337, 327, 317, 320]
3236
}

src/maps/de_anubis/meta.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// The version of this meta file
44
"radar": 1,
55
// The object format version this file is using
6-
"format": 3
6+
"format": 4
77
},
88

99
// The amount of in-game units per pixel of the 1024px radar image

src/maps/de_cache/meta.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// The version of this meta file
44
"radar": 2,
55
// The object format version this file is using
6-
"format": 3
6+
"format": 4
77
},
88

99
// The amount of in-game units per pixel of the 1024px radar image

src/maps/de_dust2/meta.json5

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"version": {
33
// The version of this meta file
4-
"radar": 3,
4+
"radar": 4,
55
// The object format version this file is using
6-
"format": 3
6+
"format": 4
77
},
88

99
// The amount of in-game units per pixel of the 1024px radar image
@@ -28,5 +28,9 @@
2828
"zRange": {
2929
"min": -50,
3030
"max": 185
31-
}
31+
},
32+
33+
// Distance in units from bomb explosion that a player can survive, depending on health
34+
// The first value is the distance at 1 health, the second at 5 health, then 10, etc
35+
"survivableDistance": [460, 424, 402, 383, 366, 350, 336, 323, 310, 298, 270, 276, 265, 255, 245, 236, 227, 218, 209, 201, 205]
3236
}

0 commit comments

Comments
 (0)