public static void PlayerSearch(int curX, int curY, byte rClick) { ByteStream buffer = new ByteStream(4); if (C_GameLogic.IsInBounds()) { buffer.WriteInt32((System.Int32)Packets.ClientPackets.CSearch); buffer.WriteInt32(curX); buffer.WriteInt32(curY); buffer.WriteInt32(rClick); C_NetworkConfig.Socket.SendData(buffer.Data, buffer.Head); } buffer.Dispose(); }
public void Picscreen_MouseDown(object sender, MouseEventArgs e) { if (!C_GuiFunctions.CheckGuiClick(e.X, e.Y, e)) { if (C_Constants.InMapEditor) { FrmEditor_MapEditor.Default.MapEditorMouseDown((System.Int32)e.Button, e.X, e.Y, false); } // left click if (e.Button == MouseButtons.Left) { // if we're in the middle of choose the trade target or not if (!C_Trade.TradeRequest) { if (C_Pets.PetAlive(C_Variables.Myindex)) { if (C_GameLogic.IsInBounds()) { C_Pets.PetMove(C_Variables.CurX, C_Variables.CurY); } } // targetting C_NetworkSend.PlayerSearch(C_Variables.CurX, C_Variables.CurY, (byte)0); } else { // trading C_Trade.SendTradeRequest(C_Types.Player[C_Variables.MyTarget].Name); } C_UpdateUI.PnlRClickVisible = false; C_Pets.ShowPetStats = false; // right click } else if (e.Button == MouseButtons.Right) { if (C_Variables.ShiftDown || C_UpdateUI.VbKeyShift == true) { // admin warp if we're pressing shift and right clicking if (C_Player.GetPlayerAccess(C_Variables.Myindex) >= 2) { C_NetworkSend.AdminWarp(C_Variables.CurX, C_Variables.CurY); } } else { // rightclick menu if (C_Pets.PetAlive(C_Variables.Myindex)) { if (C_GameLogic.IsInBounds() && C_Variables.CurX == C_Types.Player[C_Variables.Myindex].Pet.X & C_Variables.CurY == C_Types.Player[C_Variables.Myindex].Pet.Y) { C_Pets.ShowPetStats = true; } } else { C_NetworkSend.PlayerSearch(C_Variables.CurX, C_Variables.CurY, (byte)1); } } C_Housing.FurnitureSelected = 0; } } C_GuiFunctions.CheckGuiMouseDown(e.X, e.Y, e); if (!FrmAdmin.Default.Visible || !FrmOptions.Default.Visible) { Focus(); } }