ABCxFF / diepcustom

An open source diep.io custom private-server template
https://diepcustom.herokuapp.com/
GNU Affero General Public License v3.0
67 stars 60 forks source link

Minor patches(#44,#49,#50,#2, #4) #55

Closed ABCxFF closed 1 year ago

ABCxFF commented 1 year ago

Why:

Closes #2, #44, #49, and #50.

Summarize what's being changed (include any screenshots, code, or other media if available):

  1. 2) Added 00 packet chunking (idea by Nulled) to split up larger packets into multiple smaller ones. Along with that, made the OUTPUT_BUFFER resize if running out of space.

  2. 44) Makes AI check if the target's sides != 0, before continuing to use it as a target.

  3. 49) Set the spectator tank to actually use the invisibility meta data described earlier (someone forgot to do this previously)

  4. 50) Set fallen bosses to have no team, and set non teamed dominators to default to the Arena

  5. 4) Calculates barrel pos correctly - algorithms were off

    Confirm the following:

    • [x] I have tested these changes (by compiling, running, and playing) and have seen no differences in gameplay
Nul-led commented 1 year ago

Possible Improvements for #2:

ABCxFF commented 1 year ago

Ah smart. Also thinking of generally switching to Buffers instead of Uint8Array and views

Nul-led commented 1 year ago

Yup LGTM

c86ec23b-fef1-4979-b2fa-b9adc351b8cc commented 1 year ago

seems good

c86ec23b-fef1-4979-b2fa-b9adc351b8cc commented 1 year ago

it has bug: console is spammed with possible desync error

Nul-led commented 1 year ago

I suppose we cant do much about that, apart from a) collecting & merging 00 packets on the client b) disabling console output

c86ec23b-fef1-4979-b2fa-b9adc351b8cc commented 1 year ago

@Nul-led only the camera file causes that bug not the writer it seems

supahero1 commented 1 year ago

As for #2, you can use:

socket.send(data, { fin: false })

to send a partial message without actually splitting it into a separate websocket message (all of them will be merged into one on the other side once fin: true is set, or if the second argument is not given, since then fin is set to true by default). There's no need to dynamically resize the buffer or anything, just check if we're about to write past the end of it, and send the frame.

Altanis commented 1 year ago

LGTM

quick thing, invisible entities don't get sent to the client right

ABCxFF commented 1 year ago

As for #2, you can use:

socket.send(data, { fin: false })

to send a partial message without actually splitting it into a separate websocket message (all of them will be merged into one on the other side once fin: true is set, or if the second argument is not given, since then fin is set to true by default). There's no need to dynamically resize the buffer or anything, just check if we're about to write past the end of it, and send the frame.

That's awesome, thanks for letting me know. I'll add in later today / tomorrow

ABCxFF commented 1 year ago

Should be fixed now @c86ec23b-fef1-4979-b2fa-b9adc351b8cc

Nul-led commented 1 year ago

LGTM