Stencyl 3.4.0 is now out. Get it now!

Multiplayer Extensions Resource List

mdotedot

  • *
  • Posts: 1296
Well then we need to inspect your code very, very closely.

Because if you added the isConnect=false; in the Logout function like this:
Code: [Select]
public static function Logout(Player_ID:Float, func:Dynamic){
                // Logout = Kick player out of room
               isConnect=false;

Then this part should never be done:
Code: [Select]
  public static function hearts(){
                SecondCounter++;
                if(SecondCounter % HeartBeat == 0 && isConnect){




Maybe you can use print(trace) blocks to find out why the isConnect is not set to false.
You might be re-initialize things and/or don't use the Logout block where you think you did...

Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

RulezTeam

  • *
  • Posts: 223
Hi mdotedot,

Also, I have tried to add the code line  to this part of turn.hx (as it's present on lobby.hx)

Code: [Select]
if(text_func=="logout"){
RoomName="";
HeartBeat=0;
TurnTime=0;
Seat=0;
PlayerID=0;
[i]isConnect=false;[/i]
callBack(items[0]);
}

but nothing is changed.

That's strange, because the lobby logout works as expected.

Edit: I have added the block that I use to logout. Is this correct ?

« Last Edit: November 28, 2017, 02:05:22 am by RulezTeam »

mdotedot

  • *
  • Posts: 1296
Hi RulezTeam,

As always I strongly recommend using the examples to indicate a problem since we both can test.

I set the [ set debug on ] on the board event (Free_Tic_Tac_Toe game)

When in-game the heartbeat is shown.
When using the back button to go to the login page the heartbeat messages don't appear until I click on the login button.

So my estimation is that you somewhere have the logic to keep getting the heartbeat. 
Again: use lots of debug trace calls to inspect the flow of your game to pin-point the problem.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

RulezTeam

  • *
  • Posts: 223
Hi mdotedot,

thank you for your support. I have tried to use the logout block in another scene and now it's working.

I have two question about this extension :

- Should I add the line code to the "if(text_func=="logout")" too ?
- Is this extension working with Stencyl 3.5 ?

Thanks again for everything

mdotedot

  • *
  • Posts: 1296
You can put the isConnect to the text_func == logout too.
Currently you need to alter some code to work on 3.5. I've not published a 3.5 version as things might change and I wait for the official 3.5 release. If you want to use the extension on 3.5 before launch you should inspect this Thread : http://community.stencyl.com/index.php?topic=54585.0

Change code     e.target.data    to   cast(e.target, URLLoader).data

If you do that on all the multiplayer extensions it should work on 3.5

Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • *
  • Posts: 1296
Hi RulezTeam,

Today I checked out the new PHP 7.2 and MariaDB (10.1) in relation to the multiplayer code.

The issue is that the code is written for PHP 5.4 which uses code that is obsolete in later versions:

"
mysql_connect
(PHP 4, PHP 5)

mysql_connect — Open a connection to a MySQL Server

Warning
This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:

mysqli_connect()
PDO::__construct()
"

It will take quite some work to rewrite the code. I´m not planning on doing this rewrite anytime soon.

So I advice you to stay on older PHP / MySQL when you want to use the Multiplayer Extensions.

Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.