diff --git a/Core/Game.cs b/Core/Game.cs index 415af01..5fe9889 100644 --- a/Core/Game.cs +++ b/Core/Game.cs @@ -195,6 +195,7 @@ private Globals m_oGlobals private bool m_bUpdatingRoom = false; private bool m_bUpdateRoomOnStreamEnd = false; private string m_sRoomTitle = string.Empty; + private string m_sRoomUid = string.Empty; // private Match m_oRegMatch; private Hashtable m_oIndicatorHash = new Hashtable(); private Hashtable m_oCompassHash = new Hashtable(); @@ -1400,21 +1401,40 @@ private string ProcessXMLNodeElement(XmlNode oXmlNode) { string argstrAttributeName4 = "subtitle"; m_sRoomTitle = GetAttributeData(oXmlNode, argstrAttributeName4); - if (m_sRoomTitle.StartsWith(" - ")) + m_sRoomUid = "0"; + + Regex m_RoomNameRegex = new Regex(@"\[(?[^\]]+)\](?: \((?\d+)\))?"); + System.Text.RegularExpressions.Match o_Match = m_RoomNameRegex.Match(m_sRoomTitle); + if (o_Match.Success) { - m_sRoomTitle = m_sRoomTitle.Substring(3); + m_sRoomTitle = o_Match.Groups["roomname"].Value; + m_sRoomUid = o_Match.Groups["roomuid"].Success ? o_Match.Groups["roomuid"].Value : "0"; } - - if (m_sRoomTitle.StartsWith("[")) + else { - m_sRoomTitle = m_sRoomTitle.Substring(1, m_sRoomTitle.Length - 2); + if (m_sRoomTitle.StartsWith(" - ")) + { + m_sRoomTitle = m_sRoomTitle.Substring(3); + } + + if (m_sRoomTitle.StartsWith("[")) + { + m_sRoomTitle = m_sRoomTitle.Substring(1, m_sRoomTitle.Length - 2); + } + + m_sRoomTitle = m_sRoomTitle.Trim(); } - m_sRoomTitle = m_sRoomTitle.Trim(); - string argkey = "roomname"; - m_oGlobals.VariableList.Add(argkey, m_sRoomTitle, Globals.Variables.VariableType.Reserved); + string argkey1 = "roomname"; + m_oGlobals.VariableList.Add(argkey1, m_sRoomTitle, Globals.Variables.VariableType.Reserved); string argsVariable1 = "$roomname"; VariableChanged(argsVariable1); + + string argkey2 = "uid"; + m_oGlobals.VariableList.Add(argkey2, m_sRoomUid, Globals.Variables.VariableType.Reserved); + string argsVariable2 = "$uid"; + VariableChanged(argsVariable2); + m_bUpdatingRoom = true; break; } @@ -3359,4 +3379,4 @@ private void GameSocket_EventConnectionLost() m_bManualDisconnect = false; } } -} \ No newline at end of file +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 4f83b2e..472bbf8 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // by using the '*' as shown below: // -[assembly: AssemblyVersion("4.0.2.9")] -[assembly: AssemblyFileVersion("4.0.2.9")] +[assembly: AssemblyVersion("4.0.2.10")] +[assembly: AssemblyFileVersion("4.0.2.10")]