1.优化websocket中的jackpot.hit
2.优化/api/game/betMyOrders接口,新增中奖号码字段result_number
This commit is contained in:
@@ -170,10 +170,24 @@ class GameWebSocketServer
|
||||
if ($action === 'subscribe') {
|
||||
$rawTopics = $decoded['topics'] ?? [];
|
||||
$rawList = is_array($rawTopics) ? $rawTopics : [];
|
||||
$finalTopics = GameWebSocketSubscriptionRegistry::replaceSubscriptions($connection->id, $rawList);
|
||||
$replace = false;
|
||||
if (!empty($decoded['replace'])) {
|
||||
$replace = true;
|
||||
}
|
||||
if (isset($decoded['mode']) && is_string($decoded['mode']) && trim($decoded['mode']) === 'replace') {
|
||||
$replace = true;
|
||||
}
|
||||
$before = GameWebSocketSubscriptionRegistry::meta($connection->id);
|
||||
$beforeTopics = is_array($before) ? ($before['topics'] ?? []) : [];
|
||||
|
||||
$finalTopics = $replace
|
||||
? GameWebSocketSubscriptionRegistry::replaceSubscriptions($connection->id, $rawList)
|
||||
: GameWebSocketSubscriptionRegistry::mergeSubscriptions($connection->id, $rawList);
|
||||
Log::channel('ws')->info('subscribe', [
|
||||
'connection_id' => $connection->id,
|
||||
'user_id' => GameWebSocketSubscriptionRegistry::userIdOf($connection->id),
|
||||
'replace' => $replace,
|
||||
'before_topics' => $beforeTopics,
|
||||
'topics' => $finalTopics,
|
||||
'requested_count' => is_array($rawTopics) ? count($rawTopics) : 0,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user