Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions internal/rooms/ephemeral.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (
)

const (
ephemeralChunksLimit = 100 // The maximum number of ephemeral chunks that can be created
ephemeralChunkSize = 250 // The maximum quantity of ephemeral room's that can be copied/created in a given chunk.
roomIdMin32Bit = 1000000000 // 1,000,000,000
ephemeralChunksLimit = 100 // The maximum number of ephemeral chunks that can be created
ephemeralChunkSize = 250 // The maximum quantity of ephemeral room's that can be copied/created in a given chunk.
roomIdMin32Bit = 1000000 // 1,000,000 - Safe for 32-bit systems (was 1,000,000,000 which overflows when multiplied by 1000)
)

var (
ephemeralRoomIdMinimum = roomIdMin32Bit // 1,000,000,000 is assuming 32 bit. the init() function may override this value.
ephemeralRoomIdMinimum = roomIdMin32Bit // 1,000,000 is assuming 32 bit. the init() function may override this value to 1,000,000,000 on 64-bit systems.
ephemeralRoomChunks = [ephemeralChunksLimit][]int{} // map of ranges to actual rooms. If empty, slot is available.
originalRoomIdLookups = map[int]int{} // a map of ephemeralId's to their original RoomId's, for special purposes
// errors
Expand Down Expand Up @@ -232,6 +232,6 @@ func GetOriginalRoom(roomId int) int {

func init() {
if math.MaxInt > ephemeralRoomIdMinimum*1000 {
ephemeralRoomIdMinimum = ephemeralRoomIdMinimum * 1000 // 1,000,000,000 => // 1,000,000,000,000
ephemeralRoomIdMinimum = ephemeralRoomIdMinimum * 1000 // 1,000,000 => 1,000,000,000 on 64-bit systems
}
}