File tree 5 files changed +21
-27
lines changed
5 files changed +21
-27
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env sh
2
2
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);
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ import Player from "./Player";
6
6
import Map2d from "./map/Map2d" ;
7
7
import InfoPanel from "./panel/InfoPanel" ;
8
8
import '../libs/wasm_exec.js' ;
9
+ import './protos/Message_pb.js'
9
10
10
11
export function PlayerApp ( ) {
11
12
const [ messageBus ] = useState ( new MessageBus ( ) )
12
13
const [ player ] = useState ( new Player ( messageBus ) )
13
14
const [ serverHost ] = useState ( window . location . host . includes ( "localhost" ) ? "http://localhost:8080" : "" ) ;
14
- const proto = require ( "./protos/Message_pb.js" ) ;
15
15
16
16
useEffect ( ( ) => {
17
17
console . log ( "run run run" )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 10
10
// GENERATED CODE -- DO NOT EDIT!
11
11
/* eslint-disable */
12
12
// @ts -nocheck
13
+ import jspb from 'google-protobuf'
13
14
14
- var jspb = require ( 'google-protobuf' ) ;
15
+ // var jspb = require('google-protobuf');
15
16
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' ) ( ) ;
23
24
24
25
goog . exportSymbol ( 'proto.csgo.Bomb' , null , global ) ;
25
26
goog . exportSymbol ( 'proto.csgo.Bomb.BombState' , null , global ) ;
@@ -4400,4 +4401,4 @@ proto.csgo.Demo.prototype.setPlatform = function(value) {
4400
4401
} ;
4401
4402
4402
4403
4403
- goog . object . extend ( exports , proto . csgo ) ;
4404
+ goog . object . extend ( window . proto = window . proto || { } , proto . csgo ) ;
Original file line number Diff line number Diff line change @@ -4,4 +4,6 @@ import preact from '@preact/preset-vite';
4
4
// https://vitejs.dev/config/
5
5
export default defineConfig ( {
6
6
plugins : [ preact ( ) ] ,
7
+ open : true ,
8
+ port : 3000 ,
7
9
} ) ;
You can’t perform that action at this time.
0 commit comments