Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion hook/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ pub unsafe fn initialize() -> Result<()> {
)?;
HookUFunctionBind.enable()?;

if let Ok(server_name) = &globals().resolution.server_name {
if let Ok(server_name) = &globals().resolution.server_name
&& globals().meta.mods.iter().any(|m| m.gameplay_affecting)
{
GetServerName
.initialize(
std::mem::transmute(server_name.get_server_name.0),
Expand Down
2 changes: 2 additions & 0 deletions hook/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![feature(let_chains)]

mod hooks;
mod ue;

Expand Down
10 changes: 9 additions & 1 deletion mint_lib/src/mod_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub enum ApprovalStatus {
}

/// Whether a mod can be resolved by clients or not
#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd, Hash)]
#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ResolvableStatus {
Unresolvable(String),
Resolvable,
Expand Down Expand Up @@ -112,11 +112,13 @@ impl ModIdentifier {
Self(s)
}
}

impl From<String> for ModIdentifier {
fn from(value: String) -> Self {
Self::new(value)
}
}

impl From<&str> for ModIdentifier {
fn from(value: &str) -> Self {
Self::new(value.to_owned())
Expand All @@ -130,21 +132,25 @@ pub struct Meta {
pub mods: Vec<MetaMod>,
pub config: MetaConfig,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct MetaConfig {
pub disable_fix_exploding_gas: bool,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct SemverVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
}

impl Display for SemverVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}.{}.{}", self.major, self.minor, self.patch)
}
}

#[derive(Debug, Serialize, Deserialize)]
pub struct MetaMod {
pub name: String,
Expand All @@ -153,7 +159,9 @@ pub struct MetaMod {
pub author: String,
pub approval: ApprovalStatus,
pub required: bool,
pub gameplay_affecting: bool,
}

impl Meta {
pub fn to_server_list_string(&self) -> String {
use itertools::Itertools;
Expand Down
1 change: 1 addition & 0 deletions src/gui/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ async fn integrate_async(
crate::integrate::integrate(
fsd_pak,
config,
store,
to_integrate.into_iter().zip(paths).collect(),
)
})
Expand Down
Loading