Exemplo n.º 1
0
 public void StartGSDK(int zoneid, string tag, string roomiP)
 {
     this.cacheZoneID = zoneid;
     this.cacheTag    = tag;
     this.cacheRoomIP = roomiP;
     GSDK.Start(zoneid, tag, roomiP);
 }
Exemplo n.º 2
0
    public void InitGSDK()
    {
        if (this.m_bInit)
        {
            GSDKsys.PrintLog("already init");
            GSDK.SetZoneId(MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID);
            return;
        }
        this.m_GsdkSpeedFlag = -1000;
        GSDK.Init(ApolloConfig.appID, false, MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID);
        this.m_bInit     = true;
        this.m_bUseSpeed = 1;
        Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Settings_OnCheckMna, new CUIEventManager.OnUIEventHandler(this.OnCheckMna));

        Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Settings_OnCheckMnaTimeOut, new CUIEventManager.OnUIEventHandler(this.OnCheckMnaTimeOut));

        this.SetUserName();
        GSDK.SetObserver(delegate(StartSpeedRet ret)
        {
            this.m_GsdkSpeedFlag = ret.flag;
        });
        GSDK.SetKartinObserver(delegate(KartinRet result)
        {
            GSDKsys.PrintLog("StartKartin result  " + Time.realtimeSinceStartup);
            GSDKsys.PrintLog(result.ToString());
            this.m_lastQuery    = result;
            this.m_LastQueryStr = result.ToString();
            this.m_bStartKartin = false;
            this.m_bDealyUpdate = true;
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();
        });
        GSDKsys.PrintLog(" init succ");
    }
Exemplo n.º 3
0
 private void OnApplicationPause(bool pause)
 {
     if (this.m_bInit)
     {
         if (!pause)
         {
             GSDK.GoFront();
         }
         else
         {
             GSDK.GoBack();
         }
     }
     if (NetworkAccelerator.Inited)
     {
         if (!pause)
         {
             NetworkAccelerator.GoFront();
         }
         else
         {
             NetworkAccelerator.GoBack();
         }
     }
 }
Exemplo n.º 4
0
 public void EndSpeed()
 {
     if (this.Enable)
     {
         GSDK.EndSpeed(this.m_LastIP, this.m_LastPort);
     }
 }
Exemplo n.º 5
0
 public SpeedInfo GetSpeedInfo(string vip, int vport)
 {
     if (this.m_bInit)
     {
         return(GSDK.GetSpeedInfo(vip, vport));
     }
     return(new SpeedInfo());
 }
Exemplo n.º 6
0
 public void StartKartin(string tag)
 {
     if (this.m_bInit)
     {
         GSDKsys.PrintLog("StartKartin " + Time.realtimeSinceStartup);
         GSDK.QueryKartin(tag);
     }
 }
Exemplo n.º 7
0
 public void EndSpeed()
 {
     if (this.m_bInit && this.m_bUseSpeed == 0)
     {
         GSDK.EndSpeed(this.m_LastIP, this.m_LastPort);
         GSDKsys.PrintLog("end speed");
     }
 }
Exemplo n.º 8
0
 public void StartSpeed(string vip, int vport)
 {
     if (this.Enable)
     {
         this.m_LastIP   = vip;
         this.m_LastPort = vport;
         GSDK.StartSpeed(vip, vport, 1, "libapollo.so", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID, 0);
     }
 }
Exemplo n.º 9
0
 public void StartSpeed(string vip, int vport)
 {
     if (this.m_bInit && this.m_bUseSpeed == 0)
     {
         this.m_GsdkSpeedFlag = -1000;
         this.m_LastIP        = vip;
         this.m_LastPort      = vport;
         GSDK.StartSpeed(vip, vport, 1, "libapollo.so", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID, this.m_bUseSpeed);
         GSDKsys.PrintLog("start speed");
     }
 }
Exemplo n.º 10
0
    public void SetUserName()
    {
        if (this.m_bInit)
        {
            ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false);

            if (accountInfo != null)
            {
                GSDK.SetUserName((int)ApolloConfig.platform, accountInfo.OpenId);
            }
        }
    }
Exemplo n.º 11
0
    public void SetUserName()
    {
        if (this.Enable)
        {
            ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false);

            if (accountInfo != null)
            {
                GSDK.SetUserName(ApolloConfig.platform, accountInfo.get_OpenId());
            }
        }
    }
Exemplo n.º 12
0
 private void OnApplicationPause(bool pause)
 {
     if (this.Enable)
     {
         if (!pause)
         {
             GSDK.GoFront();
         }
         else
         {
             GSDK.GoBack();
         }
     }
 }
Exemplo n.º 13
0
    public void SetGSDKUserName(int plat, string openid)
    {
        int plat2;

        if (plat == 3)
        {
            plat2 = 2;
        }
        else if (plat == 4)
        {
            plat2 = 1;
        }
        else
        {
            plat2 = 5;
        }
        GSDK.SetUserName(plat2, openid);
    }
Exemplo n.º 14
0
 public void InitSys()
 {
     if (this.m_bEnable)
     {
         return;
     }
     this.m_bEnable = false;
     if (!NetworkAccelerator.EnableForGSDK)
     {
         this.m_bEnable = true;
     }
     Debug.Log("HJJ init");
     if (this.m_bEnable)
     {
         GSDK.Init(ApolloConfig.appID, false);
         this.SetUserName();
     }
 }
Exemplo n.º 15
0
 public void InitGSDK(string mAppID)
 {
     GSDK.Init(mAppID, false, 1);
 }
Exemplo n.º 16
0
 public void EndGSDK()
 {
     this.cacheTag = string.Empty;
     GSDK.End();
 }
Exemplo n.º 17
0
 public void SetGSDKEvent(int tag, bool status, string msg)
 {
     GSDK.SetEvent(tag, status, msg);
 }