aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorcw2007-02-01 00:15:47 +0000
committercw2007-02-01 00:15:47 +0000
commit89d242d246cbe8023af9b428257053e92572a8c8 (patch)
tree2439577b82c44b9dcc499994e70e863343d00831
parentMaking trunk; applying appropriate license to each file (diff)
downloadopensim-SC_OLD-89d242d246cbe8023af9b428257053e92572a8c8.zip
opensim-SC_OLD-89d242d246cbe8023af9b428257053e92572a8c8.tar.gz
opensim-SC_OLD-89d242d246cbe8023af9b428257053e92572a8c8.tar.bz2
opensim-SC_OLD-89d242d246cbe8023af9b428257053e92572a8c8.tar.xz
Cleanup
-rw-r--r--Agent_Manager.cs2
-rw-r--r--Asset_manager.cs2
-rw-r--r--Class1.cs23
-rw-r--r--Controller.cs229
-rw-r--r--Main-sever.Designer.cs80
-rw-r--r--Main-sever.cs270
-rw-r--r--Main-sever.resx123
-rw-r--r--Prim_manager.cs2
-rw-r--r--Second-server.csproj34
-rw-r--r--Second-server.sln23
-rw-r--r--Server.cs2
-rw-r--r--Texture_manager.cs2
-rw-r--r--lib/Axiom.MathLib.dllbin0 -> 69632 bytes
-rw-r--r--lib/log4net.dllbin0 -> 270336 bytes
14 files changed, 269 insertions, 523 deletions
diff --git a/Agent_Manager.cs b/Agent_Manager.cs
index 934fb57..3b05480 100644
--- a/Agent_Manager.cs
+++ b/Agent_Manager.cs
@@ -192,7 +192,7 @@ namespace Second_server
192 { 192 {
193 193
194 //shouldn't really have to read all this in from disk for every new client? 194 //shouldn't really have to read all this in from disk for every new client?
195 string data_path=System.Windows.Forms.Application.StartupPath + @"\layer_data\"; 195 string data_path=System.AppDomain.CurrentDomain.BaseDirectory + @"\layer_data\";
196 196
197 //send layerdata 197 //send layerdata
198 LayerDataPacket layerpack=new LayerDataPacket(); 198 LayerDataPacket layerpack=new LayerDataPacket();
diff --git a/Asset_manager.cs b/Asset_manager.cs
index 194d28f..3723e1d 100644
--- a/Asset_manager.cs
+++ b/Asset_manager.cs
@@ -118,7 +118,7 @@ namespace Second_server
118 } 118 }
119 private void load_asset(Asset_info info) 119 private void load_asset(Asset_info info)
120 { 120 {
121 string data_path=System.Windows.Forms.Application.StartupPath + @"\assets\"; 121 string data_path = System.AppDomain.CurrentDomain.BaseDirectory + @"\assets\";
122 string filename=data_path+@info.filename; 122 string filename=data_path+@info.filename;
123 FileInfo fInfo = new FileInfo(filename); 123 FileInfo fInfo = new FileInfo(filename);
124 124
diff --git a/Class1.cs b/Class1.cs
deleted file mode 100644
index 761a7eb..0000000
--- a/Class1.cs
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Created by SharpDevelop.
3 * User: Ma
4 * Date: 29/01/2007
5 * Time: 18:02
6 *
7 * To change this template use Tools | Options | Coding | Edit Standard Headers.
8 */
9
10using System;
11
12namespace Second_server
13{
14 /// <summary>
15 /// Description of Class1.
16 /// </summary>
17 public class Class1
18 {
19 public Class1()
20 {
21 }
22 }
23}
diff --git a/Controller.cs b/Controller.cs
new file mode 100644
index 0000000..351ff65
--- /dev/null
+++ b/Controller.cs
@@ -0,0 +1,229 @@
1/*
2Copyright (c) 2007 Michael Wright
3
4* Copyright (c) <year>, <copyright holder>
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Timers;
32using System.Collections.Generic;
33using libsecondlife;
34using libsecondlife.Packets;
35using System.Collections;
36using System.Text;
37using System.IO;
38using Axiom.MathLib;
39using log4net;
40
41namespace Second_server {
42 /// <summary>
43 /// Description of MainForm.
44 /// </summary>
45 public partial class Controller : Server_callback {
46
47
48
49 [STAThread]
50 public static void Main( string[] args ) {
51 Controller c = new Controller();
52 while( true ) // fuckin' a
53 System.Threading.Thread.Sleep( 1000 );
54
55 }
56 public Server server;
57
58 private Agent_Manager agent_man;
59 private Prim_manager prim_man;
60 private Texture_manager texture_man;
61 private Asset_manager asset_man;
62 private Login_manager login_man; //built in login server
63 private ulong time; //ticks
64 private Timer timer1 = new Timer();
65
66
67 public Controller() {
68 server = new Server( this );
69 agent_man = new Agent_Manager( this.server );
70 prim_man = new Prim_manager( this.server );
71 texture_man = new Texture_manager( this.server );
72 asset_man = new Asset_manager( this.server );
73 prim_man.agent_man = agent_man;
74 agent_man.prim_man = prim_man;
75 login_man = new Login_manager(); // startup
76 login_man.startup(); // login server
77 timer1.Enabled = true;
78 timer1.Interval = 200;
79 timer1.Elapsed +=new ElapsedEventHandler( this.Timer1Tick );
80
81
82 }
83 public void main_callback( Packet pack, User_Agent_info User_info ) {
84 if( ( pack.Type != PacketType.StartPingCheck ) && ( pack.Type != PacketType.AgentUpdate ) ) {
85 System.Console.WriteLine(pack.Type);
86 //this.richTextBox1.Text=this.richTextBox1.Text+"\n "+pack.Type;
87 }
88 if( pack.Type == PacketType.AgentSetAppearance ) {
89 System.Console.WriteLine(pack);
90 //this.richTextBox1.Text=this.richTextBox1.Text+"\n "+pack.Type;
91
92 }
93 if( pack.Type == PacketType.TransferRequest ) {
94 TransferRequestPacket tran = (TransferRequestPacket)pack;
95 LLUUID id = new LLUUID( tran.TransferInfo.Params, 0 );
96
97 if( ( id == new LLUUID( "66c41e39-38f9-f75a-024e-585989bfab73" ) ) || ( id == new LLUUID( "e0ee49b5a4184df8d3c9a65361fe7f49" ) ) ) {
98 //System.Console.WriteLine(pack);
99 //System.Console.WriteLine(tran.TransferInfo.TransferID);
100 asset_man.add_request( User_info, id, tran );
101 //this.richTextBox1.Text=this.richTextBox1.Text+"\n "+pack.Type;
102 }
103
104 }
105 if( ( pack.Type == PacketType.StartPingCheck ) ) {
106 //reply to pingcheck
107 libsecondlife.Packets.StartPingCheckPacket startp = (libsecondlife.Packets.StartPingCheckPacket)pack;
108 libsecondlife.Packets.CompletePingCheckPacket endping = new CompletePingCheckPacket();
109 endping.PingID.PingID = startp.PingID.PingID;
110 server.SendPacket( endping, true, User_info );
111 }
112 if( pack.Type == PacketType.CompleteAgentMovement ) {
113 // new client
114 agent_man.Agent_join( User_info );
115 }
116 if( pack.Type == PacketType.RequestImage ) {
117 RequestImagePacket image_req = (RequestImagePacket)pack;
118 for( int i = 0; i < image_req.RequestImage.Length; i++ ) {
119 this.texture_man.add_request( User_info, image_req.RequestImage[ i ].Image );
120
121 }
122 }
123 if( pack.Type == PacketType.RegionHandshakeReply ) {
124 //recieved regionhandshake so can now start sending info
125 agent_man.send_intial_data( User_info );
126 //this.setuptemplates("objectupate164.dat",User_info,false);
127 }
128 if( pack.Type == PacketType.ObjectAdd ) {
129 ObjectAddPacket ad = (ObjectAddPacket)pack;
130 prim_man.create_prim( User_info, ad.ObjectData.RayEnd, ad );
131 //this.send_prim(User_info,ad.ObjectData.RayEnd, ad);
132 }
133 if( pack.Type == PacketType.ObjectPosition ) {
134 //System.Console.WriteLine(pack.ToString());
135 }
136 if( pack.Type == PacketType.MultipleObjectUpdate ) {
137 //System.Console.WriteLine(pack.ToString());
138 MultipleObjectUpdatePacket mupd = (MultipleObjectUpdatePacket)pack;
139
140 for( int i = 0; i < mupd.ObjectData.Length; i++ ) {
141 if( mupd.ObjectData[ i ].Type == 9 ) //change position
142 {
143 libsecondlife.LLVector3 pos = new LLVector3( mupd.ObjectData[ i ].Data, 0 );
144
145 prim_man.update_prim_position( User_info, pos.X, pos.Y, pos.Z, mupd.ObjectData[ i ].ObjectLocalID );
146 //should update stored position of the prim
147 }
148 }
149 }
150 if( pack.Type == PacketType.AgentWearablesRequest ) {
151 agent_man.send_intial_avatar_apper( User_info );
152 }
153
154 if( pack.Type == PacketType.AgentUpdate ) {
155 AgentUpdatePacket ag = (AgentUpdatePacket)pack;
156 uint mask = ag.AgentData.ControlFlags & ( 1 );
157 Avatar_data m_av = agent_man.Get_Agent( User_info.AgentID );
158 if( m_av != null ) {
159 if( m_av.started ) {
160 if( mask == ( 1 ) ) {
161 if( !m_av.walk ) {
162 //start walking
163 agent_man.send_move_command( User_info, false, m_av.pos.X, m_av.pos.Y, m_av.pos.Z, 0, ag.AgentData.BodyRotation );
164 Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3( 1, 0, 0 );
165 Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion( ag.AgentData.BodyRotation.W, ag.AgentData.BodyRotation.X, ag.AgentData.BodyRotation.Y, ag.AgentData.BodyRotation.Z );
166 Axiom.MathLib.Vector3 direc = q * v3;
167 direc.Normalize();
168 direc = direc * ( ( 0.03f ) * 128f );
169
170 m_av.vel.X = direc.x;
171 m_av.vel.Y = direc.y;
172 m_av.vel.Z = direc.z;
173 m_av.walk = true;
174 }
175 }
176 else {
177 if( m_av.walk ) {
178 //walking but key not pressed so need to stop
179 agent_man.send_move_command( User_info, true, m_av.pos.X, m_av.pos.Y, m_av.pos.Z, 0, ag.AgentData.BodyRotation );
180 m_av.walk = false;
181 m_av.vel.X = 0;
182 m_av.vel.Y = 0;
183 m_av.vel.Z = 0;
184 }
185 }
186 }
187 }
188 }
189
190 if( pack.Type == PacketType.ChatFromViewer ) {
191 ChatFromViewerPacket chat = (ChatFromViewerPacket)pack;
192 System.Text.Encoding enc = System.Text.Encoding.ASCII;
193
194 string myString = enc.GetString( chat.ChatData.Message );
195 if( myString != "" ) {
196 string[] comp = new string[ 10 ];
197 string delimStr = " , ";
198 char[] delimiter = delimStr.ToCharArray();
199 string line;
200
201 line = myString;
202 comp = line.Split( delimiter );
203 if( comp[ 0 ] == "pos" ) {
204 }
205 else if( comp[ 0 ] == "veloc" ) {
206 }
207 else {
208 agent_man.send_chat_message( User_info, line );
209
210 }
211 }
212 }
213 }
214 public void new_user( User_Agent_info User_info ) {
215 Console.WriteLine( "new user - {0} - has joined [session {1}]", User_info.AgentID.ToString(), User_info.SessionID.ToString() );
216 agent_man.New_Agent( User_info );
217 }
218
219 public void error( string text ) {
220 Console.WriteLine( "error report: {0}", text );
221 }
222
223 void Timer1Tick( object sender, System.EventArgs e ) {
224 this.time++;
225 agent_man.tick();
226 texture_man.Do_work( time );
227 }
228 }
229} \ No newline at end of file
diff --git a/Main-sever.Designer.cs b/Main-sever.Designer.cs
deleted file mode 100644
index af8cfe8..0000000
--- a/Main-sever.Designer.cs
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2Copyright (c) 2007 Michael Wright
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18namespace Second_server
19{
20 partial class Main_server : System.Windows.Forms.Form
21 {
22 /// <summary>
23 /// Designer variable used to keep track of non-visual components.
24 /// </summary>
25 private System.ComponentModel.IContainer components = null;
26
27 /// <summary>
28 /// Disposes resources used by the form.
29 /// </summary>
30 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
31 protected override void Dispose(bool disposing)
32 {
33 if (disposing) {
34 if (components != null) {
35 components.Dispose();
36 }
37 }
38 base.Dispose(disposing);
39 }
40
41 /// <summary>
42 /// This method is required for Windows Forms designer support.
43 /// Do not change the method contents inside the source code editor. The Forms designer might
44 /// not be able to load this method if it was changed manually.
45 /// </summary>
46 private void InitializeComponent()
47 {
48 this.components = new System.ComponentModel.Container();
49 this.richTextBox1 = new System.Windows.Forms.RichTextBox();
50 this.timer1 = new System.Windows.Forms.Timer(this.components);
51 this.SuspendLayout();
52 //
53 // richTextBox1
54 //
55 this.richTextBox1.Location = new System.Drawing.Point(11, 12);
56 this.richTextBox1.Name = "richTextBox1";
57 this.richTextBox1.Size = new System.Drawing.Size(346, 402);
58 this.richTextBox1.TabIndex = 0;
59 this.richTextBox1.Text = "";
60 //
61 // timer1
62 //
63 this.timer1.Enabled = true;
64 this.timer1.Interval = 200;
65 this.timer1.Tick += new System.EventHandler(this.Timer1Tick);
66 //
67 // Main_server
68 //
69 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
70 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
71 this.ClientSize = new System.Drawing.Size(596, 426);
72 this.Controls.Add(this.richTextBox1);
73 this.Name = "Main_server";
74 this.Text = "Main_sever";
75 this.ResumeLayout(false);
76 }
77 private System.Windows.Forms.Timer timer1;
78 private System.Windows.Forms.RichTextBox richTextBox1;
79 }
80}
diff --git a/Main-sever.cs b/Main-sever.cs
deleted file mode 100644
index 911d9d7..0000000
--- a/Main-sever.cs
+++ /dev/null
@@ -1,270 +0,0 @@
1/*
2Copyright (c) 2007 Michael Wright
3
4* Copyright (c) <year>, <copyright holder>
5* All rights reserved.
6*
7* Redistribution and use in source and binary forms, with or without
8* modification, are permitted provided that the following conditions are met:
9* * Redistributions of source code must retain the above copyright
10* notice, this list of conditions and the following disclaimer.
11* * Redistributions in binary form must reproduce the above copyright
12* notice, this list of conditions and the following disclaimer in the
13* documentation and/or other materials provided with the distribution.
14* * Neither the name of the <organization> nor the
15* names of its contributors may be used to endorse or promote products
16* derived from this software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
19* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30using System;
31using System.Collections.Generic;
32using System.Drawing;
33using System.Windows.Forms;
34using libsecondlife;
35using libsecondlife.Packets;
36using System.Collections;
37using System.Text;
38using System.IO;
39using Axiom.MathLib;
40
41namespace Second_server
42{
43 /// <summary>
44 /// Description of MainForm.
45 /// </summary>
46 public partial class Main_server:Server_callback
47 {
48
49 [STAThread]
50 public static void Main(string[] args)
51 {
52 Application.EnableVisualStyles();
53 Application.SetCompatibleTextRenderingDefault(false);
54 Application.Run(new Main_server());
55 }
56 public Server server;
57
58 //public bool intin=false;
59 //private libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock avatar_template;
60 //private libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock object_template;
61
62 private Agent_Manager agent_man;
63 private Prim_manager prim_man;
64 private Texture_manager texture_man;
65 private Asset_manager asset_man;
66 private Login_manager login_man; //built in login server
67 private ulong time; //ticks
68
69 public Main_server()
70 {
71 //
72 // The InitializeComponent() call is required for Windows Forms designer support.
73 //
74 InitializeComponent();
75
76 //
77 // TODO: Add constructor code after the InitializeComponent() call.
78 //
79
80 server=new Server(this);
81 agent_man=new Agent_Manager(this.server);
82 prim_man=new Prim_manager(this.server);
83 texture_man=new Texture_manager(this.server);
84 asset_man=new Asset_manager(this.server);
85 prim_man.agent_man=agent_man;
86 agent_man.prim_man=prim_man;
87 login_man=new Login_manager(); // startup
88 login_man.startup(); // login server
89
90 }
91 public void main_callback(Packet pack, User_Agent_info User_info)
92 {
93 if((pack.Type!= PacketType.StartPingCheck) && (pack.Type!= PacketType.AgentUpdate))
94 {
95 //System.Console.WriteLine(pack.Type);
96 //this.richTextBox1.Text=this.richTextBox1.Text+"\n "+pack.Type;
97 }
98 if(pack.Type== PacketType.AgentSetAppearance)
99 {
100 //System.Console.WriteLine(pack);
101 //this.richTextBox1.Text=this.richTextBox1.Text+"\n "+pack.Type;
102
103 }
104 if(pack.Type== PacketType.TransferRequest)
105 {
106 TransferRequestPacket tran=(TransferRequestPacket)pack;
107 LLUUID id=new LLUUID(tran.TransferInfo.Params,0);
108
109 if((id==new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73")) ||(id==new LLUUID("e0ee49b5a4184df8d3c9a65361fe7f49")))
110 {
111 //System.Console.WriteLine(pack);
112 //System.Console.WriteLine(tran.TransferInfo.TransferID);
113 asset_man.add_request(User_info,id,tran);
114 //this.richTextBox1.Text=this.richTextBox1.Text+"\n "+pack.Type;
115 }
116
117 }
118 if((pack.Type== PacketType.StartPingCheck) )
119 {
120 //reply to pingcheck
121 libsecondlife.Packets.StartPingCheckPacket startp=(libsecondlife.Packets.StartPingCheckPacket)pack;
122 libsecondlife.Packets.CompletePingCheckPacket endping=new CompletePingCheckPacket();
123 endping.PingID.PingID=startp.PingID.PingID;
124 server.SendPacket(endping,true,User_info);
125 }
126 if(pack.Type==PacketType.CompleteAgentMovement)
127 {
128 // new client
129 agent_man.Agent_join(User_info);
130 }
131 if (pack.Type==PacketType.RequestImage)
132 {
133 RequestImagePacket image_req=(RequestImagePacket)pack;
134 for(int i=0; i<image_req.RequestImage.Length ;i++)
135 {
136 this.texture_man.add_request(User_info,image_req.RequestImage[i].Image);
137
138 }
139 }
140 if (pack.Type==PacketType.RegionHandshakeReply)
141 {
142 //recieved regionhandshake so can now start sending info
143 agent_man.send_intial_data(User_info);
144 //this.setuptemplates("objectupate164.dat",User_info,false);
145 }
146 if(pack.Type== PacketType.ObjectAdd)
147 {
148 ObjectAddPacket ad=(ObjectAddPacket)pack;
149 prim_man.create_prim(User_info,ad.ObjectData.RayEnd, ad);
150 //this.send_prim(User_info,ad.ObjectData.RayEnd, ad);
151 }
152 if(pack.Type== PacketType.ObjectPosition)
153 {
154 //System.Console.WriteLine(pack.ToString());
155 }
156 if(pack.Type== PacketType.MultipleObjectUpdate)
157 {
158 //System.Console.WriteLine(pack.ToString());
159 MultipleObjectUpdatePacket mupd=(MultipleObjectUpdatePacket)pack;
160
161 for(int i=0; i<mupd.ObjectData.Length; i++)
162 {
163 if(mupd.ObjectData[i].Type==9) //change position
164 {
165 libsecondlife.LLVector3 pos=new LLVector3(mupd.ObjectData[i].Data, 0);
166
167 prim_man.update_prim_position(User_info, pos.X,pos.Y,pos.Z,mupd.ObjectData[i].ObjectLocalID);
168 //should update stored position of the prim
169 }
170 }
171 }
172 if(pack.Type== PacketType.AgentWearablesRequest)
173 {
174 agent_man.send_intial_avatar_apper(User_info);
175 }
176
177 if(pack.Type==PacketType.AgentUpdate)
178 {
179 AgentUpdatePacket ag=(AgentUpdatePacket)pack;
180 uint mask=ag.AgentData.ControlFlags&(1);
181 Avatar_data m_av=agent_man.Get_Agent(User_info.AgentID);
182 if(m_av!=null)
183 {
184 if(m_av.started)
185 {
186 if(mask==(1))
187 {
188 if(!m_av.walk)
189 {
190 //start walking
191 agent_man.send_move_command(User_info,false,m_av.pos.X,m_av.pos.Y,m_av.pos.Z,0,ag.AgentData.BodyRotation);
192 Axiom.MathLib.Vector3 v3=new Axiom.MathLib.Vector3(1,0,0);
193 Axiom.MathLib.Quaternion q=new Axiom.MathLib.Quaternion(ag.AgentData.BodyRotation.W,ag.AgentData.BodyRotation.X,ag.AgentData.BodyRotation.Y,ag.AgentData.BodyRotation.Z);
194 Axiom.MathLib.Vector3 direc=q*v3;
195 direc.Normalize();
196 direc=direc*((0.03f)*128f);
197
198 m_av.vel.X=direc.x;
199 m_av.vel.Y=direc.y;
200 m_av.vel.Z=direc.z;
201 m_av.walk=true;
202 }
203 }
204 else{
205 if(m_av.walk)
206 {
207 //walking but key not pressed so need to stop
208 agent_man.send_move_command(User_info,true,m_av.pos.X,m_av.pos.Y,m_av.pos.Z,0,ag.AgentData.BodyRotation);
209 m_av.walk=false;
210 m_av.vel.X=0;
211 m_av.vel.Y=0;
212 m_av.vel.Z=0;
213 }
214 }
215 }}
216 }
217
218 if(pack.Type==PacketType.ChatFromViewer)
219 {
220 ChatFromViewerPacket chat=(ChatFromViewerPacket)pack;
221 System.Text.Encoding enc = System.Text.Encoding.ASCII;
222
223 string myString = enc.GetString(chat.ChatData.Message );
224 if(myString!="")
225 {
226 string [] comp= new string[10];
227 string delimStr = " , ";
228 char [] delimiter = delimStr.ToCharArray();
229 string line;
230
231 line=myString;
232 comp=line.Split(delimiter);
233 if(comp[0]=="pos")
234 {
235 }
236 else if(comp[0]=="veloc")
237 {
238 }
239 else
240 {
241 agent_man.send_chat_message(User_info,line);
242
243 }
244 }
245 }
246 }
247 public void new_user(User_Agent_info User_info)
248 {
249 this.richTextBox1.Text=this.richTextBox1.Text+"\n "+"new user - "+User_info.AgentID.ToString()+" - has joined";
250 this.richTextBox1.Text=this.richTextBox1.Text+"\n "+"session id := "+User_info.SessionID.ToString();
251 agent_man.New_Agent(User_info);
252
253 }
254
255 public void error(string text)
256 {
257 this.richTextBox1.Text=this.richTextBox1.Text+"\n error report: "+text;
258 }
259
260 void Timer1Tick(object sender, System.EventArgs e)
261 {
262 this.time++;
263 agent_man.tick();
264 texture_man.Do_work(time);
265 }
266
267
268 }
269
270}
diff --git a/Main-sever.resx b/Main-sever.resx
deleted file mode 100644
index 6999fbf..0000000
--- a/Main-sever.resx
+++ /dev/null
@@ -1,123 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<root>
3 <!--
4 Microsoft ResX Schema
5
6 Version 2.0
7
8 The primary goals of this format is to allow a simple XML format
9 that is mostly human readable. The generation and parsing of the
10 various data types are done through the TypeConverter classes
11 associated with the data types.
12
13 Example:
14
15 ... ado.net/XML headers & schema ...
16 <resheader name="resmimetype">text/microsoft-resx</resheader>
17 <resheader name="version">2.0</resheader>
18 <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19 <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20 <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21 <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22 <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23 <value>[base64 mime encoded serialized .NET Framework object]</value>
24 </data>
25 <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26 <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27 <comment>This is a comment</comment>
28 </data>
29
30 There are any number of "resheader" rows that contain simple
31 name/value pairs.
32
33 Each data row contains a name, and value. The row also contains a
34 type or mimetype. Type corresponds to a .NET class that support
35 text/value conversion through the TypeConverter architecture.
36 Classes that don't support this are serialized and stored with the
37 mimetype set.
38
39 The mimetype is used for serialized objects, and tells the
40 ResXResourceReader how to depersist the object. This is currently not
41 extensible. For a given mimetype the value must be set accordingly:
42
43 Note - application/x-microsoft.net.object.binary.base64 is the format
44 that the ResXResourceWriter will generate, however the reader can
45 read any of the formats listed below.
46
47 mimetype: application/x-microsoft.net.object.binary.base64
48 value : The object must be serialized with
49 : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50 : and then encoded with base64 encoding.
51
52 mimetype: application/x-microsoft.net.object.soap.base64
53 value : The object must be serialized with
54 : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55 : and then encoded with base64 encoding.
56
57 mimetype: application/x-microsoft.net.object.bytearray.base64
58 value : The object must be serialized into a byte array
59 : using a System.ComponentModel.TypeConverter
60 : and then encoded with base64 encoding.
61 -->
62 <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63 <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64 <xsd:element name="root" msdata:IsDataSet="true">
65 <xsd:complexType>
66 <xsd:choice maxOccurs="unbounded">
67 <xsd:element name="metadata">
68 <xsd:complexType>
69 <xsd:sequence>
70 <xsd:element name="value" type="xsd:string" minOccurs="0" />
71 </xsd:sequence>
72 <xsd:attribute name="name" use="required" type="xsd:string" />
73 <xsd:attribute name="type" type="xsd:string" />
74 <xsd:attribute name="mimetype" type="xsd:string" />
75 <xsd:attribute ref="xml:space" />
76 </xsd:complexType>
77 </xsd:element>
78 <xsd:element name="assembly">
79 <xsd:complexType>
80 <xsd:attribute name="alias" type="xsd:string" />
81 <xsd:attribute name="name" type="xsd:string" />
82 </xsd:complexType>
83 </xsd:element>
84 <xsd:element name="data">
85 <xsd:complexType>
86 <xsd:sequence>
87 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89 </xsd:sequence>
90 <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91 <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92 <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93 <xsd:attribute ref="xml:space" />
94 </xsd:complexType>
95 </xsd:element>
96 <xsd:element name="resheader">
97 <xsd:complexType>
98 <xsd:sequence>
99 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100 </xsd:sequence>
101 <xsd:attribute name="name" type="xsd:string" use="required" />
102 </xsd:complexType>
103 </xsd:element>
104 </xsd:choice>
105 </xsd:complexType>
106 </xsd:element>
107 </xsd:schema>
108 <resheader name="resmimetype">
109 <value>text/microsoft-resx</value>
110 </resheader>
111 <resheader name="version">
112 <value>2.0</value>
113 </resheader>
114 <resheader name="reader">
115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116 </resheader>
117 <resheader name="writer">
118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 </resheader>
120 <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121 <value>17, 17</value>
122 </metadata>
123</root> \ No newline at end of file
diff --git a/Prim_manager.cs b/Prim_manager.cs
index dff2d24..da1d626 100644
--- a/Prim_manager.cs
+++ b/Prim_manager.cs
@@ -258,7 +258,7 @@ namespace Second_server
258 objupdate.ObjectData=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[num]; 258 objupdate.ObjectData=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[num];
259 259
260 // int count=0; 260 // int count=0;
261 string data_path=System.Windows.Forms.Application.StartupPath + @"\data\"; 261 string data_path = System.AppDomain.CurrentDomain.BaseDirectory + @"\data\";
262 for(int cc=0; cc<num; cc++) 262 for(int cc=0; cc<num; cc++)
263 { 263 {
264 string filenam=data_path+@"prim_updates"+start+".dat"; 264 string filenam=data_path+@"prim_updates"+start+".dat";
diff --git a/Second-server.csproj b/Second-server.csproj
index 4823611..79db97f 100644
--- a/Second-server.csproj
+++ b/Second-server.csproj
@@ -1,7 +1,7 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup> 2 <PropertyGroup>
3 <OutputType>Exe</OutputType> 3 <OutputType>Exe</OutputType>
4 <RootNamespace>Second_server</RootNamespace> 4 <RootNamespace>Controller</RootNamespace>
5 <AssemblyName>Second-server</AssemblyName> 5 <AssemblyName>Second-server</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -24,32 +24,22 @@
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> 24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup> 25 </PropertyGroup>
26 <ItemGroup> 26 <ItemGroup>
27 <Reference Include="System" /> 27 <Reference Include="Axiom.MathLib, Version=0.7.0.25497, Culture=neutral">
28 <Reference Include="System.Data" />
29 <Reference Include="System.Drawing" />
30 <Reference Include="System.Windows.Forms" />
31 <Reference Include="System.Xml" />
32 <Reference Include="Axiom.MathLib">
33 <HintPath>bin\Release\Axiom.MathLib.dll</HintPath>
34 <SpecificVersion>False</SpecificVersion> 28 <SpecificVersion>False</SpecificVersion>
29 <HintPath>lib\Axiom.MathLib.dll</HintPath>
35 </Reference> 30 </Reference>
36 <Reference Include="libsecondlife"> 31 <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
37 <HintPath>bin\Release\libsecondlife.dll</HintPath>
38 <SpecificVersion>False</SpecificVersion> 32 <SpecificVersion>False</SpecificVersion>
33 <HintPath>lib\log4net.dll</HintPath>
39 </Reference> 34 </Reference>
35 <Reference Include="System" />
36 <Reference Include="System.Data" />
37 <Reference Include="System.Xml" />
40 </ItemGroup> 38 </ItemGroup>
41 <ItemGroup> 39 <ItemGroup>
42 <Compile Include="AssemblyInfo.cs" /> 40 <Compile Include="AssemblyInfo.cs" />
43 <Compile Include="Main-sever.Designer.cs">
44 <DependentUpon>Main-sever.cs</DependentUpon>
45 </Compile>
46 <Compile Include="Main-sever.cs">
47 <SubType>Form</SubType>
48 </Compile>
49 <EmbeddedResource Include="Main-sever.resx">
50 <DependentUpon>Main-sever.cs</DependentUpon>
51 </EmbeddedResource>
52 <Compile Include="Agent_Manager.cs" /> 41 <Compile Include="Agent_Manager.cs" />
42 <Compile Include="Controller.cs" />
53 <Compile Include="Prim_manager.cs" /> 43 <Compile Include="Prim_manager.cs" />
54 <Compile Include="Texture_manager.cs" /> 44 <Compile Include="Texture_manager.cs" />
55 <Compile Include="Login_manager.cs" /> 45 <Compile Include="Login_manager.cs" />
@@ -58,5 +48,11 @@
58 <Compile Include="Script_manager.cs" /> 48 <Compile Include="Script_manager.cs" />
59 <Compile Include="Server.cs" /> 49 <Compile Include="Server.cs" />
60 </ItemGroup> 50 </ItemGroup>
51 <ItemGroup>
52 <ProjectReference Include="..\..\libsecondlife\libsecondlife-cs\libsecondlife.csproj">
53 <Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
54 <Name>libsecondlife</Name>
55 </ProjectReference>
56 </ItemGroup>
61 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> 57 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
62</Project> \ No newline at end of file 58</Project> \ No newline at end of file
diff --git a/Second-server.sln b/Second-server.sln
index 0106f61..9cdd672 100644
--- a/Second-server.sln
+++ b/Second-server.sln
@@ -1,17 +1,34 @@
1 1
2Microsoft Visual Studio Solution File, Format Version 9.00 2Microsoft Visual Studio Solution File, Format Version 9.00
3# SharpDevelop 2.1.0.2017 3# Visual Studio 2005
4Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second-server", "Second-server.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}" 4Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second-server", "Second-server.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}"
5EndProject 5EndProject
6Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libsecondlife", "..\..\libsecondlife\libsecondlife-cs\libsecondlife.csproj", "{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}"
7EndProject
6Global 8Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 Debug|.NET 1.1 = Debug|.NET 1.1
8 Debug|Any CPU = Debug|Any CPU 11 Debug|Any CPU = Debug|Any CPU
12 Release|.NET 1.1 = Release|.NET 1.1
9 Release|Any CPU = Release|Any CPU 13 Release|Any CPU = Release|Any CPU
10 EndGlobalSection 14 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution 15 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|.NET 1.1.ActiveCfg = Debug|Any CPU
13 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.Build.0 = Release|Any CPU 18 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.Build.0 = Debug|Any CPU
19 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|.NET 1.1.ActiveCfg = Release|Any CPU
15 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.ActiveCfg = Release|Any CPU 20 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.Build.0 = Release|Any CPU
22 {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Debug|.NET 1.1.ActiveCfg = Debug|.NET 1.1
23 {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Debug|.NET 1.1.Build.0 = Debug|.NET 1.1
24 {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Release|.NET 1.1.ActiveCfg = Release|.NET 1.1
27 {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Release|.NET 1.1.Build.0 = Release|.NET 1.1
28 {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}.Release|Any CPU.Build.0 = Release|Any CPU
30 EndGlobalSection
31 GlobalSection(SolutionProperties) = preSolution
32 HideSolutionNode = FALSE
16 EndGlobalSection 33 EndGlobalSection
17EndGlobal 34EndGlobal
diff --git a/Server.cs b/Server.cs
index 1917922..7bc4050 100644
--- a/Server.cs
+++ b/Server.cs
@@ -1,5 +1,5 @@
1/* 1/*
2 * * Copyright (c) <year>, <copyright holder> 2 * Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3* All rights reserved. 3* All rights reserved.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
diff --git a/Texture_manager.cs b/Texture_manager.cs
index 990557e..1321358 100644
--- a/Texture_manager.cs
+++ b/Texture_manager.cs
@@ -169,7 +169,7 @@ namespace Second_server
169 } 169 }
170 private void load_image(Texture_image im) 170 private void load_image(Texture_image im)
171 { 171 {
172 string data_path=System.Windows.Forms.Application.StartupPath + @"\textures\"; 172 string data_path=System.AppDomain.CurrentDomain.BaseDirectory + @"\textures\";
173 string filename=data_path+@im.filename; 173 string filename=data_path+@im.filename;
174 FileInfo fInfo = new FileInfo(filename); 174 FileInfo fInfo = new FileInfo(filename);
175 175
diff --git a/lib/Axiom.MathLib.dll b/lib/Axiom.MathLib.dll
new file mode 100644
index 0000000..21ce3a8
--- /dev/null
+++ b/lib/Axiom.MathLib.dll
Binary files differ
diff --git a/lib/log4net.dll b/lib/log4net.dll
new file mode 100644
index 0000000..ffc57e1
--- /dev/null
+++ b/lib/log4net.dll
Binary files differ