示例#1
0
 public void onGPLoginFailure(uint iErrorCode, byte[] szDescription)
 {
     if (iErrorCode == 3 || iErrorCode == 1)  //账号未注册
     {
         Loom.QueueOnMainThread(() => { LogIn.ShowNickNameForRegisterWin(true); });
         //RegisterAccount();
     }
     else if (iErrorCode == 7)   //注册冲突问题,需要重新修改
     {
         string strDescribe = GlobalUserInfo.GBToUtf8(szDescription);
         GameSceneUIHandler.ShowLog(strDescribe);
     }
     else
     {
         Debug.Log(Encoding.Default.GetString(szDescription));
         //TimeManager::Instance().addCerterTimeCB(TIME_CALLBACK(HNScenceManager::InHomeScence, HNScenceManager::pInstance()), 3.0f);
         Loom.QueueOnMainThread(() =>
         {
             SceneManager.LoadScene("GameLand");
         });
     }
     Loom.QueueOnMainThread(() =>
     {
         if (PlayerPrefs.HasKey("ChoosedModelIndex"))
         {
             PlayerPrefs.DeleteKey("ChoosedModelIndex");
             PlayerPrefs.Save();
         }
     });
 }
        private bool onSubQueryInfoResult(byte[] data, int size)
        {
            if (size != Marshal.SizeOf(typeof(CMD_GP_CheckInInfo)))
            ///if (size != sizeof(CMD_GP_CheckInInfo))
            {
                ///ASSERT(false);
                return(false);
            }

            CMD_GP_CheckInInfo pNetInfo = (CMD_GP_CheckInInfo)StructConverterByteArray.BytesToStruct(data, typeof(CMD_GP_CheckInInfo));
            ///CMD_GP_CheckInInfo* pNetInfo = (CMD_GP_CheckInInfo*)data;

            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            pGlobalUserData.wSeriesDate   = pNetInfo.wSeriesDate;
            pGlobalUserData.bTodayChecked = (pNetInfo.bTodayChecked != 0);
            //pGlobalUserData.wSeriesDate++;//hack

            if (mIGPSignInMissionSink != null)
            {
                mIGPSignInMissionSink.onSignInQueryInfoResult(pNetInfo);
            }

            stop();


            return(true);
        }
        //提示消息(对话框方式??)0:确认 1:确认,取消
        public int InsertPromptString(byte[] pszString, int iButtonType)
        {
            string strLog = GlobalUserInfo.GBToUtf8(pszString);

            GameSceneUIHandler.ShowLog(strLog);
            return(1);
        }
        //////////////////////////////////////////////////////////////////////////
        // ISocketEngineSink

        public override void onEventTCPSocketLink()
        {
            //变量定义


            switch (mMissionType)
            {
            case Type.MISSION_SEND_CHAT_DATA:
            {
                CMD_GP_CHAT kNetInfo = new CMD_GP_CHAT();
                kNetInfo.Init();

                GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
                tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();
                kNetInfo.dwUserID = pGlobalUserData.dwUserID;

                Buffer.BlockCopy(pGlobalUserData.szNickName, 0, kNetInfo.szNickName, 0, pGlobalUserData.szNickName.Length);

                var szChatData = Encoding.UTF8.GetBytes(m_chatText);
                Buffer.BlockCopy(szChatData, 0, kNetInfo.szChatData, 0, szChatData.Length);

                Buffer.BlockCopy(pGlobalUserData.szHeadHttp, 0, kNetInfo.szHeadHttp, 0, pGlobalUserData.szHeadHttp.Length);

                var buf = StructConverterByteArray.StructToBytes(kNetInfo);
                send(MsgDefine.MDM_GP_USER_SERVICE, MsgDefine.SUB_GP_LOBBY_CHAT, buf, buf.Length);

                break;
            }

            default:
                stop();
                break;
            }
        }
        void OnFreeScence(byte[] data, int dataSize)
        {
            var typeValue     = typeof(CMD_S_StatusFree);
            int localDataSize = Marshal.SizeOf(typeValue);

            if (dataSize != localDataSize)
            {
                Debug.LogError("OnFreeScence:localDataSize=" + localDataSize + ", serverDataSize=" + dataSize);
                return;
            }

            CMD_S_StatusFree pNetInfo = (CMD_S_StatusFree)StructConverterByteArray.BytesToStruct(data, typeValue);

            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            pGlobalUserData.cbMapIndexRand = pNetInfo.cbMapIndex;
            pGlobalUserData.wRandseed      = pNetInfo.wRandseed;
            pGlobalUserData.wRandseedForRandomGameObject = pNetInfo.wRandseedForRandomGameObject;
            pGlobalUserData.wRandseedForInventory        = pNetInfo.wRandseedForInventory;
            //道具同步
            Array.Copy(pNetInfo.sInventoryList, pGlobalUserData.sInventoryList, pNetInfo.sInventoryList.Length);
            //Buffer.BlockCopy(pNetInfo.sInventoryList, 0, pGlobalUserData.sInventoryList, 0, pNetInfo.sInventoryList.Length);

            Loom.QueueOnMainThread(() =>
            {
                hnManager.LoadHideSeekSceneOfWangHu();
            });
        }
示例#6
0
        void modeHeadHttp()
        {
            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            m_kIndividualMission.modifyHeadHttp(pGlobalUserData.szHeadHttp);
        }
示例#7
0
    // Use this for initialization
    void Start()
    {
        //签到查询
        GameNet.UserInfo.getInstance().QuerySignIn();

        RegisterRaffleWindow = GameObject.Find("RegisterRaffleWindow");
        SignInDayUI          = new GameObject[maxSignInDay];

        if (RegisterRaffleWindow == null)
        {
            return;
        }

        SignInButton = RegisterRaffleWindow.transform.Find("RegisterButton").gameObject;
        //RaffleButton = RegisterRaffleWindow.transform.Find("RaffleButton").gameObject;
        //RaffleImageObj = RegisterRaffleWindow.transform.Find("RaffleImage").gameObject;

        GameNet.GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
        GameNet.tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();
        PlayCount   = pGlobalUserData.dwPlayCount;
        SeriesDate  = pGlobalUserData.wSeriesDate;
        RaffleCount = pGlobalUserData.dwRaffleCount;
        //System.Random rand = new System.Random();
        //SeriesDate = rand.Next(0,10);
        //SeriesDate = SeriesDate % 5;

        for (int i = 0; i < maxSignInDay; i++)
        {
            SignInDayUI[i] = RegisterRaffleWindow.transform.Find("RegisterImage" + i + "/RegisteredImage").gameObject;
            if (SignInDayUI[i] == null)
            {
                continue;
            }

            if (i < SeriesDate)
            {
                SignInDayUI[i].SetActive(true);
            }
            else
            {
                SignInDayUI[i].SetActive(false);
            }
        }

        // Raffle
        uint minPlayCountToRaffle = RaffleCount * PlayCountPerRaffle;

        if (minPlayCountToRaffle == 0)
        {
            minPlayCountToRaffle = PlayCountPerRaffle;
        }
        if (PlayCount < minPlayCountToRaffle)
        {
            if (RaffleButton != null)
            {
                RaffleButton.GetComponent <Button>().interactable = false;
            }
        }
    }
示例#8
0
        //静态函数

        //获取对象
        public static GlobalUserInfo GetInstance()
        {
            if (m_pGlobalUserInfo == null)
            {
                m_pGlobalUserInfo = new GlobalUserInfo();
            }
            return(m_pGlobalUserInfo);
        }
        //普通消息(窗口输出)
        public bool InsertNormalString(byte[] pszString)
        {
            //NoticeMsg::Instance().ShowTopMsg(utility::a_u8(pszString));
            string strLog = GlobalUserInfo.GBToUtf8(pszString);

            Debug.Log(strLog);
            GameSceneUIHandler.ShowLog(strLog);

            return(true);
        }
        //系统消息(窗口输出)
        public bool InsertSystemStringScript(byte[] pszString)
        {
            string strLog = GlobalUserInfo.GBToUtf8(pszString);

            Debug.Log(strLog);

            GameSceneUIHandler.ShowLog(strLog);

            return(true);
        }
示例#11
0
    private void Start()
    {
        publicNotice = GetComponent <Text>();
        if (publicNotice != null)
        {
            GameNet.GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
            GameNet.tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            string szPublicNotice = GameNet.GlobalUserInfo.GBToUtf8(pGlobalUserData.szPublicNotice);
            publicNotice.text = szPublicNotice;
        }
    }
        public void SendInventoryConsumption(byte ItemID, ushort wAwardGlod = 10, byte cbCostType = 0)
        {
            Debug.LogWarning("------------SendInventoryConsumption");
            CMD_C_InventoryConsumptionInfo kNetInfo = new CMD_C_InventoryConsumptionInfo();

            kNetInfo.dwUserID   = GlobalUserInfo.getUserID();
            kNetInfo.cbItemID   = ItemID;
            kNetInfo.wAmount    = wAwardGlod;
            kNetInfo.cbCostType = cbCostType;
            //发送数据
            var buf = StructConverterByteArray.StructToBytes(kNetInfo);

            SendSocketData(HNMJ_Defines.SUB_C_CONSUMPTION_INVENTORY, buf, (ushort)buf.Length);
        }
示例#13
0
        //////////////////////////////////////////////////////////////////////////
        ///
        /// // 登陆
        public bool sendLoginVisitor(CMD_GP_VisitorLogon VisitorAccount)
        {
            GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            Buffer.BlockCopy(mVisitorAccount.szPassWord, 0, pGlobalUserData.szPassword, 0,
                             mVisitorAccount.szPassWord.Length);

            //发送数据
            var buf = StructConverterByteArray.StructToBytes(mVisitorAccount);

            send(MsgDefine.MDM_GP_LOGON, MsgDefine.SUB_GP_LOGON_VISITOR, buf, buf.Length);
            return(true);
        }
示例#14
0
//登录完成
        bool onSocketSubLogonFinish(byte[] data, int size)
        {
            stop();

            if (mIGPLoginMissionSink != null)
            {
                mIGPLoginMissionSink.onGPLoginComplete();
            }

            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            pGlobalUserInfo.LoginSucess();
            return(true);
        }
示例#15
0
        //发送登陆信息
        public bool sendLoginAccount(CMD_GP_LogonAccounts LoginAccount)
        {
            GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            Buffer.BlockCopy(LoginAccount.szPassword, 0, pGlobalUserData.szPassword, 0, LoginAccount.szPassword.Length);

            // for Match Time
            Debug.Log("登錄設置kindid");
            LoginAccount.wKindID = GameScene.KIND_ID_JianDe;

            //发送数据
            //var buf = StructConverterByteArray.StructToBytes<CMD_GP_LogonAccounts>(LoginAccount);
            var buf = StructConverterByteArray.StructToBytes(LoginAccount);

            send(MsgDefine.MDM_GP_LOGON, MsgDefine.SUB_GP_LOGON_ACCOUNTS, buf, buf.Length);
            return(true);
        }
示例#16
0
        //发送注册信息
        public bool sendRegisterPacket(CMD_GP_RegisterAccounts RegisterAccount)
        {
            GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            Buffer.BlockCopy(RegisterAccount.szLogonPass, 0, pGlobalUserData.szPassword, 0,
                             RegisterAccount.szLogonPass.Length);

            // for Match Time
            Debug.Log("發送註冊信息");
            RegisterAccount.wKindID = GameScene.KIND_ID_JianDe;

            //发送数据
            var buf = StructConverterByteArray.StructToBytes(RegisterAccount);

            send(MsgDefine.MDM_GP_LOGON, MsgDefine.SUB_GP_REGISTER_ACCOUNTS, buf, buf.Length);
            return(true);
        }
        public void SendAwardData(uint dwAwardGlod = 10, byte cbCostType = 0)
        {
            Debug.LogWarning("------------SendAwardData");
            //变量定义
            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            CMD_C_AwardDone kNetInfo = new CMD_C_AwardDone();

            kNetInfo.Init();
            kNetInfo.dwUserID    = pGlobalUserData.dwUserID;
            kNetInfo.dwAwardGold = dwAwardGlod;
            kNetInfo.cbCostType  = cbCostType;
            Buffer.BlockCopy(pGlobalUserData.szPassword, 0, kNetInfo.szPassword, 0, pGlobalUserData.szPassword.Length);
            var buf = StructConverterByteArray.StructToBytes(kNetInfo);

            SendSocketData(HNMJ_Defines.SUB_C_AWARD_DONE, buf, (ushort)buf.Length);
        }
示例#18
0
    public void OnButtonDelSpreader()
    {
        GameNet.GlobalUserInfo   pGlobalUserInfo      = GameNet.GlobalUserInfo.GetInstance();
        GameNet.tagSpreadersInfo pGlobalSpreadersInfo = pGlobalUserInfo.GetSpreadersInfo();

        if (m_infoIdxToRemove >= 0 && m_infoIdxToRemove < pGlobalSpreadersInfo.wItemCount)
        {
            GameNet.SpreaderInfoItem infoItem = pGlobalSpreadersInfo.SpreaderInfoItems[m_infoIdxToRemove];

            string strRealName = GameNet.GlobalUserInfo.GBToUtf8(infoItem.RealName);
            //int len = strRealName.Length;
            //var szSpreaderRealName = Encoding.UTF8.GetBytes(strRealName);

            ///string strIDCardNo = GameNet.GlobalUserInfo.GBToUtf8(infoItem.IDCardNo);
            string strTelNum        = GameNet.GlobalUserInfo.GBToUtf8(infoItem.TelNum);
            string strWeiXinAccount = GameNet.GlobalUserInfo.GBToUtf8(infoItem.WeiXinAccount);
            GameNet.UserInfo.getInstance().addDelSpreader(infoItem.SpreaderId, strRealName, strTelNum, strWeiXinAccount, infoItem.ParentID, infoItem.SpreaderLevel, false);
        }
    }
示例#19
0
    private void CheckShowOrHideInput()
    {
        GameNet.GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
        GameNet.tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();
        if (pGlobalUserData.dwSpreaderID != 0)
        {
            //已经绑定代理人

            if (input != null)
            {
                input.transform.parent.gameObject.SetActive(false);
            }

            if (BindButton != null)
            {
                BindButton.SetActive(false);
            }

            if (BindedInviteNum != null)
            {
                BindedInviteNum.text = Surrogate.IdToInviteCode(pGlobalUserData.dwSpreaderID);
                BindedInviteNum.transform.parent.gameObject.SetActive(true);
            }
        }
        else
        {
            if (input != null)
            {
                input.transform.parent.gameObject.SetActive(true);
            }

            if (BindButton != null)
            {
                BindButton.SetActive(true);
            }

            if (BindedInviteNum != null)
            {
                BindedInviteNum.transform.parent.gameObject.SetActive(false);
            }
        }
    }
        //系统消息(窗口输出)
        public bool InsertSystemString(byte[] pszString)
        {
            string strLog = Encoding.Default.GetString(pszString);

            Debug.Log(strLog);
            String[] str = strLog.Split(new string[] { "[", "]" }, StringSplitOptions.RemoveEmptyEntries);
            if (str.Length != 1)
            {
                int time = int.Parse(str[1]);
                if (time == 200)  //Play-200s
                {
                    Debug.Log("Play SOUND_TIPS_START_SEEK");
                    Loom.QueueOnMainThread(() => { hnManager.PlaySoundEffect(-1, (int)AudioManager.Sound_Effect_Defines.SOUND_TIPS_START_SEEK); });
                }
                else if (time == 45 || time == 100) //Hide-45s,Play-100s,Play-45s
                {
                    Debug.Log("Play SOUND_TIPS_STARTOREND");
                    Loom.QueueOnMainThread(() => { hnManager.PlaySoundEffect(-1, (int)AudioManager.Sound_Effect_Defines.SOUND_TIPS_STARTOREND); });
                    if (time == 45)
                    {
                        IClientUserItem pMeItem   = CServerItem.get().GetMeUserItem();
                        byte            Gamestate = CServerItem.get().GetGameStatus();
                        if (Gamestate == SocketDefines.GAME_STATUS_PLAY)
                        {
                            if (UIManager.GetInstance() != null)
                            {
                                UIManager.GetInstance().ShowMiddleTips("警察进入无敌状态");
                            }
                        }
                    }
                }
                else if (time == 5 || time == 4 || time == 3 || time == 2 || time == 1)
                {
                    Debug.Log("Play SOUND_TIME_SEC");
                    Loom.QueueOnMainThread(() => { hnManager.PlaySoundEffect(-1, (int)AudioManager.Sound_Effect_Defines.SOUND_TIME_SEC); });
                }
            }
            strLog = GlobalUserInfo.GBToUtf8(pszString);
            GameSceneUIHandler.ShowLog(strLog);

            return(true);
        }
示例#21
0
        /*----------------IGPLoginMissionSink------------------------*/

        public void onGPLoginSuccess()
        {
            UnityEngine.Debug.Log("--IGPLoginMissionSink----------onGPLoginSuccess call---------");
            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            Loom.QueueOnMainThread(() =>
            {
                if (PlayerPrefs.HasKey("LocalHumanInfo"))  //登陆成功清除之前断线位置信息
                {
                    PlayerPrefs.DeleteKey("LocalHumanInfo");
                    PlayerPrefs.Save();
                }

                //PlayerPrefs.SetString("Accounts", Encoding.Default.GetString(pGlobalUserData.szAccounts));
                //PlayerPrefs.SetString("Accounts", Encoding.Default.GetString(pGlobalUserData.szPassword));
                LogIn.ShowNickNameForRegisterWin(false);
                Debug.Log("Go to Hall Scene1");
                SceneManager.LoadScene("GameHall");
            });
        }
示例#22
0
    // Use this for initialization
    void Start()
    {
        m_dwSpreaderID       = 0;
        m_dwParentSpreaderID = 0;
        m_wSpreaderLevel     = 1;
        m_infoIdxToRemove    = -1;

        m_szSpreaderRealName      = "";
        m_szSpreaderTelNum        = "";
        m_szSpreaderWeiXinAccount = "";

        m_infoItemObjList = new List <GameObject>();
        m_infoItemObjList.Clear();

        m_paymentInfoItemObjList = new List <GameObject>();
        m_paymentInfoItemObjList.Clear();
        m_dTotalGrantFromChildrenBuy = 0;

        if (LogText != null)
        {
            LogText.text = "";
            LogText.gameObject.SetActive(true);
        }

        GameNet.GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
        GameNet.tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();
        if (SelfInviteCodeText != null)
        {
            string strCode = IdToInviteCode(pGlobalUserData.dwUserID);
            uint   userId  = InviteCodeToId(strCode);
            SelfInviteCodeText.text = string.Format("您的邀请码是:{0}", strCode);
            SelfInviteCodeText.gameObject.SetActive(true);
        }

        //GameNet.tagSpreadersInfo pGlobalSpreadersInfo = pGlobalUserInfo.GetSpreadersInfo();
        //if(pGlobalSpreadersInfo.wItemCount==0)
        //{
        //    GameNet.UserInfo.getInstance().querySpreadersInfo(this);
        //}
    }
示例#23
0
        public UserInfo()
        {
            m_kUpPlayerInfoCB       = new List <UserCallInfo>();
            m_kLoginSucessCB        = new List <UserCallInfo>();
            m_kUserInGameServerInfo =
                new CGUserInGameServerInfo(System.Text.Encoding.Default.GetBytes(LoginScene.m_strServerIP), LoginScene.m_nLogonServerPort);
            m_kIndividualMission = new CGPIndividualMission(System.Text.Encoding.Default.GetBytes(LoginScene.m_strServerIP),
                                                            LoginScene.m_nLogonServerPort);
            GlobalUserInfo.GetInstance().setSink(this);
            m_kUserInGameServerInfo.setMissionSink(this);

            m_kSignInMission = new CGPSignInMission(System.Text.Encoding.Default.GetBytes(LoginScene.m_strServerIP), LoginScene.m_nLogonServerPort);
            m_kRaffleMission = new CGPRaffleMission(System.Text.Encoding.Default.GetBytes(LoginScene.m_strServerIP), LoginScene.m_nLogonServerPort);

            if (m_hnManager == null)
            {
                Loom.QueueOnMainThread(() =>
                {
                    m_hnManager = GameObject.FindObjectOfType <HNGameManager>();
                });
            }
        }
        public void OnSubAwardData(byte[] pBuffer, ushort wDataSize)
        {
            Debug.LogWarning("------------OnSubAwardData");
            var typeValue = typeof(CMD_S_AwardResult);

            if (wDataSize != Marshal.SizeOf(typeValue))
            {
                Debug.LogError("数据长度不符合");
                return;
            }
            CMD_S_AwardResult pNetInfo = (CMD_S_AwardResult)StructConverterByteArray.BytesToStruct(pBuffer, typeValue);
            string            strLog   = GlobalUserInfo.GBToUtf8(pNetInfo.szNotifyContent);

            Debug.Log("OnSubAwardData: " + strLog);
            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            if (pNetInfo.bSuccessed == 0)  //成功
            {
                //Success
                if (pNetInfo.cbCostType == 0)  //奖励金币
                {
                    GlobalUserInfo.setUserScore(pNetInfo.lScore);
                    GameSceneUIHandler.ShowLog("奖励10枚金币");
                }
                else  //奖励钻石
                {
                    GlobalUserInfo.setUserInsure(pNetInfo.lScore);
                    GameSceneUIHandler.ShowLog("奖励10颗钻石");
                }
                Loom.QueueOnMainThread(() =>
                {
                    if (UIManager.GetInstance() != null)
                    {
                        UIManager.GetInstance().UpdateUIInfo();   //更新钻石金币
                    }
                });
            }
        }
示例#25
0
        //////////////////////////////////////////////////////////////////////////
        // ISocketEngineSink

        public override void onEventTCPSocketLink()
        {
            //变量定义
            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            switch (mMissionType)
            {       // 查询
            case Type.MISSION_RAFFLE:
            {
                CMD_GP_RaffleDone kNetInfo = new CMD_GP_RaffleDone();
                kNetInfo.Init();

                kNetInfo.dwUserID     = pGlobalUserData.dwUserID;
                kNetInfo.dwRaffleGold = m_dwRaffleGold;

                Buffer.BlockCopy(pGlobalUserData.szPassword, 0, kNetInfo.szPassword, 0, pGlobalUserData.szPassword.Length);
                ///strncpy(kNetInfo.szPassword, pGlobalUserData->szPassword, countarray(kNetInfo.szPassword));

                var MachineID = DF.shared().GetMachineID();
                if (MachineID != null)
                {
                    Buffer.BlockCopy(MachineID, 0, kNetInfo.szMachineID, 0, MachineID.Length);
                }
                ///strncpy(kNetInfo.szMachineID, DF::shared()->GetMachineID(), countarray(kNetInfo.szMachineID));

                var buf = StructConverterByteArray.StructToBytes(kNetInfo);
                send(MsgDefine.MDM_GP_USER_SERVICE, MsgDefine.SUB_GP_RAFFLE_DONE, buf, buf.Length);
                ///send(MDM_GP_USER_SERVICE, SUB_GP_RAFFLE_DONE, &kNetInfo, sizeof(CMD_GP_CheckInDone));

                break;
            }

            default:
                stop();
                break;
            }
        }
示例#26
0
    public void OnButtonCashOut()
    {
        if (SurrogateMoneyWin == null)
        {
            return;
        }

        var transTotalMoney = SurrogateMoneyWin.transform.Find("TotalMoney");

        if (transTotalMoney != null)
        {
            Text textTotalMoney = transTotalMoney.GetComponent <Text>();
            if (textTotalMoney != null)
            {
                //string strTotalMoney = textTotalMoney.text;
                //string strPurTotalMoney = strTotalMoney.Replace("可提现金额:","");
                //double dTotalMoney = double.Parse(strPurTotalMoney);

                GameNet.GlobalUserInfo         pGlobalUserInfo            = GameNet.GlobalUserInfo.GetInstance();
                GameNet.tagChildrenPaymentInfo pGlobalChildrenPaymentInfo = pGlobalUserInfo.GetChildrenPaymentInfo();
                uint dwPayment = (uint)(pGlobalChildrenPaymentInfo.dTotalLeftCash * 100.0);//pGlobalChildrenPaymentInfo.dTotalLeftCash*100.0 单位:分
                if (dwPayment > 0)
                {
                    GameNet.UserInfo.getInstance().AddEnterprisePay(dwPayment);

                    if (CashOutButton != null)
                    {
                        CashOutButton.enabled = false;
                    }
                }
                else
                {
                    ShowLog("提现金额低于最小金额");
                }
            }
        }
    }
示例#27
0
        private bool onSubRaffleResult(byte[] data, int size)
        {
            CMD_GP_RaffleResult pNetInfo = (CMD_GP_RaffleResult)StructConverterByteArray.BytesToStruct(data, typeof(CMD_GP_RaffleResult));
            ///CMD_GP_RaffleResult* pNetInfo = (CMD_GP_RaffleResult*)data;

            string strLog = GlobalUserInfo.GBToUtf8(pNetInfo.szNotifyContent);

            //string strLog2 = Encoding.Default.GetString(pNetInfo.szNotifyContent);
            //string strLog3 = Encoding.GetEncoding(936).GetString(pNetInfo.szNotifyContent);
            //string strLog4 = Encoding.UTF8.GetString(pNetInfo.szNotifyContent);
            Debug.Log("CGPRaffleMission::onSubRaffleResult:" + strLog);
            GameSceneUIHandler.ShowLog(strLog);

            GlobalUserInfo    pGlobalUserInfo = GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            if (pNetInfo.bSuccessed != 0)
            {
                //Success

                pGlobalUserData.lUserInsure   = pNetInfo.lScore;
                pGlobalUserData.dwPlayCount   = pNetInfo.dwPlayCount;
                pGlobalUserData.dwRaffleCount = pNetInfo.dwRaffleCount;

                pGlobalUserInfo.upPlayerInfo();
            }

            stop();

            //if (mIGPSignInMissionSink != null)
            //{
            //    mIGPSignInMissionSink.onSignInDoneResult(pNetInfo);
            //}

            return(true);
        }
 //用户信息
 //用户进入
 public void OnGRUserEnter(IClientUserItem pIClientUserItem)
 {
     Debug.Log("GameManager::OnGRUserEnter: " + GlobalUserInfo.GBToUtf8(pIClientUserItem.GetNickName()));
 }
示例#29
0
    // Update is called once per frame
    void Update()
    {
        GameNet.GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
        GameNet.tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();
        if (SeriesDate != pGlobalUserData.wSeriesDate)
        {
            SeriesDate = pGlobalUserData.wSeriesDate;

            ///SignInDayUI[SeriesDate].SetActive(true);
            for (int i = 0; i < maxSignInDay; i++)
            {
                if (SignInDayUI[i] == null)
                {
                    continue;
                }

                if (i < SeriesDate)
                {
                    SignInDayUI[i].SetActive(true);
                }
                else
                {
                    SignInDayUI[i].SetActive(false);
                }
            }
        }
        //if(PlayCount != pGlobalUserData.dwPlayCount)
        //{
        //    PlayCount = pGlobalUserData.dwPlayCount;
        //}
        //if (RaffleCount != pGlobalUserData.dwRaffleCount)
        //{
        //    RaffleCount = pGlobalUserData.dwRaffleCount;
        //}

        //uint minPlayCountToRaffle = RaffleCount * PlayCountPerRaffle;
        //if (minPlayCountToRaffle == 0)
        //{
        //    minPlayCountToRaffle = PlayCountPerRaffle;
        //}
        //if (PlayCount >= minPlayCountToRaffle)
        //{
        //    RaffleButton.GetComponent<Button>().interactable = true;
        //}
        //else
        //{
        //    RaffleButton.GetComponent<Button>().interactable = false;
        //}

        if (m_brot)
        {
            m_timer -= Time.deltaTime;
            if (m_timer <= 0.0f)
            {
                m_timer = 0.01f;
                //every 0.1s
                float temv = m_initV - m_tcount * m_deltav;
                RaffleImageObj.transform.Rotate(new Vector3(0, 0, temv));

                m_tcount += 1;
            }
            if (m_tcount >= m_endcount)
            {
                m_brot = false;
            }
        }
    }
示例#30
0
//登录成功
        bool onSocketSubLogonSuccess(byte[] data, int size)
        {
            //登陆成功
            CMD_GP_LogonSuccess pData =
                (CMD_GP_LogonSuccess)StructConverterByteArray.BytesToStruct(data, typeof(CMD_GP_LogonSuccess));

            // for Match Time
            Loom.QueueOnMainThread(() =>
            {
                if (hnManager == null)
                {
                    hnManager = GameObject.FindObjectOfType <HNGameManager>();
                }
                hnManager.m_matchStartTime = pData.MatchStartTime;
                hnManager.m_matchEndTime   = pData.MatchEndTime;
            });

            //变量定义
            GlobalUserInfo    pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance();
            tagGlobalUserData pGlobalUserData = pGlobalUserInfo.GetGlobalUserData();

            pGlobalUserData.lUserScore  = pData.lUserScore;
            pGlobalUserData.lUserInsure = pData.lUserInsure;

            // for签到
            pGlobalUserData.wSeriesDate = pData.wSeriesDate;

            // 已打场次,for抽奖
            pGlobalUserData.dwPlayCount = pData.dwPlayCount;

            //WQ add,抽奖记录
            pGlobalUserData.dwRaffleCount        = pData.dwRaffleCount;
            pGlobalUserData.dwPlayCountPerRaffle = pData.dwPlayCountPerRaffle;

            // 代理
            pGlobalUserData.iSpreaderLevel = pData.iSpreaderLevel;  // -1:不是代理人

            // for HideSeek:查询警察模型库
            pGlobalUserData.lModelIndex0 = pData.lModelIndex0;

            pGlobalUserData.bGPIsForAppleReview = (pData.cbGPIsForAppleReview != 0);

            //WQ 头像Http
            string szHeadHttp = GlobalUserInfo.GBToUtf8(pData.szHeadHttp);

            Buffer.BlockCopy(pData.szHeadHttp, 0, pGlobalUserData.szHeadHttp, 0, pData.szHeadHttp.Length);

            //WQ add,公告信息
            string szPublicNotice = GlobalUserInfo.GBToUtf8(pData.szPublicNotice);

            Buffer.BlockCopy(pData.szPublicNotice, 0, pGlobalUserData.szPublicNotice, 0, pData.szPublicNotice.Length);

            //保存信息
            pGlobalUserData.wFaceID         = pData.wFaceID;
            pGlobalUserData.cbGender        = pData.cbGender;
            pGlobalUserData.dwUserID        = pData.dwUserID;
            pGlobalUserData.dwGameID        = pData.dwGameID;
            pGlobalUserData.dwSpreaderID    = pData.dwSpreaderID;
            pGlobalUserData.dwExperience    = pData.dwExperience;
            pGlobalUserData.cbInsureEnabled = pData.cbInsureEnabled;

            Debug.Log("onSocketSubLogonSuccess " + Encoding.Default.GetString(pData.szNickName));
            Buffer.BlockCopy(pData.szNickName, 0, pGlobalUserData.szNickName, 0, pData.szNickName.Length);
            // strcpy(pGlobalUserData.szNickName, utility::a_u8((char*)pData.szNickName).c_str());

            Buffer.BlockCopy(pData.szAccounts, 0, pGlobalUserData.szAccounts, 0, pData.szAccounts.Length);
            // strncpy(pGlobalUserData.szAccounts, ((char*)pData.szAccounts), countarray(pGlobalUserData.szAccounts));

            //金币信息
            pGlobalUserInfo.upPlayerInfo();

            if (mIGPLoginMissionSink != null)
            {
                mIGPLoginMissionSink.onGPLoginSuccess();
            }

            return(true);
        }