Files
red-valley/console_demo.ps1
2026-03-29 21:41:17 +03:00

335 lines
13 KiB
PowerShell

# ============================================================
# RED VALLEY - Console Wrapper DEMO v3
# Block-art banner + single loading bar + categorized summary
# ============================================================
$Host.UI.RawUI.WindowTitle = "Red Valley Roleplay - Server Console"
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$esc = [char]27
$orange = "$esc[38;2;255;140;0m"
$reset = "$esc[0m"
function Get-BannerLine {
# Converts ASCII template to Unicode box-drawing chars
# # = full block, > = top-right corner, < = top-left corner
# [ = bottom-left, ] = bottom-right, ~ = horizontal double, ! = vertical double
param([string]$t)
return $t.Replace('#',([string][char]9608)).Replace('>',([string][char]9559)).Replace('<',([string][char]9556)).Replace('[',([string][char]9562)).Replace(']',([string][char]9565)).Replace('~',([string][char]9552)).Replace('!',([string][char]9553))
}
function Write-Banner {
Clear-Host
Write-Host ""
# ANSI Shadow figlet font - RED VALLEY
$lines = @(
'######> #######>######> ##> ##> #####> ##> ##> #######>##> ##>',
'##<~~##>##<~~~~]##<~~##> ##! ##!##<~~##>##! ##! ##<~~~~][##> ##<]',
'######<]#####> ##! ##! ##! ##!#######!##! ##! #####> [####<] ',
'##<~~##>##<~~] ##! ##! [##> ##<]##<~~##!##! ##! ##<~~] [##<] ',
'##! ##!#######>######<] [####<] ##! ##!#######>#######>#######> ##! ',
'[~] [~][~~~~~~][~~~~~] [~~~] [~] [~][~~~~~~][~~~~~~][~~~~~~] [~] '
)
for ($i = 0; $i -lt $lines.Count; $i++) {
$color = if ($i -lt 3) { "Red" } else { "DarkRed" }
Write-Host " $(Get-BannerLine $lines[$i])" -ForegroundColor $color
}
Write-Host ""
$lb = ([string][char]9604) * 78
$ub = ([string][char]9600) * 78
Write-Host " $lb" -ForegroundColor DarkRed
Write-Host " " -NoNewline
Write-Host "ROLEPLAY SERVER" -NoNewline -ForegroundColor White
Write-Host " v2.0" -NoNewline -ForegroundColor DarkGray
Write-Host " | " -NoNewline -ForegroundColor DarkRed
Write-Host "vlxre.cata" -ForegroundColor DarkGray
Write-Host " $ub" -ForegroundColor DarkRed
Write-Host ""
}
function Update-ProgressBar {
param([int]$Current, [int]$Total, [string]$ResourceName)
$percent = [math]::Round(($Current / $Total) * 100)
$barWidth = 50
$filled = [math]::Round(($Current / $Total) * $barWidth)
$empty = $barWidth - $filled
$barFull = ([string][char]9608) * $filled
$barEmpty = ([string][char]9617) * $empty
$padName = $ResourceName.PadRight(26)
$padPercent = "$percent%".PadLeft(4)
Write-Host "`r $barFull" -NoNewline -ForegroundColor Green
Write-Host "$barEmpty " -NoNewline -ForegroundColor DarkGray
Write-Host "$padPercent " -NoNewline -ForegroundColor White
Write-Host "$padName" -NoNewline -ForegroundColor DarkCyan
}
function Write-Sep {
$line = ([string][char]9472) * 58
Write-Host " $line" -ForegroundColor DarkGray
}
function Write-SepBold {
$line = ([string][char]9608) * 58
Write-Host " $line" -ForegroundColor DarkGray
}
# ============================================================
# DEMO
# ============================================================
Write-Banner
# --- Config Info ---
Write-Host " " -NoNewline
Write-Host "[OK]" -NoNewline -ForegroundColor Green
Write-Host " Config " -NoNewline -ForegroundColor White
Write-Host ": e:\FiveMserver\server\server.cfg" -ForegroundColor DarkGray
Write-Host " " -NoNewline
Write-Host "[OK]" -NoNewline -ForegroundColor Green
Write-Host " Artifact " -NoNewline -ForegroundColor White
Write-Host ": E:\FiveMserver\server\artifacts" -ForegroundColor DarkGray
Write-Host " " -NoNewline
Write-Host "[OK]" -NoNewline -ForegroundColor Green
Write-Host " Server " -NoNewline -ForegroundColor White
Write-Host ": E:\FiveMserver\server\artifacts\FXServer.exe" -ForegroundColor DarkGray
Write-Host ""
Write-Host " Starting >> " -NoNewline -ForegroundColor DarkGray
Write-Host "E:\FiveMserver\server\artifacts\FXServer.exe" -ForegroundColor Yellow
Write-Host " Data dir >> " -NoNewline -ForegroundColor DarkGray
Write-Host "e:\FiveMserver\server\" -ForegroundColor Yellow
Write-Host ""
Write-Host " Loading $totalResources resources..." -ForegroundColor DarkGray
# All resources for loading bar
$allResources = @(
"baseevents","mapmanager","sessionmanager","spawnmanager",
"ox_lib","qb-core","qb-target","qs-inventory","no-npc",
"bob74_ipl","PolyZone","progressbar","screenshot-basic",
"VehicleDeformation","wasabi_bridge","xsound","pma-voice",
"connectqueue","17mov_CharacterSystem","17mov-plugin-char-creator",
"17mov_Hud","wasabi_police","wasabi_ambulance","codem-mdt",
"codem-dispatch","codem-mdtProp","t1ger_mechanic","t1ger_tuningsystem",
"jo_towtruck","mBossmenu","0r_idcard","bit-driverschool",
"qs-advancedgarages","qs-housing","qs-shops","qb-weathersync",
"kq_carheist","qs-smartphone-pro","qs-vehiclekeys",
"rcore_casino","rcore_prison","rcore_doorlock",
"cfx-fm-fleeca-banks-v2","cfx-fm-mrpd","cfx-gabz-mapdata",
"soloty-southside-custom","rfc_los_santos_customs",
"patoche_bigbenny_original","octavista_vespuccilspd",
"wxmaps_commons","wxmaps_lshospital_v","wxmaps_lshospital",
"ps-cayomansion","verpi_driving_school","rbmwm3f80",
"minimap","phone-props","squidgame","AdminPack",
"KawaiixQuasar_props","KillstorexQuasar_props",
"lunaticstudio_promo001","murm_dec_pack","luxu_admin"
)
$totalResources = $allResources.Count
# Single in-place progress bar
for ($i = 0; $i -lt $totalResources; $i++) {
Update-ProgressBar ($i + 1) $totalResources $allResources[$i]
Start-Sleep -Milliseconds 20
}
Update-ProgressBar $totalResources $totalResources "COMPLETE"
Start-Sleep -Milliseconds 300
Write-Host ""
Write-Sep
$b1 = "["
$b2 = "]"
$sq = ([string][char]9632) # small square
$n = 1
# --- ERRORS ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor Red
Write-Host "ERRORS" -ForegroundColor Red
Write-Host " X cfx-gabz-mapdata " -NoNewline -ForegroundColor Red
Write-Host "unexpected symbol near '<\180>' (compiled bytecode)" -ForegroundColor DarkRed
# --- WARNINGS ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor DarkYellow
Write-Host "WARNINGS" -ForegroundColor DarkYellow
Write-Host " ! oxmysql " -NoNewline -ForegroundColor DarkYellow
Write-Host "crypto_history: oversized result set - 3137 rows" -ForegroundColor Yellow
Write-Host " ! wasabi_bridge " -NoNewline -ForegroundColor DarkYellow
Write-Host "Outdated: 1.6.6 -> 1.6.9" -ForegroundColor Yellow
Write-Host " ! screenshot " -NoNewline -ForegroundColor DarkYellow
Write-Host "dist/server.js + dist/ui.html missing (cosmetic)" -ForegroundColor Yellow
# --- QBCore ---
Write-Host ""
Write-Host " ${orange}${sq}${reset} " -NoNewline
Write-Host "QBCore" -NoNewline -ForegroundColor White
Write-Host " Framework" -ForegroundColor DarkGray
foreach ($r in @("qb-core", "qb-target", "qb-weathersync", "no-npc")) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 $r" -ForegroundColor Gray
$n++
}
# --- 17mov ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor Magenta
Write-Host "17mov" -NoNewline -ForegroundColor White
Write-Host " Malizniakk" -ForegroundColor DarkGray
foreach ($r in @("17mov_CharacterSystem", "17mov-plugin-char-creator", "17mov_Hud")) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 $r" -ForegroundColor Gray
$n++
}
# --- Quasar ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor Cyan
Write-Host "Quasar" -NoNewline -ForegroundColor White
Write-Host " Store" -ForegroundColor DarkGray
foreach ($r in @("qs-inventory", "qs-advancedgarages", "qs-housing", "qs-shops", "qs-smartphone-pro", "qs-vehiclekeys")) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 $r" -ForegroundColor Gray
$n++
}
# --- T1GER ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor Yellow
Write-Host "T1GER" -ForegroundColor White
foreach ($r in @("t1ger_mechanic", "t1ger_tuningsystem")) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 $r" -ForegroundColor Gray
$n++
}
# --- Wasabi ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor Green
Write-Host "Wasabi" -NoNewline -ForegroundColor White
Write-Host " Scripts" -ForegroundColor DarkGray
foreach ($r in @("wasabi_police", "wasabi_ambulance", "wasabi_bridge")) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 $r" -ForegroundColor Gray
$n++
}
# --- CodeM ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor DarkYellow
Write-Host "CodeM" -ForegroundColor White
foreach ($r in @("codem-mdt", "codem-dispatch", "codem-mdtProp")) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 $r" -ForegroundColor Gray
$n++
}
# --- rcore ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor DarkCyan
Write-Host "rcore" -ForegroundColor White
foreach ($r in @("rcore_casino", "rcore_prison", "rcore_doorlock")) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 $r" -ForegroundColor Gray
$n++
}
# --- MLOs ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor DarkGreen
Write-Host "MLOs" -NoNewline -ForegroundColor White
Write-Host " Map Interiors" -ForegroundColor DarkGray
$mloData = @(
@{N="soloty-southside-custom"; W=1},
@{N="rfc_los_santos_customs"; W=0},
@{N="cfx-fm-fleeca-banks-v2"; W=0},
@{N="cfx-fm-mrpd"; W=0},
@{N="octavista_vespuccilspd"; W=10},
@{N="patoche_bigbenny_original"; W=5},
@{N="wxmaps_lshospital"; W=1},
@{N="rbmwm3f80"; W=11}
)
foreach ($r in $mloData) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 " -NoNewline -ForegroundColor DarkGray
if ($r.W -gt 0) {
Write-Host $r.N.PadRight(33) -NoNewline -ForegroundColor Gray
Write-Host "$b1$($r.W) warn$b2" -ForegroundColor DarkYellow
} else {
Write-Host $r.N -ForegroundColor Gray
}
$n++
}
# --- Other ---
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor DarkGray
Write-Host "Other" -ForegroundColor White
foreach ($r in @("ox_lib","bob74_ipl","PolyZone","pma-voice","connectqueue","jo_towtruck","mBossmenu","luxu_admin","0r_idcard","bit-driverschool","kq_carheist")) {
Write-Host " $b1" -NoNewline -ForegroundColor DarkGray
Write-Host $n.ToString().PadLeft(2) -NoNewline -ForegroundColor DarkCyan
Write-Host "$b2 $r" -ForegroundColor Gray
$n++
}
Write-Host ""
Write-Sep
# ============================================================
# STATUS / UPDATES / WARNINGS
# ============================================================
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor Green
Write-Host "STATUS" -ForegroundColor Green
Write-Host " + Database connected - MariaDB 10.4.32" -ForegroundColor Green
Write-Host " + cfx.re Nucleus: kotzu-el7krp.users.cfx.re" -ForegroundColor Green
Write-Host " + QBCore Multi-identifier system ready" -ForegroundColor Green
Write-Host " + Luxu Admin: Red Valley Community" -ForegroundColor Green
Write-Host " + Discord bot: Red Valley Panel#3065" -ForegroundColor Green
Write-Host ""
Write-Host " $sq " -NoNewline -ForegroundColor Magenta
Write-Host "UPDATES" -ForegroundColor Magenta
Write-Host " ^ qs-inventory " -NoNewline -ForegroundColor White
Write-Host "3.7.16 -> 3.7.22" -ForegroundColor Magenta
Write-Host " ^ qs-advancedgarages " -NoNewline -ForegroundColor White
Write-Host "5.0.20 -> 5.0.29" -ForegroundColor Magenta
Write-Host " ^ qs-vehiclekeys " -NoNewline -ForegroundColor White
Write-Host "4.0.13 -> 4.0.29" -ForegroundColor Magenta
Write-Host " ^ 17mov_CharacterSystem " -NoNewline -ForegroundColor White
Write-Host "1.2.5 -> 1.2.6" -ForegroundColor Magenta
# --- FOOTER ---
Write-Host ""
$footerBar = ([string][char]9604) * 58
Write-Host " $footerBar" -ForegroundColor DarkGray
Write-Host " " -NoNewline
Write-Host " $([char]9608) SERVER READY " -NoNewline -ForegroundColor Green
Write-Host "$([char]9474) " -NoNewline -ForegroundColor DarkGray
Write-Host "$totalResources loaded" -NoNewline -ForegroundColor DarkCyan
Write-Host " $([char]9474) " -NoNewline -ForegroundColor DarkGray
Write-Host "$($n - 1) tracked" -NoNewline -ForegroundColor DarkCyan
Write-Host " $([char]9474) " -NoNewline -ForegroundColor DarkGray
$time = Get-Date -Format "HH:mm:ss"
Write-Host $time -ForegroundColor DarkGray
$footerBarTop = ([string][char]9600) * 58
Write-Host " $footerBarTop" -ForegroundColor DarkGray
Write-Host ""
Write-Host " RV> " -NoNewline -ForegroundColor Cyan
Read-Host