game: add: online
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { AExchangeable } from "../AExchangable.js";
|
||||
import { APlayer } from "./APlayer.js";
|
||||
import { Client } from "../Client.js"
|
||||
import { sleep } from "../../utils/sleep.js";
|
||||
|
||||
export class AGame extends AExchangeable
|
||||
{
|
||||
@ -96,10 +97,15 @@ export class AGame extends AExchangeable
|
||||
*/
|
||||
send(data)
|
||||
{
|
||||
if (this._socket === undefined || this._socket.readyState === WebSocket.OPEN)
|
||||
return;
|
||||
|
||||
console.log(this._socket)
|
||||
if (this._socket === undefined || this._socket.readyState !== WebSocket.OPEN)
|
||||
{
|
||||
console.log("bozo pas confirme")
|
||||
return ;
|
||||
}
|
||||
console.log("j'essaye de send")
|
||||
this._socket.send(data);
|
||||
console.log("j'ai passer le send")
|
||||
}
|
||||
|
||||
async join()
|
||||
|
Reference in New Issue
Block a user