|
|
@ -565,6 +565,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
socket.on("node checked",(id, works, askedIndex, newPlayerIndex, socketId) => {
|
|
|
|
socket.on("node checked",(id, works, askedIndex, newPlayerIndex, socketId) => {
|
|
|
|
|
|
|
|
console.log("coucou")
|
|
|
|
cptBug=0
|
|
|
|
cptBug=0
|
|
|
|
//@ts-ignore
|
|
|
|
//@ts-ignore
|
|
|
|
const node = nodes.get().find((n) => id == n.id)
|
|
|
|
const node = nodes.get().find((n) => id == n.id)
|
|
|
@ -594,7 +595,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
if (!node.label.includes(colorToEmoji(positionToColor(askedIndex), works))){
|
|
|
|
if (!node.label.includes(colorToEmoji(positionToColor(askedIndex), works))){
|
|
|
|
networkData.nodes.update({id: id, label: node.label + positionToEmoji(askedIndex, works)})
|
|
|
|
networkData.nodes.update({id: id, label: node.label + positionToEmoji(askedIndex, works)})
|
|
|
|
cptHistory++
|
|
|
|
cptHistory++
|
|
|
|
if (cptHistory % 2 == 0){
|
|
|
|
if (cptHistory % 2 >= 0){
|
|
|
|
lastNodes.push(node)
|
|
|
|
lastNodes.push(node)
|
|
|
|
addToHistory(testPlayers[askedIndex].pseudo + " à mis un " + positionToEmoji(askedIndex, works) + " à " + personNetwork.getPersons()[id].getName())
|
|
|
|
addToHistory(testPlayers[askedIndex].pseudo + " à mis un " + positionToEmoji(askedIndex, works) + " à " + personNetwork.getPersons()[id].getName())
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -620,7 +621,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
|
|
|
|
|
|
|
|
socket.on("asked wrong", () =>{
|
|
|
|
socket.on("asked wrong", () =>{
|
|
|
|
cptSquare++
|
|
|
|
cptSquare++
|
|
|
|
if (cptSquare % 2 == 0){
|
|
|
|
if (cptSquare % 2 >= 0){
|
|
|
|
if (indice==null){
|
|
|
|
if (indice==null){
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -659,7 +660,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
socket.on("can't put square", (askingPlayer) => {
|
|
|
|
socket.on("can't put square", (askingPlayer) => {
|
|
|
|
cptBug=0
|
|
|
|
cptBug=0
|
|
|
|
cptOnAskedWrong ++
|
|
|
|
cptOnAskedWrong ++
|
|
|
|
if (cptOnAskedWrong % 2 == 0){
|
|
|
|
if (cptOnAskedWrong % 2 >= 0){
|
|
|
|
addToHistory(testPlayers[askingPlayer].pseudo + " ne peut plus poser de carré")
|
|
|
|
addToHistory(testPlayers[askingPlayer].pseudo + " ne peut plus poser de carré")
|
|
|
|
playerIndex = askingPlayer + 1
|
|
|
|
playerIndex = askingPlayer + 1
|
|
|
|
if(playerIndex == players.length){
|
|
|
|
if(playerIndex == players.length){
|
|
|
|