kevinhikaruevans / uojs2

An unfinished web-based client written in Javascript for the game Ultima Online
MIT License
53 stars 28 forks source link

Create Map & Map Tile components #69

Open kevinhikaruevans opened 7 years ago

kevinhikaruevans commented 7 years ago

@lamo2k123 can you take a look at this branch? https://github.com/kevinhikaruevans/uojs2/compare/get-map-data

I'm trying to send data through the websocket, but I'm getting this error:

Uncaught SyntaxError: Unexpected token o in JSON at position 1 at Object.parse () at WebSocket.once (transport.js:88) once @ transport.js:88

I think it's sending "[object...]" as a string but I'm not sure why. Any ideas? 😕

lamo2k123 commented 7 years ago

fixed https://github.com/kevinhikaruevans/uojs2/commit/54b3cecad0c58a9b102651de69c077ee7aa56f4a

kevinhikaruevans commented 7 years ago

Thanks!

I ran into another issue. I'm trying to use connect() on a component, but I'm getting this error:

Uncaught (in promise) Error: Could not find "store" in either the context or props of "Connect([component] map)". Either wrap the root component in a , or explicitly pass "store" as a prop to "Connect([component] map)". at invariant (http://localhost:8080/bundle.js:65251:15) at new Connect (http://localhost:8080/bundle.js:70594:58) at http://localhost:8080/bundle.js:98048:24

I'm calling connect in map.js: https://github.com/kevinhikaruevans/uojs2/blob/get-map-data/src/client/components/map/index.js#L13

Should I pass store in props from scene/index.js?

(loaded in scene/index.js and in pages/game/index.js)

lamo2k123 commented 7 years ago

The react-three-renderer implemented a method that does not render passes React context. And I think that this is not the only problem)) https://github.com/toxicFork/react-three-renderer/blob/master/src/lib/React3Renderer.js#L631

lamo2k123 commented 7 years ago

Why do not you just THREEJS use? I think that react-three-renderer is not yet a problem.

kevinhikaruevans commented 7 years ago

Like... use Three.js without react-three-renderer? I like react-three-renderer because it manages a lot of stuff.

Maybe something like:

lamo2k123 commented 7 years ago

Use the '@connect' component 'scene / index.js' and there Give props to 'map' component.