public static void Attack(uint serial) { if (ProfileManager.CurrentProfile.EnabledCriminalActionQuery) { Mobile m = World.Mobiles.Get(serial); if (m != null && (World.Player.NotorietyFlag == NotorietyFlag.Innocent || World.Player.NotorietyFlag == NotorietyFlag.Ally) && m.NotorietyFlag == NotorietyFlag.Innocent && m != World.Player) { QuestionGump messageBox = new QuestionGump ( ResGeneral.ThisMayFlagYouCriminal, s => { if (s) { Socket.Send_AttackRequest(serial); } } ); UIManager.Add(messageBox); return; } } TargetManager.LastAttack = serial; Socket.Send_AttackRequest(serial); }
public static void Attack(Serial serial) { if (ProfileManager.Current.EnabledCriminalActionQuery) { Mobile m = World.Mobiles.Get(serial); if (m != null && (World.Player.NotorietyFlag == NotorietyFlag.Innocent || World.Player.NotorietyFlag == NotorietyFlag.Ally) && m.NotorietyFlag == NotorietyFlag.Innocent && m != World.Player) { QuestionGump messageBox = new QuestionGump("This may flag\nyou criminal!", s => { if (s) { Socket.Send(new PAttackRequest(serial)); } }); UIManager.Add(messageBox); return; } } TargetManager.LastAttack = serial; Socket.Send(new PAttackRequest(serial)); }
public static void TargetObject(Serial entity, Serial cursorID, byte cursorType) { Entity e = World.Get(entity); if (e == null) { return; } if (Engine.Profile.Current.EnabledCriminalActionQuery && TargetManager.TargeringType == TargetType.Harmful) { Mobile m = World.Mobiles.Get(entity); if (m != null && (World.Player.NotorietyFlag == NotorietyFlag.Innocent || World.Player.NotorietyFlag == NotorietyFlag.Ally) && m.NotorietyFlag == NotorietyFlag.Innocent && m != World.Player) { QuestionGump messageBox = new QuestionGump("This may flag\nyou criminal!", s => { if (s) { Socket.Send(new PTargetObject(entity, e.Graphic, e.X, e.Y, e.Z, cursorID, cursorType)); } }); Engine.UI.Add(messageBox); return; } } Socket.Send(new PTargetObject(entity, e.Graphic, e.X, e.Y, e.Z, cursorID, cursorType)); }
public static void Target(uint serial) { if (!IsTargeting) { return; } Entity entity = World.InGame ? World.Get(serial) : null; if (entity != null) { switch (TargetingState) { case CursorTarget.Invalid: return; case CursorTarget.MultiPlacement: case CursorTarget.Position: case CursorTarget.Object: case CursorTarget.HueCommandTarget: case CursorTarget.SetTargetClientSide: if (entity != World.Player) { LastTargetInfo.SetEntity(serial); } if (SerialHelper.IsMobile(serial) && serial != World.Player && (World.Player.NotorietyFlag == NotorietyFlag.Innocent || World.Player.NotorietyFlag == NotorietyFlag.Ally)) { Mobile mobile = entity as Mobile; if (mobile != null) { bool showCriminalQuery = false; if (TargetingType == TargetType.Harmful && ProfileManager.Current.EnabledCriminalActionQuery && mobile.NotorietyFlag == NotorietyFlag.Innocent) { showCriminalQuery = true; } else if (TargetingType == TargetType.Beneficial && ProfileManager.Current.EnabledBeneficialCriminalActionQuery && (mobile.NotorietyFlag == NotorietyFlag.Criminal || mobile.NotorietyFlag == NotorietyFlag.Murderer || mobile.NotorietyFlag == NotorietyFlag.Gray)) { showCriminalQuery = true; } if (showCriminalQuery) { QuestionGump messageBox = new QuestionGump("This may flag\nyou criminal!", s => { if (s) { NetClient.Socket.Send(new PTargetObject(entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargetingType)); ClearTargetingWithoutTargetCancelPacket(); } }); UIManager.Add(messageBox); return; } } } if (TargetingState != CursorTarget.SetTargetClientSide) { var packet = new PTargetObject(entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargetingType); for (int i = 0; i < _lastDataBuffer.Length; i++) { _lastDataBuffer[i] = packet[i]; } NetClient.Socket.Send(packet); } ClearTargetingWithoutTargetCancelPacket(); Mouse.CancelDoubleClick = true; break; case CursorTarget.Grab: if (SerialHelper.IsItem(serial)) { GameActions.GrabItem(serial, ((Item)entity).Amount); } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.SetGrabBag: if (SerialHelper.IsItem(serial)) { ProfileManager.Current.GrabBagSerial = serial; GameActions.Print($"Grab Bag set: {serial}"); } ClearTargetingWithoutTargetCancelPacket(); return; } } }
public static void Target(uint serial) { if (!IsTargeting) { return; } Entity entity = World.InGame ? World.Get(serial) : null; if (entity != null) { switch (TargetingState) { case CursorTarget.Invalid: return; case CursorTarget.MultiPlacement: case CursorTarget.Position: case CursorTarget.Object: case CursorTarget.HueCommandTarget: case CursorTarget.SetTargetClientSide: if (entity != World.Player) { LastTargetInfo.SetEntity(serial); } if (SerialHelper.IsMobile(serial) && serial != World.Player && (World.Player.NotorietyFlag == NotorietyFlag.Innocent || World.Player.NotorietyFlag == NotorietyFlag.Ally)) { Mobile mobile = entity as Mobile; if (mobile != null) { bool showCriminalQuery = false; if (TargetingType == TargetType.Harmful && ProfileManager.CurrentProfile.EnabledCriminalActionQuery && mobile.NotorietyFlag == NotorietyFlag.Innocent) { showCriminalQuery = true; } else if (TargetingType == TargetType.Beneficial && ProfileManager.CurrentProfile.EnabledBeneficialCriminalActionQuery && (mobile.NotorietyFlag == NotorietyFlag.Criminal || mobile.NotorietyFlag == NotorietyFlag.Murderer || mobile.NotorietyFlag == NotorietyFlag.Gray)) { showCriminalQuery = true; } if (showCriminalQuery && UIManager.GetGump <QuestionGump>() == null) { QuestionGump messageBox = new QuestionGump ( "This may flag\nyou criminal!", s => { if (s) { NetClient.Socket.Send_TargetObject(entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargetingType); ClearTargetingWithoutTargetCancelPacket(); if (LastTargetInfo.Serial != serial) { GameActions.RequestMobileStatus(serial); } } } ); UIManager.Add(messageBox); return; } } } if (TargetingState != CursorTarget.SetTargetClientSide) { _lastDataBuffer[0] = 0x6C; _lastDataBuffer[1] = 0x00; _lastDataBuffer[2] = (byte)(_targetCursorId >> 24); _lastDataBuffer[3] = (byte)(_targetCursorId >> 16); _lastDataBuffer[4] = (byte)(_targetCursorId >> 8); _lastDataBuffer[5] = (byte)_targetCursorId; _lastDataBuffer[6] = (byte)TargetingType; _lastDataBuffer[7] = (byte)(entity.Serial >> 24); _lastDataBuffer[8] = (byte)(entity.Serial >> 16); _lastDataBuffer[9] = (byte)(entity.Serial >> 8); _lastDataBuffer[10] = (byte)entity.Serial; _lastDataBuffer[11] = (byte)(entity.X >> 8); _lastDataBuffer[12] = (byte)entity.X; _lastDataBuffer[13] = (byte)(entity.Y >> 8); _lastDataBuffer[14] = (byte)entity.Y; _lastDataBuffer[15] = (byte)(entity.Z >> 8); _lastDataBuffer[16] = (byte)entity.Z; _lastDataBuffer[17] = (byte)(entity.Graphic >> 8); _lastDataBuffer[18] = (byte)entity.Graphic; NetClient.Socket.Send_TargetObject(entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargetingType); if (SerialHelper.IsMobile(serial) && LastTargetInfo.Serial != serial) { GameActions.RequestMobileStatus(serial); } } ClearTargetingWithoutTargetCancelPacket(); Mouse.CancelDoubleClick = true; break; case CursorTarget.Grab: if (SerialHelper.IsItem(serial)) { GameActions.GrabItem(serial, ((Item)entity).Amount); } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.SetGrabBag: if (SerialHelper.IsItem(serial)) { ProfileManager.CurrentProfile.GrabBagSerial = serial; GameActions.Print(string.Format(ResGeneral.GrabBagSet0, serial)); } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.IgnorePlayerTarget: if (SelectedObject.Object is Entity pmEntity) { IgnoreManager.AddIgnoredTarget(pmEntity); } CancelTarget(); return; } } }
public static void Target(Serial serial) { if (!IsTargeting) { return; } Entity entity = World.InGame ? World.Get(serial) : null; if (entity != null) { switch (TargetingState) { case CursorTarget.Invalid: return; case CursorTarget.MultiPlacement: case CursorTarget.Position: case CursorTarget.Object: case CursorTarget.HueCommandTarget: case CursorTarget.SetTargetClientSide: if (entity != World.Player) { UIManager.RemoveTargetLineGump(LastAttack); UIManager.RemoveTargetLineGump(LastTarget); LastTarget = entity.Serial; } if (_enqueuedAction != null) { _enqueuedAction(entity.Serial, entity.Graphic, entity.X, entity.Y, entity.Z, entity is Item it && it.OnGround || entity.Serial.IsMobile); } else { if (TargeringType == TargetType.Harmful && serial.IsMobile && ProfileManager.Current.EnabledCriminalActionQuery) { Mobile mobile = entity as Mobile; if (((World.Player.NotorietyFlag == NotorietyFlag.Innocent || World.Player.NotorietyFlag == NotorietyFlag.Ally) && mobile.NotorietyFlag == NotorietyFlag.Innocent && serial != World.Player)) { QuestionGump messageBox = new QuestionGump("This may flag\nyou criminal!", s => { if (s) { NetClient.Socket.Send(new PTargetObject(entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargeringType)); ClearTargetingWithoutTargetCancelPacket(); } }); UIManager.Add(messageBox); return; } } NetClient.Socket.Send(new PTargetObject(entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargeringType)); ClearTargetingWithoutTargetCancelPacket(); } Mouse.CancelDoubleClick = true; break; case CursorTarget.Grab: if (serial.IsItem) { GameActions.GrabItem(serial, ((Item)entity).Amount); } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.SetGrabBag: if (serial.IsItem) { ProfileManager.Current.GrabBagSerial = serial; GameActions.Print($"Grab Bag set: {serial}"); } ClearTargetingWithoutTargetCancelPacket(); return; } } }
public static void Target(uint serial) { if (!IsTargeting) { return; } Entity entity = World.InGame ? World.Get(serial) : null; if (entity != null) { switch (TargetingState) { case CursorTarget.Invalid: return; case CursorTarget.MultiPlacement: case CursorTarget.Position: case CursorTarget.Object: case CursorTarget.HueCommandTarget: case CursorTarget.SetTargetClientSide: if (entity != World.Player) { LastTargetInfo.SetEntity(serial); } if (SerialHelper.IsMobile (serial) && serial != World.Player && (World.Player.NotorietyFlag == NotorietyFlag.Innocent || World.Player.NotorietyFlag == NotorietyFlag.Ally)) { Mobile mobile = entity as Mobile; if (mobile != null) { bool showCriminalQuery = false; if (TargetingType == TargetType.Harmful && ProfileManager.CurrentProfile.EnabledCriminalActionQuery && mobile.NotorietyFlag == NotorietyFlag.Innocent) { showCriminalQuery = true; } else if (TargetingType == TargetType.Beneficial && ProfileManager.CurrentProfile.EnabledBeneficialCriminalActionQuery && (mobile.NotorietyFlag == NotorietyFlag.Criminal || mobile.NotorietyFlag == NotorietyFlag.Murderer || mobile.NotorietyFlag == NotorietyFlag.Gray)) { showCriminalQuery = true; } if (showCriminalQuery && UIManager.GetGump <QuestionGump>() == null) { QuestionGump messageBox = new QuestionGump ( "This may flag\nyou criminal!", s => { if (s) { NetClient.Socket.Send ( new PTargetObject ( entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargetingType ) ); ClearTargetingWithoutTargetCancelPacket(); if (LastTargetInfo.Serial != serial) { GameActions.RequestMobileStatus(serial); } } } ); UIManager.Add(messageBox); return; } } } if (TargetingState != CursorTarget.SetTargetClientSide) { PTargetObject packet = new PTargetObject ( entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargetingType ); for (int i = 0; i < _lastDataBuffer.Length; i++) { _lastDataBuffer[i] = packet[i]; } NetClient.Socket.Send(packet); if (SerialHelper.IsMobile(serial) && LastTargetInfo.Serial != serial) { GameActions.RequestMobileStatus(serial); } } ClearTargetingWithoutTargetCancelPacket(); Mouse.CancelDoubleClick = true; break; case CursorTarget.Grab: if (SerialHelper.IsItem(serial)) { GameActions.GrabItem(serial, ((Item)entity).Amount); } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.SetGrabBag: if (SerialHelper.IsItem(serial)) { ProfileManager.CurrentProfile.GrabBagSerial = serial; GameActions.Print(string.Format(ResGeneral.GrabBagSet0, serial)); } ClearTargetingWithoutTargetCancelPacket(); return; // ## BEGIN - END ## // case CursorTarget.SetCustomSerial: if (SerialHelper.IsItem(serial)) { ProfileManager.CurrentProfile.CustomSerial = serial; GameActions.Print($"Custom UOClassicEquipment Item set: {serial}", 88); } else if ((TargetingType == TargetType.Neutral && SerialHelper.IsMobile(serial))) { Mobile mobile = entity as Mobile; if ((!World.Player.IsDead && !mobile.IsDead) && serial != World.Player) { ProfileManager.CurrentProfile.Mimic_PlayerSerial = entity; //entity.serial GameActions.Print($"Mimic Player Serial Set: {entity.Name} : {entity.Serial}", 88); //entity.serial } } ClearTargetingWithoutTargetCancelPacket(); return; // ## BEGIN - END ## // } } }
public static void Target(uint serial) { if (!IsTargeting) { return; } Entity entity = World.InGame ? World.Get(serial) : null; if (entity != null) { switch (TargetingState) { case CursorTarget.Invalid: return; case CursorTarget.MultiPlacement: case CursorTarget.Position: case CursorTarget.Object: case CursorTarget.HueCommandTarget: case CursorTarget.SetTargetClientSide: Mobile m = World.Mobiles.Get(entity); if (entity != World.Player) { UIManager.RemoveTargetLineGump(LastAttack); UIManager.RemoveTargetLineGump(LastTarget); LastTarget = entity.Serial; LastTarget_name = entity.Name; TargetMenuGump tm = UIManager.GetGump <TargetMenuGump>(); if (tm != null) { tm.SetName(); } } if (m != null && m != World.Player) { switch (m.NotorietyFlag) { case NotorietyFlag.Ally: case NotorietyFlag.Innocent: LastBeneficialTarget = entity.Serial; LastBeneficialTarget_name = entity.Name; TargetMenuGump tm = UIManager.GetGump <TargetMenuGump>(); if (tm != null) { tm.SetName(); } break; case NotorietyFlag.Enemy: case NotorietyFlag.Gray: case NotorietyFlag.Murderer: case NotorietyFlag.Unknown: case NotorietyFlag.Criminal: LastHarmfulTarget = entity.Serial; LastHarmfulTarget_name = entity.Name; tm = UIManager.GetGump <TargetMenuGump>(); if (tm != null) { tm.SetName(); } break; } } if (TargeringType == TargetType.Harmful && SerialHelper.IsMobile(serial) && ProfileManager.Current.EnabledCriminalActionQuery) { Mobile mobile = entity as Mobile; if (((World.Player.NotorietyFlag == NotorietyFlag.Innocent || World.Player.NotorietyFlag == NotorietyFlag.Ally) && mobile.NotorietyFlag == NotorietyFlag.Innocent && serial != World.Player)) { QuestionGump messageBox = new QuestionGump(LanguageManager.Current.UI_Public_Criminal, s => { if (s) { NetClient.Socket.Send(new PTargetObject(entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargeringType)); ClearTargetingWithoutTargetCancelPacket(); } }); UIManager.Add(messageBox); return; } } var packet = new PTargetObject(entity, entity.Graphic, entity.X, entity.Y, entity.Z, _targetCursorId, (byte)TargeringType); for (int i = 0; i < _lastDataBuffer.Length; i++) { _lastDataBuffer[i] = packet[i]; } NetClient.Socket.Send(packet); ClearTargetingWithoutTargetCancelPacket(); Mouse.CancelDoubleClick = true; break; case CursorTarget.Grab: if (SerialHelper.IsItem(serial)) { GameActions.GrabItem(serial, ((Item)entity).Amount); } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.SetGrabBag: if (SerialHelper.IsItem(serial)) { ProfileManager.Current.GrabBagSerial = serial; GameActions.Print(LanguageManager.Current.UI_GrabBagSet + $"{ serial}"); } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.AddToLootlist: Item item = World.Items.Get(serial); if (SerialHelper.IsItem(serial)) { ushort[] obj = new ushort[2]; obj[0] = item.Graphic; obj[1] = item.Hue; if (ProfileManager.Current.LootList == null) { ProfileManager.Current.LootList = new List <ushort[]>(); } bool contain = false; foreach (ushort[] i in ProfileManager.Current.LootList) { if (obj[0] == i[0] && obj[1] == i[1]) { contain = true; break; } } if (!contain) { ProfileManager.Current.LootList.Add(obj); UIManager.GetGump <LootListGump>()?.Dispose(); UIManager.Add(new LootListGump()); } } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.AddToSelllist: if (SerialHelper.IsItem(serial)) { item = World.GetOrCreateItem(serial); ushort[] obj = new ushort[3]; obj[0] = item.Graphic; obj[1] = item.Hue; obj[2] = (ushort)ProfileManager.Current.AutoBuyAmount; if (ProfileManager.Current.SellList == null) { ProfileManager.Current.SellList = new List <ushort[]>(); } bool contain = false; foreach (ushort[] i in ProfileManager.Current.SellList) { if (obj[0] == i[0] && obj[1] == i[1]) { contain = true; break; } } if (!contain) { ProfileManager.Current.SellList.Add(obj); UIManager.GetGump <SellListGump>()?.Dispose(); UIManager.Add(new SellListGump(false)); } } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.AddToBuylist: if (SerialHelper.IsItem(serial)) { item = World.GetOrCreateItem(serial); ushort[] obj = new ushort[3]; obj[0] = item.Graphic; obj[1] = item.Hue; obj[2] = (ushort)ProfileManager.Current.AutoBuyAmount; if (ProfileManager.Current.BuyList == null) { ProfileManager.Current.BuyList = new List <ushort[]>(); } bool contain = false; foreach (ushort[] i in ProfileManager.Current.BuyList) { if (obj[0] == i[0] && obj[1] == i[1]) { contain = true; break; } } if (!contain) { ProfileManager.Current.BuyList.Add(obj); UIManager.GetGump <SellListGump>()?.Dispose(); UIManager.Add(new SellListGump(true)); } } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.Target_1: if (SerialHelper.IsMobile(serial)) { m = World.GetOrCreateMobile(serial); Target_1 = m; Target_1_name = entity.Name; TargetMenuGump tm = UIManager.GetGump <TargetMenuGump>(); if (tm != null) { tm.SetName(); } } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.Target_2: if (SerialHelper.IsMobile(serial)) { m = World.GetOrCreateMobile(serial); Target_2 = m; Target_2_name = entity.Name; TargetMenuGump tm = UIManager.GetGump <TargetMenuGump>(); if (tm != null) { tm.SetName(); } } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.Target_3: if (SerialHelper.IsMobile(serial)) { m = World.GetOrCreateMobile(serial); Target_3 = m; Target_3_name = entity.Name; TargetMenuGump tm = UIManager.GetGump <TargetMenuGump>(); if (tm != null) { tm.SetName(); } } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.Target_4: if (SerialHelper.IsMobile(serial)) { m = World.GetOrCreateMobile(serial); Target_4 = m; Target_4_name = m.Name; TargetMenuGump tm = UIManager.GetGump <TargetMenuGump>(); if (tm != null) { tm.SetName(); } } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.Target_5: if (SerialHelper.IsMobile(serial)) { m = World.GetOrCreateMobile(serial); Target_5 = m; Target_5_name = m.Name; TargetMenuGump tm = UIManager.GetGump <TargetMenuGump>(); if (tm != null) { tm.SetName(); } } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.Clear: if (SerialHelper.IsItem(serial)) { PlayerMobile.MoveObject = true; PlayerMobile.MoveType = 0; PlayerMobile.MoveBag = World.GetOrCreateItem(serial); } ClearTargetingWithoutTargetCancelPacket(); return; case CursorTarget.Supply: if (SerialHelper.IsItem(serial)) { PlayerMobile.MoveObject = true; PlayerMobile.MoveType = 1; PlayerMobile.MoveBag = World.GetOrCreateItem(serial); } ClearTargetingWithoutTargetCancelPacket(); return; // case CursorTarget.Object_1: // if (SerialHelper.IsItem(serial)) // { // item = World.GetOrCreateItem(serial); // Object_1 = item.Graphic; //// Object_1_name = item.Name; // TargetMenuGump tm = UIManager.GetGump<TargetMenuGump>(); // if (tm != null) // { // tm.SetName(); // } // } // ClearTargetingWithoutTargetCancelPacket(); // return; // case CursorTarget.Object_2: // if (SerialHelper.IsItem(serial)) // { // item = World.GetOrCreateItem(serial); // Object_2 = item.Graphic; // //Object_2_name = item.Name; // TargetMenuGump tm = UIManager.GetGump<TargetMenuGump>(); // if (tm != null) // { // tm.SetName(); // } // } // ClearTargetingWithoutTargetCancelPacket(); // return; // case CursorTarget.Object_3: // if (SerialHelper.IsItem(serial)) // { // item = World.GetOrCreateItem(serial); // Object_3 = item.Graphic; // //Object_3_name = item.Name; // TargetMenuGump tm = UIManager.GetGump<TargetMenuGump>(); // if (tm != null) // { // tm.SetName(); // } // } // ClearTargetingWithoutTargetCancelPacket(); // return; // case CursorTarget.Object_4: // if (SerialHelper.IsItem(serial)) // { // item = World.GetOrCreateItem(serial); // Object_4 = item.Graphic; // //Object_4_name = item.Name; // TargetMenuGump tm = UIManager.GetGump<TargetMenuGump>(); // if (tm != null) // { // tm.SetName(); // } // } // ClearTargetingWithoutTargetCancelPacket(); // return; // case CursorTarget.Object_5: // if (SerialHelper.IsItem(serial)) // { // item = World.GetOrCreateItem(serial); // Object_5 = item.Graphic; // //Object_5_name = item.Name; // TargetMenuGump tm = UIManager.GetGump<TargetMenuGump>(); // if (tm != null) // { // tm.SetName(); // } // } // ClearTargetingWithoutTargetCancelPacket(); // return; } } }