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 01-02-2008, 10:59 PM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Client. vs Clientr.

Hey this is probably a really stupid question but Ive never been too sure.
From what I know, clientr. variables are more secure but you can only change them serverside, usualy with triggeractions (pain in the ass). But Im told client. variables can be edited clientside.

I was thinking of using some values in client. vars, should I? Its quicker and doesn't use triggeractions. Less lag right?
Reply With Quote
  #2  
Old 01-02-2008, 11:00 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Well, first you should weigh up what you're using them for. If it's information you wish to be kept secure.

What are you storing in it? Then maybe I can help you decide what prefix to use.
Reply With Quote
  #3  
Old 01-02-2008, 11:02 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
If you are storing gralats or or money you should use clientr. also if you arn't invoking an action on a x/y you should use triggerserver, not triggeraction.
__________________
Deep into the Darkness peering...
Reply With Quote
  #4  
Old 01-02-2008, 11:04 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Well, as Codein said, it depends on what you are making. Clientr is often used for security, ie storing MD5 encrypted passwords for comparision or if you don't want it to be edited clientside.

Should provide more info tho
__________________
Reply With Quote
  #5  
Old 01-02-2008, 11:41 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
Think of it this way: What don't you want hackers changing with a memory editer . If it's something like a flag saying your radio is playing then client.radio =1 is fine. If it's something like your characters expierence, clientr.exp would be more appropriate. If it's important: clientr. it.
Reply With Quote
  #6  
Old 01-03-2008, 12:15 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Ya, less important things that wouldn't effect gameplay if hacked is what you'd use client.vars for. Things that would give benefits for the player if they were able to hack them are for clientr.vars, like a speed var for your movement, damage vars, and so on.
Reply With Quote
  #7  
Old 01-03-2008, 01:47 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
Just a note, for things which you need client. for, but you need secure, I would use base64encode() and base64decode() ... would work best if you did it a certain number of time such as this:

PHP Code:
function encodeTexttext )
{
  
temp.text;
  for ( 
temp.10temp.10temp.++ )
  {
    
temp.base64encodetemp.);
  }
  return 
temp.t;
}
function 
decodeTexttext )
{
  
temp.text;
  for ( 
temp.0temp.10temp.++ )
  {
    
temp.base64decodetemp.);
  }
  return 
temp.t;

I've used this for gun systems and such where you need to store things that change on the dot (such as ammo), yet need to be hard to hack. For HP or experience, clientr all the way.
__________________
Reply With Quote
  #8  
Old 01-03-2008, 02:25 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by cbkbud View Post
Just a note, for things which you need client. for, but you need secure, I would use base64encode() and base64decode() ... would work best if you did it a certain number of time such as this:

PHP Code:
function encodeTexttext )
{
  
temp.text;
  for ( 
temp.10temp.10temp.++ )
  {
    
temp.base64encodetemp.);
  }
  return 
temp.t;
}
function 
decodeTexttext )
{
  
temp.text;
  for ( 
temp.0temp.10temp.++ )
  {
    
temp.base64decodetemp.);
  }
  return 
temp.t;

I've used this for gun systems and such where you need to store things that change on the dot (such as ammo), yet need to be hard to hack. For HP or experience, clientr all the way.
I could think of ways to make ammo serversided, which includes a way to overcome the initial client - server lag.

A smart game hacker could use the lead that servers use base64 encoding. If the hacker was worth his salt, he'd easily find the the amount of times you've base64 encoded a value and then decode it from there. I had an example in my head on how I'd get round but a) It's lost now and b) I'm not sharing it publicly.

My idea was this:

Say if you have your finger on the shoot button, a temp variable would count how many bullets have been shot and then after you release the button, it'd subtract this amount from your clientr.ammo. I don't know how practical it is though. Also, this way, it doesn't matter who's shooting and who's not. It might cause a bit more lag than you'd want for the whole server but definitely less lag than taking off the ammo every time a projectile is launched/fired and definitely more secure than client. flags. Maybe a combination of my idea and base64 encoding so that hackers can't just hold down the ammo button and find the address for the client variable.

I'm not sure though, just a thought.
Reply With Quote
  #9  
Old 01-03-2008, 02:33 AM
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
Quote:
Originally Posted by Codein View Post
I could think of ways to make ammo serversided, which includes a way to overcome the initial client - server lag.

A smart game hacker could use the lead that servers use base64 encoding. If the hacker was worth his salt, he'd easily find the the amount of times you've base64 encoded a value and then decode it from there. I had an example in my head on how I'd get round but a) It's lost now and b) I'm not sharing it publicly.
I wrote this encryption example a while ago for this sort of problem.
Reply With Quote
  #10  
Old 01-03-2008, 03:12 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Skyld View Post
I wrote this encryption example a while ago for this sort of problem.
Ah, perfect. Now there's no need for my serverside ammunition, which'd cause unecessary in light of a secure clientside ammunition method. I didn't notice it on your wiki, of which I often read. Not lately though, I've noticed most of the links are underlined in read, meaning they don't exist.
Reply With Quote
  #11  
Old 01-03-2008, 06:28 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 Codein View Post
I could think of ways to make ammo serversided, which includes a way to overcome the initial client - server lag.

A smart game hacker could use the lead that servers use base64 encoding. If the hacker was worth his salt, he'd easily find the the amount of times you've base64 encoded a value and then decode it from there. I had an example in my head on how I'd get round but a) It's lost now and b) I'm not sharing it publicly.

My idea was this:

Say if you have your finger on the shoot button, a temp variable would count how many bullets have been shot and then after you release the button, it'd subtract this amount from your clientr.ammo. I don't know how practical it is though. Also, this way, it doesn't matter who's shooting and who's not. It might cause a bit more lag than you'd want for the whole server but definitely less lag than taking off the ammo every time a projectile is launched/fired and definitely more secure than client. flags. Maybe a combination of my idea and base64 encoding so that hackers can't just hold down the ammo button and find the address for the client variable.

I'm not sure though, just a thought.
I was just giving an example of a way to do it. Obviously you would want something better. I was thinking on Skyld's example he posted below, but I couldn't find it.
Quote:
Originally Posted by Skyld View Post
I wrote this encryption example a while ago for this sort of problem.
That's the one, I searched all over the wiki and couldn't find it. Shouldn't you add it to the official wiki, seeing as you are kinda the leader of the GST in a way, and uh ... that's sorta your job ... adding things to the wiki ... Can't just expect normal players to do it.
__________________
Reply With Quote
  #12  
Old 01-05-2008, 06:25 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
Really I don't like to use clientr. flags to "store" information, really. I use it as a reference of sorts, I like to store important information like a players HP, money, etc, in objects and files and reflect those to clientr. flags so that they can be easily read.

But, like I've said before, I've come across an odd problem where clientr. flags can be set clientside.
__________________

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
  #13  
Old 01-05-2008, 04:30 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by coreys View Post
Really I don't like to use clientr. flags to "store" information, really. I use it as a reference of sorts, I like to store important information like a players HP, money, etc, in objects and files and reflect those to clientr. flags so that they can be easily read.

But, like I've said before, I've come across an odd problem where clientr. flags can be set clientside.
Yeah, before I experienced that with movement systems that used and battle systems, if someone setted clientr. clientside with a wnpc, they are stored locally at the player. And when you like, press s and a trigger will be sent, and that clientr. string that is stored locally will be sent..

Dunno if this is fixed or all, because using objects and comparison serverside fix insexure stuff like that..
__________________
Reply With Quote
  #14  
Old 01-05-2008, 10:00 PM
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
Quote:
Originally Posted by Chompy View Post
Yeah, before I experienced that with movement systems that used and battle systems, if someone setted clientr. clientside with a wnpc, they are stored locally at the player. And when you like, press s and a trigger will be sent, and that clientr. string that is stored locally will be sent..
You don't need to send clientr. flags through triggers in the first place...

However, I also use a system where important values are stored in objects and reflected to clientr. flags. Just seems more secure.
__________________
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.
Reply With Quote
  #15  
Old 01-05-2008, 10:21 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by napo_p2p View Post
You don't need to send clientr. flags through triggers in the first place...

However, I also use a system where important values are stored in objects and reflected to clientr. flags. Just seems more secure.
Yes, but I did that sometime in 05-06, gs1

Now I use objects and clientr flags.
__________________
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 06:24 AM.


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