The same thing applies to (Iron)Python, you only have to register you object, like you did with your LUA script, and it has knowledge of the whole class.Quote:
what i really like with Lua is lets say you want to access the calling players class (ima call it Client wich is GameClient class).
IN your LUA initialization you can add engine["Player"] = Client;
This tells lua to allow you access to the whole GameClient class.
Then later on in your script you can do something like...
Dialog("Welcome "..Player.Name.." What can i do for you?");
or
Player.Teleport(1002,400,400);
or
Player.Kill();
these are just examples To show you that with LUA you dont need to write your whole class over to a scriptable object.
Regards
uint Life{
get{
return this.life; //db arg
}
set{
this.life = value;
UpdateNotifier.Status(this.Id, Status.HP, value);// so it send a packet to update your health.
}
}
What I'm doing in my current source using reflection for C# scripting is loading the methods into a collection and simply calling upon that, but not loading them every time an action is required for it, but rather just having some form of update command which will update the collection with changes. Works pretty fine for me at least.Quote:
Guess I'd go with what almost everyone else said, it's either Lua or Python. Reflection on the other hand can get quite messy, let alone that the performance *might* not be the best.
IMO though, you should make sure that reflection isn't slow in critical parts, and somehow measure relative performances of the possible routes that you may take (to my experience, not exactly the easiest task when you're dealing with a crapload of I/O). At the end of the day you should ultimately choose something that you're comfortable with and that doesn't impact the performance of the server.
Just do a quick hash check on the script files and update the appropriate ones every few minutes. (Would take what, 2 seconds to hash check 300 files? not done any tests myself, but I doubt it'd take long, depending on what hash you use)Quote:
What I'm doing in my current source using reflection for C# scripting is loading the methods into a collection and simply calling upon that, but not loading them every time an action is required for it, but rather just having some form of update command which will update the collection with changes. Works pretty fine for me at least.
The biggest bottleneck would be to place the head of the drive for each file. Else, hashing around 125 MB with MD5 is REALLY negligible.Quote:
Just do a quick hash check on the script files and update the appropriate ones every few minutes. (Would take what, 2 seconds to hash check 300 files? not done any tests myself, but I doubt it'd take long, depending on what hash you use)
real 0m1.456s user 0m0.437s sys 0m0.125s
Would that count empty files or files with actual content?Quote:
Just do a quick hash check on the script files and update the appropriate ones every few minutes. (Would take what, 2 seconds to hash check 300 files? not done any tests myself, but I doubt it'd take long, depending on what hash you use)