Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-21-2007, 06:18 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Encode/Decode

I'm developing an advanced rights system to help kill abuse on my server.

Using base64encode("bscharff"), the encoding translates to 'YnNjaGFyZmY=' (notice it ends with a '=')

As everyone knows (hopefully), to assign variables to something, you use an equals sign. Therefor, I cannot save with base64 encoding.

Is there any other encoding available in GS2 other than base64?
__________________
Trying to be nice now...
Reply With Quote
  #2  
Old 11-21-2007, 06:27 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Quote:
Originally Posted by bscharff View Post
I'm developing an advanced rights system to help kill abuse on my server.

Using base64encode("bscharff"), the encoding translates to 'YnNjaGFyZmY=' (notice it ends with a '=')

As everyone knows (hopefully), to assign variables to something, you use an equals sign. Therefor, I cannot save with base64 encoding.

Is there any other encoding available in GS2 other than base64?
PHP Code:
string "="
Umm... As long as the '=' is in quotes, it shouldn't be a problem.
Reply With Quote
  #3  
Old 11-21-2007, 06:30 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Novo View Post
PHP Code:
string "="
Umm... As long as the '=' is in quotes, it shouldn't be a problem.
Can you make a variable with name "var="? I think that's what he's getting at.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #4  
Old 11-21-2007, 06:35 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Quote:
Originally Posted by Tolnaftate2004 View Post
Can you make a variable with name "var="? I think that's what he's getting at.
Ah... Umm... ereg_replace anyone? =D

Yea... Don't encode the account names... First off, they hide who has what rights -- And in terms of manageability, it's a useless overhead. You're much more likely to leave an ex-staff in the rights if you don't see his account in the first place. ( thus, increasing abuse! )

I don't see how it'll help you in any way by doing so: Anyone can easily find their account info with encode, and it just delays them... About 3 seconds.

Otherwise, it's quite a bad habit.

I would just log all actions, and if one isn't justified, than there you go! You have a log about it. ( and you could take counter-measures. )
Reply With Quote
  #5  
Old 11-21-2007, 06:57 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Encoding is honestly only good for passwords and the like. And I wouldn't use base64encode by itself for anything that you want secure, since there is a base64decode function, rendering it completely useless by itself, honestly.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #6  
Old 11-21-2007, 09:15 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
You don't need to encode, why not use an md5 hash or something.
__________________
Reply With Quote
  #7  
Old 11-21-2007, 11:24 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
  • Best Option: Limit the access to the weapon(s), then you wouldn't need to waste time on an "advanced rights system."
  • Next Best Option: Use an md5 hash (like Inver said). The command is md5(str).
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.

Last edited by napo_p2p; 11-21-2007 at 09:03 PM..
Reply With Quote
  #8  
Old 11-21-2007, 01:15 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I asked for an encryption method that could pass a key as a parameter but it never got anywhere. Ultimately, the idea was put forward that a key could be how many times you keep re-encoding it in a loop.

If someone knows how to get that variable, using the encode function won't do much at all . In the end, It would be better to just stop scripting rights systems for time-wasting and unnecessary staff systems.
Reply With Quote
  #9  
Old 11-21-2007, 06:53 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Inverness View Post
You don't need to encode, why not use an md5 hash or something.
Exactly.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #10  
Old 11-21-2007, 07:04 PM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Quote:
Originally Posted by Tolnaftate2004 View Post
Can you make a variable with name "var="? I think that's what he's getting at.
That's EXACTLY What I'm Getting At.
The Variable is rights_bscharff and It would translate to rights_(I forget)=
and a variable cannot have '=' in it
__________________
Trying to be nice now...
Reply With Quote
  #11  
Old 11-21-2007, 07:08 PM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
"time-wasting"..."unnecessary staff systems."
No. It Is Completely Necessary.
Don't Reply unless you intend to help.

M'Kay.
If I'm Making My Own Encode/Decode Script, How Would I basically tokenize each character on it's own? (without manually adding spaces)
__________________
Trying to be nice now...
Reply With Quote
  #12  
Old 11-21-2007, 07:32 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Why do you double post all the time? Just use MD5 hashes ;o
Reply With Quote
  #13  
Old 11-21-2007, 07:38 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
On behalf of this thread, I wrote an encryption/decryption example. It is simple and by no means industry standard, and it will almost certainly produce characters that are not allowed in variable names, so think about how you are going to use it. I guess it could be adapted to replace such characters with more variable-name friendly ones but I didn't have time to think about that.

Take a look at http://skyld.vip.graal.net/wikka.php...mpleEncryption.

It was a quickly written script, and probably can be made more efficient, but I hope it demonstrates the idea.
Reply With Quote
  #14  
Old 11-22-2007, 01:52 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Thanks Skyld!
__________________
Trying to be nice now...
Reply With Quote
  #15  
Old 11-22-2007, 03:13 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Actually, staff systems usually aren't really that important. Or necessary at that...
__________________
Stan.
Reply With Quote
  #16  
Old 11-22-2007, 03:40 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Uh, I've never heard of anyone (Staff with the weapon) actually hacking rights out of a staff weapon, its not really worth the effort considering you'd just get fired.

If you're wasting this much time working on some super staff script and not on developing the server then you're a bad staff member.
__________________

Last edited by Inverness; 11-22-2007 at 04:00 AM..
Reply With Quote
  #17  
Old 11-22-2007, 03:42 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by bscharff View Post
"time-wasting"..."unnecessary staff systems."
No. It Is Completely Necessary.
Don't Reply unless you intend to help.
Quote:
Originally Posted by Kyranki View Post
Actually, staff systems usually aren't really that important. Or necessary at that...
Speaking of things that aren't necessary... why post such an unnecessary comment that is almost irrelevant to the topic at hand: encoding and decoding?
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #18  
Old 11-22-2007, 03:45 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Tigairius View Post
Speaking of things that aren't necessary... why post such an unnecessary comment that is almost irrelevant to the topic at hand: encoding and decoding?
Almost isn't good enough. And he doesn't need a reason to post either.

Edit: Here's a rephrasing. Why does it matter? He's not going to stop posting just because you don't like the necessity of his post, so it isn't really necessary to bring up the necessity of his posting.
__________________

Last edited by Inverness; 11-22-2007 at 03:56 AM..
Reply With Quote
  #19  
Old 11-22-2007, 03:58 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Tigairius View Post
I don't see me saying anywhere that he needs a reason to post things.
Me neither. See my edit.
__________________
Reply With Quote
  #20  
Old 11-22-2007, 10:39 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Kyranki View Post
Actually, staff systems usually aren't really that important. Or necessary at that...
It's just a combination of small, basic scripts piled into one behemoth of a script. Most commands don't actually have a logical use. It's worse when it's a combination of scripts stolen from multiple sources. Multiple coding styles clash and the **** hits the fan.
Reply With Quote
  #21  
Old 11-22-2007, 08:15 PM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by Twinny View Post
It's just a combination of small, basic scripts piled into one behemoth of a script. Most commands don't actually have a logical use. It's worse when it's a combination of scripts stolen from multiple sources. Multiple coding styles clash and the **** hits the fan.
Sounds like a computer talking badass Twinny lol
__________________
Stan.
Reply With Quote
  #22  
Old 11-23-2007, 08:55 PM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Second at Tigairius (& Inverness)
__________________
Trying to be nice now...
Reply With Quote
  #23  
Old 11-23-2007, 09:26 PM
Pimmeh Pimmeh is offline
Rgesitreed Uesr
Pimmeh's Avatar
Join Date: May 2007
Location: Utrecht, the Netherlands
Posts: 1,586
Pimmeh has a spectacular aura about
Send a message via AIM to Pimmeh Send a message via MSN to Pimmeh
Quote:
Originally Posted by bscharff View Post
Second at Tigairius (& Inverness)
Whats the point of this post?
__________________
Oh, Death,
No wealth, no ruin, no silver, no gold
Nothing satisfies me but your soul
Reply With Quote
  #24  
Old 11-24-2007, 12:46 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by bscharff View Post
Second at Tigairius (& Inverness)
I don't understand what you're trying to say, elaborate.
__________________
Reply With Quote
  #25  
Old 11-24-2007, 05:31 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Like if someone agrees to something they say "second"
I'm saying I Agree With Tigairius & Inverness :P
__________________
Trying to be nice now...
Reply With Quote
  #26  
Old 11-24-2007, 08:54 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by bscharff View Post
Like if someone agrees to something they say "second"
I'm saying I Agree With Tigairius & Inverness :P
How? We're not even agreed on the same thing.

I'm confused now
__________________
Reply With Quote
  #27  
Old 11-25-2007, 02:15 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
How? We're not even agreed on the same thing.

I'm confused now
He's trying to confuse you. He's messing with your mind. Be strong.


I only encrypt things that are being used in real-time, so to say. For example, encrypting the ammo you have with base64encode x ammount of times, then decoding it x ammount of times. This simply makes it harder to use CheatEngine, etc
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.