Exemplo n.º 1
0
			public virtual bool Parse (SSvChatMessage chat_msg, string[] texts, out ChatTagData[] tag_data)
			{
				tag_data = null;
				
				if (IsElemCountOk (texts)) {
					
					if(msgs == null) msgs = GetMessages();
					
					tag_data = new ChatTagData[msgs.Length];
					
					int txt_index = 1;
					for(int i=0; i<tag_data.Length; i++)
					{
						tag_data[i] = new ChatTagData();
						
						string msg = msgs[i];
					
						if(ContainsFormtaTag(msg)) {
							GetParseTag(txt_index)(chat_msg, texts[txt_index], ref tag_data[i]);
							txt_index++;
						} else {
							tag_data[i].message = msg;
							
						}
					}
					return true;
				}
				return false;
			}
Exemplo n.º 2
0
			protected static void ParseUserTag(SSvChatMessage chat_msg, string text, ref ChatTagData tag_data)
			{
				tag_data.tag_type = ChatTagType.User;
				tag_data.id = chat_msg.user_id;
				tag_data.message = "USER_" + chat_msg.user_id;
			}
Exemplo n.º 3
0
	static public ChatTagData[] Parse(SSvChatMessage chat_msg)
	{
		return parser.Parse (chat_msg);
	}
Exemplo n.º 4
0
		public ChatTagData[] Parse(SSvChatMessage chat_msg)
		{
			ChatTagData[] tag_data = null;

			foreach (Match match in regex.Matches(chat_msg.msg)) 
			{
				string tag_text = match.Groups["tag"].Value;

				if(string.IsNullOrEmpty(tag_text)) continue;

				string[] split = tag_text.Split(':');

				if(split.Length < 1) continue;

				string tag = split[0];

				if(!tag_parsers.ContainsKey(tag)) continue;

				if(tag_parsers[tag].Parse(chat_msg, split, out tag_data)) {
					return tag_data;
				}
			}
			return tag_data;
		}
Exemplo n.º 5
0
			static void ParseQuestTag(SSvChatMessage chat_msg, string text, ref ChatTagData tag_data)
			{
				tag_data.tag_type = ChatTagType.Quest;
				tag_data.id = int.Parse (text);
				tag_data.message = text;
			}
Exemplo n.º 6
0
	static public void Process(SSvChatMessage chat_message)
	{
	}