Packages

A library that allows connecting to Freelancer game servers via an FLHook socket to run commands and receive events.

Current section

Files

Jump to
fl_hook_client lib fl_hook utils.ex
Raw

lib/fl_hook/utils.ex

defmodule FLHook.Utils do
@moduledoc false
@line_sep "\r\n"
@spec line_sep() :: String.t()
def line_sep, do: @line_sep
@spec map_chars(String.t(), %{optional(String.t()) => String.t()}) ::
String.t()
def map_chars(str, map) do
Enum.reduce(map, str, fn {char, mapped_char}, str ->
String.replace(str, char, mapped_char)
end)
end
end