Quote:
Originally Posted by steppdroid
The problem i think is on this code.. the exploit attack the timer ? 
LaserAttackTimer
Code:
private static void LaserAttackTimer(object attacker)
{
....
}
|
Can't see any error in this code, because I don't know the other code.
The bug is in the Server when you receive the packet-id "a".
When the Server receives a|ID then it exectues the damage-script. You have to make that a shoot can only be done every second.
The client should only send "a|ID" for the first time it attacks, not every second.
The server should send the client that there was damage on a npc.
So the server should send every second after the Attack-Packet that the player shooted.
Example:
Player Attacks NPC-ID 5.
Client: Send a|5
Server:
If attack_timer is not running Then
-> do attack
-> can_attack = true;
-> Run attack timer with 1000ms (1 sec.)
Timer after 1 sec.:
-> if(can_attack == true)
---> do attack
---> run timer to check attack with 1000ms again
Client: Send G|5
Server: Only abort attack (can_attack = false).
Don't reset timer for attack. Otherwise we could send a|5, G|5, a|5, G|5, a|5... so i would re-run
This is only pseudo-code how it could work, but there are many other ways.