/** * Validates Session Key. * * @param string $s_key Session Key * @return boolean Success */ private function validate_session($s_key) { $player = new CnCNet_Player(); // Maybe query database table to check if valid session key and comming from correct IP? $valid = $player->validate_s_key($s_key, $_SERVER['REMOTE_ADDR']); return $valid == 1 ? true : false; }
/** * Validates Session Key. * * @param string $s_key Session Key * @return boolean Success */ private function validate_session($s_key) { $player = new CnCNet_Player(); $event = new CnCNet_Event(); // Maybe query database table to check if valid session key and coming from correct IP? $valid = $player->validate_s_key($s_key, $_SERVER['REMOTE_ADDR']); if (is_object($valid)) { foreach ($valid as $id) { // TODO: improve this $event->add('exit', '0', '0', $id, ''); } } return $valid == 1 || is_object($valid) ? true : false; }