예제 #1
0
파일: MsgrDb.cs 프로젝트: ClutchMAV/aura-2
		/// <summary>
		/// Reads note from reader, returns null on error.
		/// </summary>
		/// <param name="reader"></param>
		/// <returns></returns>
		private Note ReadNote(MySqlDataReader reader)
		{
			var note = new Note();

			note.Id = reader.GetInt64("noteId");
			note.Sender = reader.GetStringSafe("sender");
			note.Receiver = reader.GetStringSafe("receiver");
			note.Message = reader.GetStringSafe("message");
			note.Time = reader.GetDateTimeSafe("time");
			note.Read = reader.GetBoolean("read");

			var split = note.Sender.Split('@');
			if (split.Length != 2)
				return null;

			note.FromCharacterName = split[0];
			note.FromServer = split[1];

			return note;
		}