Don't need a + in replace regexpes since they're global.
This commit is contained in:
parent
dd0162458b
commit
f9a61af2dc
@ -394,7 +394,7 @@ handle(16#0304, _, GID, Version, Packet) ->
|
|||||||
end,
|
end,
|
||||||
[LogName|_] = re:split(ActualName, "\\0\\0", [{return, binary}]),
|
[LogName|_] = re:split(ActualName, "\\0\\0", [{return, binary}]),
|
||||||
[LogMessage|_] = re:split(ChatMessage, "\\0\\0", [{return, binary}]),
|
[LogMessage|_] = re:split(ChatMessage, "\\0\\0", [{return, binary}]),
|
||||||
log(GID, io_lib:format("chat from ~s: ~s", [[re:replace(LogName, "\\0+", "", [global, {return, binary}])], [re:replace(LogMessage, "\\0+", "", [global, {return, binary}])]])),
|
log(GID, io_lib:format("chat from ~s: ~s", [[re:replace(LogName, "\\0", "", [global, {return, binary}])], [re:replace(LogMessage, "\\0", "", [global, {return, binary}])]])),
|
||||||
lists:foreach(fun(User) -> User#users.pid ! {psu_chat, GID, ActualName, ChatModifiers, ChatMessage} end, egs_db:users_select_all());
|
lists:foreach(fun(User) -> User#users.pid ! {psu_chat, GID, ActualName, ChatModifiers, ChatMessage} end, egs_db:users_select_all());
|
||||||
|
|
||||||
%% @doc Map change handler.
|
%% @doc Map change handler.
|
||||||
|
@ -123,8 +123,8 @@ packet_split(Packet, Result) ->
|
|||||||
|
|
||||||
parse_auth_request(Packet) ->
|
parse_auth_request(Packet) ->
|
||||||
<< _:352, Username:192/bits, Password:192/bits, _/bits >> = Packet,
|
<< _:352, Username:192/bits, Password:192/bits, _/bits >> = Packet,
|
||||||
[{username, re:replace(Username, "\\0+", "", [global, {return, binary}])},
|
[{username, re:replace(Username, "\\0", "", [global, {return, binary}])},
|
||||||
{password, re:replace(Password, "\\0+", "", [global, {return, binary}])}].
|
{password, re:replace(Password, "\\0", "", [global, {return, binary}])}].
|
||||||
|
|
||||||
%% @doc Parse a character creation command. Return the character number and data.
|
%% @doc Parse a character creation command. Return the character number and data.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user