示例#1
0
        /// <summary>
        /// 发送好友查找请求。
        /// </summary>
        /// <param name="name">查找名称。</param>
        public void SendFindRequest(string name)
        {
            MsgData_cFindFriend data = new MsgData_cFindFriend();

            NetLogicGame.str2Bytes(name, data.RoleName);
            CoreEntry.netMgr.send((Int16)NetMsgDef.C_FRIEND_FIND, data);
        }
示例#2
0
        /// <summary>
        /// 请求创建角色
        /// </summary>
        /// <param name="roleName"></param>
        /// <param name="job"></param>
        /// <param name="icon"></param>
        /// <param name="channel"></param>
        /// <param name="exts"></param>
        public void SendReqCreateRole(string roleName, int job, int icon, string channel, string exts)
        {
            LogMgr.Log("SendReqCreateRole: roleName : " + roleName);
            MsgData_cCreateRole data = new MsgData_cCreateRole();

            NetLogicGame.str2Bytes(roleName, data.RoleName);
            NetLogicGame.str2Bytes(channel, data.Channel);
            NetLogicGame.str2Bytes(exts, data.Exts);
            data.Job           = job;
            data.Icon          = icon;
            data.AccountGUID   = AccountGuid;
            data.CurrentRoleID = 0;
            CoreEntry.netMgr.send(NetMsgDef.C_CREATEROLE, data);
        }
示例#3
0
        /// <summary>
        /// 请求进入游戏
        /// </summary>
        /// <param name="accountID"></param>
        /// <param name="ip"></param>
        /// <param name="mac"></param>
        /// <param name="openKey"></param>
        /// <param name="channel"></param>
        /// <param name="exts"></param>
        /// <param name="serverID"></param>
        /// <param name="loginType"></param>
        /// <param name="activityID"></param>
        /// <param name="pid"></param>
        public void SendReqEnterGame(string accountID, string ip, string mac, string openKey, string channel, string exts, int serverID, int loginType, int activityID, int pid, long rid)
        {
            LogMgr.Log("SendReqEnterGame: accountID : " + accountID);

            MsgData_cEnterGame data = new MsgData_cEnterGame();

            NetLogicGame.str2Bytes(accountID, data.Account);
            NetLogicGame.str2Bytes(ip, data.IP);
            NetLogicGame.str2Bytes(mac, data.MAC);
            NetLogicGame.str2Bytes(openKey, data.OpenKey);
            NetLogicGame.str2Bytes(channel, data.Channel);
            NetLogicGame.str2Bytes(exts, data.Exts);

            //xy channel
            if (ClientSetting.Instance.GetBoolValue("useThirdPartyLogin"))
            {
                int sdkType = ClientSetting.Instance.GetIntValue("thirdPartyComponent");
                if (sdkType == 1)
                {
                    NetLogicGame.str2Bytes(XYSDK.Instance.getMasterID(), data.Channel);
                    Debug.Log("getMasterID:XYSDK" + XYSDK.Instance.getMasterID());
                }
                else if (sdkType == 2)
                {
                    NetLogicGame.str2Bytes(DYBSDK.Instance.getMasterID(), data.Channel);
                    Debug.Log("getMasterID:DYBSDK" + DYBSDK.Instance.getMasterID());
                }
                else if (sdkType == 3)
                {
                    NetLogicGame.str2Bytes(SQWSDK.Instance.getMasterID(), data.Channel);
                    Debug.Log("getMasterID:SQWSDK" + SQWSDK.Instance.getMasterID());
                }
            }

#if UNITY_ANDROID
            data.LoginType = 1;
#elif UNITY_IOS
            data.LoginType = 2;
#endif
            data.ServerID     = serverID;
            data.ActivityID   = activityID;
            data.PID          = pid;
            data.SelectedRole = rid;
            data.AccountGUID  = AccountGuid;
            CoreEntry.netMgr.send(NetMsgDef.C_ENTERGAME, data);
        }