1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

no longer store weapon name per kill

This commit is contained in:
Robin Appelman 2021-05-22 20:32:11 +02:00
commit 89687f6a76
8 changed files with 12 additions and 28 deletions

View file

@ -10,15 +10,13 @@ class Kill {
private int $attackerId;
private int $assisterId;
private int $victimId;
private string $weapon;
public function __construct(int $id, int $demoId, int $attackerId, int $assisterId, int $victimId, string $weapon) {
public function __construct(int $id, int $demoId, int $attackerId, int $assisterId, int $victimId) {
$this->id = $id;
$this->demoId = $demoId;
$this->attackerId = $attackerId;
$this->assisterId = $assisterId;
$this->victimId = $victimId;
$this->weapon = $weapon;
}
public function getId(): int {
@ -40,8 +38,4 @@ class Kill {
public function getVictimId(): int {
return $this->victimId;
}
public function getWeapon(): string {
return $this->weapon;
}
}

View file

@ -8,13 +8,11 @@ class ParsedKill {
private int $attackerDemoId;
private int $assisterDemoId;
private int $victimDemoId;
private string $weapon;
public function __construct(int $attackerDemoId, int $assisterDemoId, int $victimDemoId, string $weapon) {
public function __construct(int $attackerDemoId, int $assisterDemoId, int $victimDemoId) {
$this->attackerDemoId = $attackerDemoId;
$this->assisterDemoId = $assisterDemoId;
$this->victimDemoId = $victimDemoId;
$this->weapon = $weapon;
}
public function getAttackerDemoId(): int {
@ -28,8 +26,4 @@ class ParsedKill {
public function getVictimDemoId(): int {
return $this->victimDemoId;
}
public function getWeapon(): string {
return $this->weapon;
}
}

View file

@ -88,8 +88,7 @@ class DemoSaver {
$demoId,
$userMap[$kill->getAttackerDemoId()] ?? 0,
$userMap[$kill->getAssisterDemoId()] ?? 0,
$userMap[$kill->getVictimDemoId()] ?? 0,
$kill->getWeapon()
$userMap[$kill->getVictimDemoId()] ?? 0
));
}

View file

@ -93,8 +93,7 @@ class Parser {
});
/** @var ParsedKill[] $kills */
$kills = array_map(function (array $death) {
return new ParsedKill($death['killer'] ?? 0, $death['assister'] ?? 0, $death['victim'] ?? 0,
$death['weapon']);
return new ParsedKill($death['killer'] ?? 0, $death['assister'] ?? 0, $death['victim'] ?? 0);
}, $deaths);
$activityMap = [];
foreach ($kills as $kill) {

View file

@ -15,7 +15,6 @@ class KillProvider extends BaseProvider {
'attacker_id' => $query->createNamedParameter($kill->getAttackerId()),
'assister_id' => $query->createNamedParameter($kill->getAssisterId()),
'victim_id' => $query->createNamedParameter($kill->getVictimId()),
'weapon' => $query->createNamedParameter($kill->getWeapon()),
'created_at' => 'now()',
'updated_at' => 'now()',
]);