That code is scary for a lot of reasons.
The array is probably stringified, you might've wanted:
onmessage handler on line 21, the if chain should be an
if else chain, or a
switch case, as multiple can't be true at once.
There is a heavy overuse of
let, a good number of those should be
Simply seeing this tells me use misused a struct:
Maybe you want a
This is being called more than once? The timeouts will never get cleared, that seems bad, am I missing something?
Also, you can just use:
I'd recommend either pre-declaring
keys properties, or using a
Map, or a
Maybe this would be better as:
Ooh, window mutation is bad.
Is SortaGames accepting new members?
@tussiez Re-read my comment, the last line ;)
I couldn't tell if you responsed to it or not.
Also, I tend to quickly analyze others' code, as I'm used to auditing code before I use it myself, example: whenever I'm about to use a new lib in a project, I'll quickly check it out to make sure it's safe to use.
@xxpertHacker1. He made a giant paragraph on recommendations for SortaCraft, then I replied with a couple more, then he did again
This was actually a kinda old idea, I was messing with THREE for a year or so until I finally found a voxel engine that I could build on top of (threejsfundamentals tutorial) - and now I'm here
@xxpertHacker Ok so C++ server is working (kinda). I am thinking of using C++ for calculations as using nodeJS with two people in it as multiplayer was SLOW AS HECK. Plus, C++ has (I'm pretty sure native. If not, it can support it anyways with a few adjustments or whatever) support for multithreading and so we can have more threads for different servers (of course, we can't have one thread for each server because that would be a nightmare due to overusing threads).
I might need some help with the threading.
PS:Don't take over my job pls
As for the above I was being "semi-serious" but ol markdown won't work ARGH
You should only have as many threads as you have CPU cores, on Repl, that'd be 2.
C++ has std::thread.
I already have a multi-threaded Rust++ server working on Repl.
(Rust++ is the name that I gave to my abomination of mixing C++ and Rust)
You will screw up multi-threading, you don't know basic C++, you definately don't know advanced C++.
Threading is advanced; that's no question.
Memory management is hard.
Multi-threaded memory management is as hard as (normal memory management + threading + normal C++) * 1e100.
I changed my program and also did a big of configuring on urs tussiez.
Fixed tussiez's use of
const scope = this by just binding
this (check ChunkGen.js tussiez).
Eh, I should prob relearn JS, but that takes too much time so I'm just going to cache myself using bad code and use better code...
Doing this in a new multiplayer client would make this a LOT faster (no heavy lag, should be just as quick as the singleplayer client)
@tussiez Well, I'm in now. Don't worry about being late, you could've taken an extra day for all I cared.
If there's any specific parts that the team every needs help with, just ping me.
If there's any part of the code that is slightly slower that you think it should be, ping me.
Same applies to if there's any part you want done; I've got plenty of time.
I'll go play around and try to break anything ;)