Site
- add action on game request
This commit is contained in:
@ -9,6 +9,10 @@ class User(models.Model):
|
||||
pfp = models.CharField(max_length=1024, default="/static/img/default_pfp.jpg")
|
||||
banner = models.CharField(max_length=1024, default="/static/img/default_banner.jpg")
|
||||
mail_verified = models.BooleanField(default=False)
|
||||
github_link = models.CharField(max_length=1024, null=True, blank=True, default=None)
|
||||
discord_username = models.CharField(max_length=1024, null=True, blank=True, default=None)
|
||||
elo = models.DecimalField(max_digits=10, decimal_places=0, default=1000)
|
||||
|
||||
|
||||
class Message(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/22 17:08:46 by madegryc #+# #+# */
|
||||
/* Updated: 2024/09/18 19:51:25 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/20 14:19:33 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -239,9 +239,12 @@ function initButtonPopMenuLogin()
|
||||
{
|
||||
const buttons = document.getElementById('popMenuLoginButton').getElementsByTagName('p');
|
||||
|
||||
buttons[0].addEventListener('click', () => {
|
||||
pageRenderer.changePage('profilPage', false, userMeInfo.id);
|
||||
})
|
||||
buttons[2].addEventListener('click', () => {
|
||||
window.location.replace('/logout');
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export { LobbyPage };
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/19 23:08:31 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/20 11:15:34 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/20 14:17:56 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -20,7 +20,6 @@ class ProfilPage
|
||||
{
|
||||
static create(userId)
|
||||
{
|
||||
const profilInfos = document.getElementsByClassName('profile-info')[0];
|
||||
const username = document.getElementsByTagName('h2')[0];
|
||||
const pfp = document.getElementsByClassName('profile-image')[0];
|
||||
const banner = document.getElementsByClassName('background-card')[0];
|
||||
|
@ -6,11 +6,11 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/15 12:00:01 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/17 14:38:06 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/20 15:45:55 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
import { MultiOnlineGamePage, opponent } from "/static/javascript/multiOnlineGame/multiOnlineGamePage.js"
|
||||
import { MultiOnlineGamePage, opponent, player, map } from "/static/javascript/multiOnlineGame/multiOnlineGamePage.js"
|
||||
import { ball } from "/static/javascript/multiOnlineGame/multiOnlineGamePage.js"
|
||||
import { WaitingGamePage } from "/static/javascript/waitingGame/main.js"
|
||||
import { pageRenderer } from '/static/javascript/main.js'
|
||||
@ -28,6 +28,13 @@ function typeGame(content)
|
||||
MultiOnlineGamePage.opponentDisconnect();
|
||||
else if (content.action == 5 && pageRenderer.actualPage == MultiOnlineGamePage)
|
||||
ball.updatePos(content);
|
||||
else if (content.action == 6 && pageRenderer.actualPage == MultiOnlineGamePage)
|
||||
{
|
||||
if (content.is_opponent)
|
||||
player.pointOpponentAnimation(map, opponent.object);
|
||||
else
|
||||
player.pointAnimation(map);
|
||||
}
|
||||
}
|
||||
|
||||
export { typeGame };
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/31 22:17:24 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/20 00:50:56 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/20 13:04:33 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
Reference in New Issue
Block a user