| | |
| | | } |
| | | |
| | | public C0101_tagCPlayerLogin Get0101SendPackage(H0101_tagServerPrepared _serverInfo) |
| | | { |
| | | var send = new C0101_tagCPlayerLogin(); |
| | | switch (VersionConfig.Get().versionAuthority) |
| | | { |
| | | var send = new C0101_tagCPlayerLogin(); |
| | | switch (VersionConfig.Get().versionAuthority) |
| | | { |
| | | case VersionAuthority.InterTest: |
| | | send.IDType = 1; |
| | | send.AccID = accountBuf; |
| | | if (sdkLoginResult == null) |
| | | send.Password = "111"; |
| | | else |
| | | send.Password = sdkLoginResult.token; |
| | | send.MAC = DeviceUtility.GetMac(); |
| | | send.Version = _serverInfo.Version; |
| | | send.LineNO = 255; |
| | | send.AppID = VersionConfig.Get().appId; |
| | | send.AccountID = 1000;// 内部登陆的时候的id |
| | | send.TokenExpire = "1519750743000";// 内部登陆的时长,无所谓的 |
| | | send.Phone = 0; |
| | | send.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag; |
| | | case VersionAuthority.InterTest: |
| | | send.IDType = 1; |
| | | send.AccID = accountBuf; |
| | | if (sdkLoginResult == null) |
| | | send.Password = "111"; |
| | | else |
| | | send.Password = sdkLoginResult.token; |
| | | send.MAC = DeviceUtility.GetMac(); |
| | | send.Version = _serverInfo.Version; |
| | | send.LineNO = 255; |
| | | send.AppID = VersionConfig.Get().appId; |
| | | send.AccountID = 1000;// 内部登陆的时候的id |
| | | send.TokenExpire = "1519750743000";// 内部登陆的时长,无所谓的 |
| | | send.Phone = 0; |
| | | send.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag; |
| | | send.Adult = 1; |
| | | send.ExtraLen = 0; |
| | | send.Extra = ""; |
| | | break; |
| | | case VersionAuthority.Release:
|
| | | {
|
| | | var deviceInfo = DeviceUtility.GetDeviceModel();
|
| | | deviceInfo.Replace(" ", "").Replace("=", "").Replace("%", "").Replace("-", "").Replace("|", "");
|
| | | var versionStr = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex, "_", deviceInfo);
|
| | |
|
| | | send.Extra = StringUtility.Contact(VersionConfig.Get().SpID, "|", |
| | | SDKUtils.Instance.Device.uniqueID, "|", |
| | | sdkLoginResult.token, "|", |
| | | sdkLoginResult.qkUserName, "|", |
| | | versionStr.Substring(0, Math.Min(24, versionStr.Length)));
|
| | |
|
| | |
|
| | | Debug.Log("=====> extra: " + send.Extra);
|
| | | send.ExtraLen = (ushort)send.Extra.Length;
|
| | |
|
| | | send.IDType = (byte)SDKUtils.Instance.ChannelPlatform; |
| | | send.Password = sdkLoginResult.token; |
| | | send.AccID = sdkLoginResult.account; |
| | | send.MAC = DeviceUtility.GetMac(); |
| | | send.Version = _serverInfo.Version; |
| | | send.LineNO = 255; |
| | | send.AppID = VersionConfig.Get().appId; |
| | | send.AccountID = (uint)sdkLoginResult.accountID; |
| | | send.TokenExpire = sdkLoginResult.tokenExpire; |
| | | send.Phone = (byte)sdkLoginResult.phone; |
| | | send.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag; |
| | | if (sdkIDCheckIDAuthentication.type == "1") |
| | | { |
| | | send.Adult = 1; |
| | | send.ExtraLen = 0; |
| | | send.Extra = ""; |
| | | break; |
| | | case VersionAuthority.Release: |
| | | send.Extra = VersionConfig.Get().SpID + "|" + SDKUtils.Instance.Device.uniqueID; |
| | | send.ExtraLen = (ushort)send.Extra.Length; |
| | | if (SDKUtils.Instance.ChannelPlatform == SDKUtils.E_ChannelPlatform.Free) |
| | | { |
| | | send.IDType = 1; |
| | | send.Password = sdkLoginResult.token; |
| | | } |
| | | else if (SDKUtils.Instance.ChannelPlatform == SDKUtils.E_ChannelPlatform.Quick) |
| | | { |
| | | send.IDType = 10; |
| | | send.Extra += ("|" + sdkLoginResult.token + "|" + sdkLoginResult.qkUserName); |
| | | send.ExtraLen = (ushort)send.Extra.Length; |
| | | } |
| | | else if (SDKUtils.Instance.ChannelPlatform == SDKUtils.E_ChannelPlatform.Hy || |
| | | SDKUtils.Instance.ChannelPlatform == SDKUtils.E_ChannelPlatform.hygt || |
| | | SDKUtils.Instance.ChannelPlatform == SDKUtils.E_ChannelPlatform.newyn || |
| | | SDKUtils.Instance.ChannelPlatform == SDKUtils.E_ChannelPlatform.en |
| | | ) |
| | | { |
| | | send.IDType = (byte)SDKUtils.Instance.ChannelPlatform; |
| | | send.Extra += ("|" + sdkLoginResult.token + "|" + sdkLoginResult.qkUserName); |
| | | send.ExtraLen = (ushort)send.Extra.Length; |
| | | } |
| | | |
| | | send.AccID = sdkLoginResult.account; |
| | | |
| | | var deviceInfo = DeviceUtility.GetDeviceModel(); |
| | | deviceInfo.Replace(" ", "").Replace("=", "").Replace("%", "").Replace("-", "").Replace("|",""); |
| | | var versionStr = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex, "_", deviceInfo); |
| | | |
| | | send.Extra += ("|" + versionStr.Substring(0, Math.Min(24, versionStr.Length))); |
| | | Debug.Log("=====> extra: " + send.Extra); |
| | | send.ExtraLen = (ushort)send.Extra.Length; |
| | | send.MAC = DeviceUtility.GetMac(); |
| | | send.Version = _serverInfo.Version; |
| | | send.LineNO = 255; |
| | | send.AppID = VersionConfig.Get().appId; |
| | | send.AccountID = (uint)sdkLoginResult.accountID; |
| | | send.TokenExpire = sdkLoginResult.tokenExpire; |
| | | if (SDKUtils.Instance.ChannelPlatform == SDKUtils.E_ChannelPlatform.Sp) |
| | | { |
| | | send.TokenExpire = SDKUtils.Instance.FreePlatformInfo.timeStamp; |
| | | } |
| | | send.Phone = (byte)sdkLoginResult.phone; |
| | | send.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag; |
| | | if (sdkIDCheckIDAuthentication.type == "1") |
| | | { |
| | | send.Adult = 1; |
| | | } |
| | | else if (sdkIDCheckIDAuthentication.type == "2") |
| | | { |
| | | send.Adult = MathUtility.CheckAdult(sdkIDCheckIDAuthentication.card_id) ? (byte)1 : (byte)0; |
| | | } |
| | | else |
| | | { |
| | | send.Adult = 0; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | return send; |
| | | } |
| | | else if (sdkIDCheckIDAuthentication.type == "2") |
| | | { |
| | | send.Adult = MathUtility.CheckAdult(sdkIDCheckIDAuthentication.card_id) ? (byte)1 : (byte)0; |
| | | } |
| | | else |
| | | { |
| | | send.Adult = 0; |
| | | } |
| | | break;
|
| | | }
|
| | | } |
| | | |
| | | return send; |
| | | } |
| | | |
| | | public string GetVersionStr() |
| | | {
|
| | | return StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex, "_", InitialFunctionConfig.Get("version").Numerical1);
|
| | | } |
| | | } |