- add action on game request
This commit is contained in:
Kum1ta
2024-09-20 15:47:52 +02:00
parent cb5d00c1d2
commit c3942627a6
5 changed files with 20 additions and 7 deletions

View File

@ -9,6 +9,10 @@ class User(models.Model):
pfp = models.CharField(max_length=1024, default="/static/img/default_pfp.jpg") pfp = models.CharField(max_length=1024, default="/static/img/default_pfp.jpg")
banner = models.CharField(max_length=1024, default="/static/img/default_banner.jpg") banner = models.CharField(max_length=1024, default="/static/img/default_banner.jpg")
mail_verified = models.BooleanField(default=False) 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): class Message(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/22 17:08:46 by madegryc #+# #+# */ /* 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'); const buttons = document.getElementById('popMenuLoginButton').getElementsByTagName('p');
buttons[0].addEventListener('click', () => {
pageRenderer.changePage('profilPage', false, userMeInfo.id);
})
buttons[2].addEventListener('click', () => { buttons[2].addEventListener('click', () => {
window.location.replace('/logout'); window.location.replace('/logout');
}) });
} }
export { LobbyPage }; export { LobbyPage };

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/19 23:08:31 by edbernar #+# #+# */ /* 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) static create(userId)
{ {
const profilInfos = document.getElementsByClassName('profile-info')[0];
const username = document.getElementsByTagName('h2')[0]; const username = document.getElementsByTagName('h2')[0];
const pfp = document.getElementsByClassName('profile-image')[0]; const pfp = document.getElementsByClassName('profile-image')[0];
const banner = document.getElementsByClassName('background-card')[0]; const banner = document.getElementsByClassName('background-card')[0];

View File

@ -6,11 +6,11 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/15 12:00:01 by edbernar #+# #+# */ /* 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 { ball } from "/static/javascript/multiOnlineGame/multiOnlineGamePage.js"
import { WaitingGamePage } from "/static/javascript/waitingGame/main.js" import { WaitingGamePage } from "/static/javascript/waitingGame/main.js"
import { pageRenderer } from '/static/javascript/main.js' import { pageRenderer } from '/static/javascript/main.js'
@ -28,6 +28,13 @@ function typeGame(content)
MultiOnlineGamePage.opponentDisconnect(); MultiOnlineGamePage.opponentDisconnect();
else if (content.action == 5 && pageRenderer.actualPage == MultiOnlineGamePage) else if (content.action == 5 && pageRenderer.actualPage == MultiOnlineGamePage)
ball.updatePos(content); 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 }; export { typeGame };

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/31 22:17:24 by edbernar #+# #+# */ /* 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 */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */