a bit of progress
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Game;
|
||||
|
||||
use App\Models\Character;
|
||||
use App\Models\Crime;
|
||||
|
||||
class ActivityLogService
|
||||
{
|
||||
/**
|
||||
* Log a generic activity
|
||||
*/
|
||||
public function log(Character $character, string $action, ?string $description = null, ?string $ipAddress = null, ?string $userAgent = null): void
|
||||
{
|
||||
\App\Models\ActivityLog::log($character, $action, $description, $ipAddress, $userAgent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a crime attempt
|
||||
*/
|
||||
public function logCrimeAttempt(Character $character, Crime $crime, bool $success, int $reward = 0): void
|
||||
{
|
||||
\App\Models\ActivityLog::logCrimeAttempt($character, $crime, $success, $reward);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log money transaction
|
||||
*/
|
||||
public function logMoneyTransaction(Character $character, string $type, int $amount, string $reason): void
|
||||
{
|
||||
\App\Models\ActivityLog::logMoneyTransaction($character, $type, $amount, $reason);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log level up
|
||||
*/
|
||||
public function logLevelUp(Character $character, int $newLevel): void
|
||||
{
|
||||
\App\Models\ActivityLog::logLevelUp($character, $newLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log character creation
|
||||
*/
|
||||
public function logCharacterCreated(Character $character): void
|
||||
{
|
||||
\App\Models\ActivityLog::logCharacterCreated($character);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user