public void PlayerShoot(RealmTime time, PlayerShootPacket pkt) { Debug.WriteLine(pkt.Position); // Was Commented! var item = XmlDatas.ItemDescs[pkt.ContainerType]; if (item.ObjectType != Inventory[0].ObjectType && item.ObjectType != Inventory[1].ObjectType) { return; } var prjDesc = item.Projectiles[0]; //Assume only one projectileId = pkt.BulletId; var prj = CreateProjectile(prjDesc, item.ObjectType, 0, pkt.Time + tickMapping, pkt.Position, pkt.Angle); Owner.EnterWorld(prj); Owner.BroadcastPacket(new AllyShootPacket { OwnerId = Id, Angle = pkt.Angle, ContainerType = pkt.ContainerType, BulletId = pkt.BulletId }, this); fames.Shoot(prj); }
public override void OnCreate() { font = new Font("res/fonts/defaultFont.ttf"); info = new Text("Server", font); // A separate thread to make connections on new Thread(() => { while (!_closeRequested) { Connection client = Connection.Listen(42069, (connection, data) => { if (data.Length == 0) { return; } // Responding for a packet if (Packet.GetType(data) == PACKET_TYPES.PLAYER_UPDATE) { PlayerUpdatePacket packet = Packet.Deserialize <PlayerUpdatePacket>(data); lock (_players) { if (_players.ContainsKey(connection)) { packet.id = _players[connection].id; _players[connection] = packet; } } if (packet.health <= 0.0f) { MoveToLobby(connection); } } if (Packet.GetType(data) == PACKET_TYPES.PLAYER_SHOOT) { PlayerShootPacket packet = Packet.Deserialize <PlayerShootPacket>(data); lock (_players) if (_players.ContainsKey(connection)) { packet.id = _players[connection].id; } lock (_actions) _actions.Enqueue(packet); } }); // Adding new client lock (_lobbyClients) _lobbyClients.Add(client); } }).Start(); }
private void OnPlayerShoot(Client client, PlayerShootPacket packet) { client.PlayerData.Pos = new Location() { X = packet.Position.X - 0.3f * (float)Math.Cos(packet.Angle), Y = packet.Position.Y - 0.3f * (float)Math.Sin(packet.Angle) }; }
// Token: 0x0600049E RID: 1182 RVA: 0x000195BC File Offset: 0x000177BC private void Shoot(int Time) { if (this._isSafeMap) { return; } if (this.client.Player == null) { return; } int num = this.client.Player.Inventory[1]; if (num == -1) { return; } if (this.client.Player.isStunned()) { return; } if (this.client.Player.isPaused()) { return; } ItemStructure itemStructure = GameData.Items.ByID((ushort)num); if (itemStructure == null) { return; } if (itemStructure.NumProjectiles != 0) { return; } for (int i = 0; i < itemStructure.NumProjectiles; i++) { PlayerShootPacket projectile = (PlayerShootPacket)Packet.Create(PacketType.PLAYERSHOOT); projectile.Angle = 0f; projectile.Position = new Location(this.client.Player.ClientPosition.X + Math.Cos((double)projectile.Angle) * 0.3, this.client.Player.ClientPosition.Y + Math.Sin((double)projectile.Angle) * 0.3); projectile.Time = Time; projectile.BulletId = this.client.GetBulletId(); projectile.ContainerType = (short)itemStructure.ID; AllyShootPacket allyShootPacket = (AllyShootPacket)Packet.Create(PacketType.ALLYSHOOT); allyShootPacket.Angle = projectile.Angle; allyShootPacket.BulletId = projectile.BulletId; allyShootPacket.ContainerType = projectile.ContainerType; allyShootPacket.OwnerId = this.client.Player.ObjectId; this.client.SendToServer(projectile); this.client.SendToClient(allyShootPacket); } }
public void PlayerShoot(RealmTime time, PlayerShootPacket pkt) { // System.Diagnostics.Debug.WriteLine(pkt.Position); Item item = XmlDatas.ItemDescs[pkt.ContainerType]; var prjDesc = item.Projectiles[0]; //Assume only one projectileId = pkt.BulletId; Projectile prj = CreateProjectile(prjDesc, item.ObjectType, (int)statsMgr.GetAttackDamage(prjDesc.MinDamage, prjDesc.MaxDamage), pkt.Time + tickMapping, pkt.Position, pkt.Angle); Owner.EnterWorld(prj); Owner.BroadcastPacket(new AllyShootPacket() { OwnerId = Id, Angle = pkt.Angle, ContainerType = pkt.ContainerType, BulletId = pkt.BulletId }, this); fames.Shoot(prj); }
private void OnPlayerShoot(Client client, PlayerShootPacket packet) { //Console.WriteLine(packet); /* * PLAYERSHOOT(52) Packet Instance * Time => 2167100 * BulletId => 1 * ContainerType => 2824 * Position => { X=106.9856, Y=162.6525 } * Angle => 3.080225 * Send => True * Id => 52 * PLAYERSHOOT(52) Packet Instance * Time => 2167100 * BulletId => 2 * ContainerType => 2824 * Position => { X=106.9856, Y=162.6525 } * Angle => 3.080225 * Send => True * Id => 52 * PLAYERSHOOT(52) Packet Instance * Time => 2167228 * BulletId => 3 * ContainerType => 2824 * Position => { X=106.9856, Y=162.6525 } * Angle => 3.080225 * Send => True * Id => 52 * PLAYERSHOOT(52) Packet Instance * Time => 2167228 * BulletId => 4 * ContainerType => 2824 * Position => { X=106.9856, Y=162.6525 } * Angle => 3.080225 * Send => True * Id => 52 */ }
protected override Task OnMessage(MessageEventArgs e) { using (System.IO.MemoryStream memStream = new System.IO.MemoryStream()) using (System.IO.BinaryReader reader = new System.IO.BinaryReader(memStream)) { e.Data.CopyTo(memStream); memStream.Position = 0; PacketType packetType = (PacketType)reader.ReadByte(); Packet packet; switch (packetType) { case PacketType.PlayerAction: packet = PlayerActionPacket.Parse(reader); break; case PacketType.Ping: packet = PingPacket.Parse(reader); break; case PacketType.PlayerUpdate: packet = PlayerUpdatePacket.Parse(reader, this); break; case PacketType.PlayerShoot: packet = PlayerShootPacket.Parse(reader); break; default: return(base.OnMessage(e)); // Packet not recognized. Ignore it. } packet.PacketType = packetType; packet.Handle(this); return(base.OnMessage(e)); } }
public void PlayerShoot(RealmTime time, PlayerShootPacket pkt) { System.Diagnostics.Debug.WriteLine(pkt.Position); Item item = XmlDatas.ItemDescs[pkt.ContainerType]; if (item.ObjectType == Inventory[0].ObjectType || item.ObjectType == Inventory[1].ObjectType) { var prjDesc = item.Projectiles[0]; projectileId = pkt.BulletId; Projectile prj = CreateProjectile(prjDesc, item.ObjectType, 0, pkt.Time + tickMapping, pkt.Position, pkt.Angle); Owner.EnterWorld(prj); Owner.BroadcastPacket(new AllyShootPacket() { OwnerId = Id, Angle = pkt.Angle, ContainerType = pkt.ContainerType, BulletId = pkt.BulletId }, this); fames.Shoot(prj); } }
private void OnNewTick(Client client, NewTickPacket packet) { PlayerShootPacket shootPacket = Packet.Create <PlayerShootPacket>(PacketType.PLAYERSHOOT); shootPacket.Angle = (float)Math.PI; shootPacket.Position = Add(ToRect(shootPacket.Angle, 0.3f), client.PlayerData.Pos); shootPacket.BulletId = 1; shootPacket.ContainerType = 2824; shootPacket.Time = client.Time; Console.WriteLine(shootPacket); client.SendToServer(shootPacket); return; foreach (Entity entity in client.State.RenderedEntities) { ObjectStructure obj = GameData.Objects.ByID(entity.ObjectType); if (obj.Enemy) { Console.WriteLine(obj.Name); PlayerShootPacket p = new PlayerShootPacket(); //shootPacket. } } }
public void PlayerShoot(RealmTime time, PlayerShootPacket pkt) { if (dying || spectate) { return; } Item item = XmlDatas.ItemDescs[pkt.ContainerType]; if (((Inventory[0] == null) || (item.ObjectType != Inventory[0].ObjectType)) && ((Inventory[1] == null) || (item.ObjectType != Inventory[1].ObjectType))) { return; } if (item.DualShooting) { double arcGap1 = item.ArcGap1 * Math.PI / 180; double arcGap2 = item.ArcGap2 * Math.PI / 180; //var startAngle1 = Math.Atan2(target.Y - Y, target.X - X) - (item.NumProjectiles1 - 1) / 2 * arcGap1; //var startAngle2 = Math.Atan2(target.Y - Y, target.X - X) - (item.NumProjectiles2 - 1) / 2 * arcGap2; double startAngle1 = pkt.Angle - (item.NumProjectiles1 - 1) / 2 * arcGap1; double startAngle2 = pkt.Angle - (item.NumProjectiles2 - 1) / 2 * arcGap2; ProjectileDesc prjDesc1 = item.Projectiles[0]; ProjectileDesc prjDesc2 = item.Projectiles[1]; //Assume only two for (int i = 0; i < item.NumProjectiles1; i++) { Projectile proj = CreateProjectile(prjDesc1, item.ObjectType, (int)statsMgr.GetAttackDamage(prjDesc1.MinDamage, prjDesc1.MaxDamage), time.tickTimes, new Position { X = X, Y = Y }, (float)(startAngle1 + arcGap1 * i)); Owner.EnterWorld(proj); Owner.BroadcastPacket(new AllyShootPacket { OwnerId = Id, Angle = (float)(startAngle1 + arcGap1 * i), ContainerType = pkt.ContainerType, BulletId = 0 }, this); fames.Shoot(proj); } for (int h = 0; h < item.NumProjectiles2; h++) { Projectile proj = CreateProjectile(prjDesc2, item.ObjectType, (int)statsMgr.GetAttackDamage(prjDesc2.MinDamage, prjDesc2.MaxDamage), time.tickTimes, new Position { X = X, Y = Y }, (float)(startAngle2 + arcGap2 * h)); Owner.EnterWorld(proj); Owner.BroadcastPacket(new AllyShootPacket { OwnerId = Id, Angle = (float)(startAngle2 + arcGap2 * h), ContainerType = pkt.ContainerType, BulletId = 1 }, this); fames.Shoot(proj); } } else { ProjectileDesc prjDesc = item.Projectiles[0]; //Assume only one projectileId = pkt.BulletId; Projectile prj = CreateProjectile(prjDesc, item.ObjectType, 0, pkt.Time, pkt.Position, pkt.Angle); Owner.EnterWorld(prj); Owner.BroadcastPacket(new AllyShootPacket { OwnerId = Id, Angle = pkt.Angle, ContainerType = pkt.ContainerType, BulletId = pkt.BulletId }, this); fames.Shoot(prj); } }
// Token: 0x06000232 RID: 562 RVA: 0x0000FDC0 File Offset: 0x0000DFC0 private void HandlePacket(Packet packet) { UpdatePacket updatePacket = packet as UpdatePacket; if (updatePacket != null) { this._objectTracker.Update(updatePacket); this.SafeWalk.Update(updatePacket); this._autoNexus.Update(updatePacket); this._fameHelper.Update(updatePacket); this._accuracyFarm.Update(updatePacket); this._antiLag.Update(updatePacket); this._autoLoot.Update(updatePacket); this._mapHack.Update(updatePacket); this._o3Helper.Update(updatePacket); this._showLHPot.Update(updatePacket); return; } NewTickPacket newTickPacket = packet as NewTickPacket; if (newTickPacket != null) { this._objectTracker.NewTick(newTickPacket); this._antiDebuffs.NewTick(newTickPacket); this._autoNexus.NewTick(newTickPacket); this._antiDdos.NewTick(); this._fameHelper.NewTick(newTickPacket); this._accuracyFarm.NewTick(newTickPacket); this._antiLag.NewTick(newTickPacket); this._o3Helper.NewTick(newTickPacket); this._autoNexus2.NewTick(newTickPacket); return; } MovePacket movePacket = packet as MovePacket; if (movePacket != null) { this.PreviousTime = movePacket._Nx46RcGIU0H1BCGWaJXjN1ieopt; this._objectTracker.move(movePacket); this._antiDebuffs.Move(movePacket); this._autoLoot.Move(movePacket); this.AntiAfk.move(movePacket); this._autoNexus.move(movePacket); this._autoNexus2.move(movePacket); return; } MapInfoPacket mapInfoPacket = packet as MapInfoPacket; if (mapInfoPacket != null) { Console.WriteLine("Client: Map is " + mapInfoPacket.Name); this._objectTracker.MapInfo(mapInfoPacket); this._autoNexus2.MapInfo(mapInfoPacket); this.SafeWalk.MapInfo(mapInfoPacket); this._autoNexus.MapInfo(mapInfoPacket); this._autoLoot.MapInfo(mapInfoPacket); this._fameHelper.MapInfo(); _accuracyFarm.MapInfo(); this._antiLag.MapInfo(mapInfoPacket); this._mapHack.MapInfo(mapInfoPacket); this._o3Helper.MapInfo(mapInfoPacket); this._showLHPot.MapInfo(mapInfoPacket); return; } PlayerTextPacket playerTextPacket = packet as PlayerTextPacket; if (playerTextPacket != null) { this._teleportTools.text(playerTextPacket); this._ipJoin.text(playerTextPacket); this._fameHelper._QrK9KtR4xguWgEYrBE9xnEwwcqd(playerTextPacket); this._antiLag.PlayerText(playerTextPacket); this._mapHack.text(playerTextPacket); this._autoNexus._QrK9KtR4xguWgEYrBE9xnEwwcqd(playerTextPacket); return; } _5Qyhf9ImNgkDzh4BmaDRKP646iH createSuccessPacket = packet as _5Qyhf9ImNgkDzh4BmaDRKP646iH; if (createSuccessPacket != null) { this.PlayerId = createSuccessPacket.ObjectId; this._objectTracker._1lYB9SyYVs1zUAIHgLGbUs7pmeb(); this._bazaarTimer.CreateSuccess(); this._autoNexus2._1lYB9SyYVs1zUAIHgLGbUs7pmeb(); return; } FailurePacket failurePacket = packet as FailurePacket; if (failurePacket != null) { Console.WriteLine(string.Format("Client: Got failure {0}, {1} ({2})", failurePacket.ErrorId, failurePacket.ErrorMessage, failurePacket.ErrorPlace)); return; } ReconnectPacket reconnectPacket = packet as ReconnectPacket; if (reconnectPacket != null) { this.Reconnect(reconnectPacket); return; } HelloPacket helloPacket = packet as HelloPacket; if (helloPacket != null) { this.Hello(helloPacket); return; } PlayerHitPacket playerHitPacket = packet as PlayerHitPacket; if (playerHitPacket != null) { this._autoNexus.PlayerHit(playerHitPacket); this._antiDebuffs.PlayerHit(playerHitPacket); return; } AoEPacket pqhqze9k9pObME2LmlIcbfEeSYS = packet as AoEPacket; if (pqhqze9k9pObME2LmlIcbfEeSYS != null) { this._autoNexus._M1PxW31jx87SGG4gvOYAwe86vjg(pqhqze9k9pObME2LmlIcbfEeSYS); this._antiDebuffs.AoE(pqhqze9k9pObME2LmlIcbfEeSYS); return; } AoEAckPacket x7UwVkbcYG7VnZWu4HCA8hCeQtS = packet as AoEAckPacket; if (x7UwVkbcYG7VnZWu4HCA8hCeQtS != null) { this._autoNexus._iKqf12lpU2ifSlxUxUegqEC5CVe(x7UwVkbcYG7VnZWu4HCA8hCeQtS); return; } GroundDamagePacket hllcDvAIxPBOvJZP4BFTFQUoryN = packet as GroundDamagePacket; if (hllcDvAIxPBOvJZP4BFTFQUoryN != null) { this._autoNexus._524YRDmz9HCOj575eu5oeD5ruJb(hllcDvAIxPBOvJZP4BFTFQUoryN); return; } _6lHFncsY9352Wg3pNnnFZ49g5xA 6lHFncsY9352Wg3pNnnFZ49g5xA = packet as QuestObjIdPacket; if (6lHFncsY9352Wg3pNnnFZ49g5xA != null) { this._teleportTools._FMTVFcTfzNRteqoB3XiUkaNps7l(6lHFncsY9352Wg3pNnnFZ49g5xA); return; } ShowEffectPacket showEffectPacket = packet as ShowEffectPacket; if (showEffectPacket != null) { this._antiLag.ShowEffect(showEffectPacket); this._autoNexus._1nwhQXngJ6rNjd7Ufx1bWeF0vhM(showEffectPacket); this._o3Helper._1nwhQXngJ6rNjd7Ufx1bWeF0vhM(showEffectPacket); return; } _4wU9AwmH67XtmNygsXuDz9DUXYm 4wU9AwmH67XtmNygsXuDz9DUXYm = packet as _4wU9AwmH67XtmNygsXuDz9DUXYm; if (4wU9AwmH67XtmNygsXuDz9DUXYm != null) { this._antiLag._Q1PiJQ99KBCJeLcZ0HOk3AUAjIP(4wU9AwmH67XtmNygsXuDz9DUXYm); return; } PlayerShootPacket fbqBESNaaIBpK5dNK9X5lWOOll = packet as PlayerShootPacket; if (fbqBESNaaIBpK5dNK9X5lWOOll != null) { this._autoNexus2.PlayerShoot(fbqBESNaaIBpK5dNK9X5lWOOll); return; } TextPacket cbwOjnzusZzuPkHfx7wuwePHqrf = packet as TextPacket; if (cbwOjnzusZzuPkHfx7wuwePHqrf != null) { this._antiSpam._IDtpCgDjmC1AQOcZCJSFNAYjlbH(cbwOjnzusZzuPkHfx7wuwePHqrf); this._antiLag.Text(cbwOjnzusZzuPkHfx7wuwePHqrf); this._o3Helper._IDtpCgDjmC1AQOcZCJSFNAYjlbH(cbwOjnzusZzuPkHfx7wuwePHqrf); return; } UseItemPacket lylWoxWrca2h31SiYiDb8gyQP0o = packet as UseItemPacket; if (lylWoxWrca2h31SiYiDb8gyQP0o != null) { this._autoNexus2.UseItem(lylWoxWrca2h31SiYiDb8gyQP0o); this._fameHelper.UseItem(lylWoxWrca2h31SiYiDb8gyQP0o); return; } EnemyShootPacket cbwrHXLbrCktla3qkqXNmNymbvH = packet as EnemyShootPacket; if (cbwrHXLbrCktla3qkqXNmNymbvH != null) { this._objectTracker._Qz49aY7UXgmnBNNMA6Q6IEQtadk(cbwrHXLbrCktla3qkqXNmNymbvH); return; } InvSwapPacket maJp2qic3r54gk5Eg1eeMowxvXh = packet as InvSwapPacket; if (maJp2qic3r54gk5Eg1eeMowxvXh != null) { this._autoLoot.InvSwap(maJp2qic3r54gk5Eg1eeMowxvXh); this._autoNexus._ZHfjECn2B9JJHnVF67eBaO57JUp(maJp2qic3r54gk5Eg1eeMowxvXh); return; } EscapePacket m74ADSrj0VfuNwRBO916gAw0Nu = packet as EscapePacket; if (m74ADSrj0VfuNwRBO916gAw0Nu != null) { this.Escape(m74ADSrj0VfuNwRBO916gAw0Nu); return; } InvitedToGuildPacket tJHGMoVf7DhHyQm8a6SCuL1cSWl = packet as InvitedToGuildPacket; if (tJHGMoVf7DhHyQm8a6SCuL1cSWl != null) { this._antiDdos.Invite(tJHGMoVf7DhHyQm8a6SCuL1cSWl); return; } TeleportPacket rvckmor8bw91EVaRfdwc25aHYbc = packet as TeleportPacket; if (rvckmor8bw91EVaRfdwc25aHYbc != null) { this._fameHelper.Teleport(rvckmor8bw91EVaRfdwc25aHYbc); this._accuracyFarm.Teleport(rvckmor8bw91EVaRfdwc25aHYbc); return; } _6UIiGxMChbVinHsvx5uqg8WrMRc 6UIiGxMChbVinHsvx5uqg8WrMRc = packet as InvResultPacket; if (6UIiGxMChbVinHsvx5uqg8WrMRc != null) { this._autoLoot._yOjSn1WKSXsXVziJpL1eH5gSoWg(6UIiGxMChbVinHsvx5uqg8WrMRc); return; } NotificationPacket zIBPB6zZVww7yGWtjJqRMmACh1q = packet as NotificationPacket; if (zIBPB6zZVww7yGWtjJqRMmACh1q != null) { this._autoNexus._4GSfC8bADOwIwOXLYze8EOUBQxJ(zIBPB6zZVww7yGWtjJqRMmACh1q); return; } AccountListPacket k4pBHmoGRyaE6dWf1FIvL0dcuzKA = packet as AccountListPacket; if (k4pBHmoGRyaE6dWf1FIvL0dcuzKA != null) { this._antiLag.AccountList(k4pBHmoGRyaE6dWf1FIvL0dcuzKA); return; } EditAccountListPacket co7ACSeK1WWaCGAPAqLaov37Wqdb = packet as EditAccountListPacket; if (co7ACSeK1WWaCGAPAqLaov37Wqdb != null) { this._antiLag.EditAccountList(co7ACSeK1WWaCGAPAqLaov37Wqdb); return; } _7k8aOfI7MhNrVnHioUXbsPAxkbm 7k8aOfI7MhNrVnHioUXbsPAxkbm = packet as EnemyHitPacket; if (7k8aOfI7MhNrVnHioUXbsPAxkbm != null) { this._o3Helper._9BgsXisaUbFFlj5HLRd76sERUUX(7k8aOfI7MhNrVnHioUXbsPAxkbm); return; } DeathPacket wOmvsGmaE1PheZ2fPjD9V16UEseb = packet as DeathPacket; if (wOmvsGmaE1PheZ2fPjD9V16UEseb != null) { this._autoNexus._qQsqaOxgCR9yg9ky7erATaKrgCC(wOmvsGmaE1PheZ2fPjD9V16UEseb); return; } }
// Token: 0x06000496 RID: 1174 RVA: 0x00018DA4 File Offset: 0x00016FA4 public void PlayerShoot(PlayerShootPacket playerShoot) { this._fakeMousePosition = this.client.Player.ClientPosition.PositionInDirection((double)playerShoot.Angle, 6.0); }