Jump to content
  • 0
Sign in to follow this  
Lynx

Treasure Hunt Digging Does Not Work

Question

I've been working on Treasure Hunt for RBSE and I've got to the point where I'm able to get the players onto the table and have the game started and it shows the arrow, but right after the first try to dig, it doesn't send any packet to the server even though according to the Actionscript I looked into the TreasureHunt.swf it is supposed to do that...I'm pretty sure that this has something to do with the client and I have a huge doubt it would be the source because everything is being handled properly as far as I know. Here are some screenshots:

 

59470b09b9f15_Screenshotfrom2017-06-19044524.thumb.png.6f7047d73e1a4fbe53c05c7a3a2f2765.png

 

59470ad3dd707_Screenshotfrom2017-06-19035708.thumb.png.4d064c6c18e9804e115ae8457f1de761.png

 

Obviously you may notice that the map in the emulator console is a bit different but that's because I took the screenshots at a different time and had the game restarted and I had the rooms changed as well because I thought that maybe causing it to bug out but apparently not...Here are my Treasure Hunt swfs if it helps: treasurehunt.zip

 

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 1
33 minutes ago, Lynx said:

and the 2nd player after that (this is where when gz gets sent again, jz doesnt get sent by the client so I send gz twice).

When the second player joins, try resending the jz packet to both players.

  • Like 3

Share this post


Link to post
Share on other sites
  • 0

Take a look at the AS code

if(this.movieClip.placer[buttonName].active == false || this.movieClip.placer[buttonName].active == undefined && this.currentTurn < com.clubpenguin.games.treasure.GameEngine.NUM_TURNS)
{
  if(com.clubpenguin.games.treasure.GameEngine.PLAYING_MULTIPLAYER_GAME)
  {
    if(this.netPlayerID == com.clubpenguin.games.treasure.GameEngine.PLAYER_1 && buttonDir == "right" || this.netPlayerID == com.clubpenguin.games.treasure.GameEngine.PLAYER_2 && buttonDir == "down")
    {
      this.netClient.sendDigMessage(buttonName,buttonDir,buttonNum);
    }
  }
  ...

This is where the onpress event handler calls sendDigMessage which should write the dig message to the socket.

I'm wondering whether maybe this condition isn't met?

this.netPlayerID == com.clubpenguin.games.treasure.GameEngine.PLAYER_1 && buttonDir == "right" || this.netPlayerID == com.clubpenguin.games.treasure.GameEngine.PLAYER_2 && buttonDir == "down"

Those constants are set as follows

static var PLAYER_1 = 0;
static var PLAYER_2 = 1;

And netPlayerID is updated to the seat ID:

//com.clubpenguin.games.treasure.net.TreasureHuntClient
function handleJoinGameMessage(resObj)
{
  this.debugTrace("handleJoinGameMessage");
  this.debugTrace("smartRoomID: " + resObj[0]);
  this.debugTrace("seatID: " + resObj[1]);
  var _loc3_ = parseInt(resObj[1]);
  this.gameEngine.updatePlayerSeatID(_loc3_);
}

//com.clubpenguin.games.treasure.GameEngine
function updatePlayerSeatID(seatID)
{
	this.netPlayerID = seatID;
}

So, when the arrows in the game are pointing right, player one must be taking their turn on seat ID 0, could you confirm this is the case? I can't see the JoinGame message response in your screenshots, it seems that perhaps that message should be sent every time a player takes their turn.

  • Like 2

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Ben said:

So, when the arrows in the game are pointing right, player one must be taking their turn on seat ID 0, could you confirm this is the case? I can't see the JoinGame message response in your screenshots, it seems that perhaps that message should be sent every time a player takes their turn.

That's what I'm trying to figure out as well, I do see those methods and how things are being handled but unfortunately the client seems to be hesitant.

Share this post


Link to post
Share on other sites
  • 0
20 minutes ago, Lynx said:

That's what I'm trying to figure out as well, I do see those methods and how things are being handled but unfortunately the client seems to be hesitant.

Are you able to provide screenshots of more traffic? You should be sending

 jz

somewhere.

  • Like 1

Share this post


Link to post
Share on other sites
  • 0
4 minutes ago, Ben said:

Are you able to provide screenshots of more traffic? You should be sending

 jz

somewhere.

First player joining:

5947cc054a612_Screenshotfrom2017-06-19183308.thumb.png.d980cbb2d377f0adc170feebe0e499f1.png

 

and the 2nd player after that (this is where when gz gets sent again, jz doesnt get sent by the client so I send gz twice).

5947cc43b4b7c_Screenshotfrom2017-06-19183443.thumb.png.c5db3d4add81a8461794e0976a7d0b4a.png

 

  • Like 1

Share this post


Link to post
Share on other sites
  • 0
10 hours ago, Ben said:

When the second player joins, try resending the jz packet to both players.

Damn you son of a bitch! That worked! Wow. Now the client is actually sending data back to the server 😀 Thank you.

  • Like 1

Share this post


Link to post
Share on other sites
Sign in to follow this  

×