Skip to content

Commit

Permalink
somehow it's starting to run
Browse files Browse the repository at this point in the history
  • Loading branch information
sparkoo committed Dec 5, 2024
1 parent 8e0160b commit b560106
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
9 changes: 8 additions & 1 deletion proto.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/usr/bin/env sh

protoc -I="./protos" --go_out="./pkg" --js_out=import_style=commonjs,binary:"web/player/src/protos" ./protos/*.proto
# protoc -I="./protos" --go_out="./pkg" --js_out=library=blubli,binary:"web/src/Player/protos" ./protos/*.proto
# protoc -I="./protos" --js_out=library=Message_pb,binary:"web/src/Player/protos" ./protos/*.proto
protoc -I="./protos" --js_out=import_style=commonjs,binary:"web/src/Player/protos" ./protos/*.proto

# import jspb from 'google-protobuf'

# // var jspb = require('google-protobuf');
# goog.object.extend(window.proto = window.proto || {}, proto.csgo);
2 changes: 1 addition & 1 deletion web/src/Player/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import Player from "./Player";
import Map2d from "./map/Map2d";
import InfoPanel from "./panel/InfoPanel";
import '../libs/wasm_exec.js';
import './protos/Message_pb.js'

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

useEffect(() => {
console.log("run run run")
Expand Down
16 changes: 0 additions & 16 deletions web/src/Player/index.js

This file was deleted.

19 changes: 10 additions & 9 deletions web/src/Player/protos/Message_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
import jspb from 'google-protobuf'

var jspb = require('google-protobuf');
// var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var global =
(typeof globalThis !== 'undefined' && globalThis) ||
(typeof window !== 'undefined' && window) ||
(typeof global !== 'undefined' && global) ||
(typeof self !== 'undefined' && self) ||
(function () { return this; }).call(null) ||
Function('return this')();

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


goog.object.extend(exports, proto.csgo);
goog.object.extend(window.proto = window.proto || {}, proto.csgo);
2 changes: 2 additions & 0 deletions web/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ import preact from '@preact/preset-vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [preact()],
open: true,
port: 3000,
});

0 comments on commit b560106

Please sign in to comment.