Quote:
Originally Posted by FuriousFang
Not everyone knows what you're talking about when you say that Arco. Using a bool is a simple fix for people that don't know how to do that. Hint, why i'm suggesting it. =]
|
That also will not stop the client from sending the movement packets. Thus they will still move on their screen and you will then have to send a packet back 'correcting' their position.
A simple status effect combined with checks on movement to see if they are frozen is the best way to handle this.
@Dread: Status effects COMBINE
Eg: 1 is bluename 2 is poison... 3 is therefor bluename AND poison.
Due to this they follow a pattern of growth because you must account for all combination possible.
So lets say for example top tro has a value of 100 (it's not... I'm just using as an example)
When you add your freeze effect (which you are claiming to be 59, not sure on that... doesn't seem to follow the pattern but w/e) you would actually use a value of 159 (top tro PLUS freeze effect)
Personally I use a add/remove system for my effects where I have a character dictionary where... Key = the status effect and Value = the date time added, a bool for if it should be removed and a value for how long it should last.
Then in my character update thread I run through characters and their active status effect values and check time started, duration, should be removed vs current datetime and if so I remove it from the client effect bools and as such update the client at the same time (any time my status effect pool is altered it will update the client, YAY use of accessors (get/set))
It's rather simple to do and lets you do something like...
if(Client.ActiveEffects.ContainsKey(StatusEnums.Fr ozen))
return;
There is no duplication or accidental double removal of effects due to it being a dictionary key value (if you try it will fuck up.. and personally my add/remove effect code checks for it)
<edit>
posted my codes I use for it... not that most ppl will bother