Skip to content

Commit e5d68ea

Browse files
authored
fix(ingress): don't fetch skins for players without uuids (#895)
The server can skip fetching the skin in this case because the player does not have a skin.
1 parent 2f4bcfe commit e5d68ea

File tree

1 file changed

+18
-14
lines changed
  • crates/hyperion/src/ingress

1 file changed

+18
-14
lines changed

crates/hyperion/src/ingress/mod.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,25 @@ fn process_login(
130130
let skins = comms.skins_tx.clone();
131131
let id = entity.id();
132132

133-
tasks.spawn(async move {
134-
let skin = match PlayerSkin::from_uuid(uuid, &mojang, &skins_collection).await {
135-
Ok(Some(skin)) => skin,
136-
Err(e) => {
137-
error!("failed to get skin {e}. Using empty skin");
138-
PlayerSkin::EMPTY
139-
}
140-
Ok(None) => {
141-
error!("failed to get skin. Using empty skin");
142-
PlayerSkin::EMPTY
143-
}
144-
};
133+
if profile_id.is_some() {
134+
tasks.spawn(async move {
135+
let skin = match PlayerSkin::from_uuid(uuid, &mojang, &skins_collection).await {
136+
Ok(Some(skin)) => skin,
137+
Err(e) => {
138+
error!("failed to get skin {e}. Using empty skin");
139+
PlayerSkin::EMPTY
140+
}
141+
Ok(None) => {
142+
error!("failed to get skin. Using empty skin");
143+
PlayerSkin::EMPTY
144+
}
145+
};
145146

146-
skins.send((id, skin)).unwrap();
147-
});
147+
skins.send((id, skin)).unwrap();
148+
});
149+
} else {
150+
skins.send((id, PlayerSkin::EMPTY)).unwrap();
151+
}
148152

149153
let pkt = login::LoginSuccessS2c {
150154
uuid,

0 commit comments

Comments
 (0)