Multiplayer Extensions Resource List

mdotedot

  • *
  • Posts: 1443
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: 286
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: 1443
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: 286
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: 1443
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: 1443
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.

RulezTeam

  • *
  • Posts: 286
Hi mdotedot,

I've changed some code so now I can working on php 5.6 and MariaDB 10.1. I'll test php 7.1 or more later, after change some code in your extension to work with Stencyl 3.5, because this year Goggle will force to build to target API 26 and Stencyl 3.4 cannot do it.

Thank you.

mdotedot

  • *
  • Posts: 1443
As long as you don't upgrade PHP you should still be able to use the multiplayer extensions.
Last  week I've been working on the extensions to make them 3.5 ready. You can find the 3.5 versions in the repository: M.E. Extension Repository

Currently the 3.5 Beta version doesn't let you build for larger than Android version 25.
I've build the 3.5 version of the TicTacToe game for android Nougat : TicTacToe
But I haven't got a 7.1 device to test it  :D



« Last Edit: February 01, 2018, 10:36:15 pm by mdotedot »
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.

ceosol

  • *
  • Posts: 2201
Rulez, there is an openfl flag you can use to target API 26 on 3.4. I'll look through my stuff and try to find it.

RulezTeam

  • *
  • Posts: 286
Hi mdotedot, hi ceosol,

thank you both.

for mdotedot
I'll look at your repository and I'll try to find your modification and I'll look at my mod of the extensions to be sure that I've well done.

for ceosol
I'll wait for your mod for Stencyl 3.4. I've wrote to Justin and open a thread (http://community.stencyl.com/index.php/topic,55579.0.html) and I hope that 3.5 will be ready soon to support the last ndk and sdk.

ceosol

  • *
  • Posts: 2201
for ceosol
I'll wait for your mod for Stencyl 3.4. I've wrote to Justin and open a thread (http://community.stencyl.com/index.php/topic,55579.0.html) and I hope that 3.5 will be ready soon to support the last ndk and sdk.


Go to Setting>Advanced>Openfl flags and copy/paste this:
<android minimum-sdk-version="9" target-sdk-version="26" />

You'll have to have SDK26 downloaded in your android manager.

RulezTeam

  • *
  • Posts: 286
Hi ceosol,
I don't know if what I've done is the same, but usually I modded the AndroidManifest.xml in Android / Template directory in Stencyl, and I've already try this method to write 26 as target version. I've compile it (but without sdk26) and the apk is working, tell me that target version is 26, but I know that this app isn't true api26.
So, do you think that your mod is the same as mine ?

ceosol

  • *
  • Posts: 2201
So, do you think that your mod is the same as mine ?

With the openfl flag, if you do not have SDK26 downloaded, it will give you an error message saying that you need it. So yes, I think the two methods are different.

RulezTeam

  • *
  • Posts: 286
Thank you ceosol.

Hi mdotedot,
I've compared your extension mod for working with Stencyl 3.5 and I've seen that you have modded more command than you have talked in other thread. For example I've found this :
               #if (openfl >= "4.0.0")
       script = new com.stencyl.behavior.Script();
      #else
                script = new com.stencyl.behavior.Script(Engine.engine);
      #end
So there are more things that must be converted to work with new openfl, not only the call to URL...

mdotedot

  • *
  • Posts: 1443
Actually that Script thing was already needed for 3.4. I believe the engine changed from 3.2, but I'm not sure.

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.