Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit 8a556f8

Browse files
author
Flowing
committed
prepare for footstep radar
1 parent a3eb00e commit 8a556f8

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/echoradar.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import mirvpgl from './mirvpgl';
2+
3+
var pgl = new mirvpgl(31337, "/radar");
4+
5+
pgl.emitter.on('gameEvent',(data:any) => {
6+
var obj = JSON.parse(data)
7+
if (obj.name == "player_footstep") {
8+
// TODO...
9+
}
10+
})

src/example.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var pgl = new mirvpgl(31337,"/mirv");
77
// mirv_pgl url "ws://127.0.0.1:31337/mirv"
88

99
// this tells you what you received, e.g. "dataStop","CAM" etc.
10-
pgl.emitter.on('cmd',(cmd) => {
10+
pgl.emitter.on('cmd',(cmd:string) => {
1111
console.log(`CMD : ${cmd}`)
1212
})
1313

@@ -25,13 +25,13 @@ pgl.emitter.on('map',(map:string) => {
2525
// fires each camera pos change
2626
// To receive cam info, Enter below
2727
// mirv_pgl datastart;
28-
pgl.emitter.on('cam',(data) => {
28+
pgl.emitter.on('cam',(data:any) => {
2929
console.log(data)
3030
})
3131

3232
// fires if you chose version3 mirv_pgl
3333
// mirv_pgl start 3
34-
pgl.emitter.on('gameEvent',(data) => {
34+
pgl.emitter.on('gameEvent',(data:any) => {
3535
console.log(JSON.parse(data))
3636
})
3737

@@ -41,7 +41,7 @@ pgl.emitter.on('close',() => {
4141
})
4242

4343
// error handling
44-
pgl.emitter.on('error',(e) => {
44+
pgl.emitter.on('error',(e:any) => {
4545
console.log("CONNECTION ERROR!")
4646
console.error(e)
4747
})

0 commit comments

Comments
 (0)