mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-04 23:05:35 +00:00
Compare commits
7 Commits
v1.81.4
...
show-temp-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b4852d5b4 | ||
|
|
5343c34488 | ||
|
|
4878be1a53 | ||
|
|
1ff689c26c | ||
|
|
79b660e899 | ||
|
|
4bfe60b75c | ||
|
|
6a44d10c56 |
@@ -2,6 +2,15 @@
|
||||
|
||||
<!-- changelog -->
|
||||
|
||||
## [v1.81.5](https://github.com/wanderer-industries/wanderer/compare/v1.81.4...v1.81.5) (2025-10-09)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Core: Update connection ship size based on linked signature type
|
||||
|
||||
## [v1.81.4](https://github.com/wanderer-industries/wanderer/compare/v1.81.3...v1.81.4) (2025-10-09)
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ const renderLinkedSystemItem = (option: { value: string }) => {
|
||||
|
||||
return (
|
||||
<div className="flex gap-2 items-center">
|
||||
<SystemView systemId={value} className={classes.SystemView} />
|
||||
<SystemView systemId={value} className={classes.SystemView} showCustomName={true} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -37,7 +37,7 @@ const renderLinkedSystemValue = (option: { value: string }) => {
|
||||
|
||||
return (
|
||||
<div className="flex gap-2 items-center">
|
||||
<SystemView systemId={option.value} className={classes.SystemView} />
|
||||
<SystemView systemId={option.value} className={classes.SystemView} showCustomName={true} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -42,5 +42,5 @@ export const SystemView = ({ systemId, systemInfo: customSystemInfo, showCustomN
|
||||
return <SystemViewStandalone {...rest} {...systemInfo} />;
|
||||
}
|
||||
|
||||
return <SystemViewStandalone customName={mapSystemInfo.name ?? undefined} {...rest} {...systemInfo} />;
|
||||
return <SystemViewStandalone customName={mapSystemInfo.temporary_name ?? mapSystemInfo.name ?? undefined} {...rest} {...systemInfo} />;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ defmodule WandererApp.Map.Server.SignaturesImpl do
|
||||
alias WandererApp.Character
|
||||
alias WandererApp.User.ActivityTracker
|
||||
alias WandererApp.Map.Server.{Impl, ConnectionsImpl, SystemsImpl}
|
||||
alias WandererApp.Utils.EVEUtil
|
||||
|
||||
@doc """
|
||||
Public entrypoint for updating signatures on a map system.
|
||||
@@ -221,6 +222,7 @@ defmodule WandererApp.Map.Server.SignaturesImpl do
|
||||
) do
|
||||
{:ok, updated} ->
|
||||
maybe_update_connection_time_status(state, existing, updated)
|
||||
maybe_update_connection_mass_status(state, existing, updated)
|
||||
:ok
|
||||
|
||||
{:error, reason} ->
|
||||
@@ -251,6 +253,29 @@ defmodule WandererApp.Map.Server.SignaturesImpl do
|
||||
|
||||
defp maybe_update_connection_time_status(_state, _old_sig, _updated_sig), do: :ok
|
||||
|
||||
defp maybe_update_connection_mass_status(
|
||||
state,
|
||||
%{type: old_type} = old_sig,
|
||||
%{type: new_type, system_id: system_id, linked_system_id: linked_system_id} =
|
||||
updated_sig
|
||||
)
|
||||
when not is_nil(linked_system_id) do
|
||||
if old_type != new_type do
|
||||
{:ok, source_system} = MapSystem.by_id(system_id)
|
||||
signature_ship_size_type = EVEUtil.get_wh_size(new_type)
|
||||
|
||||
if not is_nil(signature_ship_size_type) do
|
||||
ConnectionsImpl.update_connection_ship_size_type(state, %{
|
||||
solar_system_source_id: source_system.solar_system_id,
|
||||
solar_system_target_id: linked_system_id,
|
||||
ship_size_type: signature_ship_size_type
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
defp maybe_update_connection_mass_status(_state, _old_sig, _updated_sig), do: :ok
|
||||
|
||||
defp track_activity(event, map_id, solar_system_id, user_id, character_id, signatures) do
|
||||
ActivityTracker.track_map_event(event, %{
|
||||
map_id: map_id,
|
||||
|
||||
@@ -3,6 +3,8 @@ defmodule WandererApp.Utils.EVEUtil do
|
||||
Utility functions for EVE Online related operations.
|
||||
"""
|
||||
|
||||
alias WandererApp.Map.Operations.Connections
|
||||
|
||||
@doc """
|
||||
Generates a URL for a character portrait.
|
||||
|
||||
@@ -28,4 +30,28 @@ defmodule WandererApp.Utils.EVEUtil do
|
||||
def get_portrait_url(eve_id, size) do
|
||||
"https://images.evetech.net/characters/#{eve_id}/portrait?size=#{size}"
|
||||
end
|
||||
|
||||
def get_wh_size(nil), do: nil
|
||||
def get_wh_size("K162"), do: nil
|
||||
|
||||
def get_wh_size(wh_type_name) do
|
||||
{:ok, wormhole_types} = WandererApp.CachedInfo.get_wormhole_types()
|
||||
|
||||
wormhole_types
|
||||
|> Enum.find(fn wh_type_data -> wh_type_data.name == wh_type_name end)
|
||||
|> case do
|
||||
%{max_mass_per_jump: max_mass_per_jump} when not is_nil(max_mass_per_jump) ->
|
||||
get_connection_size_status(max_mass_per_jump)
|
||||
|
||||
_ ->
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
defp get_connection_size_status(5_000_000), do: Connections.small_ship_size()
|
||||
defp get_connection_size_status(62_000_000), do: Connections.medium_ship_size()
|
||||
defp get_connection_size_status(375_000_000), do: Connections.large_ship_size()
|
||||
defp get_connection_size_status(1_000_000_000), do: Connections.freight_ship_size()
|
||||
defp get_connection_size_status(2_000_000_000), do: Connections.capital_ship_size()
|
||||
defp get_connection_size_status(_max_mass_per_jump), do: Connections.large_ship_size()
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ defmodule WandererAppWeb.MapSignaturesEventHandler do
|
||||
require Logger
|
||||
|
||||
alias WandererAppWeb.{MapEventHandler, MapCoreEventHandler}
|
||||
alias WandererApp.Map.Operations.Connections
|
||||
alias WandererApp.Utils.EVEUtil
|
||||
|
||||
def handle_server_event(
|
||||
%{
|
||||
@@ -233,7 +233,7 @@ defmodule WandererAppWeb.MapSignaturesEventHandler do
|
||||
})
|
||||
end
|
||||
|
||||
signature_ship_size_type = get_wh_size(signature.type)
|
||||
signature_ship_size_type = EVEUtil.get_wh_size(signature.type)
|
||||
|
||||
if not is_nil(signature_ship_size_type) do
|
||||
map_id
|
||||
@@ -369,28 +369,4 @@ defmodule WandererAppWeb.MapSignaturesEventHandler do
|
||||
defp get_integer(nil), do: nil
|
||||
defp get_integer(value) when is_binary(value), do: String.to_integer(value)
|
||||
defp get_integer(value), do: value
|
||||
|
||||
defp get_wh_size(nil), do: nil
|
||||
defp get_wh_size("K162"), do: nil
|
||||
|
||||
defp get_wh_size(wh_type_name) do
|
||||
{:ok, wormhole_types} = WandererApp.CachedInfo.get_wormhole_types()
|
||||
|
||||
wormhole_types
|
||||
|> Enum.find(fn wh_type_data -> wh_type_data.name == wh_type_name end)
|
||||
|> case do
|
||||
%{max_mass_per_jump: max_mass_per_jump} when not is_nil(max_mass_per_jump) ->
|
||||
get_connection_size_status(max_mass_per_jump)
|
||||
|
||||
_ ->
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
defp get_connection_size_status(5_000_000), do: Connections.small_ship_size()
|
||||
defp get_connection_size_status(62_000_000), do: Connections.medium_ship_size()
|
||||
defp get_connection_size_status(375_000_000), do: Connections.large_ship_size()
|
||||
defp get_connection_size_status(1_000_000_000), do: Connections.freight_ship_size()
|
||||
defp get_connection_size_status(2_000_000_000), do: Connections.capital_ship_size()
|
||||
defp get_connection_size_status(_max_mass_per_jump), do: Connections.large_ship_size()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user