kimi gone wild
This commit is contained in:
@@ -35,6 +35,25 @@ defmodule Odinsea.Channel.Players do
|
||||
:ok
|
||||
end
|
||||
|
||||
@doc """
|
||||
Adds a player with full character state.
|
||||
Extracts relevant fields from character state.
|
||||
"""
|
||||
def add_character(character_id, %{} = character_state) do
|
||||
player_data = %{
|
||||
character_id: character_id,
|
||||
name: character_state.name,
|
||||
map_id: character_state.map_id,
|
||||
level: character_state.level,
|
||||
job: character_state.job,
|
||||
gm: Map.get(character_state, :gm, 0),
|
||||
client_pid: character_state.client_pid
|
||||
}
|
||||
|
||||
:ets.insert(@table, {character_id, player_data})
|
||||
:ok
|
||||
end
|
||||
|
||||
@doc """
|
||||
Removes a player from the channel storage.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user