From a4668b8cb46747b1b92c84cbd24beaae2591ffbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 21 May 2010 02:35:29 +0200 Subject: [PATCH] Add a command to warp all players to a new lobby. --- src/egs.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/egs.erl b/src/egs.erl index 8918b35..9c9c14a 100644 --- a/src/egs.erl +++ b/src/egs.erl @@ -17,7 +17,7 @@ % along with EGS. If not, see . -module(egs). --export([start/0, reload/0, global/2]). +-export([start/0, reload/0, global/2, warp/2]). -include("include/records.hrl"). @@ -46,3 +46,8 @@ reload() -> global(Type, Message) -> lists:foreach(fun(User) -> egs_proto:send_global(User#users.socket, Type, Message) end, egs_db:users_select_all()). + +%% @doc Warp all players to a new map. + +warp(Map, Entry) -> + lists:foreach(fun(User) -> egs_game:lobby_load(User#users.socket, User#users.gid, Map, Entry) end, egs_db:users_select_all()).