aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ThirdParty
diff options
context:
space:
mode:
authorJohan Berntsson2008-03-11 04:40:39 +0000
committerJohan Berntsson2008-03-11 04:40:39 +0000
commitf0bfb879798e87296e13063203d5b18a1aa1097f (patch)
tree675b3442cf477d8ed242cb23c97bd610e98d0492 /ThirdParty
parentThe plugin loader can now handle plugin dependencies without hardcoding (diff)
downloadopensim-SC-f0bfb879798e87296e13063203d5b18a1aa1097f.zip
opensim-SC-f0bfb879798e87296e13063203d5b18a1aa1097f.tar.gz
opensim-SC-f0bfb879798e87296e13063203d5b18a1aa1097f.tar.bz2
opensim-SC-f0bfb879798e87296e13063203d5b18a1aa1097f.tar.xz
Eliminated several compiler warning messages
Diffstat (limited to 'ThirdParty')
-rw-r--r--ThirdParty/3Di/LoadBalancer/TcpClient.cs7
-rw-r--r--ThirdParty/3Di/LoadBalancer/TcpServer.cs18
-rw-r--r--ThirdParty/3Di/RegionMonitor/ServerPlugin/RegionMonitorPlugin.cs129
3 files changed, 4 insertions, 150 deletions
diff --git a/ThirdParty/3Di/LoadBalancer/TcpClient.cs b/ThirdParty/3Di/LoadBalancer/TcpClient.cs
index 2e4cdc7..ab1f692 100644
--- a/ThirdParty/3Di/LoadBalancer/TcpClient.cs
+++ b/ThirdParty/3Di/LoadBalancer/TcpClient.cs
@@ -37,8 +37,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer {
37 public class AsynchronousClient { 37 public class AsynchronousClient {
38 private static ManualResetEvent connectDone = new ManualResetEvent(false); 38 private static ManualResetEvent connectDone = new ManualResetEvent(false);
39 private static ManualResetEvent sendDone = new ManualResetEvent(false); 39 private static ManualResetEvent sendDone = new ManualResetEvent(false);
40 private static ManualResetEvent receiveDone = new ManualResetEvent(false);
41 private static String response = String.Empty;
42 40
43 public static Socket StartClient(string hostname, int port) { 41 public static Socket StartClient(string hostname, int port) {
44 try { 42 try {
@@ -114,7 +112,10 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer {
114 try { 112 try {
115 Socket client = (Socket) ar.AsyncState; 113 Socket client = (Socket) ar.AsyncState;
116 int bytesSent = client.EndSend(ar); 114 int bytesSent = client.EndSend(ar);
117 //Console.WriteLine("Sent {0} bytes to server.", bytesSent); 115 if(bytesSent > 0)
116 {
117 //Console.WriteLine("Sent {0} bytes to server.", bytesSent);
118 }
118 sendDone.Set(); 119 sendDone.Set();
119 } catch (Exception e) { 120 } catch (Exception e) {
120 Console.WriteLine(e.ToString()); 121 Console.WriteLine(e.ToString());
diff --git a/ThirdParty/3Di/LoadBalancer/TcpServer.cs b/ThirdParty/3Di/LoadBalancer/TcpServer.cs
index 2d46294..216db3b 100644
--- a/ThirdParty/3Di/LoadBalancer/TcpServer.cs
+++ b/ThirdParty/3Di/LoadBalancer/TcpServer.cs
@@ -89,7 +89,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer {
89 } 89 }
90 90
91 public static void ReadCallback(IAsyncResult ar) { 91 public static void ReadCallback(IAsyncResult ar) {
92 String content = String.Empty;
93 StateObject state = (StateObject) ar.AsyncState; 92 StateObject state = (StateObject) ar.AsyncState;
94 Socket handler = state.workSocket; 93 Socket handler = state.workSocket;
95 94
@@ -183,23 +182,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer {
183 182
184 handler.BeginReceive( state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), state); 183 handler.BeginReceive( state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), state);
185 } 184 }
186
187 private static void Send(Socket handler, String data) {
188 byte[] byteData = Encoding.ASCII.GetBytes(data);
189 handler.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), handler);
190 }
191
192 private static void SendCallback(IAsyncResult ar) {
193 try {
194 Socket handler = (Socket) ar.AsyncState;
195 int bytesSent = handler.EndSend(ar);
196 //Console.WriteLine("Sent {0} bytes to client.", bytesSent);
197 handler.Shutdown(SocketShutdown.Both);
198 handler.Close();
199 } catch (Exception e) {
200 Console.WriteLine(e.ToString());
201 }
202 }
203 } 185 }
204 186
205 public class TcpServer { 187 public class TcpServer {
diff --git a/ThirdParty/3Di/RegionMonitor/ServerPlugin/RegionMonitorPlugin.cs b/ThirdParty/3Di/RegionMonitor/ServerPlugin/RegionMonitorPlugin.cs
deleted file mode 100644
index 3ea19a0..0000000
--- a/ThirdParty/3Di/RegionMonitor/ServerPlugin/RegionMonitorPlugin.cs
+++ /dev/null
@@ -1,129 +0,0 @@
1/*
2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Runtime.Remoting;
30using System.Threading;
31using Mono.Addins;
32using OpenSim;
33using OpenSim.Framework.Console;
34using MonitorLib;
35
36[assembly:Addin]
37[assembly:AddinDependency ("OpenSim", "0.5")]
38
39namespace OpenSim.ApplicationPlugins.RegionMonitor
40{
41 [Extension("/OpenSim/Startup")]
42 public class RegionMonitorPlugin : MonitorLibBase, IApplicationPlugin
43 {
44 protected Thread m_mointorThread;
45 protected static OpenSimMain m_openSimMain;
46
47 public void Initialise(OpenSimMain opensim)
48 {
49 m_openSimMain = opensim;
50 Start();
51 MainLog.Instance.Verbose("Monitor", "Region monitor is runing ...");
52 }
53
54 public void Close()
55 {
56 }
57
58 public void Start()
59 {
60 // start monitor thread (remoting module)
61 m_mointorThread = new Thread(new ThreadStart(StartMonitor));
62 m_mointorThread.IsBackground = true;
63 m_mointorThread.Start();
64 }
65
66 private void StartMonitor()
67 {
68 try
69 {
70 Object lockObj = new Object();
71
72 RemotingConfiguration.Configure("monitorS.config", false);
73
74 lock (lockObj)
75 {
76 System.Threading.Monitor.Wait(lockObj);
77 }
78 }
79 catch (Exception e)
80 {
81 MainLog.Instance.Warn("MONITOR", "Error - " + e.Message);
82 }
83 }
84
85 public override bool FetchInfo(out string outstr)
86 {
87 MainLog.Instance.Verbose("MONITOR", "Fetch Information from Region server");
88 bool status = true;
89 string startTime = "";
90 string upTime = "";
91 int userNumber = 0;
92 int regionNumber = 0;
93 m_openSimMain.GetRunTime(out startTime, out upTime);
94 m_openSimMain.GetAvatarNumber(out userNumber);
95 m_openSimMain.GetRegionNumber(out regionNumber);
96 outstr = startTime
97 + "," + upTime
98 + "," + regionNumber
99 + "," + userNumber;
100 return status;
101 }
102
103
104 public override bool MoveRegion()
105 {
106 MainLog.Instance.Verbose("MONITOR", "Move Region");
107 bool status = true;
108
109 return status;
110 }
111
112 public override bool SplitRegion()
113 {
114 MainLog.Instance.Verbose("MONITOR", "Split Region");
115 bool status = true;
116
117 return status;
118 }
119
120 public override bool MergeScenes()
121 {
122 MainLog.Instance.Verbose("MONITOR", "Merge Scenes");
123 bool status = true;
124
125 return status;
126 }
127
128 }
129}