Skip to content

Commit b560106

Browse files
committed
somehow it's starting to run
1 parent 8e0160b commit b560106

File tree

5 files changed

+21
-27
lines changed

5 files changed

+21
-27
lines changed

proto.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
#!/usr/bin/env sh
22

3-
protoc -I="./protos" --go_out="./pkg" --js_out=import_style=commonjs,binary:"web/player/src/protos" ./protos/*.proto
3+
# protoc -I="./protos" --go_out="./pkg" --js_out=library=blubli,binary:"web/src/Player/protos" ./protos/*.proto
4+
# protoc -I="./protos" --js_out=library=Message_pb,binary:"web/src/Player/protos" ./protos/*.proto
5+
protoc -I="./protos" --js_out=import_style=commonjs,binary:"web/src/Player/protos" ./protos/*.proto
6+
7+
# import jspb from 'google-protobuf'
8+
9+
# // var jspb = require('google-protobuf');
10+
# goog.object.extend(window.proto = window.proto || {}, proto.csgo);

web/src/Player/App.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import Player from "./Player";
66
import Map2d from "./map/Map2d";
77
import InfoPanel from "./panel/InfoPanel";
88
import '../libs/wasm_exec.js';
9+
import './protos/Message_pb.js'
910

1011
export function PlayerApp() {
1112
const [messageBus] = useState(new MessageBus())
1213
const [player] = useState(new Player(messageBus))
1314
const [serverHost] = useState(window.location.host.includes("localhost") ? "http://localhost:8080" : "");
14-
const proto = require("./protos/Message_pb.js");
1515

1616
useEffect(() => {
1717
console.log("run run run")

web/src/Player/index.js

-16
This file was deleted.

web/src/Player/protos/Message_pb.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@
1010
// GENERATED CODE -- DO NOT EDIT!
1111
/* eslint-disable */
1212
// @ts-nocheck
13+
import jspb from 'google-protobuf'
1314

14-
var jspb = require('google-protobuf');
15+
// var jspb = require('google-protobuf');
1516
var goog = jspb;
16-
var global = (function() {
17-
if (this) { return this; }
18-
if (typeof window !== 'undefined') { return window; }
19-
if (typeof global !== 'undefined') { return global; }
20-
if (typeof self !== 'undefined') { return self; }
21-
return Function('return this')();
22-
}.call(null));
17+
var global =
18+
(typeof globalThis !== 'undefined' && globalThis) ||
19+
(typeof window !== 'undefined' && window) ||
20+
(typeof global !== 'undefined' && global) ||
21+
(typeof self !== 'undefined' && self) ||
22+
(function () { return this; }).call(null) ||
23+
Function('return this')();
2324

2425
goog.exportSymbol('proto.csgo.Bomb', null, global);
2526
goog.exportSymbol('proto.csgo.Bomb.BombState', null, global);
@@ -4400,4 +4401,4 @@ proto.csgo.Demo.prototype.setPlatform = function(value) {
44004401
};
44014402

44024403

4403-
goog.object.extend(exports, proto.csgo);
4404+
goog.object.extend(window.proto = window.proto || {}, proto.csgo);

web/vite.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ import preact from '@preact/preset-vite';
44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [preact()],
7+
open: true,
8+
port: 3000,
79
});

0 commit comments

Comments
 (0)