Пример #1
0
        //public int GetMemberSlot(PartyMember member) {
        //    return Members.IndexOf(member);
        //}

        public void Remove(string playerID)
        {
            if (IsPlayerInParty(playerID))
            {
                for (int i = 0; i < Members.Count; i++)
                {
                    if (Members[i] == playerID)
                    {
                        Members.RemoveAt(i);
                        break;
                    }
                }

                using (DatabaseConnection dbConnection = new DatabaseConnection(DatabaseID.Players))
                {
                    PartyManager.SaveParty(dbConnection.Database, this);
                }
            }
        }
Пример #2
0
        public static bool AttemptPartyWarp(Client client, PlayerWarpAction action)
        {
            if (client.Player.PartyID == null)
            {
                action(client);
                return(true);
            }
            else
            {
                bool  warp      = true;
                IMap  sourceMap = client.Player.Map;
                Party party     = PartyManager.FindPlayerParty(client);
                foreach (Client member in party.GetOnlineMemberClients())
                {
                    if (/*!member.Player.Dead &&*/ member.Player.MapID == client.Player.MapID && (member.Player.X != client.Player.X || member.Player.Y != client.Player.Y))
                    {
                        warp = false;
                    }
                }

                if (warp)
                {
                    foreach (Client member in party.GetOnlineMemberClients())
                    {
                        if (member.Player.Map != sourceMap)
                        {
                            continue;
                        }

                        action(member);
                    }
                }
                else
                {
                    Messenger.PlayerMsg(client, "All surviving players on the floor must be on the goal in order to continue.", Text.WhiteSmoke);
                }
                return(warp);
            }
        }