20.04.26
This commit is contained in:
@@ -13,5 +13,8 @@ flask create-demo-rooms
|
||||
# 5. Валидация баланса
|
||||
flask validate-balance
|
||||
|
||||
# 6. Запустите сервер
|
||||
# 6. Проверка прибыльности
|
||||
flask test-income
|
||||
|
||||
# 7. Запустите сервер
|
||||
python app.py
|
||||
@@ -15,9 +15,9 @@ class GameConfig:
|
||||
# Тайминги фаз (секунды)
|
||||
PHASE_DURATIONS = {
|
||||
'action': 120,
|
||||
'market': 30,
|
||||
'event': 30,
|
||||
'results': 45
|
||||
'market': 20,
|
||||
'event': 20,
|
||||
'results': 25
|
||||
}
|
||||
|
||||
# Режимы скорости
|
||||
|
||||
3449
templates/game.html
3449
templates/game.html
File diff suppressed because it is too large
Load Diff
@@ -612,8 +612,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const readyPlayers = {{ players|selectattr('is_ready')|list|length }};
|
||||
const totalPlayers = {{ players|length }};
|
||||
const readyPlayers = document.querySelectorAll('.player-ready.ready').length;
|
||||
const totalPlayers = document.querySelectorAll('.player-item').length;
|
||||
|
||||
if (totalPlayers < 2) {
|
||||
showNotification('❌ Нужно минимум 2 игрока для начала игры', 'error');
|
||||
@@ -626,6 +626,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
showNotification('🔄 Запуск игры...', 'info');
|
||||
|
||||
fetch('/room/{{ room.code }}/start', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -633,7 +635,12 @@
|
||||
'X-CSRFToken': '{{ csrf_token() if csrf_token else "" }}'
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
return response.json().then(err => Promise.reject(err));
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
showNotification('✅ Игра начинается!', 'success');
|
||||
@@ -647,8 +654,8 @@
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
showNotification('❌ Ошибка при запуске игры', 'error');
|
||||
console.error('Error starting game:', error);
|
||||
showNotification('❌ Ошибка при запуске игры: ' + (error.error || error.message || 'Неизвестная ошибка'), 'error');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user