mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-03 15:07:47 +00:00
fix: remove IW4x CDNs
This commit is contained in:
11
README.md
11
README.md
@@ -4,7 +4,7 @@
|
||||
|
||||
#### Official launcher for AlterWare Call of Duty mods
|
||||
|
||||
##### IW4x | IW4-SP | IW5-Mod | IW6-Mod | S1-Mod
|
||||
##### IW4-SP | IW5-Mod | IW6-Mod | S1-Mod
|
||||
|
||||
  
|
||||
</div>
|
||||
@@ -100,9 +100,6 @@
|
||||
> [!IMPORTANT]
|
||||
> **Only legitimate copies of the games are supported. If you don't own the game, please buy it.**
|
||||
|
||||
> **IW4x**
|
||||
> Call of Duty: Modern Warfare 2 - Multiplayer
|
||||
|
||||
> **IW4-SP**
|
||||
> Call of Duty: Modern Warfare 2 - Singeplayer
|
||||
|
||||
@@ -119,7 +116,7 @@
|
||||
|
||||
## ⚙️ Command line arguments
|
||||
|
||||
- ```iw4-sp```, ```iw4x```, ```iw5-mod```, ```iw6-mod```, ```s1-mod```
|
||||
- ```iw4-sp```, ```iw5-mod```, ```iw6-mod```, ```s1-mod```
|
||||
- Skip automatic detection and launch the specified game
|
||||
- Must be the first argument if used
|
||||
- ```--help```
|
||||
@@ -149,7 +146,7 @@
|
||||
- ```--redist```
|
||||
- Install or reinstall redistributables
|
||||
- ```--prerelease```
|
||||
- Update to prerelease version of clients (currently only available for IW4x) and launcher
|
||||
- Update to prerelease version of the launcher
|
||||
- ```--rate```
|
||||
- Rate and display CDN servers
|
||||
- ```--cdn-url```
|
||||
@@ -159,7 +156,7 @@
|
||||
|
||||
##### Example:
|
||||
```shell
|
||||
alterware-launcher.exe iw4x --bonus -u --path "C:\Games\IW4x" --pass "-console"
|
||||
alterware-launcher.exe iw6 --bonus -u --path "C:\Games\IW6x" --pass "-headless"
|
||||
```
|
||||
> [!TIP]
|
||||
> Some arguments can be set in alterware-launcher.json, args generally override the values of the config.
|
||||
|
||||
@@ -1,27 +1,3 @@
|
||||
# IW4x
|
||||
[github.com/iw4x/iw4x-client#command-line-arguments](https://github.com/iw4x/iw4x-client#command-line-arguments)
|
||||
|
||||
| Argument | Description |
|
||||
|:------------------------|:-----------------------------------------------|
|
||||
| `-tests` | Perform unit tests. |
|
||||
| `-entries` | Print to the console a list of every asset as they are loaded from zonefiles. |
|
||||
| `-stdout` | Redirect all logging output to the terminal iw4x is started from, or if there is none, creates a new terminal window to write log information in. |
|
||||
| `-console` | Allow the game to display its own separate interactive console window. |
|
||||
| `-dedicated` | Starts the game as a headless dedicated server. |
|
||||
| `-bigminidumps` | Include all code sections from loaded modules in the dump. |
|
||||
| `-reallybigminidumps` | Include data sections from all loaded modules in the dump. |
|
||||
| `-dump` | Write info of loaded assets to the raw folder as they are being loaded. |
|
||||
| `-nointro` | Skip game's cinematic intro. |
|
||||
| `-version` | Print IW4x build info on startup. |
|
||||
| `-nosteam` | Disable friends feature and do not update Steam about the game's current status just like an invisible mode. |
|
||||
| `-unprotect-dvars` | Allow the server to modify saved/archive dvars. |
|
||||
| `-zonebuilder` | Start the interactive zonebuilder tool console instead of starting the game. |
|
||||
| `-disable-notifies` | Disable "Anti-CFG" checks |
|
||||
| `-disable-mongoose` | Disable Mongoose HTTP server |
|
||||
| `-disable-rate-limit-check` | Disable RCOn rate limit checks |
|
||||
| `+<command>` | Execute game command (ex. `+set net_port 1337`)|
|
||||
|
||||
|
||||
# S1-Mod, IW6-Mod
|
||||
| Argument | Description |
|
||||
|:------------------------|:-----------------------------------------------|
|
||||
|
||||
16
src/cdn.rs
16
src/cdn.rs
@@ -195,12 +195,8 @@ pub struct Hosts {
|
||||
|
||||
impl Hosts {
|
||||
/// create new rated hosts instance
|
||||
pub async fn new(use_iw4x_cdns: bool) -> Self {
|
||||
let cdn_hosts = if use_iw4x_cdns {
|
||||
crate::global::IW4X_CDN_HOSTS.to_vec()
|
||||
} else {
|
||||
crate::global::CDN_HOSTS.to_vec()
|
||||
};
|
||||
pub async fn new() -> Self {
|
||||
let cdn_hosts = crate::global::CDN_HOSTS.to_vec();
|
||||
|
||||
let mut hosts = Hosts {
|
||||
servers: cdn_hosts,
|
||||
@@ -276,7 +272,7 @@ impl Hosts {
|
||||
}
|
||||
|
||||
/// CDN rating function for --rate flag
|
||||
pub async fn rate_cdns_and_display(use_iw4x_cdns: bool) {
|
||||
pub async fn rate_cdns_and_display() {
|
||||
use colored::Colorize;
|
||||
|
||||
let (asn, region_str) = crate::http::get_location_info().await;
|
||||
@@ -293,11 +289,7 @@ pub async fn rate_cdns_and_display(use_iw4x_cdns: bool) {
|
||||
|
||||
println!("Rating CDNs...");
|
||||
|
||||
let cdn_hosts = if use_iw4x_cdns {
|
||||
crate::global::IW4X_CDN_HOSTS.to_vec()
|
||||
} else {
|
||||
crate::global::CDN_HOSTS.to_vec()
|
||||
};
|
||||
let cdn_hosts = crate::global::CDN_HOSTS.to_vec();
|
||||
|
||||
let mut hosts = Hosts {
|
||||
servers: cdn_hosts,
|
||||
|
||||
@@ -19,11 +19,6 @@ pub const CDN_HOSTS: [Server; 2] = [
|
||||
Server::new("us-cdn.alterware.ovh", Region::NorthAmerica),
|
||||
];
|
||||
|
||||
pub const IW4X_CDN_HOSTS: [Server; 2] = [
|
||||
Server::new("cdn.iw4x.dev", Region::Europe),
|
||||
Server::new("cf-cdn.iw4x.dev", Region::Global),
|
||||
];
|
||||
|
||||
pub const IP2ASN: &str = "https://ip2asn.getserve.rs/v1/as/ip/self";
|
||||
|
||||
pub static USER_AGENT: Lazy<String> = Lazy::new(|| {
|
||||
@@ -87,12 +82,10 @@ pub static PREFIXES: Lazy<HashMap<&'static str, PrintPrefix>> = Lazy::new(|| {
|
||||
])
|
||||
});
|
||||
|
||||
pub async fn check_connectivity_and_rate_cdns(
|
||||
use_iw4x_cdns: bool,
|
||||
) -> Pin<Box<dyn Future<Output = bool> + Send>> {
|
||||
pub async fn check_connectivity_and_rate_cdns() -> Pin<Box<dyn Future<Output = bool> + Send>> {
|
||||
Box::pin(async move {
|
||||
crate::println_info!("Initializing CDN rating system...");
|
||||
let hosts = Hosts::new(use_iw4x_cdns).await;
|
||||
let hosts = Hosts::new().await;
|
||||
let best_cdn = hosts.get_master_url();
|
||||
|
||||
if let Some(cdn_url) = best_cdn {
|
||||
@@ -135,7 +128,7 @@ pub fn check_connectivity(
|
||||
}
|
||||
}
|
||||
} else {
|
||||
check_connectivity_and_rate_cdns(false).await.await
|
||||
check_connectivity_and_rate_cdns().await.await
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -667,9 +667,7 @@ async fn main() {
|
||||
println!(" --offline: Run in offline mode");
|
||||
println!(" --skip-connectivity-check: Don't check connectivity");
|
||||
println!(" --rate: Display CDN rating information and exit");
|
||||
println!(
|
||||
"\nExample:\n alterware-launcher.exe iw4x --bonus --pass \"-console -nointro\""
|
||||
);
|
||||
println!("\nExample:\n alterware-launcher.exe iw6 --pass \"-headless\"");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -705,7 +703,7 @@ async fn main() {
|
||||
}
|
||||
|
||||
if arg_bool(&args, "--rate") {
|
||||
cdn::rate_cdns_and_display(false).await;
|
||||
cdn::rate_cdns_and_display().await;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -737,7 +735,7 @@ async fn main() {
|
||||
if initial_cdn.is_some() {
|
||||
cfg.offline = !global::check_connectivity(initial_cdn).await;
|
||||
} else {
|
||||
cfg.offline = !global::check_connectivity_and_rate_cdns(false).await.await;
|
||||
cfg.offline = !global::check_connectivity_and_rate_cdns().await.await;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user