playMaker

Author Topic: Photon Get Ping  (Read 5585 times)

MABManZ

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 126
    • MABManZ.com
Photon Get Ping
« on: October 02, 2015, 01:03:43 PM »
Here is a simple action that will ping your Photon server and output as int or a string

Code: [Select]
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Photon")]
[Tooltip("Recieves Player Ping and Stores in a String")]
[HelpUrl("https://hutonggames.fogbugz.com/default.asp?W1136")]
public class PhotonGetPing : FsmStateAction
{
[RequiredField]
[Tooltip("")]
public FsmInt ping;
public FsmString pingString;

public override void Reset()
{
ping = null;

}

public override void OnEnter()
{
DoGetPing();
Finish();
}

void DoGetPing()
{

ping.Value = PhotonNetwork.GetPing ();
pingString.Value = ping.Value.ToString();

}

}
}

zorranco

  • Playmaker Newbie
  • *
  • Posts: 49
Re: Photon Get Ping
« Reply #1 on: November 02, 2015, 08:38:17 AM »
Very usefull, thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15498
  • Official Playmaker Support
Re: Photon Get Ping
« Reply #2 on: November 23, 2015, 07:52:36 AM »
Hi,

 it's now part of the package on the wiki and Ecosystem.

Thanks for your contribution!


 Bye,

 Jean