예제 #1
0
        internal static void PostSentMap(Player p, Level prev, Level lvl, bool announce)
        {
            Position    pos = lvl.SpawnPos;
            Orientation rot = p.Rot;
            byte        yaw = lvl.rotx, pitch = lvl.roty;

            // in case player disconnected mid-way through loading map
            if (p.Socket.Disconnected)
            {
                return;
            }

            OnPlayerSpawningEvent.Call(p, ref pos, ref yaw, ref pitch, false);
            rot.RotY  = yaw;
            rot.HeadX = pitch;
            p.Pos     = pos;
            p.SetYawPitch(yaw, pitch);
            if (p.Socket.Disconnected)
            {
                return;
            }

            Entities.SpawnEntities(p, pos, rot);
            OnJoinedLevelEvent.Call(p, prev, lvl, ref announce);
            if (!announce || !Server.Config.ShowWorldChanges)
            {
                return;
            }

            announce = !p.hidden && Server.Config.IRCShowWorldChanges;
            string msg = p.level.IsMuseum ? "λNICK %Swent to the " : "λNICK %Swent to ";

            Chat.MessageFrom(ChatScope.Global, p, msg + lvl.ColoredName,
                             null, FilterGoto(p), announce);
        }