fix login issue*
This commit is contained in:
@@ -986,6 +986,13 @@ defmodule Odinsea.Game.Character do
|
||||
GenServer.call(via_tuple(character_id), {:remove_item_by_id, item_id, quantity})
|
||||
end
|
||||
|
||||
@doc """
|
||||
Updates the buddy list for a character.
|
||||
"""
|
||||
def update_buddies(character_id, buddies) do
|
||||
GenServer.cast(via_tuple(character_id), {:update_buddies, buddies})
|
||||
end
|
||||
|
||||
# ============================================================================
|
||||
# GenServer Callbacks - Scripting Operations
|
||||
# ============================================================================
|
||||
@@ -1014,6 +1021,14 @@ defmodule Odinsea.Game.Character do
|
||||
{:noreply, new_state}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_cast({:update_buddies, buddies}, state) do
|
||||
# TODO: Store buddies in state when buddy list is added to State struct
|
||||
# For now, just log the update
|
||||
Logger.debug("Updated buddy list for character #{state.name}")
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_call({:add_item, inventory_type, item}, _from, state) do
|
||||
inventory = Map.get(state.inventories, inventory_type, Inventory.new(inventory_type))
|
||||
|
||||
Reference in New Issue
Block a user