public static void TssSdkSetUserInfoEx(EENTRYID entryId, string uin, string appId, uint worldId, string roleId ) { if (roleId == null) { roleId = "0"; } SerializeUnity.setUserInfoEx(entryId, uin, appId, worldId, roleId); }
public static void setUserInfoEx(EENTRYID entryId, string uin, string appId, uint worldId, string roleId) { byte[] valOpenId = System.Text.Encoding.ASCII.GetBytes(uin); byte[] valAppId = System.Text.Encoding.ASCII.GetBytes(appId); byte[] valRoleId = System.Text.Encoding.ASCII.GetBytes(roleId); uint length = 0; OutputUnityBuffer data = new OutputUnityBuffer(6 * 1 + 6 * 4 + 1 + 4 + 4 + (uint)valOpenId.Length + 1 + (uint)valAppId.Length + 1 + (uint)valRoleId.Length + 1); data.write((byte)ESERAILIZETAG.TAG_TYPE); putLength(data, 1); data.write((byte)ESERIALIZETYPE.TYPE_SETUSERINFO); data.write((byte)ESERAILIZETAG.TAG_ENTRY_ID); putLength(data, 4); putInteger(data, (uint)entryId); data.write((byte)ESERAILIZETAG.TAG_OPENID); length = (uint)valOpenId.Length + 1; //if (GLog.IsLogInfoEnabled) GLog.LogInfo("openid length:" + length); putLength(data, length); putByteArray(data, valOpenId); data.write((byte)ESERAILIZETAG.TAG_APPID); length = (uint)valAppId.Length + 1; //if (GLog.IsLogInfoEnabled) GLog.LogInfo("appid length:" + length); putLength(data, length); putByteArray(data, valAppId); data.write((byte)ESERAILIZETAG.TAG_WORLD_ID); putLength(data, 4); putInteger(data, worldId); data.write((byte)ESERAILIZETAG.TAG_ROLEID); length = (uint)valRoleId.Length + 1; //if (GLog.IsLogInfoEnabled) GLog.LogInfo("roleid length:" + length); putLength(data, length); putByteArray(data, valRoleId); //if (GLog.IsLogInfoEnabled) GLog.LogInfo("data length:" + data.getLength()); tss_unity_str(data.toByteArray(), data.getLength()); }
public static void TssSdkSetUserInfoEx(EENTRYID entryId, string uin, string appId, uint worldId, string roleId ) { UserInfoEx info = new UserInfoEx (); info.size = Marshal.SizeOf (info); info.entrance_id = (uint)entryId; info.uin_type = (uint)EUINTYPE.UIN_TYPE_STR; byte[] chars = new byte[64]; byte[] uinArray = String2Bytes (uin); int i; for (i = 0; i < uinArray.Length && i < 64; i++) { chars[i] = uinArray[i]; } for (; i < 64; i++) { chars[i] = 0; } info.uin_00 = chars [0]; info.uin_01 = chars [1]; info.uin_02 = chars [2]; info.uin_03 = chars [3]; info.uin_04 = chars [4]; info.uin_05 = chars [5]; info.uin_06 = chars [6]; info.uin_07 = chars [7]; info.uin_08 = chars [8]; info.uin_09 = chars [9]; info.uin_10 = chars [10]; info.uin_11 = chars [11]; info.uin_12 = chars [12]; info.uin_13 = chars [13]; info.uin_14 = chars [14]; info.uin_15 = chars [15]; info.uin_16 = chars [16]; info.uin_17 = chars [17]; info.uin_18 = chars [18]; info.uin_19 = chars [19]; info.uin_20 = chars [20]; info.uin_21 = chars [21]; info.uin_22 = chars [22]; info.uin_23 = chars [23]; info.uin_24 = chars [24]; info.uin_25 = chars [25]; info.uin_26 = chars [26]; info.uin_27 = chars [27]; info.uin_28 = chars [28]; info.uin_29 = chars [29]; info.uin_30 = chars [30]; info.uin_31 = chars [31]; info.uin_32 = chars [32]; info.uin_33 = chars [33]; info.uin_34 = chars [34]; info.uin_35 = chars [35]; info.uin_36 = chars [36]; info.uin_37 = chars [37]; info.uin_38 = chars [38]; info.uin_39 = chars [39]; info.uin_40 = chars [40]; info.uin_41 = chars [41]; info.uin_42 = chars [42]; info.uin_43 = chars [43]; info.uin_44 = chars [44]; info.uin_45 = chars [45]; info.uin_46 = chars [46]; info.uin_47 = chars [47]; info.uin_48 = chars [48]; info.uin_49 = chars [49]; info.uin_50 = chars [50]; info.uin_51 = chars [51]; info.uin_52 = chars [52]; info.uin_53 = chars [53]; info.uin_54 = chars [54]; info.uin_55 = chars [55]; info.uin_56 = chars [56]; info.uin_57 = chars [57]; info.uin_58 = chars [58]; info.uin_59 = chars [59]; info.uin_60 = chars [60]; info.uin_61 = chars [61]; info.uin_62 = chars [62]; info.uin_63 = chars [63]; //info.uin = uin; info.appid_type = (uint)EAPPIDTYPE.APP_ID_TYPE_STR; //info.appid = appId; byte[] appIdArray = String2Bytes (appId); for (i = 0; i < appIdArray.Length && i < 64; i++) { chars[i] = appIdArray[i]; } for (; i < 64; i++) { chars[i] = 0; } //byte[] uinArray = Encoding.ASCII.GetBytes (uin); info.appid_00 = chars [0]; info.appid_01 = chars [1]; info.appid_02 = chars [2]; info.appid_03 = chars [3]; info.appid_04 = chars [4]; info.appid_05 = chars [5]; info.appid_06 = chars [6]; info.appid_07 = chars [7]; info.appid_08 = chars [8]; info.appid_09 = chars [9]; info.appid_10 = chars [10]; info.appid_11 = chars [11]; info.appid_12 = chars [12]; info.appid_13 = chars [13]; info.appid_14 = chars [14]; info.appid_15 = chars [15]; info.appid_16 = chars [16]; info.appid_17 = chars [17]; info.appid_18 = chars [18]; info.appid_19 = chars [19]; info.appid_20 = chars [20]; info.appid_21 = chars [21]; info.appid_22 = chars [22]; info.appid_23 = chars [23]; info.appid_24 = chars [24]; info.appid_25 = chars [25]; info.appid_26 = chars [26]; info.appid_27 = chars [27]; info.appid_28 = chars [28]; info.appid_29 = chars [29]; info.appid_30 = chars [30]; info.appid_31 = chars [31]; info.appid_32 = chars [32]; info.appid_33 = chars [33]; info.appid_34 = chars [34]; info.appid_35 = chars [35]; info.appid_36 = chars [36]; info.appid_37 = chars [37]; info.appid_38 = chars [38]; info.appid_39 = chars [39]; info.appid_40 = chars [40]; info.appid_41 = chars [41]; info.appid_42 = chars [42]; info.appid_43 = chars [43]; info.appid_44 = chars [44]; info.appid_45 = chars [45]; info.appid_46 = chars [46]; info.appid_47 = chars [47]; info.appid_48 = chars [48]; info.appid_49 = chars [49]; info.appid_50 = chars [50]; info.appid_51 = chars [51]; info.appid_52 = chars [52]; info.appid_53 = chars [53]; info.appid_54 = chars [54]; info.appid_55 = chars [55]; info.appid_56 = chars [56]; info.appid_57 = chars [57]; info.appid_58 = chars [58]; info.appid_59 = chars [59]; info.appid_60 = chars [60]; info.appid_61 = chars [61]; info.appid_62 = chars [62]; info.appid_63 = chars [63]; info.world_id = worldId; //info.role_id = roleId; byte[] roleIdArray = String2Bytes(roleId); for (i = 0; i < roleIdArray.Length; i++) { chars[i] = roleIdArray[i]; } for (; i < 64; i++) { chars[i] = 0; } //byte[] uinArray = Encoding.ASCII.GetBytes (uin); info.role_id_00 = chars [0]; info.role_id_01 = chars [1]; info.role_id_02 = chars [2]; info.role_id_03 = chars [3]; info.role_id_04 = chars [4]; info.role_id_05 = chars [5]; info.role_id_06 = chars [6]; info.role_id_07 = chars [7]; info.role_id_08 = chars [8]; info.role_id_09 = chars [9]; info.role_id_10 = chars [10]; info.role_id_11 = chars [11]; info.role_id_12 = chars [12]; info.role_id_13 = chars [13]; info.role_id_14 = chars [14]; info.role_id_15 = chars [15]; info.role_id_16 = chars [16]; info.role_id_17 = chars [17]; info.role_id_18 = chars [18]; info.role_id_19 = chars [19]; info.role_id_20 = chars [20]; info.role_id_21 = chars [21]; info.role_id_22 = chars [22]; info.role_id_23 = chars [23]; info.role_id_24 = chars [24]; info.role_id_25 = chars [25]; info.role_id_26 = chars [26]; info.role_id_27 = chars [27]; info.role_id_28 = chars [28]; info.role_id_29 = chars [29]; info.role_id_30 = chars [30]; info.role_id_31 = chars [31]; info.role_id_32 = chars [32]; info.role_id_33 = chars [33]; info.role_id_34 = chars [34]; info.role_id_35 = chars [35]; info.role_id_36 = chars [36]; info.role_id_37 = chars [37]; info.role_id_38 = chars [38]; info.role_id_39 = chars [39]; info.role_id_40 = chars [40]; info.role_id_41 = chars [41]; info.role_id_42 = chars [42]; info.role_id_43 = chars [43]; info.role_id_44 = chars [44]; info.role_id_45 = chars [45]; info.role_id_46 = chars [46]; info.role_id_47 = chars [47]; info.role_id_48 = chars [48]; info.role_id_49 = chars [49]; info.role_id_50 = chars [50]; info.role_id_51 = chars [51]; info.role_id_52 = chars [52]; info.role_id_53 = chars [53]; info.role_id_54 = chars [54]; info.role_id_55 = chars [55]; info.role_id_56 = chars [56]; info.role_id_57 = chars [57]; info.role_id_58 = chars [58]; info.role_id_59 = chars [59]; info.role_id_60 = chars [60]; info.role_id_61 = chars [61]; info.role_id_62 = chars [62]; info.role_id_63 = chars [63]; //UnityEngine.Debug.Log (string.Format("UserInfoEx size:{0}", Marshal.SizeOf(info)), null); tss_sdk_setuserinfo_ex (info); }
public static void TssSdkSetUserInfo(EENTRYID entryId, string uin, string appId) { TssSdkSetUserInfoEx(entryId, uin, appId, 0, "0"); }
public static void TssSdkSetUserInfoEx(EENTRYID entryId, string uin, string appId, uint worldId, string roleId) { UserInfoEx ex; ex = new UserInfoEx { size = Marshal.SizeOf(ex), entrance_id = (uint)entryId, uin_type = 2 }; byte[] buffer = new byte[0x40]; byte[] buffer2 = String2Bytes(uin); int index = 0; while ((index < buffer2.Length) && (index < 0x40)) { buffer[index] = buffer2[index]; index++; } while (index < 0x40) { buffer[index] = 0; index++; } ex.uin_00 = buffer[0]; ex.uin_01 = buffer[1]; ex.uin_02 = buffer[2]; ex.uin_03 = buffer[3]; ex.uin_04 = buffer[4]; ex.uin_05 = buffer[5]; ex.uin_06 = buffer[6]; ex.uin_07 = buffer[7]; ex.uin_08 = buffer[8]; ex.uin_09 = buffer[9]; ex.uin_10 = buffer[10]; ex.uin_11 = buffer[11]; ex.uin_12 = buffer[12]; ex.uin_13 = buffer[13]; ex.uin_14 = buffer[14]; ex.uin_15 = buffer[15]; ex.uin_16 = buffer[0x10]; ex.uin_17 = buffer[0x11]; ex.uin_18 = buffer[0x12]; ex.uin_19 = buffer[0x13]; ex.uin_20 = buffer[20]; ex.uin_21 = buffer[0x15]; ex.uin_22 = buffer[0x16]; ex.uin_23 = buffer[0x17]; ex.uin_24 = buffer[0x18]; ex.uin_25 = buffer[0x19]; ex.uin_26 = buffer[0x1a]; ex.uin_27 = buffer[0x1b]; ex.uin_28 = buffer[0x1c]; ex.uin_29 = buffer[0x1d]; ex.uin_30 = buffer[30]; ex.uin_31 = buffer[0x1f]; ex.uin_32 = buffer[0x20]; ex.uin_33 = buffer[0x21]; ex.uin_34 = buffer[0x22]; ex.uin_35 = buffer[0x23]; ex.uin_36 = buffer[0x24]; ex.uin_37 = buffer[0x25]; ex.uin_38 = buffer[0x26]; ex.uin_39 = buffer[0x27]; ex.uin_40 = buffer[40]; ex.uin_41 = buffer[0x29]; ex.uin_42 = buffer[0x2a]; ex.uin_43 = buffer[0x2b]; ex.uin_44 = buffer[0x2c]; ex.uin_45 = buffer[0x2d]; ex.uin_46 = buffer[0x2e]; ex.uin_47 = buffer[0x2f]; ex.uin_48 = buffer[0x30]; ex.uin_49 = buffer[0x31]; ex.uin_50 = buffer[50]; ex.uin_51 = buffer[0x33]; ex.uin_52 = buffer[0x34]; ex.uin_53 = buffer[0x35]; ex.uin_54 = buffer[0x36]; ex.uin_55 = buffer[0x37]; ex.uin_56 = buffer[0x38]; ex.uin_57 = buffer[0x39]; ex.uin_58 = buffer[0x3a]; ex.uin_59 = buffer[0x3b]; ex.uin_60 = buffer[60]; ex.uin_61 = buffer[0x3d]; ex.uin_62 = buffer[0x3e]; ex.uin_63 = buffer[0x3f]; ex.appid_type = 2; byte[] buffer3 = String2Bytes(appId); index = 0; while ((index < buffer3.Length) && (index < 0x40)) { buffer[index] = buffer3[index]; index++; } while (index < 0x40) { buffer[index] = 0; index++; } ex.appid_00 = buffer[0]; ex.appid_01 = buffer[1]; ex.appid_02 = buffer[2]; ex.appid_03 = buffer[3]; ex.appid_04 = buffer[4]; ex.appid_05 = buffer[5]; ex.appid_06 = buffer[6]; ex.appid_07 = buffer[7]; ex.appid_08 = buffer[8]; ex.appid_09 = buffer[9]; ex.appid_10 = buffer[10]; ex.appid_11 = buffer[11]; ex.appid_12 = buffer[12]; ex.appid_13 = buffer[13]; ex.appid_14 = buffer[14]; ex.appid_15 = buffer[15]; ex.appid_16 = buffer[0x10]; ex.appid_17 = buffer[0x11]; ex.appid_18 = buffer[0x12]; ex.appid_19 = buffer[0x13]; ex.appid_20 = buffer[20]; ex.appid_21 = buffer[0x15]; ex.appid_22 = buffer[0x16]; ex.appid_23 = buffer[0x17]; ex.appid_24 = buffer[0x18]; ex.appid_25 = buffer[0x19]; ex.appid_26 = buffer[0x1a]; ex.appid_27 = buffer[0x1b]; ex.appid_28 = buffer[0x1c]; ex.appid_29 = buffer[0x1d]; ex.appid_30 = buffer[30]; ex.appid_31 = buffer[0x1f]; ex.appid_32 = buffer[0x20]; ex.appid_33 = buffer[0x21]; ex.appid_34 = buffer[0x22]; ex.appid_35 = buffer[0x23]; ex.appid_36 = buffer[0x24]; ex.appid_37 = buffer[0x25]; ex.appid_38 = buffer[0x26]; ex.appid_39 = buffer[0x27]; ex.appid_40 = buffer[40]; ex.appid_41 = buffer[0x29]; ex.appid_42 = buffer[0x2a]; ex.appid_43 = buffer[0x2b]; ex.appid_44 = buffer[0x2c]; ex.appid_45 = buffer[0x2d]; ex.appid_46 = buffer[0x2e]; ex.appid_47 = buffer[0x2f]; ex.appid_48 = buffer[0x30]; ex.appid_49 = buffer[0x31]; ex.appid_50 = buffer[50]; ex.appid_51 = buffer[0x33]; ex.appid_52 = buffer[0x34]; ex.appid_53 = buffer[0x35]; ex.appid_54 = buffer[0x36]; ex.appid_55 = buffer[0x37]; ex.appid_56 = buffer[0x38]; ex.appid_57 = buffer[0x39]; ex.appid_58 = buffer[0x3a]; ex.appid_59 = buffer[0x3b]; ex.appid_60 = buffer[60]; ex.appid_61 = buffer[0x3d]; ex.appid_62 = buffer[0x3e]; ex.appid_63 = buffer[0x3f]; ex.world_id = worldId; byte[] buffer4 = String2Bytes(roleId); index = 0; while (index < buffer4.Length) { buffer[index] = buffer4[index]; index++; } while (index < 0x40) { buffer[index] = 0; index++; } ex.role_id_00 = buffer[0]; ex.role_id_01 = buffer[1]; ex.role_id_02 = buffer[2]; ex.role_id_03 = buffer[3]; ex.role_id_04 = buffer[4]; ex.role_id_05 = buffer[5]; ex.role_id_06 = buffer[6]; ex.role_id_07 = buffer[7]; ex.role_id_08 = buffer[8]; ex.role_id_09 = buffer[9]; ex.role_id_10 = buffer[10]; ex.role_id_11 = buffer[11]; ex.role_id_12 = buffer[12]; ex.role_id_13 = buffer[13]; ex.role_id_14 = buffer[14]; ex.role_id_15 = buffer[15]; ex.role_id_16 = buffer[0x10]; ex.role_id_17 = buffer[0x11]; ex.role_id_18 = buffer[0x12]; ex.role_id_19 = buffer[0x13]; ex.role_id_20 = buffer[20]; ex.role_id_21 = buffer[0x15]; ex.role_id_22 = buffer[0x16]; ex.role_id_23 = buffer[0x17]; ex.role_id_24 = buffer[0x18]; ex.role_id_25 = buffer[0x19]; ex.role_id_26 = buffer[0x1a]; ex.role_id_27 = buffer[0x1b]; ex.role_id_28 = buffer[0x1c]; ex.role_id_29 = buffer[0x1d]; ex.role_id_30 = buffer[30]; ex.role_id_31 = buffer[0x1f]; ex.role_id_32 = buffer[0x20]; ex.role_id_33 = buffer[0x21]; ex.role_id_34 = buffer[0x22]; ex.role_id_35 = buffer[0x23]; ex.role_id_36 = buffer[0x24]; ex.role_id_37 = buffer[0x25]; ex.role_id_38 = buffer[0x26]; ex.role_id_39 = buffer[0x27]; ex.role_id_40 = buffer[40]; ex.role_id_41 = buffer[0x29]; ex.role_id_42 = buffer[0x2a]; ex.role_id_43 = buffer[0x2b]; ex.role_id_44 = buffer[0x2c]; ex.role_id_45 = buffer[0x2d]; ex.role_id_46 = buffer[0x2e]; ex.role_id_47 = buffer[0x2f]; ex.role_id_48 = buffer[0x30]; ex.role_id_49 = buffer[0x31]; ex.role_id_50 = buffer[50]; ex.role_id_51 = buffer[0x33]; ex.role_id_52 = buffer[0x34]; ex.role_id_53 = buffer[0x35]; ex.role_id_54 = buffer[0x36]; ex.role_id_55 = buffer[0x37]; ex.role_id_56 = buffer[0x38]; ex.role_id_57 = buffer[0x39]; ex.role_id_58 = buffer[0x3a]; ex.role_id_59 = buffer[0x3b]; ex.role_id_60 = buffer[60]; ex.role_id_61 = buffer[0x3d]; ex.role_id_62 = buffer[0x3e]; ex.role_id_63 = buffer[0x3f]; tss_sdk_setuserinfo_ex(ex); }
public static void TssSdkSetUserInfo(EENTRYID entryId, string uin, string appId) { TssSdkSetUserInfoEx(entryId, uin, appId, 0, "0"); }