mirror of
https://github.com/PretendoNetwork/nex-go.git
synced 2025-04-02 11:02:14 -04:00
Server now properly splits the packet payload into multiple fragments if needed. Server settings now properly get defaults. Added the basis for compression support, though it doesn't do anything right now. Removed unused NEX type structs. And finally, fixed all godoc and other linting issues.
27 lines
758 B
Go
27 lines
758 B
Go
package nex
|
|
|
|
// DummyCompression represents no compression
|
|
type DummyCompression struct{}
|
|
|
|
// Compress returns the data as-is
|
|
func (compression *DummyCompression) Compress(data []byte) []byte {
|
|
return data
|
|
}
|
|
|
|
// Decompress returns the data as-is
|
|
func (compression *DummyCompression) Decompress(data []byte) []byte {
|
|
return data
|
|
}
|
|
|
|
// ZLibCompression represents ZLib compression
|
|
type ZLibCompression struct{}
|
|
|
|
// Compress returns the data as-is (needs to be updated to return ZLib compressed data)
|
|
func (compression *ZLibCompression) Compress(data []byte) []byte {
|
|
return data
|
|
}
|
|
|
|
// Decompress returns the data as-is (needs to be updated to return ZLib decompressed data)
|
|
func (compression *ZLibCompression) Decompress(data []byte) []byte {
|
|
return data
|
|
}
|