Thread: Better ATTR's
View Single Post
  #12  
Old 07-27-2011, 07:46 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
There's probably something you can be doing different if you need more than 233 characters of data in an attr.

You're committing an SQL Atrocity (Search Google: "new table for each user") by creating a new table of data for each player, and aren't really gaining any kind of performance boost by doing that at all.

SQL just seems really overkill for this. I.e:

PHP Code:
function onPlayerLogin(pl) {
  
this.shared.(@pl.account).clearvars();
}

function 
onPlayerLogout(pl) {
  
this.shared.(@pl.account).clearvars();
}

public function 
addSharedVariable(target, flagName, value) {
  
// ... other code 
  
this.shared.(@target).(@flagName) = value;
  
  
// Packet...
  
temp.packet = {};
  
temp.packet.add(target.account);
  
temp.packet.add(flagName);
  
temp.packet.add(value);
 
  
// update players
} 
__________________
Quote:
Reply With Quote