Avoid Memories leak

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

weirdone2 wrote:Using my tele function are you. :P Anyway it doesn't matter if you have it in a condition or not, condition = takes up a little more space but the locals won't be set when you issue any point order cmd. No condition = less space but will set a few locals when you give a point order. Adding a condition is only really useful when you have like 10+ locals in a single function.
No idea what you mean.
Having a triggercondition instead of an if statement has nothing to do with locals and adds maybe like 1-2 lines in total (It actually uses LESS lines if you recycle the condition).

Advantages over using a condition: Cleaner and I would assume faster. I will run tests later maybe.
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Avoid Memories leak

Post by weirdone2 »

Aero wrote:
weirdone2 wrote:Using my tele function are you. :P Anyway it doesn't matter if you have it in a condition or not, condition = takes up a little more space but the locals won't be set when you issue any point order cmd. No condition = less space but will set a few locals when you give a point order. Adding a condition is only really useful when you have like 10+ locals in a single function.
No idea what you mean.
Having a triggercondition instead of an if statement has nothing to do with locals and adds maybe like 1-2 lines in total (It actually uses LESS lines if you recycle the condition).

Advantages over using a condition: Cleaner and I would assume faster. I will run tests later maybe.
I'd imagine that with a condition it will only go to the function if the condition passes and therefore any locals that you have in the function won't be ran unless the condition passes this is what it has to do with locals.

Could you explain this recycles thing though?
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

Ah, yeah, if you have any locals that make function calls it's advantageous to have a condition.
As for recycling conditions...

function SomeCond takes nothing returns boolean
return true
endfunction

I could do the following:

call TriggerAddCondition(triggerA,Condition(function SomeCond))
call TriggerAddCondition(triggerB,Condition(function SomeCond))

Multiple triggers can have the same condition.
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Avoid Memories leak

Post by weirdone2 »

Ahh OK I get you.
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Avoid Memories leak

Post by initialD »

I wasn't using your -tele. You can check the tp. action in my dota hacked map. I didn't really check on your pack, but I believe it has diferent native function.
the very early codes I was taken from JJ's pack, just to ask Aero if there is leaks. I would probably just copy+ paste it if it wasn't leaking.
too bad I alwasy have to redo the job. I prefer just copy paste things. As you all know, I am lazy.
lol
If I have used someone codes I will credit him.

hmmm....
w/e

Code: Select all

function Tele takes player p7,string s7,integer fei returns nothing
local integer yf7=S2I(SubString(s7,0,3))
local trigger t7=CreateTrigger()
local triggeraction ta7=TriggerAddAction(t7,function Tlp)
if fei<1then
set yf7=GetPlayerId(p7)+1
elseif yf7<1 or yf7>12then
call clC(p7)
call DisplayTextToPlayer(p7,0,0,"wrong player code, dude")
return
endif
call TriggerRegisterPlayerUnitEvent(t7,Player(yf7-1),ConvertPlayerUnitEvent(39),null)
call Waiting(p7,SubString(s7,0,fei+2))
call DisableTrigger(t7)
call TriggerRemoveAction(t7,ta7)
call DestroyTrigger(t7)
set t7=null
set ta7=null
endfunction
Aero, can you see what's wrong with this codes? I am thinking that this -tele will probably causes server split.
Isn't ConverPlayerUnitEvent leaking a handle?
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Avoid Memories leak

Post by weirdone2 »

JJ also uses my tele command, so guess you are using my tele cmd. :P
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

No, the convert event doesnt leak but the memory needs to be cleaned up before the "return" call else it leaks.
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Avoid Memories leak

Post by initialD »

lol nice orbservation. I know what to do. I just relaesed that the memory has already been created in the locals. lol

Weirdone, i really didn't use your codes. Netheir do I used JJ codes.
I hoped I could use them but those codes leak. So I used Aero's suggestion. And add somemore thing I needed.
Your -tele or Jj's -tele was using call location xy right? Since I don't wanna to use the removeLocation thingie I have to do it another way.


all right, Aero, please take a look again and tell as if you can find some leaks.

Code: Select all

function InfMp takes player p7,string s7,integer fei returns nothing
local integer yf7=S2I(SubString(s7,0,3))
local trigger t7=CreateTrigger()
local triggercondition tc7=TriggerAddCondition(t7,Condition(function rmCon))
local triggeraction ta7=TriggerAddAction(t7,function ReMP)
if fei<1then
set yf7=GetPlayerId(p7)+1
elseif yf7<1 or yf7>12then
call clC(p7)
call DisplayTextToPlayer(p7,0,0,"wrong player code, dude")
call TriggerRemoveCondition(t7,tc7)
call TriggerRemoveAction(t7,ta7)
call DestroyTrigger(t7)
set t7=null
set tc7=null
set ta7=null
return
endif
call TriggerRegisterPlayerUnitEvent(t7,Player(yf7-1),EVENT_PLAYER_UNIT_SPELL_CAST,null)
call TriggerRegisterPlayerUnitEvent(t7,Player(yf7-1),EVENT_PLAYER_UNIT_SPELL_FINISH,null)
call TriggerRegisterPlayerUnitEvent(t7,Player(yf7-1),EVENT_PLAYER_UNIT_SPELL_CHANNEL,null)
call TriggerRegisterPlayerUnitEvent(t7,Player(yf7-1),EVENT_PLAYER_UNIT_SPELL_ENDCAST,null)
call TriggerRegisterPlayerUnitEvent(t7,Player(yf7-1),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
call Waiting(p7,SubString(s7,0,fei+2))
call DisableTrigger(t7)
call TriggerRemoveCondition(t7,tc7)
call TriggerRemoveAction(t7,ta7)
call DestroyTrigger(t7)
set t7=null
set tc7=null
set ta7=null
endfunction
Big Credit to Aero
Just tested with my beta testers.With all functions activated, spamming as much cheat as possible, a total 3x 5v5 dota games in battlenet, yet, no one dc'ed, no one complained about lagginess.
I just want to say thank you to you Aero, without your help I wouldn't have made such a good cheat pack with almost 100%, no lagginess.


p/s the server split was caused by some invalid return. I just knew this "Blizzard bug" recently.
Whenever a function takes something from boolean, if the boolean is "invalid", BLizzard would not return automatically itself, the command will stay there for as long time as possible, till all player dc'ed. Since JASS is still not official codes for Blizzard, these kind of bug will not be fixed in the future patch.
w/e
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

initiald wrote:p/s the server split was caused by some invalid return. I just knew this "Blizzard bug" recently.
Whenever a function takes something from boolean, if the boolean is "invalid", BLizzard would not return automatically itself, the command will stay there for as long time as possible, till all player dc'ed. Since JASS is still not official codes for Blizzard, these kind of bug will not be fixed in the future patch.
w/e
No idea what you mean.
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Avoid Memories leak

Post by weirdone2 »

Weirdone, i really didn't use your codes. Netheir do I used JJ codes.
I hoped I could use them but those codes leak. So I used Aero's suggestion. And add somemore thing I needed.
Your -tele or Jj's -tele was using call location xy right? Since I don't wanna to use the removeLocation thingie I have to do it another way.
Pfft You're still using the concept. :P I don't really care much if you use my code as long as you don't try to pawn it off as your own idea/code. It's just something I mentioned since I saw you post it. :) Also as a note I don't know about jj's as I've never used it but my pack doesn't lag unless you do something dumb in it.