/** * Processes notification update **/ public void RecvNotificationUpdate(BinaryReader s) { string type = ""; string username = ""; int length = (int)s.ReadUInt16(); /* subtract bytes stored for total length */ length -= 2; while (length > 0) { UInt16 typeLength = s.ReadUInt16(); if (typeLength > 0) { type = new string(s.ReadChars(typeLength)); } /* subtract bytes stored for length and string */ length -= (type.Length + 2); UInt16 usernameLength = s.ReadUInt16(); if (usernameLength > 0) { username = new string(s.ReadChars(usernameLength)); } /* subtract bytes stored for length and string */ length -= (username.Length + 2); } listener.OnSessionNotificationUpdate(type, username); }