mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-06-06 20:39:47 +00:00
feat(names): Add dynamic name generation for peer
This commit is contained in:
@@ -3,8 +3,10 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/openlibrecommunity/olcrtc/internal/client"
|
||||
"github.com/openlibrecommunity/olcrtc/internal/names"
|
||||
"github.com/openlibrecommunity/olcrtc/internal/server"
|
||||
)
|
||||
|
||||
@@ -16,6 +18,7 @@ func main() {
|
||||
socksPort int
|
||||
keyHex string
|
||||
debug bool
|
||||
dataDir string
|
||||
)
|
||||
|
||||
flag.StringVar(&mode, "mode", "", "Mode: srv or cnc")
|
||||
@@ -24,6 +27,7 @@ func main() {
|
||||
flag.IntVar(&socksPort, "socks-port", 1080, "SOCKS5 port (client only)")
|
||||
flag.StringVar(&keyHex, "key", "", "Shared encryption key (hex)")
|
||||
flag.BoolVar(&debug, "debug", false, "Enable debug logging")
|
||||
flag.StringVar(&dataDir, "data", "data", "Path to data directory")
|
||||
flag.Parse()
|
||||
|
||||
if !debug {
|
||||
@@ -38,6 +42,13 @@ func main() {
|
||||
log.Fatal("Room ID required")
|
||||
}
|
||||
|
||||
namesPath := filepath.Join(dataDir, "names")
|
||||
surnamesPath := filepath.Join(dataDir, "surnames")
|
||||
|
||||
if err := names.LoadNameFiles(namesPath, surnamesPath); err != nil {
|
||||
log.Fatalf("Failed to load name files: %v", err)
|
||||
}
|
||||
|
||||
roomURL := "https://telemost.yandex.ru/j/" + roomID
|
||||
|
||||
switch mode {
|
||||
|
||||
Reference in New Issue
Block a user