|
execute
#71812
04/22/06 14:15
04/22/06 14:15
|
Joined: Aug 2005
Posts: 343 Germany
HPW
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
It would be nice to have a function to set what execute() should execute. Something like this: Code:
text execute_allowed_text { strings = 5; string = "function my_function1(v_value, s_string);", // execute my_function1 is allowed "function my_function2(s_string1, s_string2);", // execute my_function2 is allowed "function my_function3();", // execute my_function3 is allowed "skill _health;", // execute manipulations on skill named _health "var variable1;", // execute manipulations on varible named variable1 "function wait(v_time);"; // execute wait is allowed }
string test_string = "player._health = 100; player._mana = 50; my_function1(3, \"Hallo World\"); variable1 = 10; my_function5();";
function execute_mod() { execute_allowed(execute_allowed_text, test_string); }
The function execute_allowed(Text, String) should only execute... player._health = 100; my_function1(3, "Hallo World"); variable1 = 10; ...and ignore... player._mana = 50; my_function5(); This way we could make our games able for modifications without the possibility to cheat.
Last edited by HPW; 04/22/06 14:19.
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: execute
[Re: HPW]
#71813
04/22/06 15:29
04/22/06 15:29
|
Joined: Mar 2003
Posts: 569
FRAJO
User
|
User
Joined: Mar 2003
Posts: 569
|
you can do that yourself. Just check if the execute string does not contain any forbidden kewords.
-------------------------------------------
ICQ: 242543712
Ich bin nicht hier und bin nicht da.
Wo bin ich dann?
".."
("")
^ ^
This is the evil vampire bunny. Copy and paste him into your signiture to help him achieve world domination. Yeah
|
|
|
Re: execute
[Re: FRAJO]
#71814
04/22/06 18:06
04/22/06 18:06
|
Joined: Aug 2005
Posts: 343 Germany
HPW
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
I have done it before like you said but this is not the same. I have thousands of things are not allowed and only hundert that are allowed. And the String should also execute if anything is not allowed.
Last edited by HPW; 04/22/06 18:07.
|
|
|
Re: execute
[Re: TWO]
#71816
04/22/06 18:15
04/22/06 18:15
|
Joined: Aug 2005
Posts: 343 Germany
HPW
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
How can I cut a function without a regular expression if I don't know the parameters? As example: my_function(8, 7,"string123",str_to_num("1")); And if I have a function for regular expressions, then I must know what is to cut (thousands of variables and functions).
Last edited by HPW; 04/22/06 18:20.
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: execute
[Re: TWO]
#71818
04/23/06 08:28
04/23/06 08:28
|
Joined: Aug 2005
Posts: 343 Germany
HPW
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
So you mean like counting the "(" and ")"? Ok, this is possible but there are to many functions, skills and variables to ignore. It would really better to set the allowed functions, skills and variables instead of the disallowed. This would make it also better for updateing the scripts. It's less work and you can't forget to ignore skills or variables like "_health" with those the gamers would be able to cheat in the game.
Last edited by HPW; 04/23/06 08:32.
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: execute
[Re: HPW]
#71820
04/23/06 16:17
04/23/06 16:17
|
Joined: Jan 2003
Posts: 4,615 Cambridge
Joey
Expert
|
Expert
Joined: Jan 2003
Posts: 4,615
Cambridge
|
Quote:
So you mean like counting the "(" and ")"? Ok, this is possible but there are to many functions, skills and variables to ignore.
simply check for every keyword in your text string array if it's allowed or not. then cut it out. it doesn't matter if there are ten or ten thousand keywords, the work is done by the pc, the script stays the same.
Quote:
It would really better to set the allowed functions, skills and variables instead of the disallowed. This would make it also better for updateing the scripts. It's less work and you can't forget to ignore skills or variables like "_health" with those the gamers would be able to cheat in the game.
it's the same vice versa. check for the allowed keywords and delete everything else.
joey.
|
|
|
Re: execute
[Re: Joey]
#71821
04/23/06 16:27
04/23/06 16:27
|
Joined: Aug 2005
Posts: 343 Germany
HPW
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
No, I mean thousands of different functions, skills and variables, not the same!
And if I search for a allowed function and cut all other, then I can't search for the next allowed funtion. How would you do it?
Last edited by HPW; 04/23/06 16:34.
|
|
|
|