Skip to content

Commit

Permalink
removing analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
rallieon committed Sep 6, 2023
1 parent dbfd810 commit 3f7f997
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 51 deletions.
64 changes: 32 additions & 32 deletions lib/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ export class ActiveClient<
this.timekeepingSimulations.stepper.receiveCommand(timestampCommand)
net.broadcastMessage(COMMAND_MESSAGE_TYPE_ID, timestampCommand)

if (process.env['SNOWGLOBE_DEBUG']) {
this.analytics.store(
this.simulatingTimestamp(),
AnalyticType.issuecommand,
JSON.stringify(timestampCommand)
)
}
// if (process.env['SNOWGLOBE_DEBUG']) {
// this.analytics.store(
// this.simulatingTimestamp(),
// AnalyticType.issuecommand,
// JSON.stringify(timestampCommand)
// )
// }
}

bufferedCommands() {
Expand Down Expand Up @@ -235,38 +235,38 @@ export class ActiveClient<
throw Error('Clock should be synced')
}

if (process.env['SNOWGLOBE_DEBUG']) {
this.analytics.store(
this.simulatingTimestamp(),
AnalyticType.recvcommand,
JSON.stringify(recvCommand)
)
// if (process.env['SNOWGLOBE_DEBUG']) {
// this.analytics.store(
// this.simulatingTimestamp(),
// AnalyticType.recvcommand,
// JSON.stringify(recvCommand)
// )

this.analytics.store(
this.simulatingTimestamp(),
AnalyticType.snapshotapplied,
JSON.stringify(this.timekeepingSimulations.stepper.queuedSnapshot)
)
}
// this.analytics.store(
// this.simulatingTimestamp(),
// AnalyticType.snapshotapplied,
// JSON.stringify(this.timekeepingSimulations.stepper.queuedSnapshot)
// )
// }

this.timekeepingSimulations.update(
deltaSeconds,
timeSinceSync + this.timekeepingSimulations.config.serverTimeDelayLatency
)

if (process.env['SNOWGLOBE_DEBUG']) {
this.analytics.store(
this.lastCompletedTimestamp(),
AnalyticType.currentworld,
JSON.stringify(
this.worldSimulations()
.get()
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
.new.getWorld().players
)
)
}
// if (process.env['SNOWGLOBE_DEBUG']) {
// this.analytics.store(
// this.lastCompletedTimestamp(),
// AnalyticType.currentworld,
// JSON.stringify(
// this.worldSimulations()
// .get()
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-ignore
// .new.getWorld().players
// )
// )
// }
}
}

Expand Down
32 changes: 16 additions & 16 deletions lib/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ export class Server<

this.filterCommands()

if (process.env['SNOWGLOBE_DEBUG']) {
this.analytics.store(
this.timekeepingSimulation.stepper.lastCompletedTimestamp(),
AnalyticType.currentworld,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
JSON.stringify(this.timekeepingSimulation.stepper.getWorld().players)
)
}
// if (process.env['SNOWGLOBE_DEBUG']) {
// this.analytics.store(
// this.timekeepingSimulation.stepper.lastCompletedTimestamp(),
// AnalyticType.currentworld,
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-ignore
// JSON.stringify(this.timekeepingSimulation.stepper.getWorld().players)
// )
// }

const snapShotStart = performance.now()
const numberOfTraunch = 18
Expand Down Expand Up @@ -415,13 +415,13 @@ export class Server<
clonedFakeWorld.dispose()
}

if (process.env['SNOWGLOBE_DEBUG']) {
this.analytics.store(
this.lastCompletedTimestamp(),
AnalyticType.snapshotgenerated,
JSON.stringify(snapshots)
)
}
// if (process.env['SNOWGLOBE_DEBUG']) {
// this.analytics.store(
// this.lastCompletedTimestamp(),
// AnalyticType.snapshotgenerated,
// JSON.stringify(snapshots)
// )
// }
}

const snapShotEnd = performance.now()
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Keith La Force <[email protected]>"
],
"license": "Apache-2.0",
"version": "0.4.14",
"version": "0.4.15",
"description": "A TypeScript port of CrystalOrb, a high-level Rust game networking library",
"keywords": [
"netcode",
Expand Down

0 comments on commit 3f7f997

Please sign in to comment.