mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-06 00:07:48 +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
|
#### 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>
|
</div>
|
||||||
@@ -100,9 +100,6 @@
|
|||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> **Only legitimate copies of the games are supported. If you don't own the game, please buy it.**
|
> **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**
|
> **IW4-SP**
|
||||||
> Call of Duty: Modern Warfare 2 - Singeplayer
|
> Call of Duty: Modern Warfare 2 - Singeplayer
|
||||||
|
|
||||||
@@ -119,7 +116,7 @@
|
|||||||
|
|
||||||
## ⚙️ Command line arguments
|
## ⚙️ 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
|
- Skip automatic detection and launch the specified game
|
||||||
- Must be the first argument if used
|
- Must be the first argument if used
|
||||||
- ```--help```
|
- ```--help```
|
||||||
@@ -149,7 +146,7 @@
|
|||||||
- ```--redist```
|
- ```--redist```
|
||||||
- Install or reinstall redistributables
|
- Install or reinstall redistributables
|
||||||
- ```--prerelease```
|
- ```--prerelease```
|
||||||
- Update to prerelease version of clients (currently only available for IW4x) and launcher
|
- Update to prerelease version of the launcher
|
||||||
- ```--rate```
|
- ```--rate```
|
||||||
- Rate and display CDN servers
|
- Rate and display CDN servers
|
||||||
- ```--cdn-url```
|
- ```--cdn-url```
|
||||||
@@ -159,7 +156,7 @@
|
|||||||
|
|
||||||
##### Example:
|
##### Example:
|
||||||
```shell
|
```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]
|
> [!TIP]
|
||||||
> Some arguments can be set in alterware-launcher.json, args generally override the values of the config.
|
> 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
|
# S1-Mod, IW6-Mod
|
||||||
| Argument | Description |
|
| Argument | Description |
|
||||||
|:------------------------|:-----------------------------------------------|
|
|:------------------------|:-----------------------------------------------|
|
||||||
|
|||||||
16
src/cdn.rs
16
src/cdn.rs
@@ -195,12 +195,8 @@ pub struct Hosts {
|
|||||||
|
|
||||||
impl Hosts {
|
impl Hosts {
|
||||||
/// create new rated hosts instance
|
/// create new rated hosts instance
|
||||||
pub async fn new(use_iw4x_cdns: bool) -> Self {
|
pub async fn new() -> Self {
|
||||||
let cdn_hosts = if use_iw4x_cdns {
|
let cdn_hosts = crate::global::CDN_HOSTS.to_vec();
|
||||||
crate::global::IW4X_CDN_HOSTS.to_vec()
|
|
||||||
} else {
|
|
||||||
crate::global::CDN_HOSTS.to_vec()
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut hosts = Hosts {
|
let mut hosts = Hosts {
|
||||||
servers: cdn_hosts,
|
servers: cdn_hosts,
|
||||||
@@ -276,7 +272,7 @@ impl Hosts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// CDN rating function for --rate flag
|
/// 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;
|
use colored::Colorize;
|
||||||
|
|
||||||
let (asn, region_str) = crate::http::get_location_info().await;
|
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...");
|
println!("Rating CDNs...");
|
||||||
|
|
||||||
let cdn_hosts = if use_iw4x_cdns {
|
let cdn_hosts = crate::global::CDN_HOSTS.to_vec();
|
||||||
crate::global::IW4X_CDN_HOSTS.to_vec()
|
|
||||||
} else {
|
|
||||||
crate::global::CDN_HOSTS.to_vec()
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut hosts = Hosts {
|
let mut hosts = Hosts {
|
||||||
servers: cdn_hosts,
|
servers: cdn_hosts,
|
||||||
|
|||||||
@@ -19,11 +19,6 @@ pub const CDN_HOSTS: [Server; 2] = [
|
|||||||
Server::new("us-cdn.alterware.ovh", Region::NorthAmerica),
|
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 const IP2ASN: &str = "https://ip2asn.getserve.rs/v1/as/ip/self";
|
||||||
|
|
||||||
pub static USER_AGENT: Lazy<String> = Lazy::new(|| {
|
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(
|
pub async fn check_connectivity_and_rate_cdns() -> Pin<Box<dyn Future<Output = bool> + Send>> {
|
||||||
use_iw4x_cdns: bool,
|
|
||||||
) -> Pin<Box<dyn Future<Output = bool> + Send>> {
|
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
crate::println_info!("Initializing CDN rating system...");
|
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();
|
let best_cdn = hosts.get_master_url();
|
||||||
|
|
||||||
if let Some(cdn_url) = best_cdn {
|
if let Some(cdn_url) = best_cdn {
|
||||||
@@ -135,7 +128,7 @@ pub fn check_connectivity(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} 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!(" --offline: Run in offline mode");
|
||||||
println!(" --skip-connectivity-check: Don't check connectivity");
|
println!(" --skip-connectivity-check: Don't check connectivity");
|
||||||
println!(" --rate: Display CDN rating information and exit");
|
println!(" --rate: Display CDN rating information and exit");
|
||||||
println!(
|
println!("\nExample:\n alterware-launcher.exe iw6 --pass \"-headless\"");
|
||||||
"\nExample:\n alterware-launcher.exe iw4x --bonus --pass \"-console -nointro\""
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -705,7 +703,7 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if arg_bool(&args, "--rate") {
|
if arg_bool(&args, "--rate") {
|
||||||
cdn::rate_cdns_and_display(false).await;
|
cdn::rate_cdns_and_display().await;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -737,7 +735,7 @@ async fn main() {
|
|||||||
if initial_cdn.is_some() {
|
if initial_cdn.is_some() {
|
||||||
cfg.offline = !global::check_connectivity(initial_cdn).await;
|
cfg.offline = !global::check_connectivity(initial_cdn).await;
|
||||||
} else {
|
} 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