Overv / WebCraft

Minecraft clone written in Javascript.
zlib License
385 stars 183 forks source link

set and destroy bricks not working at spawn point #12

Closed p3rlphr33k closed 2 years ago

p3rlphr33k commented 8 years ago

I have multi player working but I am running into a strange problem. Blocks on and surrounding the spawn point can not be set or destroyed. I played around with the code and found I can alter the outcome by overriding the obj variable in player.js created to determine this.world or this.client. Setting obj manually will allow bricks to be set and destroyed around spawn but only for the player doing the setting/breaking. The changes are invisible to the other players and the changes are not saved since they become local changed blue sent to the server.js. I have modified the code but I rolled back to the current versions and have the same problem. Any ideas?

p3rlphr33k commented 8 years ago

Sorry, my phone corrected some text.. "The changes are invisible to the other players and the changes are not saved since they become local changed blue sent to the server.js."

Should be:

The changes are invisible to the other players and the changes are not saved since they become local changes do not seem to be sent to server.js

Overv commented 8 years ago

That is a feature to do spawn protection. See:

https://github.com/Overv/WebCraft/blob/master/js/network.js#L500

p3rlphr33k commented 8 years ago

Ahh. Never thought to check network file. Thank you.