Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetParticipant(){
- $.ajax({
- url: "/participants/GetParticipant",
- type: 'post',
- complete: function(data){
- var response = JSON.parse(data.responseText);
- IdPlayer1 = response.data.owner_id;
- IdPlayer2 = response.data.opponent_id;
- IdJoueurJouant = response.data.waiting_for_user_id;
- if(IdJoueurJouant != null){
- GetCurrentId();
- }
- if(response.data.game_data != null){
- var parsed =response.data.game_data;
- var temp = parsed.replace(/=>/g, ":");
- boardParts2 = JSON.parse(temp);
- if(boardParts2 != null){
- console.log(boardParts2);
- setBoardUpdated();
- }
- }else if(response.data.game_data == null){
- setBoard();
- }
- console.log(response);
- console.log(IdPlayer1);
- console.log(IdPlayer2);
- console.log(IdJoueurJouant);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement