Bonjour tout le monde,
Ces derniers temps, j'essaie de faire un lecteur de script lua en Vb.net, tout fonctionne parfaitement sauf qu'au bout d'un moment, la mémoire augmente assez vite. J'ai isolé le problème, et il me suffit de faire un dispose, sauf que si je fais un dispose du script lua, les variables de l'utilisateur qui à fait son script sont réinitialisées.
J'ai réfléchis longuement au problème mais j'ai pas d'idée, j'ai même fait un programme pour faire mes tests sur la consommation. Ce que je comprends pas c'est que la mémoire augmente hyper vite alors que je ne fais que récupérer une table à partir d'une fonction en Lua voici le code du script
Voici le code que j'effectue : (boucle infinie pour faire mes tests)
C'est le move.Call(0) qui fait augmenter énormément la mémoire vive, donc enfaite, ce qu'il faudrait c'est une fonction qui fait un dispose mais pas de tout si vous voyez ce que je veux dire.
Ces derniers temps, j'essaie de faire un lecteur de script lua en Vb.net, tout fonctionne parfaitement sauf qu'au bout d'un moment, la mémoire augmente assez vite. J'ai isolé le problème, et il me suffit de faire un dispose, sauf que si je fais un dispose du script lua, les variables de l'utilisateur qui à fait son script sont réinitialisées.
J'ai réfléchis longuement au problème mais j'ai pas d'idée, j'ai même fait un programme pour faire mes tests sur la consommation. Ce que je comprends pas c'est que la mémoire augmente hyper vite alors que je ne fais que récupérer une table à partir d'une fonction en Lua voici le code du script
Code:
MIN_MONSTERS = 1 -- Il va combattre seulement
MAX_MONSTERS = 8 -- les groupes de 1 a 3 monstres
CHECK = false
function move()
CHECK = true
return {
{ map = "0,-22", fight = true, path = "right|bottom" },
{ map = "1,-22", fight = true, path = "right|left|bottom" },
{ map = "2,-22", fight = true, path = "right|left|bottom" },
{ map = "3,-22", fight = true, path = "right|left|bottom" },
{ map = "4,-22", fight = true, path = "right|left|bottom" },
{ map = "5,-22", fight = true, path = "left|bottom" },
{ map = "-1,-21", fight = true, path = "right|bottom" },
{ map = "0,-21", fight = true, path = "right|left|bottom|top" },
{ map = "1,-21", fight = true, path = "right|left|bottom|top" },
{ map = "2,-21", fight = true, path = "right|left|bottom|top" },
{ map = "3,-21", fight = true, path = "right|left|bottom|top" },
{ map = "4,-21", fight = true, path = "right|left|bottom|top" },
{ map = "5,-21", fight = true, path = "right|left|bottom|top" },
{ map = "6,-21", fight = true, path = "right|left|bottom" },
{ map = "7,-21", fight = true, path = "left|bottom" },
{ map = "-1,-20", fight = true, path = "right|bottom|top" },
{ map = "0,-20", fight = true, path = "right|left|bottom|top" },
{ map = "1,-20", fight = true, path = "right|left|bottom|top" },
{ map = "2,-20", fight = true, path = "right|left|bottom|top" },
{ map = "3,-20", fight = true, path = "right|left|bottom|top" },
{ map = "4,-20", fight = true, path = "right|left|bottom|top" },
{ map = "5,-20", fight = true, path = "right|left|bottom|top" },
{ map = "6,-20", fight = true, path = "right|left|bottom|top" },
{ map = "7,-20", fight = true, path = "left|bottom|top" },
{ map = "-1,-19", fight = true, path = "right|bottom|top" },
{ map = "0,-19", fight = true, path = "right|left|bottom|top" },
{ map = "1,-19", fight = true, path = "right|left|bottom|top" },
{ map = "2,-19", fight = true, path = "right|left|bottom|top" },
{ map = "3,-19", fight = true, path = "right|left|bottom|top" },
{ map = "4,-19", fight = true, path = "right|left|bottom|top" },
{ map = "5,-19", fight = true, path = "right|left|bottom|top" },
{ map = "6,-19", fight = true, path = "right|left|bottom|top" },
{ map = "7,-19", fight = true, path = "left|bottom|top" },
{ map = "-1,-18", fight = true, path = "right|bottom|top" },
{ map = "0,-18", fight = true, path = "right|left|bottom|top" },
{ map = "1,-18", fight = true, path = "right|left|bottom|top" },
{ map = "2,-18", fight = true, path = "right|left|bottom|top" },
{ map = "3,-18", fight = true, path = "right|left|bottom|top" },
{ map = "4,-18", fight = true, path = "right|left|bottom|top" },
{ map = "5,-18", fight = true, path = "right|left|bottom|top" },
{ map = "6,-18", fight = true, path = "right|left|bottom|top" },
{ map = "7,-18", fight = true, path = "left|bottom|top" },
{ map = "-1,-17", fight = true, path = "right|bottom|top" },
{ map = "0,-17", fight = true, path = "right|left|bottom|top" },
{ map = "1,-17", fight = false, path = "right|left|bottom|top" },
{ map = "2,-17", fight = true, path = "right|left|bottom|top" },
{ map = "3,-17", fight = true, path = "right|left|bottom|top" },
{ map = "4,-17", fight = true, path = "right|left|bottom|top" },
{ map = "5,-17", fight = true, path = "right|left|bottom|top" },
{ map = "6,-17", fight = true, path = "right|left|bottom|top" },
{ map = "7,-17", fight = true, path = "left|bottom|top" },
{ map = "-1,-16", fight = true, path = "right|bottom|top" },
{ map = "0,-16", fight = true, path = "right|left|bottom|top" },
{ map = "1,-16", fight = true, path = "right|left|bottom|top" },
{ map = "2,-16", fight = true, path = "right|left|bottom|top" },
{ map = "3,-16", fight = true, path = "right|left|bottom|top" },
{ map = "5,-16", fight = true, path = "right|left|bottom|top" },
{ map = "6,-16", fight = true, path = "right|left|bottom|top" },
{ map = "7,-16", fight = true, path = "left|bottom|top" },
{ map = "-1,-15", fight = true, path = "right|bottom|top" },
{ map = "0,-15", fight = true, path = "right|left|bottom|top" },
{ map = "1,-15", fight = true, path = "right|left|bottom|top" },
{ map = "2,-15", fight = true, path = "right|left|bottom|top" },
{ map = "3,-15", fight = true, path = "right|left|bottom|top" },
{ map = "4,-15", fight = true, path = "left|top" },
{ map = "5,-15", fight = true, path = "right|left|top" },
{ map = "6,-15", fight = true, path = "right|left|top" },
{ map = "7,-15", fight = true, path = "left|top" },
{ map = "-1,-14", fight = true, path = "right|top" },
{ map = "0,-14", fight = true, path = "right|left|top" },
{ map = "1,-14", fight = true, path = "top|right" },
{ map = "2,-14", fight = true, path = "top|right|left" },
{ map = "3,-14", fight = true, path = "top|right|left" },
{ map = "4,-14", fight = true, path = "top|left" },
{ map = "-2,-14", path = "right" },
{ map = "-1,-13", path = "top" },
{ map = "84674566", path = "top" },-- Map exterieure de la banque
{ map = "83887104", path = "396" },-- Map interieur de la banque
}
end
function bank ()
return {
{ map = "0,-22",path = "right" },
{ map = "1,-22", path = "right" },
{ map = "2,-22", path = "right" },
{ map = "3,-22", path = "right" },
{ map = "4,-22", path = "bottom" },
{ map = "5,-22", path = "left" },
{ map = "-1,-21", path = "right" },
{ map = "0,-21", path = "right" },
{ map = "1,-21", path = "right" },
{ map = "2,-21", path = "right" },
{ map = "3,-21", path = "right" },
{ map = "4,-21", path = "bottom" },
{ map = "5,-21", path = "left" },
{ map = "6,-21", path = "left" },
{ map = "7,-21", path = "left" },
{ map = "-1,-20", path = "right" },
{ map = "0,-20", path = "right" },
{ map = "1,-20", path = "right" },
{ map = "2,-20", path = "right" },
{ map = "3,-20", path = "right" },
{ map = "4,-20", path = "bottom" },
{ map = "5,-20", path = "left" },
{ map = "6,-20", path = "left" },
{ map = "7,-20", path = "left" },
{ map = "-1,-19", path = "right" },
{ map = "0,-19", path = "right" },
{ map = "1,-19", path = "right" },
{ map = "2,-19", path = "right" },
{ map = "3,-19", path = "right" },
{ map = "4,-19", path = "bottom" },
{ map = "5,-19", path = "left" },
{ map = "6,-19", path = "left" },
{ map = "7,-19", path = "left" },
{ map = "-1,-18", path = "right" },
{ map = "0,-18", path = "right" },
{ map = "1,-18", path = "right" },
{ map = "2,-18", path = "right" },
{ map = "3,-18", path = "right" },
{ map = "4,-18", path = "bottom" },
{ map = "5,-18", path = "left" },
{ map = "6,-18", path = "left" },
{ map = "7,-18", path = "left" },
{ map = "-1,-17", path = "right" },
{ map = "0,-17", path = "right" },
{ map = "1,-17", path = "right" },
{ map = "2,-17", path = "right" },
{ map = "3,-17", path = "right" },
{ map = "4,-17", path = "bottom" },
{ map = "5,-17", path = "left" },
{ map = "6,-17", path = "left" },
{ map = "7,-17", path = "left" },
{ map = "-1,-16", path = "right" },
{ map = "0,-16", path = "right" },
{ map = "1,-16", path = "right" },
{ map = "2,-16", path = "right" },
{ map = "3,-16", path = "right" },
{ map = "5,-16", path = "left" },
{ map = "6,-16", path = "left" },
{ map = "7,-16", path = "left" },
{ map = "-1,-15", path = "right" },
{ map = "0,-15", path = "right" },
{ map = "1,-15", path = "right" },
{ map = "2,-15", path = "right" },
{ map = "3,-15", path = "right" },
{ map = "4,-15", path = "top" },
{ map = "5,-15", path = "left" },
{ map = "6,-15", path = "left" },
{ map = "7,-15", path = "left" },
{ map = "-1,-14", path = "right" },
{ map = "0,-14", path = "right" },
{ map = "1,-14", path = "right" },
{ map = "2,-14", path = "right" },
{ map = "3,-14", path = "right" },
{ map = "4,-14", path = "top" },
{ map = "-2,-14", path = "right" },
{ map = "-1,-13", path = "top" },
{ map = "84674566", door = "303" }, -- Map exterieure de la banque
{ map = "83887104", npcBank = true }, -- Parle au pnj et vide son inventaire en banque
}
end
C'est le move.Call(0) qui fait augmenter énormément la mémoire vive, donc enfaite, ce qu'il faudrait c'est une fonction qui fait un dispose mais pas de tout si vous voyez ce que je veux dire.