Пример #1
0
        private void listView_players_data_DoubleClick(object sender, EventArgs e)
        {
            //double click on a player in the list
            //normal - follow them
            //cntrl - attack them
            if (listView_players_data.SelectedIndices.Count > 0)
            {
                //action to this item
                uint id = Util.GetUInt32(listView_players_data.Items[listView_players_data.SelectedIndices[0]].SubItems[5].Text);

                if (Globals.PlayerLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        CharInfo player = Util.GetChar(id);

                        if (player != null)
                        {
                            ServerPackets.ClickChar(id, Util.Float_Int32(player.X), Util.Float_Int32(player.Y), Util.Float_Int32(player.Z), Globals.gamedata.Control, Globals.gamedata.Shift);
                        }
                    }
                    finally
                    {
                        Globals.PlayerLock.ExitReadLock();
                    }
                }
            }
        }