public void Initialise(IConfigSource source) { if (Simian.IsSimianEnabled(source, "AvatarServices", this.Name)) { IConfig gridConfig = source.Configs["AvatarService"]; if (gridConfig == null) { m_log.Error("[SIMIAN AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini"); throw new Exception("Avatar connector init error"); } string serviceUrl = gridConfig.GetString("AvatarServerURI"); if (String.IsNullOrEmpty(serviceUrl)) { m_log.Error("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI in section AvatarService"); throw new Exception("Avatar connector init error"); } if (!serviceUrl.EndsWith("/")) { serviceUrl = serviceUrl + '/'; } m_serverUrl = serviceUrl; } }
public bool Start(Simian simian) { m_simian = simian; m_httpServer = simian.GetAppModule <IHttpServer>(); m_assetClient = simian.GetAppModule <IAssetClient>(); m_sceneFactory = simian.GetAppModule <ISceneFactory>(); if (m_sceneFactory != null) { m_sceneFactory.OnSceneStart += SceneStartHandler; m_sceneFactory.OnSceneStop += SceneStopHandler; } IConfigSource source = simian.Config; IConfig config = source.Configs["SimianGrid"]; if (config != null) { m_serverUrl = config.GetString("GridService", null); } if (String.IsNullOrEmpty(m_serverUrl)) { m_log.Error("[SimianGrid] config section is missing the GridService URL"); return(false); } return(true); }
public PeriscopeImageDelivery(Simian server, GridClient client) { this.server = server; this.client = client; Pipeline = new TexturePipeline(client, 12); Pipeline.OnDownloadFinished += new TexturePipeline.DownloadFinishedCallback(pipeline_OnDownloadFinished); server.UDP.RegisterPacketCallback(PacketType.RequestImage, RequestImageHandler); }
public void Start() { simian = new Simian(); simian.Start(); agent = CreateDummyAgent(); simian.Scenes[0].AgentAdd(this, agent, PrimFlags.None); observer = CreateDummyAgent(); simian.Scenes[0].AgentAdd(this, observer, PrimFlags.None); }
public PeriscopeTransferManager(Simian server, GridClient client) { this.server = server; this.client = client; client.Assets.OnAssetReceived += new OpenMetaverse.AssetManager.AssetReceivedCallback(Assets_OnAssetReceived); server.UDP.RegisterPacketCallback(PacketType.AssetUploadRequest, new PacketCallback(AssetUploadRequestHandler)); server.UDP.RegisterPacketCallback(PacketType.SendXferPacket, new PacketCallback(SendXferPacketHandler)); server.UDP.RegisterPacketCallback(PacketType.AbortXfer, new PacketCallback(AbortXferHandler)); server.UDP.RegisterPacketCallback(PacketType.TransferRequest, new PacketCallback(TransferRequestHandler)); }
public PeriscopeMovement(Simian server, Periscope periscope) { this.server = server; this.periscope = periscope; server.UDP.RegisterPacketCallback(PacketType.AgentUpdate, AgentUpdateHandler); server.UDP.RegisterPacketCallback(PacketType.SetAlwaysRun, SetAlwaysRunHandler); updateTimer = new Timer(new TimerCallback(UpdateTimer_Elapsed)); LastTick = Environment.TickCount; updateTimer.Change(UPDATE_ITERATION, UPDATE_ITERATION); }
public bool Start(Simian simian) { m_simian = simian; m_userClient = m_simian.GetAppModule <IUserClient>(); // Library user and inventory creation string libraryOwnerName = "Library Owner"; IConfig config = simian.Config.Configs["StandaloneInventoryClient"]; if (config != null) { libraryOwnerName = config.GetString("LibraryOwnerName", "Library Owner"); } CreateLibrary(libraryOwnerName); // Deserialize inventories from disk m_fileDataStore = m_simian.GetAppModule <FileDataStore>(); if (m_fileDataStore != null) { IList <SerializedData> inventories = m_fileDataStore.Deserialize(UUID.Zero, "Inventory"); for (int i = 0; i < inventories.Count; i++) { string name = inventories[i].Name; UUID ownerID; if (UUID.TryParse(name, out ownerID)) { OSDMap map = null; try { map = OSDParser.Deserialize(inventories[i].Data) as OSDMap; } catch (Exception) { } if (map != null) { DeserializeInventory(ownerID, map); } else { m_log.Warn("Failed to deserialize inventory file " + name); } } } } return(true); }
public bool Start(Simian simian) { m_simian = simian; m_userClient = m_simian.GetAppModule<IUserClient>(); IConfigSource source = simian.Config; IConfig config = source.Configs["SimianGrid"]; if (config != null) m_serverUrl = config.GetString("InventoryService", null); if (String.IsNullOrEmpty(m_serverUrl)) { m_log.Error("[SimianGrid] config section is missing the InventoryService URL"); return false; } return true; }
public void Initialise(IConfigSource source) { if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector")) { IConfig gridConfig = source.Configs["UserAccountService"]; if (gridConfig == null) { m_log.Error("[SIMIAN PROFILES]: UserAccountService missing from OpenSim.ini"); throw new Exception("Profiles init error"); } string serviceUrl = gridConfig.GetString("UserAccountServerURI"); if (String.IsNullOrEmpty(serviceUrl)) { m_log.Error("[SIMIAN PROFILES]: No UserAccountServerURI in section UserAccountService"); throw new Exception("Profiles init error"); } if (!serviceUrl.EndsWith("/")) { serviceUrl = serviceUrl + '/'; } m_serverUrl = serviceUrl; IConfig profilesConfig = source.Configs["Profiles"]; if (profilesConfig == null) { // Do not run this module by default. return; } else { // if profiles aren't enabled, we're not needed. // if we're not specified as the connector to use, then we're not wanted if (profilesConfig.GetString("Module", String.Empty) != Name) { return; } m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name); } } }
public bool Start(Simian simian) { m_fileDataStore = simian.GetAppModule <FileDataStore>(); if (m_fileDataStore != null) { IList <SerializedData> users = m_fileDataStore.Deserialize(UUID.Zero, "Users"); for (int i = 0; i < users.Count; i++) { string name = users[i].Name; UUID ownerID; OSDMap map = null; try { map = OSDParser.Deserialize(users[i].Data) as OSDMap; } catch (Exception) { } if (name == "identities") { if (map != null) { DeserializeIdentities(map); } else { m_log.Warn("Failed to deserialize user identity file"); } } else if (UUID.TryParse(name, out ownerID)) { if (map != null) { DeserializeUser(map); } else { m_log.Warn("Failed to deserialize user file " + name); } } } } return(true); }
public bool Start(Simian simian) { IConfigSource source = simian.Config; IConfig config = source.Configs["SimianGrid"]; if (config != null) { m_serverUrl = config.GetString("UserService", null); } if (String.IsNullOrEmpty(m_serverUrl)) { m_log.Error("[SimianGrid] config section is missing the UserService URL"); return(false); } m_fileDataStore = simian.GetAppModule <FileDataStore>(); return(true); }
public void Initialise(IConfigSource source) { if (Simian.IsSimianEnabled(source, "AuthenticationServices", this.Name)) { IConfig assetConfig = source.Configs["AuthenticationService"]; if (assetConfig == null) { m_log.Error("[SIMIAN AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini"); throw new Exception("Authentication connector init error"); } string serviceURI = assetConfig.GetString("AuthenticationServerURI"); if (String.IsNullOrEmpty(serviceURI)) { m_log.Error("[SIMIAN AUTH CONNECTOR]: No Server URI named in section AuthenticationService"); throw new Exception("Authentication connector init error"); } m_serverUrl = serviceURI; } }
public bool Start(Simian simian) { m_simian = simian; m_userClient = m_simian.GetAppModule <IUserClient>(); IConfigSource source = simian.Config; IConfig config = source.Configs["SimianGrid"]; if (config != null) { m_serverUrl = config.GetString("InventoryService", null); } if (String.IsNullOrEmpty(m_serverUrl)) { m_log.Error("[SimianGrid] config section is missing the InventoryService URL"); return(false); } return(true); }
public void Initialise(IConfigSource source) { if (Simian.IsSimianEnabled(source, "GridServices", this.Name)) { IConfig gridConfig = source.Configs["GridService"]; if (gridConfig == null) { m_log.Error("[SIMIAN GRID CONNECTOR]: GridService missing from OpenSim.ini"); throw new Exception("Grid connector init error"); } string serviceUrl = gridConfig.GetString("GridServerURI"); if (String.IsNullOrEmpty(serviceUrl)) { m_log.Error("[SIMIAN GRID CONNECTOR]: No Server URI named in section GridService"); throw new Exception("Grid connector init error"); } m_serverUrl = serviceUrl; } }
public bool Start(Simian simian) { m_simian = simian; m_userClient = m_simian.GetAppModule<IUserClient>(); // Library user and inventory creation string libraryOwnerName = "Library Owner"; IConfig config = simian.Config.Configs["StandaloneInventoryClient"]; if (config != null) { libraryOwnerName = config.GetString("LibraryOwnerName", "Library Owner"); } CreateLibrary(libraryOwnerName); // Deserialize inventories from disk m_fileDataStore = m_simian.GetAppModule<FileDataStore>(); if (m_fileDataStore != null) { IList<SerializedData> inventories = m_fileDataStore.Deserialize(UUID.Zero, "Inventory"); for (int i = 0; i < inventories.Count; i++) { string name = inventories[i].Name; UUID ownerID; if (UUID.TryParse(name, out ownerID)) { OSDMap map = null; try { map = OSDParser.Deserialize(inventories[i].Data) as OSDMap; } catch (Exception) { } if (map != null) DeserializeInventory(ownerID, map); else m_log.Warn("Failed to deserialize inventory file " + name); } } } return true; }
public void Initialise(IConfigSource source) { if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) { IConfig assetConfig = source.Configs["UserAccountService"]; if (assetConfig == null) { m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini"); throw new Exception("User account connector init error"); } string serviceURI = assetConfig.GetString("UserAccountServerURI"); if (String.IsNullOrEmpty(serviceURI)) { m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI in section UserAccountService, skipping SimianUserAccountServiceConnector"); throw new Exception("User account connector init error"); } m_accountCache = new ExpiringCache <UUID, UserAccount>(); m_serverUrl = serviceURI; } }
public bool Start(Simian simian) { m_simian = simian; m_scheduler = m_simian.GetAppModule<IScheduler>(); if (m_scheduler == null) { m_log.Error("StandaloneAssetClient requires an IScheduler service"); return false; } m_dataStore = m_simian.GetAppModule<IDataStore>(); if (m_dataStore == null) { m_log.Error("StandaloneAssetClient requires an IDataStore service"); return false; } LoadDefaultAssets(); return true; }
public bool Start(Simian simian) { m_simian = simian; m_httpServer = simian.GetAppModule <IHttpServer>(); if (m_httpServer == null) { m_log.Error("StandaloneGridClient requires an IHttpServer"); return(false); } m_sceneFactory = simian.GetAppModule <ISceneFactory>(); if (m_sceneFactory == null) { m_log.Error("StandaloneGridClient requires an ISceneFactory"); return(false); } m_assetClient = simian.GetAppModule <IAssetClient>(); return(true); }
public void Initialise(IConfigSource source) { if (Simian.IsSimianEnabled(source, "InventoryServices", this.Name)) { IConfig gridConfig = source.Configs["InventoryService"]; if (gridConfig == null) { m_log.Error("[SIMIAN INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); throw new Exception("Inventory connector init error"); } string serviceUrl = gridConfig.GetString("InventoryServerURI"); if (String.IsNullOrEmpty(serviceUrl)) { m_log.Error("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); throw new Exception("Inventory connector init error"); } m_serverUrl = serviceUrl; gridConfig = source.Configs["UserAccountService"]; if (gridConfig != null) { serviceUrl = gridConfig.GetString("UserAccountServerURI"); if (!String.IsNullOrEmpty(serviceUrl)) { m_userServerUrl = serviceUrl; } else { m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section UserAccountService"); } } else { m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: UserAccountService missing from OpenSim.ini"); } } }
public bool Start(Simian simian) { m_simian = simian; m_scheduler = m_simian.GetAppModule <IScheduler>(); if (m_scheduler == null) { m_log.Error("StandaloneAssetClient requires an IScheduler service"); return(false); } m_dataStore = m_simian.GetAppModule <IDataStore>(); if (m_dataStore == null) { m_log.Error("StandaloneAssetClient requires an IDataStore service"); return(false); } LoadDefaultAssets(); return(true); }
public bool Start(Simian simian) { m_simian = simian; m_httpServer = simian.GetAppModule <IHttpServer>(); m_dataStore = m_simian.GetAppModule <IDataStore>(); IConfigSource source = simian.Config; IConfig config = source.Configs["SimianGrid"]; if (config != null) { m_serverUrl = config.GetString("AssetService", null); } if (String.IsNullOrEmpty(m_serverUrl)) { m_log.Error("[SimianGrid] config section is missing the AssetService URL"); return(false); } return(true); }
public bool Start(Simian simian) { m_simian = simian; #region Get Module References m_httpServer = simian.GetAppModule <IHttpServer>(); if (m_httpServer == null) { m_log.Error("Can't create the LindenLogin service without an HTTP server"); return(false); } m_userClient = simian.GetAppModule <IUserClient>(); if (m_userClient == null) { m_log.Error("Can't create the LindenLogin service without a user client"); return(false); } m_gridClient = simian.GetAppModule <IGridClient>(); if (m_gridClient == null) { m_log.Error("Can't create the LindenLogin service without a grid client"); return(false); } m_inventoryClient = simian.GetAppModule <IInventoryClient>(); #endregion Get Module References m_httpServer.AddXmlRpcHandler("/", true, "login_to_simulator", LoginHandler); m_log.Info("LindenLogin handler initialized"); return(true); }
public bool Start(Simian simian) { IConfigSource source = simian.Config; IConfig config = source.Configs["SimianGrid"]; if (config != null) m_serverUrl = config.GetString("UserService", null); if (String.IsNullOrEmpty(m_serverUrl)) { m_log.Error("[SimianGrid] config section is missing the UserService URL"); return false; } m_fileDataStore = simian.GetAppModule<FileDataStore>(); return true; }
public bool Start(Simian simian) { m_scheduler = simian.GetAppModule <IScheduler>(); if (m_scheduler == null) { m_log.Error("LLSceneFactory requires an IScheduler"); return(false); } m_scenes = new Dictionary <UUID, IScene>(); m_renderer = simian.GetAppModule <ISceneRenderer>(); m_gridClient = simian.GetAppModule <IGridClient>(); string[] sceneFiles = null; try { sceneFiles = Directory.GetFiles(SOURCE_PATH, "*.ini", SearchOption.AllDirectories); } catch (DirectoryNotFoundException) { m_log.Warn(Path.GetFullPath(SOURCE_PATH) + " not found, cannot load scene definitions"); return(false); } for (int i = 0; i < sceneFiles.Length; i++) { // Create the config source for this region by merging the app config and the region config IConfigSource configSource = simian.GetConfigCopy(); IniConfigSource regionConfigSource = new IniConfigSource(sceneFiles[i]); configSource.Merge(regionConfigSource); IConfig config = configSource.Configs["LindenRegion"]; if (config != null) { UUID id; UUID.TryParse(config.GetString("ID"), out id); string name = config.GetString("Name"); uint locationX = 0, locationY = 0; string[] locationParts = config.GetString("Location").Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (locationParts.Length != 2 || !UInt32.TryParse(locationParts[0], out locationX) || !UInt32.TryParse(locationParts[1], out locationY)) { m_log.Warn("Missing or invalid Location for " + name + " region"); } Vector3d regionPosition = new Vector3d(locationX * (uint)REGION_SIZE, locationY * (uint)REGION_SIZE, 0.0d); Scene scene = new Scene(id, name, regionPosition, new Vector3d(256.0, 256.0, 4096.0), simian, configSource); m_log.Info("Starting scene " + scene.Name + " (" + scene.ID + ")"); scene.Start(); m_scenes[scene.ID] = scene; // Create a map tile for this scene m_scheduler.FireAndForget(o => CreateMapTile((IScene)o), scene); } else { m_log.Warn("No [LindenRegion] config section found in " + sceneFiles[i] + ", skipping"); } } // Create the array m_scenesArray = new IScene[m_scenes.Count]; int j = 0; foreach (IScene scene in m_scenes.Values) { m_scenesArray[j++] = scene; } // Fire the OnSceneStart callback for each scene we started SceneStartCallback callback = OnSceneStart; if (callback != null) { for (int i = 0; i < m_scenesArray.Length; i++) { callback(m_scenesArray[i]); } } return(true); }
public Chat(Simian server) { Server = server; }
public bool Start(Simian simian) { m_simian = simian; m_httpServer = simian.GetAppModule<IHttpServer>(); m_assetClient = simian.GetAppModule<IAssetClient>(); m_sceneFactory = simian.GetAppModule<ISceneFactory>(); if (m_sceneFactory != null) { m_sceneFactory.OnSceneStart += SceneStartHandler; m_sceneFactory.OnSceneStop += SceneStopHandler; } IConfigSource source = simian.Config; IConfig config = source.Configs["SimianGrid"]; if (config != null) m_serverUrl = config.GetString("GridService", null); if (String.IsNullOrEmpty(m_serverUrl)) { m_log.Error("[SimianGrid] config section is missing the GridService URL"); return false; } return true; }
public AvatarPropertiesReply(Simian server) { Server = server; }
public Movement(Simian server) { Server = server; }
public bool Start(Simian simian) { m_simian = simian; if (File.Exists("motd.txt")) m_motd = File.ReadAllLines("motd.txt"); else m_motd = new string[0]; m_sceneFactory = m_simian.GetAppModule<ISceneFactory>(); if (m_sceneFactory != null) { m_sceneFactory.OnSceneStart += SceneStartHandler; } m_clientConnectedCallback = new AsyncCallback( delegate(IAsyncResult ar) { if (m_scene == null) return; try { //accept connection for a new user IRCUser user = new IRCUser(m_scene, null, UUID.Random()); user.TCPClient = m_listener.EndAcceptTcpClient(ar); m_log.Info("Connection from " + user.TCPClient.Client.RemoteEndPoint); //add new user to dictionary m_users.Add(user); //begin listening for data on the new connection, and also for the next client connection user.TCPClient.Client.BeginReceive(user.Buffer, 0, TCP_BUFFER_LENGTH, SocketFlags.None, m_dataReceivedCallback, user); m_listener.BeginAcceptTcpClient(m_clientConnectedCallback, user); //fire ClientConnected event if (ClientConnected != null) ClientConnected(user); } catch (ObjectDisposedException) { } } ); m_dataReceivedCallback = new AsyncCallback( delegate(IAsyncResult ar) { IRCUser user = (IRCUser)ar.AsyncState; //number of bytes read int bytesRead = user.TCPClient.Client.EndReceive(ar); //name or address, depending on whether or not user is authenticated string displayName = user.Name == null ? user.TCPClient.Client.RemoteEndPoint.ToString() : user.Name; //check for disconnection if (bytesRead == 0 || !user.TCPClient.Client.Connected) { m_log.Info("Client " + displayName + " disconnected."); SendToUserChannels(user, IRCMessageType.Quit, "Disconnected"); //TODO: quit messages //remove user from disctionary RemoveUser(user); //fire ClientDisconnected event if (ClientDisconnected != null) ClientDisconnected(user, null); return; } //trim buffer length to the number of bytes read byte[] buffer = new byte[bytesRead]; Array.Copy(user.Buffer, 0, buffer, 0, bytesRead); //split message into string lines string[] delimiters = new string[] { "\0", "\r", "\n" }; string[] lines = Encoding.ASCII.GetString(buffer).Split(delimiters, StringSplitOptions.RemoveEmptyEntries); //parse each line for (int i = 0, len = lines.Length; i < len; i++) { m_log.Info("<" + displayName + ">: " + lines[i]); //fire DataReceived event if (DataReceived != null) DataReceived(user, lines[i]); ParseCommand(user, lines[i]); } //keep listening for data try { user.TCPClient.Client.BeginReceive(user.Buffer, 0, TCP_BUFFER_LENGTH, SocketFlags.None, m_dataReceivedCallback, user); } catch (Exception ex) { m_log.Warn(ex.Message); RemoveUser(user); } } ); try { m_listener = new TcpListener(IPAddress.Any, 6667); m_listener.Start(); m_listener.BeginAcceptTcpClient(m_clientConnectedCallback, this); } catch (Exception ex) { m_log.Error("Failed to start IRC server: " + ex.Message); return false; } m_log.Info("IRC server listening on port 6667"); return true; }
public bool Start(Simian simian) { m_assetClient = simian.GetAppModule<IAssetClient>(); return true; }
private bool m_useAntiAliasing = true; // TODO: Make this a config option public bool Start(Simian simian) { m_assetClient = simian.GetAppModule <IAssetClient>(); return(true); }
public Money(Simian server) { Server = server; }
public bool Start(Simian simian) { m_fileDataStore = simian.GetAppModule<FileDataStore>(); if (m_fileDataStore != null) { IList<SerializedData> users = m_fileDataStore.Deserialize(UUID.Zero, "Users"); for (int i = 0; i < users.Count; i++) { string name = users[i].Name; UUID ownerID; OSDMap map = null; try { map = OSDParser.Deserialize(users[i].Data) as OSDMap; } catch (Exception) { } if (name == "identities") { if (map != null) DeserializeIdentities(map); else m_log.Warn("Failed to deserialize user identity file"); } else if (UUID.TryParse(name, out ownerID)) { if (map != null) DeserializeUser(map); else m_log.Warn("Failed to deserialize user file " + name); } } } return true; }
public bool Start(Simian simian) { m_simian = simian; m_httpServer = simian.GetAppModule<IHttpServer>(); m_dataStore = m_simian.GetAppModule<IDataStore>(); IConfigSource source = simian.Config; IConfig config = source.Configs["SimianGrid"]; if (config != null) m_serverUrl = config.GetString("AssetService", null); if (String.IsNullOrEmpty(m_serverUrl)) { m_log.Error("[SimianGrid] config section is missing the AssetService URL"); return false; } return true; }
public bool Start(Simian simian) { m_simian = simian; simian.RegisterAssetFilter("image/x-j2c", JPEG2000Handler); return true; }
public bool Start(Simian simian) { m_simian = simian; if (File.Exists("motd.txt")) { m_motd = File.ReadAllLines("motd.txt"); } else { m_motd = new string[0]; } m_sceneFactory = m_simian.GetAppModule <ISceneFactory>(); if (m_sceneFactory != null) { m_sceneFactory.OnSceneStart += SceneStartHandler; } m_clientConnectedCallback = new AsyncCallback( delegate(IAsyncResult ar) { if (m_scene == null) { return; } try { //accept connection for a new user IRCUser user = new IRCUser(m_scene, null, UUID.Random()); user.TCPClient = m_listener.EndAcceptTcpClient(ar); m_log.Info("Connection from " + user.TCPClient.Client.RemoteEndPoint); //add new user to dictionary m_users.Add(user); //begin listening for data on the new connection, and also for the next client connection user.TCPClient.Client.BeginReceive(user.Buffer, 0, TCP_BUFFER_LENGTH, SocketFlags.None, m_dataReceivedCallback, user); m_listener.BeginAcceptTcpClient(m_clientConnectedCallback, user); //fire ClientConnected event if (ClientConnected != null) { ClientConnected(user); } } catch (ObjectDisposedException) { } } ); m_dataReceivedCallback = new AsyncCallback( delegate(IAsyncResult ar) { IRCUser user = (IRCUser)ar.AsyncState; //number of bytes read int bytesRead = user.TCPClient.Client.EndReceive(ar); //name or address, depending on whether or not user is authenticated string displayName = user.Name == null ? user.TCPClient.Client.RemoteEndPoint.ToString() : user.Name; //check for disconnection if (bytesRead == 0 || !user.TCPClient.Client.Connected) { m_log.Info("Client " + displayName + " disconnected."); SendToUserChannels(user, IRCMessageType.Quit, "Disconnected"); //TODO: quit messages //remove user from disctionary RemoveUser(user); //fire ClientDisconnected event if (ClientDisconnected != null) { ClientDisconnected(user, null); } return; } //trim buffer length to the number of bytes read byte[] buffer = new byte[bytesRead]; Array.Copy(user.Buffer, 0, buffer, 0, bytesRead); //split message into string lines string[] delimiters = new string[] { "\0", "\r", "\n" }; string[] lines = Encoding.ASCII.GetString(buffer).Split(delimiters, StringSplitOptions.RemoveEmptyEntries); //parse each line for (int i = 0, len = lines.Length; i < len; i++) { m_log.Info("<" + displayName + ">: " + lines[i]); //fire DataReceived event if (DataReceived != null) { DataReceived(user, lines[i]); } ParseCommand(user, lines[i]); } //keep listening for data try { user.TCPClient.Client.BeginReceive(user.Buffer, 0, TCP_BUFFER_LENGTH, SocketFlags.None, m_dataReceivedCallback, user); } catch (Exception ex) { m_log.Warn(ex.Message); RemoveUser(user); } } ); try { m_listener = new TcpListener(IPAddress.Any, 6667); m_listener.Start(); m_listener.BeginAcceptTcpClient(m_clientConnectedCallback, this); } catch (Exception ex) { m_log.Error("Failed to start IRC server: " + ex.Message); return(false); } m_log.Info("IRC server listening on port 6667"); return(true); }
public CoarseLocationUpdates(Simian server) { Server = server; }
public bool Start(Simian simian) { m_simian = simian; #region Get Module References m_httpServer = simian.GetAppModule<IHttpServer>(); if (m_httpServer == null) { m_log.Error("Can't create the LindenLogin service without an HTTP server"); return false; } m_userClient = simian.GetAppModule<IUserClient>(); if (m_userClient == null) { m_log.Error("Can't create the LindenLogin service without a user client"); return false; } m_gridClient = simian.GetAppModule<IGridClient>(); if (m_gridClient == null) { m_log.Error("Can't create the LindenLogin service without a grid client"); return false; } m_inventoryClient = simian.GetAppModule<IInventoryClient>(); #endregion Get Module References m_httpServer.AddXmlRpcHandler("/", true, "login_to_simulator", LoginHandler); m_log.Info("LindenLogin handler initialized"); return true; }
public ImageDelivery(Simian server) { Server = server; }
public bool Start(Simian simian) { m_simian = simian; m_httpServer = simian.GetAppModule<IHttpServer>(); if (m_httpServer == null) { m_log.Error("StandaloneGridClient requires an IHttpServer"); return false; } m_sceneFactory = simian.GetAppModule<ISceneFactory>(); if (m_sceneFactory == null) { m_log.Error("StandaloneGridClient requires an ISceneFactory"); return false; } m_assetClient = simian.GetAppModule<IAssetClient>(); return true; }
public bool Start(Simian simian) { m_scenes = new Dictionary<UUID, IScene>(); string[] sceneFiles = null; try { sceneFiles = Directory.GetFiles(SOURCE_PATH, "*.ini", SearchOption.AllDirectories); } catch (DirectoryNotFoundException) { m_log.Warn(Path.GetFullPath(SOURCE_PATH) + " not found, cannot load scene definitions"); return false; } for (int i = 0; i < sceneFiles.Length; i++) { // Create the config source for this region by merging the app config and the region config IConfigSource configSource = simian.GetConfigCopy(); IniConfigSource regionConfigSource = new IniConfigSource(sceneFiles[i]); configSource.Merge(regionConfigSource); IConfig config = configSource.Configs["LindenRegion"]; if (config != null) { UUID id; UUID.TryParse(config.GetString("ID"), out id); string name = config.GetString("Name"); uint locationX = 0, locationY = 0; string[] locationParts = config.GetString("Location").Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (locationParts.Length != 2 || !UInt32.TryParse(locationParts[0], out locationX) || !UInt32.TryParse(locationParts[1], out locationY)) { m_log.Warn("Missing or invalid Location for " + name + " region"); } Vector3d regionPosition = new Vector3d(locationX * (uint)REGION_SIZE, locationY * (uint)REGION_SIZE, 0.0d); Scene scene = new Scene(id, name, regionPosition, new Vector3d(256.0, 256.0, 4096.0), simian, configSource); m_log.Info("Starting scene " + scene.Name + " (" + scene.ID + ")"); scene.Start(); m_scenes[scene.ID] = scene; //CreateMapTile(scene); } else { m_log.Warn("No [LindenRegion] config section found in " + sceneFiles[i] + ", skipping"); } } // Create the array m_scenesArray = new IScene[m_scenes.Count]; int j = 0; foreach (IScene scene in m_scenes.Values) m_scenesArray[j++] = scene; // Fire the OnSceneStart callback for each scene we started SceneStartCallback callback = OnSceneStart; if (callback != null) { for (int i = 0; i < m_scenesArray.Length; i++) { callback(m_scenesArray[i]); } } return true; }
public bool Start(Simian simian) { m_simian = simian; simian.RegisterAssetFilter("image/x-j2c", JPEG2000Handler); return(true); }