mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: add cron
This commit is contained in:
1 parent
ffaa368f81
commit
ed17366365
10 files changed
+87
-21
No files matched your search
@@ -5,7 +5,6 @@ export async function commitAssets(
|
||||
message: string,
|
||||
changes: FileChange[],
|
||||
production: boolean,
|
||||
verbose = true,
|
||||
) {
|
||||
console.log(`Committing ${message}...`);
|
||||
|
||||
@@ -17,6 +16,5 @@ export async function commitAssets(
|
||||
production ? 'main' : 'dev',
|
||||
`${message} - ${new Date().toDateString()}`,
|
||||
changes,
|
||||
verbose,
|
||||
);
|
||||
}
|
||||
@@ -14,7 +14,6 @@ export default async function commitMultipleFiles(
|
||||
branch: string,
|
||||
message: string,
|
||||
changes: FileChange[],
|
||||
verbose = false,
|
||||
) {
|
||||
const latestCommitSha = (
|
||||
await octokit.git.getRef({
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { lookup } from './lookup';
|
||||
|
||||
export async function decode(proto: string, data: Uint8Array) {
|
||||
const Message = await lookup(proto);
|
||||
return Message.decode(data).toJSON();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { lookup } from './lookup';
|
||||
|
||||
export async function encode(proto: string, data: any) {
|
||||
const Message = await lookup(proto);
|
||||
return Message.encode(Message.create(data)).finish();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { encode } from './encode';
|
||||
|
||||
export async function encodeToBase64(proto: string, data: any) {
|
||||
const array = await encode(proto, data);
|
||||
return Buffer.from(array).toString('base64');
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Root } from 'protobufjs';
|
||||
|
||||
export async function lookup(proto: string) {
|
||||
const root = await new Root().load(
|
||||
`src/protos/${proto.split('.')[0]}.proto`,
|
||||
{ keepCase: true },
|
||||
);
|
||||
|
||||
return root.lookupType(proto);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package blitzkit;
|
||||
|
||||
message AverageDefinitions {
|
||||
map<uint32, Tank> averages = 1;
|
||||
}
|
||||
|
||||
message Tank {
|
||||
uint32 samples = 1;
|
||||
AverageDefinitionsAllStats mu = 2;
|
||||
AverageDefinitionsAllStats sigma = 3;
|
||||
AverageDefinitionsAllStats r = 4;
|
||||
}
|
||||
|
||||
message AverageDefinitionsAllStats {
|
||||
float battles = 1;
|
||||
float capture_points = 2;
|
||||
float damage_dealt = 3;
|
||||
float damage_received = 4;
|
||||
float dropped_capture_points = 5;
|
||||
float frags = 6;
|
||||
float frags8p = 7;
|
||||
float hits = 8;
|
||||
float losses = 9;
|
||||
float max_frags = 10;
|
||||
float max_xp = 11;
|
||||
float shots = 12;
|
||||
float spotted = 13;
|
||||
float survived_battles = 14;
|
||||
float win_and_survived = 15;
|
||||
float wins = 16;
|
||||
float xp = 17;
|
||||
float battle_life_time = 18;
|
||||
}
|
||||
Reference in new issue
Block a user