View Single Post
  #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