Merge remote-tracking branch 'origin/main' into feature/restore-history

This commit is contained in:
straticspaff
2023-09-27 21:14:24 +01:00
547 changed files with 29511 additions and 6877 deletions

View File

@@ -2,6 +2,7 @@ package deltacomp
import (
"bytes"
"fmt"
"io"
)
@@ -74,6 +75,18 @@ func ApplyDataDiff(diff []byte, baseData []byte) []byte {
}
differentCount--
// Grow slice if it's required
if len(baseCopy) < dataOffset {
fmt.Printf("Slice smaller than data offset, growing slice...")
baseCopy = append(baseCopy, make([]byte, (dataOffset+differentCount)-len(baseData))...)
} else {
length := len(baseCopy[dataOffset:])
if length < differentCount {
length -= differentCount
baseCopy = append(baseCopy, make([]byte, length)...)
}
}
// Apply the patch bytes.
for i := 0; i < differentCount; i++ {
b, err := checkReadUint8(patch)

View File

@@ -7,7 +7,7 @@ import (
"io/ioutil"
"testing"
"github.com/Andoryuuta/Erupe/server/channelserver/compression/nullcomp"
"erupe-ce/server/channelserver/compression/nullcomp"
)
var tests = []struct {