Realm Wars

From LANCommander
Revision as of 21:55, 8 January 2024 by DoctorDalek (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Release Date
Windows: March 1, 2003
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\RealmWars.exe True

Install Script

# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^\$pref::Server::Info = "(.+)";' -Substitution "`$pref::Server::Info = ""Older than your mother!"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::Name = "(.+)";' -Substitution "`$pref::Server::Name = ""Vintage"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::MaxPlayers = "(.+)";' -Substitution "`$pref::Server::MaxPlayers = ""16"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::displayDevice = "(.+)";' -Substitution "`$pref::Video::displayDevice = ""OpenGL"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::fullScreen = "(.+)";' -Substitution "`$pref::Video::fullScreen = ""1"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::resolution = "(.+)";' -Substitution "`$pref::Video::resolution = ""$($Display.Bounds.Width) $($Resolution.Height) 32"";" -FilePath "$InstallDirectory\common\client\prefs.cs"

Write-ReplaceContentInFile -Pattern '^\$pref::Server::Info = "(.+)";' -Substitution "`$pref::Server::Info = ""Older than your mother!"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::Name = "(.+)";' -Substitution "`$pref::Server::Name = ""Vintage"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::MaxPlayers = "(.+)";' -Substitution "`$pref::Server::MaxPlayers = ""16"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::displayDevice = "(.+)";' -Substitution "`$pref::Video::displayDevice = ""OpenGL"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::fullScreen = "(.+)";' -Substitution "`$pref::Video::fullScreen = ""1"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::resolution = "(.+)";' -Substitution "`$pref::Video::resolution = ""$($Display.Bounds.Width) $($Display.Bounds.Height) 32"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"

Name Change Script

Write-ReplaceContentInFile -Pattern '^\$pref::Player::Name = "(.+)";' -Substitution "`$pref::Player::Name = ""$NewPlayerAlias"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Player::Name = "(.+)";' -Substitution "`$pref::Player::Name = ""$NewPlayerAlias"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"