mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
minor changes.
This commit is contained in:
@@ -88,7 +88,7 @@ func (manager *RoomManagerCtx) FindByName(name string) (*types.RoomEntry, error)
|
||||
|
||||
func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, error) {
|
||||
if settings.Name != "" && !dockerNames.RestrictedNamePattern.MatchString(settings.Name) {
|
||||
return "", fmt.Errorf("invalid container name, must match " + dockerNames.RestrictedNameChars)
|
||||
return "", fmt.Errorf("invalid container name, must match %s", dockerNames.RestrictedNameChars)
|
||||
}
|
||||
|
||||
if !manager.config.StorageEnabled && len(settings.Mounts) > 0 {
|
||||
@@ -122,7 +122,7 @@ func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, erro
|
||||
|
||||
portBindings := nat.PortMap{}
|
||||
exposedPorts := nat.PortSet{
|
||||
nat.Port(fmt.Sprintf("%d/udp", frontendPort)): struct{}{},
|
||||
nat.Port(fmt.Sprintf("%d/tcp", frontendPort)): struct{}{},
|
||||
}
|
||||
|
||||
for port := epr.Min; port <= epr.Max; port++ {
|
||||
|
||||
@@ -29,7 +29,8 @@ func (manager *RoomManagerCtx) allocatePorts(sum uint16) (EprPorts, error) {
|
||||
}
|
||||
|
||||
for _, port := range ports {
|
||||
if (epr.Min >= port.Min && epr.Min <= port.Max) || (epr.Max >= port.Min && epr.Max <= port.Max) {
|
||||
if (epr.Min >= port.Min && epr.Min <= port.Max) ||
|
||||
(epr.Max >= port.Min && epr.Max <= port.Max) {
|
||||
epr.Min = port.Max + 1
|
||||
epr.Max = port.Max + sum
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user