From 2ed523c2ea03c16e83341b1bf43af8c2d1ea621d Mon Sep 17 00:00:00 2001 From: Gabor Adam Toth Date: Sun, 14 Feb 2010 02:58:44 +0100 Subject: [PATCH] force enter cmd --- world/net/usercmd.i | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/world/net/usercmd.i b/world/net/usercmd.i index 870e7d0..b7d074f 100644 --- a/world/net/usercmd.i +++ b/world/net/usercmd.i @@ -908,6 +908,32 @@ cmd(a, args, dest, command) { else teleport(args[1], "_join", 0, 1); break; + case "forceenter": + case "forcejoin": + if (sizeof(args) < 2) { + w("_warning_usage_forceenter", "Usage: /forceenter []"); + break; + } + + string plc = args[1]; + string nick_place = sizeof(args) >= 3 ? args[2] : regreplace(plc, "^.*@", "", 1); + + placeRequest(plc, +#ifdef SPEC + "_request_context_enter" +#else + "_request_enter" +#endif + ); + + places[plc] = nick_place; + + P3(("%O force joins mcast group for %O\n", ME, plc)) + register_context(ME, plc); + + w("_notice_forceenter", "You force entered [_place] ([_nick_place]).", ([ "_place": plc, "_nick_place": nick_place ])); + + break; // etwas hässlich so.. aber was will man sonst? beim zweiten versuch? // oder gar als flag von /leave? case "forceleave": // delete the membership from places mapping