/// <summary> /// Check to see if the client has baked textures that belong to banned clients /// </summary> /// <param name="client"></param> /// <param name="textureEntry"></param> public void CheckForBannedViewer(IClientAPI client, Primitive.TextureEntry textureEntry) { try { //Read the website once! if (m_map == null) { m_map = (OSDMap)OSDParser.Deserialize(Utilities.ReadExternalWebsite("http://auroraserver.ath.cx:8080/client_tags.xml")); } //This is the givaway texture! for (int i = 0; i < textureEntry.FaceTextures.Length; i++) { if (textureEntry.FaceTextures[i] != null) { if (m_map.ContainsKey(textureEntry.FaceTextures[i].TextureID.ToString())) { OSDMap viewerMap = (OSDMap)m_map[textureEntry.FaceTextures[i].TextureID.ToString()]; //Check the names if (BannedViewers.Contains(viewerMap["name"].ToString())) { client.Kick("You cannot use " + viewerMap["name"] + " in this sim."); IEntityTransferModule transferModule = client.Scene.RequestModuleInterface <IEntityTransferModule> (); if (transferModule != null) { transferModule.IncomingCloseAgent(((Scene)client.Scene), client.AgentId); } } else if (m_banEvilViewersByDefault && viewerMap.ContainsKey("evil") && (viewerMap["evil"].AsBoolean() == true)) { client.Kick("You cannot use " + viewerMap["name"] + " in this sim."); IEntityTransferModule transferModule = client.Scene.RequestModuleInterface <IEntityTransferModule> (); if (transferModule != null) { transferModule.IncomingCloseAgent(((Scene)client.Scene), client.AgentId); } } } } } } catch { } }
public bool IsViewerBanned(string name, bool isEvil) { if (m_useIncludeList) { if (!m_allowedViewers.Contains(name)) { return(true); } } else { if (BannedViewers.Contains(name)) { return(true); } else if (m_banEvilViewersByDefault && isEvil) { return(true); } } return(false); }