• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[C++] How to stop flooding effect when being attacked

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
993
Solutions
5
Reaction score
55
TFS 1.2 8.60
So i think its a bad think, i noticed that if you being attacked by monster lets say only by one it will send effect on you that blood effect if its physical damage, right? Now lets say you being attack by 5monsters it will send 5blood effects on you. So i think its not a good think right? So how to make if you being attacked by one or two,three and etc monsters send just a one effect on you instead of that spamming shit, same stuff would happen if you attack monster with bunch of people it will send that much effects how much people attacking that monster, and probably its same think with pvp. How to fix it? because it think its by default.
 
How to fix it? Fix what? Remove information about attack from game screen?
8 knights stand around monster. How can I know, if my friend is afk or he is attacking, without counting number of attack animations?
When you are attacked, it also shows black rectangle around attacker, but in case of attacking monster you got no other information then attack animation.
 
'fix' is a bad word here. The rule is simple, if you attack, there is an effect on screen.
If you are in need to 'optimize' this you would need to keep track of effects on tile/on enemy in time, which will generate much more load than sending simple packet to the client.
Currently effects have no relation to the damage, target, attacker or anything basically
 
'fix' is a bad word here. The rule is simple, if you attack, there is an effect on screen.
If you are in need to 'optimize' this you would need to keep track of effects on tile/on enemy in time, which will generate much more load than sending simple packet to the client.
Currently effects have no relation to the damage, target, attacker or anything basically
Hmm so you mean its possible to fix it but fixing it you might give more load to the server. Fuck -_-
 
it would increase need for computing power, but decrease network traffic.
So if you have problems with network overhead, you can implement some trick like "send effect only to the target and attacker"
 
it would increase need for computing power, but decrease network traffic.
So if you have problems with network overhead, you can implement some trick like "send effect only to the target and attacker"
Mmmmm, how tho?
 
maybe a map with CombatType and time_t to check when was the last effect sent to that player/monster (assumming that you want to do the same with monsters) (not real code, is just an example)

my creature.h code would be
Code:
typedef std::map<CombatType_t, time_t> AttackEffectMap; //map to save effects
AttackEffectMap attackEffectMap

void setLastAttackEffectSent(CombatType_t combatType, time_t time )
    attackEffectMap[combatType] = time;

time_t getLastAttackEffectSent(CombatType_t combatType)
    return attackEffectMap[combatType];

void sendAttackEffect(CombatType_t combatType, uint8_t magicEffect)
if (getLastAttackEffectSent() != OTSYS_TIME())
{
    g_game.sendMagicEffect(...)
     setLastAttackEffectSent(combatType, OTSYS_TIME)
}

and then on game.cpp when magic effect needs to be sent, call the method creature->sendAttackEffect(combatType, magicEffect)

is just a theory i thought, i'm not sure if that could lag but at least is a start
 
Last edited:
Back
Top