/// <summary> /// Initializes a new instance of the <see cref="PVPSdk.AppUserInfo"/> class. /// </summary> internal AppUserInfo(PVPProtobuf.AppUserInfo u) { this.uid = u.uid; this.avatar = u.avatar; this.level = u.level; this.score = u.score; this.loseTimes = u.lose_times; this.winTimes = u.win_times; this.name = u.name; this.number = u.number; this.customDataNumber = u.custom_data_number; this.customData = new Dictionary<string, byte[]> (); foreach (PVPProtobuf.Pair item in u.custom_data) { this.customData [item.key] = item.value; } }
public RoomInfo(PVPProtobuf.RoomInfo room_info) { this.room_id = room_info.room_id; this.name = room_info.name; this.max_fighter_number = room_info.max_fighter_number; this.fighter_number = room_info.fighter_number; this.max_spectator_number = room_info.max_spectator_number; this.spectator_number = room_info.spectator_number; this.is_open = room_info.is_open; this.is_visible = room_info.is_visible; this.customData = new Dictionary<string, byte[]> (); this.customDataNumber = room_info.custom_data_number; foreach (PVPProtobuf.Pair item in room_info.custom_data) { this.customData [item.key] = item.value; } member_infos = new Dictionary<uint, MemberInfo> (); foreach (PVPProtobuf.RoomInfo.MemberInfo member in room_info.member_infos) { MemberInfo member_info = new MemberInfo (member); member_infos [member.uid] = member_info; } this.random_sequence = new List<uint> (); this.random_sequence.AddRange (room_info.random_sequence); }
public UpdateAppUserInfoResult(int errorCode, PVPProtobuf.Appuser_UpdateInfo_Response r) { this.level = r.level; this.score = r.score; this.winTimes = r.win_times; this.loseTimes = r.lose_times; this.number = r.number; this.customDataNumber = r.custom_data_number; this.updatedData = new Dictionary<string, byte[]> (); this.deletedData = new List<string> (); if (errorCode == ErrorCode.SUCCESS) { foreach (Pair item in r.updated_data) { this.updatedData [item.key] = item.value; } this.deletedData.AddRange (r.deleted_data); } else { foreach (Pair item in r.check_data) { this.updatedData [item.key] = item.value; } this.deletedData.AddRange (r.check_data_not_exist); } }
public MemberInfo(PVPProtobuf.RoomInfo.MemberInfo member) { this.uid = member.uid; this.customDataNumber = member.custom_data_number; custom_data = new Dictionary<string, byte[]>(); foreach (PVPProtobuf.Pair item in member.custom_data) { custom_data [item.key] = item.value; } }
public LocalAppUserInfo(PVPProtobuf.AppUserInfo u) : base(u) { }
internal void FillAppUserInfo(PVPProtobuf.AppUserInfo u) { this.uid = u.uid; this.avatar = u.avatar; this.level = u.level; this.score = u.score; this.loseTimes = u.lose_times; this.winTimes = u.win_times; this.name = u.name; this.number = u.number; this.customDataNumber = u.custom_data_number; this.customData.Clear (); foreach (PVPProtobuf.Pair item in u.custom_data) { this.customData [item.key] = item.value; } }
public LobbyInfo(PVPProtobuf.LobbyInfo lobby_info) { this.lobby_id = lobby_info.lobby_id; this.name = lobby_info.name; }
public RoomNewMessage(PVPProtobuf.Room_NewMessage_Broadcast meta) { this.from_uid = meta.from_uid; this.custom_command_id = meta.custom_command_id; this.message = meta.message; }