diff options
author | MW | 2007-02-03 21:09:54 +0000 |
---|---|---|
committer | MW | 2007-02-03 21:09:54 +0000 |
commit | dc2316de9c7a7168263e7a367b4c69189f9bc232 (patch) | |
tree | 57b639a77d585f5ded98f283d24a02617faf5b1a | |
parent | (no commit message) (diff) | |
download | opensim-SC-dc2316de9c7a7168263e7a367b4c69189f9bc232.zip opensim-SC-dc2316de9c7a7168263e7a367b4c69189f9bc232.tar.gz opensim-SC-dc2316de9c7a7168263e7a367b4c69189f9bc232.tar.bz2 opensim-SC-dc2316de9c7a7168263e7a367b4c69189f9bc232.tar.xz |
Basic Inventory support and clean up
Diffstat (limited to '')
-rw-r--r-- | Agent_Manager.cs | 367 | ||||
-rw-r--r-- | AssetManagement.cs | 95 | ||||
-rw-r--r-- | Controller.cs | 75 | ||||
-rw-r--r-- | InventoryManager.cs | 56 | ||||
-rw-r--r-- | Login_manager.cs | 59 | ||||
-rw-r--r-- | Prim_manager.cs | 305 | ||||
-rw-r--r-- | Server.cs | 188 |
7 files changed, 503 insertions, 642 deletions
diff --git a/Agent_Manager.cs b/Agent_Manager.cs index 2f5ceba..769ee2a 100644 --- a/Agent_Manager.cs +++ b/Agent_Manager.cs | |||
@@ -207,30 +207,18 @@ namespace OpenSim | |||
207 | /// <param name="name"></param> | 207 | /// <param name="name"></param> |
208 | private void SetupTemplate(string name) | 208 | private void SetupTemplate(string name) |
209 | { | 209 | { |
210 | /*ObjectUpdatePacket objupdate=new ObjectUpdatePacket(); | 210 | |
211 | objupdate.RegionData.RegionHandle=1096213093147648; | ||
212 | objupdate.RegionData.TimeDilation=64096; | ||
213 | objupdate.ObjectData=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; | ||
214 | */ | ||
215 | int i=0; | 211 | int i=0; |
216 | FileInfo fInfo = new FileInfo(name); | 212 | FileInfo fInfo = new FileInfo(name); |
217 | |||
218 | long numBytes = fInfo.Length; | 213 | long numBytes = fInfo.Length; |
219 | |||
220 | FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); | 214 | FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); |
221 | |||
222 | BinaryReader br = new BinaryReader(fStream); | 215 | BinaryReader br = new BinaryReader(fStream); |
223 | |||
224 | byte [] data1 = br.ReadBytes((int)numBytes); | 216 | byte [] data1 = br.ReadBytes((int)numBytes); |
225 | |||
226 | br.Close(); | 217 | br.Close(); |
227 | |||
228 | fStream.Close(); | 218 | fStream.Close(); |
229 | 219 | ||
230 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1,ref i); | 220 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1,ref i); |
231 | 221 | ||
232 | //objupdate.ObjectData[0]=objdata; | ||
233 | |||
234 | System.Text.Encoding enc = System.Text.Encoding.ASCII; | 222 | System.Text.Encoding enc = System.Text.Encoding.ASCII; |
235 | libsecondlife.LLVector3 pos=new LLVector3(objdata.ObjectData, 16); | 223 | libsecondlife.LLVector3 pos=new LLVector3(objdata.ObjectData, 16); |
236 | pos.X=100f; | 224 | pos.X=100f; |
@@ -238,8 +226,7 @@ namespace OpenSim | |||
238 | objdata.NameValue=enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); | 226 | objdata.NameValue=enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); |
239 | libsecondlife.LLVector3 pos2=new LLVector3(13.981f,100.0f,20.0f); | 227 | libsecondlife.LLVector3 pos2=new LLVector3(13.981f,100.0f,20.0f); |
240 | //objdata.FullID=user.AgentID; | 228 | //objdata.FullID=user.AgentID; |
241 | byte[] pb=pos.GetBytes(); | 229 | byte[] pb=pos.GetBytes(); |
242 | |||
243 | Array.Copy(pb,0,objdata.ObjectData,16,pb.Length); | 230 | Array.Copy(pb,0,objdata.ObjectData,16,pb.Length); |
244 | 231 | ||
245 | AvatarTemplate=objdata; | 232 | AvatarTemplate=objdata; |
@@ -254,50 +241,50 @@ namespace OpenSim | |||
254 | { | 241 | { |
255 | 242 | ||
256 | //shouldn't have to read all this in from disk for every new client | 243 | //shouldn't have to read all this in from disk for every new client |
257 | string data_path=System.AppDomain.CurrentDomain.BaseDirectory + @"\layer_data\"; | 244 | string data_path=System.AppDomain.CurrentDomain.BaseDirectory + @"\layer_data\"; |
258 | 245 | ||
259 | //send layerdata | 246 | //send layerdata |
260 | LayerDataPacket layerpack=new LayerDataPacket(); | 247 | LayerDataPacket layerpack=new LayerDataPacket(); |
261 | layerpack.LayerID.Type=76; | 248 | layerpack.LayerID.Type=76; |
262 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata0.dat"); | 249 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata0.dat"); |
263 | 250 | ||
264 | LayerDataPacket layerpack1=new LayerDataPacket(); | 251 | LayerDataPacket layerpack1=new LayerDataPacket(); |
265 | layerpack1.LayerID.Type=76; | 252 | layerpack1.LayerID.Type=76; |
266 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata1.dat"); | 253 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata1.dat"); |
267 | 254 | ||
268 | LayerDataPacket layerpack2=new LayerDataPacket(); | 255 | LayerDataPacket layerpack2=new LayerDataPacket(); |
269 | layerpack2.LayerID.Type=56; | 256 | layerpack2.LayerID.Type=56; |
270 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata2.dat"); | 257 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata2.dat"); |
271 | 258 | ||
272 | LayerDataPacket layerpack3=new LayerDataPacket(); | 259 | LayerDataPacket layerpack3=new LayerDataPacket(); |
273 | layerpack3.LayerID.Type=55; | 260 | layerpack3.LayerID.Type=55; |
274 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata3.dat"); | 261 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata3.dat"); |
275 | 262 | ||
276 | LayerDataPacket layerpack4=new LayerDataPacket(); | 263 | LayerDataPacket layerpack4=new LayerDataPacket(); |
277 | layerpack4.LayerID.Type=56; | 264 | layerpack4.LayerID.Type=56; |
278 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata4.dat"); | 265 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata4.dat"); |
279 | 266 | ||
280 | LayerDataPacket layerpack5=new LayerDataPacket(); | 267 | LayerDataPacket layerpack5=new LayerDataPacket(); |
281 | layerpack5.LayerID.Type=55; | 268 | layerpack5.LayerID.Type=55; |
282 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata5.dat"); | 269 | this.SendLayerData(User_info,ref layerpack,data_path+@"layerdata5.dat"); |
283 | 270 | ||
284 | //send intial set of captured prims data? | 271 | //send intial set of captured prims data? |
285 | this.Prim_Manager.ReadPrimDatabase( "objectdatabase.ini",User_info); | 272 | this.Prim_Manager.ReadPrimDatabase( "objectdatabase.ini",User_info); |
286 | 273 | ||
287 | //send prims that have been created by users | 274 | //send prims that have been created by users |
288 | //prim_man.send_existing_prims(User_info); | 275 | //prim_man.send_existing_prims(User_info); |
289 | 276 | ||
290 | //send update about clients avatar | 277 | //send update about clients avatar |
291 | this.SendInitialAvatarPosition(User_info); | 278 | this.SendInitialAvatarPosition(User_info); |
292 | 279 | ||
293 | //send updates about all other users | 280 | //send updates about all other users |
294 | foreach (KeyValuePair<libsecondlife.LLUUID,AvatarData> kp in this.AgentList) | 281 | foreach (KeyValuePair<libsecondlife.LLUUID,AvatarData> kp in this.AgentList) |
282 | { | ||
283 | if(kp.Value.NetInfo.AgentID!=User_info.AgentID) | ||
295 | { | 284 | { |
296 | if(kp.Value.NetInfo.AgentID!=User_info.AgentID) | 285 | this.SendOtherAvatarPosition(User_info,kp.Value); |
297 | { | 286 | } |
298 | this.SendOtherAvatarPosition(User_info,kp.Value); | 287 | } |
299 | } | ||
300 | } | ||
301 | } | 288 | } |
302 | 289 | ||
303 | /// <summary> | 290 | /// <summary> |
@@ -456,26 +443,26 @@ namespace OpenSim | |||
456 | /// <param name="line"></param> | 443 | /// <param name="line"></param> |
457 | public void SendChatMessage(User_Agent_info User_info, string line) | 444 | public void SendChatMessage(User_Agent_info User_info, string line) |
458 | { | 445 | { |
459 | libsecondlife.Packets.ChatFromSimulatorPacket reply=new ChatFromSimulatorPacket(); | 446 | libsecondlife.Packets.ChatFromSimulatorPacket reply=new ChatFromSimulatorPacket(); |
460 | reply.ChatData.Audible=1; | 447 | reply.ChatData.Audible=1; |
461 | reply.ChatData.Message=enc.GetBytes(line); | 448 | reply.ChatData.Message=enc.GetBytes(line); |
462 | reply.ChatData.ChatType=1; | 449 | reply.ChatData.ChatType=1; |
463 | reply.ChatData.SourceType=1; | 450 | reply.ChatData.SourceType=1; |
464 | reply.ChatData.Position=new LLVector3(120,100,21); //should set to actual position | 451 | reply.ChatData.Position=new LLVector3(120,100,21); //should set to actual position |
465 | reply.ChatData.FromName=enc.GetBytes(User_info.first_name +" "+User_info.last_name +"\0"); //enc.GetBytes("Echo: \0"); //and actual name | 452 | reply.ChatData.FromName=enc.GetBytes(User_info.first_name +" "+User_info.last_name +"\0"); //enc.GetBytes("Echo: \0"); //and actual name |
466 | reply.ChatData.OwnerID=User_info.AgentID; | 453 | reply.ChatData.OwnerID=User_info.AgentID; |
467 | reply.ChatData.SourceID=User_info.AgentID; | 454 | reply.ChatData.SourceID=User_info.AgentID; |
468 | //echo to sender | 455 | //echo to sender |
469 | server.SendPacket(reply,true,User_info); | 456 | server.SendPacket(reply,true,User_info); |
470 | 457 | ||
471 | //send to all users | 458 | //send to all users |
472 | foreach (KeyValuePair<libsecondlife.LLUUID,AvatarData> kp in this.AgentList) | 459 | foreach (KeyValuePair<libsecondlife.LLUUID,AvatarData> kp in this.AgentList) |
473 | { | 460 | { |
474 | if(kp.Value.NetInfo.AgentID!=User_info.AgentID) | 461 | if(kp.Value.NetInfo.AgentID!=User_info.AgentID) |
475 | { | 462 | { |
476 | server.SendPacket(reply,true,kp.Value.NetInfo); | 463 | server.SendPacket(reply,true,kp.Value.NetInfo); |
477 | } | 464 | } |
478 | } | 465 | } |
479 | } | 466 | } |
480 | 467 | ||
481 | /// <summary> | 468 | /// <summary> |
@@ -490,121 +477,121 @@ namespace OpenSim | |||
490 | /// <param name="body"></param> | 477 | /// <param name="body"></param> |
491 | public void SendMoveCommand(User_Agent_info user, bool stop,float x, float y, float z, uint av_id, libsecondlife.LLQuaternion body) | 478 | public void SendMoveCommand(User_Agent_info user, bool stop,float x, float y, float z, uint av_id, libsecondlife.LLQuaternion body) |
492 | { | 479 | { |
493 | uint ID=user.localID; | 480 | uint ID=user.localID; |
494 | //ID=av_id; | 481 | //ID=av_id; |
495 | byte[] bytes=new byte[60]; | 482 | byte[] bytes=new byte[60]; |
496 | 483 | ||
497 | ImprovedTerseObjectUpdatePacket im=new ImprovedTerseObjectUpdatePacket(); | 484 | ImprovedTerseObjectUpdatePacket im=new ImprovedTerseObjectUpdatePacket(); |
498 | im.RegionData.RegionHandle=Globals.Instance.RegionHandle;; | 485 | im.RegionData.RegionHandle=Globals.Instance.RegionHandle;; |
499 | im.RegionData.TimeDilation=64096; | 486 | im.RegionData.TimeDilation=64096; |
500 | 487 | ||
501 | im.ObjectData=new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 488 | im.ObjectData=new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
502 | int i=0; | 489 | int i=0; |
503 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat=new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); | 490 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat=new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); |
504 | 491 | ||
505 | im.ObjectData[0]=dat; | 492 | im.ObjectData[0]=dat; |
506 | 493 | ||
507 | dat.TextureEntry=AvatarTemplate.TextureEntry; | 494 | dat.TextureEntry=AvatarTemplate.TextureEntry; |
508 | libsecondlife.LLVector3 pos2=new LLVector3(x,y,z); | 495 | libsecondlife.LLVector3 pos2=new LLVector3(x,y,z); |
509 | 496 | ||
510 | bytes[i++] = (byte)(ID % 256); | 497 | bytes[i++] = (byte)(ID % 256); |
511 | bytes[i++] = (byte)((ID >> 8) % 256); | 498 | bytes[i++] = (byte)((ID >> 8) % 256); |
512 | bytes[i++] = (byte)((ID >> 16) % 256); | 499 | bytes[i++] = (byte)((ID >> 16) % 256); |
513 | bytes[i++] = (byte)((ID >> 24) % 256); | 500 | bytes[i++] = (byte)((ID >> 24) % 256); |
514 | 501 | ||
515 | bytes[i++]=0; | 502 | bytes[i++]=0; |
516 | bytes[i++]=1; | 503 | bytes[i++]=1; |
517 | 504 | ||
518 | i+=14; | 505 | i+=14; |
519 | bytes[i++]=128; | 506 | bytes[i++]=128; |
520 | bytes[i++]=63; | 507 | bytes[i++]=63; |
521 | byte[] pb=pos2.GetBytes(); | 508 | byte[] pb=pos2.GetBytes(); |
522 | 509 | ||
523 | Array.Copy(pb,0,bytes,i,pb.Length); | 510 | Array.Copy(pb,0,bytes,i,pb.Length); |
524 | i+=12; | 511 | i+=12; |
525 | ushort ac=32767; | 512 | ushort ac=32767; |
526 | Axiom.MathLib.Vector3 v3=new Axiom.MathLib.Vector3(1,0,0); | 513 | Axiom.MathLib.Vector3 v3=new Axiom.MathLib.Vector3(1,0,0); |
527 | Axiom.MathLib.Quaternion q=new Axiom.MathLib.Quaternion(body.W,body.X,body.Y,body.Z); | 514 | Axiom.MathLib.Quaternion q=new Axiom.MathLib.Quaternion(body.W,body.X,body.Y,body.Z); |
528 | Axiom.MathLib.Vector3 direc=q*v3; | 515 | Axiom.MathLib.Vector3 direc=q*v3; |
529 | direc.Normalize(); | 516 | direc.Normalize(); |
530 | 517 | ||
531 | direc=direc*(0.03f); | 518 | direc=direc*(0.03f); |
532 | direc.x+=1; | 519 | direc.x+=1; |
533 | direc.y+=1; | 520 | direc.y+=1; |
534 | direc.z+=1; | 521 | direc.z+=1; |
535 | ushort dx,dy,dz; | 522 | ushort dx,dy,dz; |
536 | dx=(ushort)(32768*direc.x); | 523 | dx=(ushort)(32768*direc.x); |
537 | dy=(ushort)(32768*direc.y); | 524 | dy=(ushort)(32768*direc.y); |
538 | dz=(ushort)(32768*direc.z); | 525 | dz=(ushort)(32768*direc.z); |
539 | 526 | ||
540 | //vel | 527 | //vel |
541 | if(!stop) | 528 | if(!stop) |
542 | { | 529 | { |
543 | bytes[i++] = (byte)(dx % 256); | 530 | bytes[i++] = (byte)(dx % 256); |
544 | bytes[i++] = (byte)((dx >> 8) % 256); | 531 | bytes[i++] = (byte)((dx >> 8) % 256); |
545 | 532 | ||
546 | bytes[i++] = (byte)(dy % 256); | 533 | bytes[i++] = (byte)(dy % 256); |
547 | bytes[i++] = (byte)((dy >> 8) % 256); | 534 | bytes[i++] = (byte)((dy >> 8) % 256); |
548 | 535 | ||
549 | bytes[i++] = (byte)(dz % 256); | 536 | bytes[i++] = (byte)(dz % 256); |
550 | bytes[i++] = (byte)((dz >> 8) % 256); | 537 | bytes[i++] = (byte)((dz >> 8) % 256); |
551 | } | 538 | } |
552 | else | 539 | else |
553 | { | 540 | { |
554 | bytes[i++] = (byte)(ac % 256); | 541 | bytes[i++] = (byte)(ac % 256); |
555 | bytes[i++] = (byte)((ac >> 8) % 256); | 542 | bytes[i++] = (byte)((ac >> 8) % 256); |
556 | 543 | ||
557 | bytes[i++] = (byte)(ac % 256); | 544 | bytes[i++] = (byte)(ac % 256); |
558 | bytes[i++] = (byte)((ac >> 8) % 256); | 545 | bytes[i++] = (byte)((ac >> 8) % 256); |
559 | 546 | ||
560 | bytes[i++] = (byte)(ac % 256); | 547 | bytes[i++] = (byte)(ac % 256); |
561 | bytes[i++] = (byte)((ac >> 8) % 256); | 548 | bytes[i++] = (byte)((ac >> 8) % 256); |
562 | } | 549 | } |
563 | //accel | 550 | //accel |
564 | bytes[i++] = (byte)(ac % 256); | 551 | bytes[i++] = (byte)(ac % 256); |
565 | bytes[i++] = (byte)((ac >> 8) % 256); | 552 | bytes[i++] = (byte)((ac >> 8) % 256); |
566 | 553 | ||
567 | bytes[i++] = (byte)(ac % 256); | 554 | bytes[i++] = (byte)(ac % 256); |
568 | bytes[i++] = (byte)((ac >> 8) % 256); | 555 | bytes[i++] = (byte)((ac >> 8) % 256); |
569 | 556 | ||
570 | bytes[i++] = (byte)(ac % 256); | 557 | bytes[i++] = (byte)(ac % 256); |
571 | bytes[i++] = (byte)((ac >> 8) % 256); | 558 | bytes[i++] = (byte)((ac >> 8) % 256); |
572 | 559 | ||
573 | //rot | 560 | //rot |
574 | bytes[i++] = (byte)(ac % 256); | 561 | bytes[i++] = (byte)(ac % 256); |
575 | bytes[i++] = (byte)((ac >> 8) % 256); | 562 | bytes[i++] = (byte)((ac >> 8) % 256); |
576 | 563 | ||
577 | bytes[i++] = (byte)(ac % 256); | 564 | bytes[i++] = (byte)(ac % 256); |
578 | bytes[i++] = (byte)((ac >> 8) % 256); | 565 | bytes[i++] = (byte)((ac >> 8) % 256); |
579 | 566 | ||
580 | bytes[i++] = (byte)(ac % 256); | 567 | bytes[i++] = (byte)(ac % 256); |
581 | bytes[i++] = (byte)((ac >> 8) % 256); | 568 | bytes[i++] = (byte)((ac >> 8) % 256); |
582 | 569 | ||
583 | bytes[i++] = (byte)(ac % 256); | 570 | bytes[i++] = (byte)(ac % 256); |
584 | bytes[i++] = (byte)((ac >> 8) % 256); | 571 | bytes[i++] = (byte)((ac >> 8) % 256); |
585 | 572 | ||
586 | //rotation vel | 573 | //rotation vel |
587 | bytes[i++] = (byte)(ac % 256); | 574 | bytes[i++] = (byte)(ac % 256); |
588 | bytes[i++] = (byte)((ac >> 8) % 256); | 575 | bytes[i++] = (byte)((ac >> 8) % 256); |
589 | 576 | ||
590 | bytes[i++] = (byte)(ac % 256); | 577 | bytes[i++] = (byte)(ac % 256); |
591 | bytes[i++] = (byte)((ac >> 8) % 256); | 578 | bytes[i++] = (byte)((ac >> 8) % 256); |
592 | 579 | ||
593 | bytes[i++] = (byte)(ac % 256); | 580 | bytes[i++] = (byte)(ac % 256); |
594 | bytes[i++] = (byte)((ac >> 8) % 256); | 581 | bytes[i++] = (byte)((ac >> 8) % 256); |
595 | 582 | ||
596 | dat.Data=bytes; | 583 | dat.Data=bytes; |
597 | 584 | ||
598 | server.SendPacket(im,true,user); | 585 | server.SendPacket(im,true,user); |
599 | 586 | ||
600 | //should send to all users. | 587 | //should send to all users. |
601 | foreach (KeyValuePair<libsecondlife.LLUUID,AvatarData> kp in this.AgentList) | 588 | foreach (KeyValuePair<libsecondlife.LLUUID,AvatarData> kp in this.AgentList) |
602 | { | 589 | { |
603 | if(kp.Value.NetInfo.AgentID!=user.AgentID) | 590 | if(kp.Value.NetInfo.AgentID!=user.AgentID) |
604 | { | 591 | { |
605 | server.SendPacket(im,true,kp.Value.NetInfo); | 592 | server.SendPacket(im,true,kp.Value.NetInfo); |
606 | } | 593 | } |
607 | } | 594 | } |
608 | } | 595 | } |
609 | 596 | ||
610 | /// <summary> | 597 | /// <summary> |
diff --git a/AssetManagement.cs b/AssetManagement.cs index adc8bd5..a43a969 100644 --- a/AssetManagement.cs +++ b/AssetManagement.cs | |||
@@ -72,14 +72,14 @@ namespace OpenSim | |||
72 | AssetInfo Asset=new AssetInfo(); | 72 | AssetInfo Asset=new AssetInfo(); |
73 | Asset.filename="base_shape.dat"; | 73 | Asset.filename="base_shape.dat"; |
74 | Asset.Full_ID=new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | 74 | Asset.Full_ID=new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); |
75 | this.LoadAsset(Asset); | 75 | this.LoadAsset(Asset, false); |
76 | this.Assets.Add(Asset.Full_ID,Asset); | 76 | this.Assets.Add(Asset.Full_ID, Asset); |
77 | 77 | ||
78 | Asset=new AssetInfo(); | 78 | Asset=new AssetInfo(); |
79 | Asset.filename="base_skin.dat"; | 79 | Asset.filename="base_skin.dat"; |
80 | Asset.Full_ID=new LLUUID("e0ee49b5a4184df8d3c9a65361fe7f49"); | 80 | Asset.Full_ID=new LLUUID("e0ee49b5a4184df8d3c9a65361fe7f49"); |
81 | this.LoadAsset(Asset); | 81 | this.LoadAsset(Asset, false); |
82 | this.Assets.Add(Asset.Full_ID,Asset); | 82 | this.Assets.Add(Asset.Full_ID, Asset); |
83 | 83 | ||
84 | //our test images | 84 | //our test images |
85 | //Change these filenames to images you want to use. | 85 | //Change these filenames to images you want to use. |
@@ -87,20 +87,20 @@ namespace OpenSim | |||
87 | Image.filename="testpic2.jp2"; | 87 | Image.filename="testpic2.jp2"; |
88 | Image.Full_ID=new LLUUID("00000000-0000-0000-5005-000000000005"); | 88 | Image.Full_ID=new LLUUID("00000000-0000-0000-5005-000000000005"); |
89 | Image.Name="test Texture"; | 89 | Image.Name="test Texture"; |
90 | this.LoadImage(Image); | 90 | this.LoadAsset(Image, true); |
91 | this.Textures.Add(Image.Full_ID,Image); | 91 | this.Textures.Add(Image.Full_ID, Image); |
92 | 92 | ||
93 | Image=new TextureImage(); | 93 | Image=new TextureImage(); |
94 | Image.filename="map_base.jp2"; | 94 | Image.filename="map_base.jp2"; |
95 | Image.Full_ID=new LLUUID("00000000-0000-0000-7007-000000000006"); | 95 | Image.Full_ID=new LLUUID("00000000-0000-0000-7007-000000000006"); |
96 | this.LoadImage(Image); | 96 | this.LoadAsset(Image, true); |
97 | this.Textures.Add(Image.Full_ID,Image); | 97 | this.Textures.Add(Image.Full_ID, Image); |
98 | 98 | ||
99 | Image=new TextureImage(); | 99 | Image=new TextureImage(); |
100 | Image.filename="map1.jp2"; | 100 | Image.filename="map1.jp2"; |
101 | Image.Full_ID=new LLUUID("00000000-0000-0000-7009-000000000008"); | 101 | Image.Full_ID=new LLUUID("00000000-0000-0000-7009-000000000008"); |
102 | this.LoadImage(Image); | 102 | this.LoadAsset(Image, true); |
103 | this.Textures.Add(Image.Full_ID,Image); | 103 | this.Textures.Add(Image.Full_ID, Image); |
104 | } | 104 | } |
105 | 105 | ||
106 | /// <summary> | 106 | /// <summary> |
@@ -129,7 +129,7 @@ namespace OpenSim | |||
129 | Transfer.TransferInfo.Size=info.data.Length; | 129 | Transfer.TransferInfo.Size=info.data.Length; |
130 | Transfer.TransferInfo.TransferID=TransferRequest.TransferInfo.TransferID; | 130 | Transfer.TransferInfo.TransferID=TransferRequest.TransferInfo.TransferID; |
131 | 131 | ||
132 | server.SendPacket(Transfer,true,UserInfo); | 132 | server.SendPacket(Transfer, true, UserInfo); |
133 | 133 | ||
134 | TransferPacketPacket TransferPacket=new TransferPacketPacket(); | 134 | TransferPacketPacket TransferPacket=new TransferPacketPacket(); |
135 | TransferPacket.TransferData.Packet=0; | 135 | TransferPacket.TransferData.Packet=0; |
@@ -148,16 +148,16 @@ namespace OpenSim | |||
148 | TransferPacket.TransferData.ChannelType=2; | 148 | TransferPacket.TransferData.ChannelType=2; |
149 | TransferPacket.TransferData.TransferID=TransferRequest.TransferInfo.TransferID; | 149 | TransferPacket.TransferData.TransferID=TransferRequest.TransferInfo.TransferID; |
150 | byte[] chunk1=new byte[(info.data.Length-1000)]; | 150 | byte[] chunk1=new byte[(info.data.Length-1000)]; |
151 | Array.Copy(info.data,1000,chunk1,0,chunk1.Length); | 151 | Array.Copy(info.data, 1000, chunk1, 0, chunk1.Length); |
152 | TransferPacket.TransferData.Data=chunk1; | 152 | TransferPacket.TransferData.Data=chunk1; |
153 | TransferPacket.TransferData.Status=1; | 153 | TransferPacket.TransferData.Status=1; |
154 | server.SendPacket(TransferPacket,true,UserInfo); | 154 | server.SendPacket(TransferPacket, true, UserInfo); |
155 | } | 155 | } |
156 | else | 156 | else |
157 | { | 157 | { |
158 | TransferPacket.TransferData.Status=1; //last packet? so set to 1 | 158 | TransferPacket.TransferData.Status=1; //last packet? so set to 1 |
159 | TransferPacket.TransferData.Data=info.data; | 159 | TransferPacket.TransferData.Data=info.data; |
160 | server.SendPacket(TransferPacket,true,UserInfo); | 160 | server.SendPacket(TransferPacket, true, UserInfo); |
161 | } | 161 | } |
162 | 162 | ||
163 | } | 163 | } |
@@ -166,12 +166,12 @@ namespace OpenSim | |||
166 | { | 166 | { |
167 | //Create Folders | 167 | //Create Folders |
168 | LLUUID BaseFolder=Avata.BaseFolder; | 168 | LLUUID BaseFolder=Avata.BaseFolder; |
169 | InventoryManager.CreateNewFolder(UserInfo,Avata.InventoryFolder); | 169 | InventoryManager.CreateNewFolder(UserInfo, Avata.InventoryFolder); |
170 | InventoryManager.CreateNewFolder(UserInfo, BaseFolder); | 170 | InventoryManager.CreateNewFolder(UserInfo, BaseFolder); |
171 | 171 | ||
172 | //Give a copy of default shape | 172 | //Give a copy of default shape |
173 | AssetInfo Base=this.Assets[new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73")]; | 173 | AssetInfo Base=this.Assets[new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73")]; |
174 | AssetInfo Shape=this.CloneAsset(UserInfo.AgentID,Base); | 174 | AssetInfo Shape=this.CloneAsset(UserInfo.AgentID, Base); |
175 | 175 | ||
176 | Shape.filename=""; | 176 | Shape.filename=""; |
177 | Shape.Name="Default Shape"; | 177 | Shape.Name="Default Shape"; |
@@ -180,15 +180,15 @@ namespace OpenSim | |||
180 | Shape.Type=libsecondlife.AssetSystem.Asset.ASSET_TYPE_WEARABLE_BODY; | 180 | Shape.Type=libsecondlife.AssetSystem.Asset.ASSET_TYPE_WEARABLE_BODY; |
181 | 181 | ||
182 | byte[] Agentid=enc.GetBytes(UserInfo.AgentID.ToStringHyphenated()); | 182 | byte[] Agentid=enc.GetBytes(UserInfo.AgentID.ToStringHyphenated()); |
183 | Array.Copy(Agentid,0,Shape.data,294,Agentid.Length); | 183 | Array.Copy(Agentid, 0, Shape.data, 294, Agentid.Length); |
184 | this.Assets.Add(Shape.Full_ID,Shape); | 184 | this.Assets.Add(Shape.Full_ID, Shape); |
185 | 185 | ||
186 | Avata.Wearables[0].ItemID=InventoryManager.AddToInventory(UserInfo,BaseFolder,Shape); | 186 | Avata.Wearables[0].ItemID=InventoryManager.AddToInventory(UserInfo, BaseFolder, Shape); |
187 | Avata.Wearables[0].AssetID=Shape.Full_ID; | 187 | Avata.Wearables[0].AssetID=Shape.Full_ID; |
188 | 188 | ||
189 | //Give copy of default skin | 189 | //Give copy of default skin |
190 | Base=this.Assets[new LLUUID("e0ee49b5a4184df8d3c9a65361fe7f49")]; | 190 | Base=this.Assets[new LLUUID("e0ee49b5a4184df8d3c9a65361fe7f49")]; |
191 | AssetInfo Skin=this.CloneAsset(UserInfo.AgentID,Base); | 191 | AssetInfo Skin=this.CloneAsset(UserInfo.AgentID, Base); |
192 | 192 | ||
193 | Skin.filename=""; | 193 | Skin.filename=""; |
194 | Skin.Name="Default Skin"; | 194 | Skin.Name="Default Skin"; |
@@ -197,25 +197,33 @@ namespace OpenSim | |||
197 | Skin.Type=libsecondlife.AssetSystem.Asset.ASSET_TYPE_WEARABLE_BODY; | 197 | Skin.Type=libsecondlife.AssetSystem.Asset.ASSET_TYPE_WEARABLE_BODY; |
198 | 198 | ||
199 | Array.Copy(Agentid,0,Skin.data,238,Agentid.Length); | 199 | Array.Copy(Agentid,0,Skin.data,238,Agentid.Length); |
200 | this.Assets.Add(Skin.Full_ID,Skin); | 200 | this.Assets.Add(Skin.Full_ID, Skin); |
201 | 201 | ||
202 | Avata.Wearables[1].ItemID=InventoryManager.AddToInventory(UserInfo,BaseFolder,Skin); | 202 | Avata.Wearables[1].ItemID=InventoryManager.AddToInventory(UserInfo, BaseFolder, Skin); |
203 | Avata.Wearables[1].AssetID=Skin.Full_ID; | 203 | Avata.Wearables[1].AssetID=Skin.Full_ID; |
204 | 204 | ||
205 | //give a copy of test texture | 205 | //give a copy of test texture |
206 | TextureImage Texture=this.CloneImage(UserInfo.AgentID,Textures[new LLUUID("00000000-0000-0000-5005-000000000005")]); | 206 | TextureImage Texture=this.CloneImage(UserInfo.AgentID,Textures[new LLUUID("00000000-0000-0000-5005-000000000005")]); |
207 | this.Textures.Add(Texture.Full_ID,Texture); | 207 | this.Textures.Add(Texture.Full_ID, Texture); |
208 | InventoryManager.AddToInventory(UserInfo,BaseFolder,Texture); | 208 | InventoryManager.AddToInventory(UserInfo, BaseFolder, Texture); |
209 | 209 | ||
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
213 | private void LoadAsset(AssetInfo info) | 213 | private void LoadAsset(AssetBase info, bool Image) |
214 | { | 214 | { |
215 | //should request Asset from storage manager | 215 | //should request Asset from storage manager |
216 | //but for now read from file | 216 | //but for now read from file |
217 | 217 | string folder; | |
218 | string data_path = System.AppDomain.CurrentDomain.BaseDirectory + @"\assets\"; | 218 | if(Image) |
219 | { | ||
220 | folder=@"\textures\"; | ||
221 | } | ||
222 | else | ||
223 | { | ||
224 | folder=@"\assets\"; | ||
225 | } | ||
226 | string data_path = System.AppDomain.CurrentDomain.BaseDirectory + folder; | ||
219 | string filename=data_path+@info.filename; | 227 | string filename=data_path+@info.filename; |
220 | FileInfo fInfo = new FileInfo(filename); | 228 | FileInfo fInfo = new FileInfo(filename); |
221 | 229 | ||
@@ -228,7 +236,7 @@ namespace OpenSim | |||
228 | br.Close(); | 236 | br.Close(); |
229 | fStream.Close(); | 237 | fStream.Close(); |
230 | info.data=idata; | 238 | info.data=idata; |
231 | info.loaded=true; | 239 | //info.loaded=true; |
232 | } | 240 | } |
233 | 241 | ||
234 | public AssetInfo CloneAsset(LLUUID NewOwner, AssetInfo SourceAsset) | 242 | public AssetInfo CloneAsset(LLUUID NewOwner, AssetInfo SourceAsset) |
@@ -252,7 +260,7 @@ namespace OpenSim | |||
252 | //not found image so send back image not in data base message | 260 | //not found image so send back image not in data base message |
253 | ImageNotInDatabasePacket im_not=new ImageNotInDatabasePacket(); | 261 | ImageNotInDatabasePacket im_not=new ImageNotInDatabasePacket(); |
254 | im_not.ImageID.ID=image_id; | 262 | im_not.ImageID.ID=image_id; |
255 | server.SendPacket(im_not,true,user); | 263 | server.SendPacket(im_not, true, user); |
256 | return; | 264 | return; |
257 | } | 265 | } |
258 | TextureImage imag=this.Textures[image_id]; | 266 | TextureImage imag=this.Textures[image_id]; |
@@ -348,27 +356,6 @@ namespace OpenSim | |||
348 | 356 | ||
349 | } | 357 | } |
350 | 358 | ||
351 | private void LoadImage(TextureImage im) | ||
352 | { | ||
353 | //should request Image from StorageManager | ||
354 | //but for now read from file | ||
355 | |||
356 | string data_path=System.AppDomain.CurrentDomain.BaseDirectory + @"\textures\"; | ||
357 | string filename=data_path+@im.filename; | ||
358 | FileInfo fInfo = new FileInfo(filename); | ||
359 | |||
360 | long numBytes = fInfo.Length; | ||
361 | |||
362 | FileStream fStream = new FileStream(filename, FileMode.Open, FileAccess.Read); | ||
363 | byte[] idata=new byte[numBytes]; | ||
364 | BinaryReader br = new BinaryReader(fStream); | ||
365 | idata= br.ReadBytes((int)numBytes); | ||
366 | br.Close(); | ||
367 | fStream.Close(); | ||
368 | im.data=idata; | ||
369 | im.loaded=true; | ||
370 | } | ||
371 | |||
372 | public TextureImage CloneImage(LLUUID NewOwner,TextureImage Source) | 359 | public TextureImage CloneImage(LLUUID NewOwner,TextureImage Source) |
373 | { | 360 | { |
374 | TextureImage NewImage=new TextureImage(); | 361 | TextureImage NewImage=new TextureImage(); |
@@ -401,7 +388,6 @@ namespace OpenSim | |||
401 | { | 388 | { |
402 | //public byte[] data; | 389 | //public byte[] data; |
403 | //public LLUUID Full_ID; | 390 | //public LLUUID Full_ID; |
404 | public string filename; | ||
405 | public bool loaded; | 391 | public bool loaded; |
406 | public ulong last_used; //need to add a tick/time counter and keep record | 392 | public ulong last_used; //need to add a tick/time counter and keep record |
407 | // of how often images are requested to unload unused ones. | 393 | // of how often images are requested to unload unused ones. |
@@ -420,13 +406,14 @@ namespace OpenSim | |||
420 | public sbyte InvType; | 406 | public sbyte InvType; |
421 | public string Name; | 407 | public string Name; |
422 | public string Description; | 408 | public string Description; |
409 | public string filename; | ||
423 | 410 | ||
424 | public AssetBase() | 411 | public AssetBase() |
425 | { | 412 | { |
426 | 413 | ||
427 | } | 414 | } |
428 | } | 415 | } |
429 | public class TextureRequest | 416 | public class TextureRequest |
430 | { | 417 | { |
431 | public User_Agent_info RequestUser; | 418 | public User_Agent_info RequestUser; |
432 | public LLUUID RequestImage; | 419 | public LLUUID RequestImage; |
@@ -442,13 +429,13 @@ namespace OpenSim | |||
442 | } | 429 | } |
443 | public class TextureImage: AssetBase | 430 | public class TextureImage: AssetBase |
444 | { | 431 | { |
432 | //any need for this class now most has been moved into AssetBase? | ||
445 | //public byte[] data; | 433 | //public byte[] data; |
446 | //public LLUUID Full_ID; | 434 | //public LLUUID Full_ID; |
447 | //public string name; | 435 | //public string name; |
448 | public string filename; | ||
449 | public bool loaded; | 436 | public bool loaded; |
450 | public ulong last_used; //need to add a tick/time counter and keep record | 437 | public ulong last_used; //need to add a tick/time counter and keep record |
451 | // of how often images are requested to unload unused ones. | 438 | // of how often images are requested to unload unused ones. |
452 | 439 | ||
453 | public TextureImage() | 440 | public TextureImage() |
454 | { | 441 | { |
diff --git a/Controller.cs b/Controller.cs index 0a6fee9..3ace638 100644 --- a/Controller.cs +++ b/Controller.cs | |||
@@ -58,7 +58,6 @@ namespace OpenSim | |||
58 | public Logon _login; | 58 | public Logon _login; |
59 | private AgentManager Agent_Manager; | 59 | private AgentManager Agent_Manager; |
60 | private PrimManager Prim_Manager; | 60 | private PrimManager Prim_Manager; |
61 | // private TextureManager Texture_Manager; | ||
62 | private AssetManagement Asset_Manager; | 61 | private AssetManagement Asset_Manager; |
63 | private GridManager Grid_Manager; | 62 | private GridManager Grid_Manager; |
64 | private InventoryManager Inventory_Manager; | 63 | private InventoryManager Inventory_Manager; |
@@ -72,21 +71,21 @@ namespace OpenSim | |||
72 | server = new Server( this ); | 71 | server = new Server( this ); |
73 | Agent_Manager = new AgentManager( this.server ); | 72 | Agent_Manager = new AgentManager( this.server ); |
74 | Prim_Manager = new PrimManager( this.server ); | 73 | Prim_Manager = new PrimManager( this.server ); |
75 | // Texture_Manager = new TextureManager( this.server ); | ||
76 | Asset_Manager = new AssetManagement( this.server ); | 74 | Asset_Manager = new AssetManagement( this.server ); |
77 | Prim_Manager.Agent_Manager = Agent_Manager; | 75 | Prim_Manager.Agent_Manager = Agent_Manager; |
78 | Agent_Manager.Prim_Manager = Prim_Manager; | 76 | Agent_Manager.Prim_Manager = Prim_Manager; |
79 | Agent_Manager.Asset_Manager=Asset_Manager; | 77 | Agent_Manager.Asset_Manager=Asset_Manager; |
80 | Inventory_Manager=new InventoryManager(this.server); | 78 | Inventory_Manager=new InventoryManager(this.server); |
81 | Asset_Manager.InventoryManager=Inventory_Manager; | 79 | Asset_Manager.InventoryManager=Inventory_Manager; |
82 | // Asset_Manager.TextureMan=Texture_Manager; | ||
83 | Grid_Manager=new GridManager(this.server,Agent_Manager); | 80 | Grid_Manager=new GridManager(this.server,Agent_Manager); |
81 | |||
84 | if(Globals.Instance.LoginSever) | 82 | if(Globals.Instance.LoginSever) |
85 | { | 83 | { |
86 | Console.WriteLine("Starting login Server"); | 84 | Console.WriteLine("Starting login Server"); |
87 | Login_Manager = new LoginManager(_login); // startup | 85 | Login_Manager = new LoginManager(_login); // startup |
88 | Login_Manager.Startup(); // login server | 86 | Login_Manager.Startup(); // login server |
89 | } | 87 | } |
88 | |||
90 | timer1.Enabled = true; | 89 | timer1.Enabled = true; |
91 | timer1.Interval = 200; | 90 | timer1.Interval = 200; |
92 | timer1.Elapsed +=new ElapsedEventHandler( this.Timer1Tick ); | 91 | timer1.Elapsed +=new ElapsedEventHandler( this.Timer1Tick ); |
@@ -103,7 +102,7 @@ namespace OpenSim | |||
103 | 102 | ||
104 | //should replace with a switch | 103 | //should replace with a switch |
105 | if( pack.Type == PacketType.AgentSetAppearance ) { | 104 | if( pack.Type == PacketType.AgentSetAppearance ) { |
106 | // System.Console.WriteLine(pack); | 105 | //System.Console.WriteLine(pack); |
107 | //this.richTextBox1.Text=this.richTextBox1.Text+"\n "+pack.Type; | 106 | //this.richTextBox1.Text=this.richTextBox1.Text+"\n "+pack.Type; |
108 | 107 | ||
109 | } | 108 | } |
@@ -142,11 +141,8 @@ namespace OpenSim | |||
142 | } | 141 | } |
143 | else if( pack.Type == PacketType.TransferRequest ) { | 142 | else if( pack.Type == PacketType.TransferRequest ) { |
144 | TransferRequestPacket tran = (TransferRequestPacket)pack; | 143 | TransferRequestPacket tran = (TransferRequestPacket)pack; |
145 | LLUUID id = new LLUUID( tran.TransferInfo.Params, 0 ); | 144 | LLUUID id = new LLUUID( tran.TransferInfo.Params, 0 ); |
146 | 145 | Asset_Manager.AddAssetRequest( User_info, id, tran ); | |
147 | // if( ( id == new LLUUID( "66c41e39-38f9-f75a-024e-585989bfab73" ) ) || ( id == new LLUUID( "e0ee49b5a4184df8d3c9a65361fe7f49" ) ) ) { | ||
148 | Asset_Manager.AddAssetRequest( User_info, id, tran ); | ||
149 | // } | ||
150 | 146 | ||
151 | } | 147 | } |
152 | else if( ( pack.Type == PacketType.StartPingCheck ) ) { | 148 | else if( ( pack.Type == PacketType.StartPingCheck ) ) { |
@@ -156,23 +152,26 @@ namespace OpenSim | |||
156 | endping.PingID.PingID = startp.PingID.PingID; | 152 | endping.PingID.PingID = startp.PingID.PingID; |
157 | server.SendPacket( endping, true, User_info ); | 153 | server.SendPacket( endping, true, User_info ); |
158 | } | 154 | } |
159 | else if( pack.Type == PacketType.CompleteAgentMovement ) { | 155 | else if( pack.Type == PacketType.CompleteAgentMovement ) |
156 | { | ||
160 | // new client | 157 | // new client |
161 | Agent_Manager.AgentJoin( User_info ); | 158 | Agent_Manager.AgentJoin( User_info ); |
162 | } | 159 | } |
163 | else if( pack.Type == PacketType.RequestImage ) { | 160 | else if( pack.Type == PacketType.RequestImage ) |
161 | { | ||
164 | RequestImagePacket image_req = (RequestImagePacket)pack; | 162 | RequestImagePacket image_req = (RequestImagePacket)pack; |
165 | for( int i = 0; i < image_req.RequestImage.Length; i++ ) { | 163 | for( int i = 0; i < image_req.RequestImage.Length; i++ ) |
164 | { | ||
166 | this.Asset_Manager.AddTextureRequest( User_info, image_req.RequestImage[ i ].Image ); | 165 | this.Asset_Manager.AddTextureRequest( User_info, image_req.RequestImage[ i ].Image ); |
167 | |||
168 | } | 166 | } |
169 | } | 167 | } |
170 | else if( pack.Type == PacketType.RegionHandshakeReply ) { | 168 | else if( pack.Type == PacketType.RegionHandshakeReply ) { |
171 | //recieved regionhandshake so can now start sending info | 169 | //recieved regionhandshake so can now start sending info |
172 | Agent_Manager.SendInitialData( User_info ); | 170 | Agent_Manager.SendInitialData( User_info ); |
173 | //this.setuptemplates("objectupate164.dat",User_info,false); | 171 | //this.setuptemplates("objectupate164.dat",User_info,false); |
174 | } | 172 | } |
175 | else if( pack.Type == PacketType.ObjectAdd ) { | 173 | else if( pack.Type == PacketType.ObjectAdd ) |
174 | { | ||
176 | ObjectAddPacket ad = (ObjectAddPacket)pack; | 175 | ObjectAddPacket ad = (ObjectAddPacket)pack; |
177 | Prim_Manager.CreatePrim( User_info, ad.ObjectData.RayEnd, ad ); | 176 | Prim_Manager.CreatePrim( User_info, ad.ObjectData.RayEnd, ad ); |
178 | //this.send_prim(User_info,ad.ObjectData.RayEnd, ad); | 177 | //this.send_prim(User_info,ad.ObjectData.RayEnd, ad); |
@@ -184,7 +183,8 @@ namespace OpenSim | |||
184 | //System.Console.WriteLine(pack.ToString()); | 183 | //System.Console.WriteLine(pack.ToString()); |
185 | MultipleObjectUpdatePacket mupd = (MultipleObjectUpdatePacket)pack; | 184 | MultipleObjectUpdatePacket mupd = (MultipleObjectUpdatePacket)pack; |
186 | 185 | ||
187 | for( int i = 0; i < mupd.ObjectData.Length; i++ ) { | 186 | for( int i = 0; i < mupd.ObjectData.Length; i++ ) |
187 | { | ||
188 | if( mupd.ObjectData[ i ].Type == 9 ) //change position | 188 | if( mupd.ObjectData[ i ].Type == 9 ) //change position |
189 | { | 189 | { |
190 | libsecondlife.LLVector3 pos = new LLVector3( mupd.ObjectData[ i ].Data, 0 ); | 190 | libsecondlife.LLVector3 pos = new LLVector3( mupd.ObjectData[ i ].Data, 0 ); |
@@ -203,19 +203,23 @@ namespace OpenSim | |||
203 | } | 203 | } |
204 | } | 204 | } |
205 | } | 205 | } |
206 | else if( pack.Type == PacketType.AgentWearablesRequest ) { | 206 | else if( pack.Type == PacketType.AgentWearablesRequest ) |
207 | { | ||
207 | Agent_Manager.SendIntialAvatarAppearance( User_info ); | 208 | Agent_Manager.SendIntialAvatarAppearance( User_info ); |
208 | } | 209 | } |
209 | |||
210 | else if( pack.Type == PacketType.AgentUpdate ) | 210 | else if( pack.Type == PacketType.AgentUpdate ) |
211 | { | 211 | { |
212 | AgentUpdatePacket ag = (AgentUpdatePacket)pack; | 212 | AgentUpdatePacket ag = (AgentUpdatePacket)pack; |
213 | uint mask = ag.AgentData.ControlFlags & ( 1 ); | 213 | uint mask = ag.AgentData.ControlFlags & ( 1 ); |
214 | AvatarData m_av = Agent_Manager.GetAgent( User_info.AgentID ); | 214 | AvatarData m_av = Agent_Manager.GetAgent( User_info.AgentID ); |
215 | if( m_av != null ) { | 215 | if( m_av != null ) |
216 | if( m_av.Started ) { | 216 | { |
217 | if( mask == ( 1 ) ) { | 217 | if( m_av.Started ) |
218 | if( !m_av.Walk ) { | 218 | { |
219 | if( mask == ( 1 ) ) | ||
220 | { | ||
221 | if( !m_av.Walk ) | ||
222 | { | ||
219 | //start walking | 223 | //start walking |
220 | Agent_Manager.SendMoveCommand( User_info, false, m_av.Position.X, m_av.Position.Y, m_av.Position.Z, 0, ag.AgentData.BodyRotation ); | 224 | Agent_Manager.SendMoveCommand( User_info, false, m_av.Position.X, m_av.Position.Y, m_av.Position.Z, 0, ag.AgentData.BodyRotation ); |
221 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3( 1, 0, 0 ); | 225 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3( 1, 0, 0 ); |
@@ -230,8 +234,10 @@ namespace OpenSim | |||
230 | m_av.Walk = true; | 234 | m_av.Walk = true; |
231 | } | 235 | } |
232 | } | 236 | } |
233 | else { | 237 | else |
234 | if( m_av.Walk ) { | 238 | { |
239 | if( m_av.Walk ) | ||
240 | { | ||
235 | //walking but key not pressed so need to stop | 241 | //walking but key not pressed so need to stop |
236 | Agent_Manager.SendMoveCommand( User_info, true, m_av.Position.X, m_av.Position.Y, m_av.Position.Z, 0, ag.AgentData.BodyRotation ); | 242 | Agent_Manager.SendMoveCommand( User_info, true, m_av.Position.X, m_av.Position.Y, m_av.Position.Z, 0, ag.AgentData.BodyRotation ); |
237 | m_av.Walk = false; | 243 | m_av.Walk = false; |
@@ -243,7 +249,8 @@ namespace OpenSim | |||
243 | } | 249 | } |
244 | } | 250 | } |
245 | } | 251 | } |
246 | else if( pack.Type == PacketType.ChatFromViewer ) { | 252 | else if( pack.Type == PacketType.ChatFromViewer ) |
253 | { | ||
247 | ChatFromViewerPacket chat = (ChatFromViewerPacket)pack; | 254 | ChatFromViewerPacket chat = (ChatFromViewerPacket)pack; |
248 | System.Text.Encoding enc = System.Text.Encoding.ASCII; | 255 | System.Text.Encoding enc = System.Text.Encoding.ASCII; |
249 | 256 | ||
@@ -256,21 +263,25 @@ namespace OpenSim | |||
256 | 263 | ||
257 | line = myString; | 264 | line = myString; |
258 | comp = line.Split( delimiter ); | 265 | comp = line.Split( delimiter ); |
259 | if( comp[ 0 ] == "pos" ) { | 266 | if( comp[ 0 ] == "pos" ) |
267 | { | ||
260 | } | 268 | } |
261 | else if( comp[ 0 ] == "veloc" ) { | 269 | else if( comp[ 0 ] == "veloc" ) |
270 | { | ||
262 | } | 271 | } |
263 | else { | 272 | else |
273 | { | ||
264 | Agent_Manager.SendChatMessage( User_info, line ); | 274 | Agent_Manager.SendChatMessage( User_info, line ); |
265 | 275 | ||
266 | } | 276 | } |
267 | } | 277 | } |
268 | } | 278 | } |
269 | } | 279 | } |
270 | public void NewUserCallback( User_Agent_info UserInfo ) { | 280 | public void NewUserCallback( User_Agent_info UserInfo ) |
281 | { | ||
271 | Console.WriteLine( "new user - {0} - has joined [session {1}]", UserInfo.AgentID.ToString(), UserInfo.SessionID.ToString() +"curcuit used"+UserInfo.circuitCode); | 282 | Console.WriteLine( "new user - {0} - has joined [session {1}]", UserInfo.AgentID.ToString(), UserInfo.SessionID.ToString() +"curcuit used"+UserInfo.circuitCode); |
272 | string first,last; | 283 | string first,last; |
273 | LLUUID Base,Inventory; | 284 | LLUUID Base,Inventory; |
274 | lock(_login) | 285 | lock(_login) |
275 | { | 286 | { |
276 | first=_login.first; | 287 | first=_login.first; |
diff --git a/InventoryManager.cs b/InventoryManager.cs index bbc340e..72c9607 100644 --- a/InventoryManager.cs +++ b/InventoryManager.cs | |||
@@ -43,6 +43,8 @@ namespace OpenSim | |||
43 | public Dictionary<LLUUID, InventoryItem> Items; | 43 | public Dictionary<LLUUID, InventoryItem> Items; |
44 | private Server server; | 44 | private Server server; |
45 | 45 | ||
46 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | ||
47 | |||
46 | /// <summary> | 48 | /// <summary> |
47 | /// | 49 | /// |
48 | /// </summary> | 50 | /// </summary> |
@@ -118,8 +120,8 @@ namespace OpenSim | |||
118 | InventoryFolder Folder=this.Folders[FetchDescend.InventoryData.FolderID]; | 120 | InventoryFolder Folder=this.Folders[FetchDescend.InventoryData.FolderID]; |
119 | InventoryDescendentsPacket Descend=new InventoryDescendentsPacket(); | 121 | InventoryDescendentsPacket Descend=new InventoryDescendentsPacket(); |
120 | Descend.AgentData.AgentID=User_info.AgentID; | 122 | Descend.AgentData.AgentID=User_info.AgentID; |
121 | Descend.AgentData.OwnerID=Folder.OwnerID;//User_info.AgentID; | 123 | Descend.AgentData.OwnerID=Folder.OwnerID; |
122 | Descend.AgentData.FolderID=FetchDescend.InventoryData.FolderID;//Folder.FolderID;//new LLUUID("4fb2dab6-a987-da66-05ee-96ca82bccbf1"); | 124 | Descend.AgentData.FolderID=FetchDescend.InventoryData.FolderID; |
123 | Descend.AgentData.Descendents=Folder.Items.Count; | 125 | Descend.AgentData.Descendents=Folder.Items.Count; |
124 | Descend.AgentData.Version=Folder.Items.Count; | 126 | Descend.AgentData.Version=Folder.Items.Count; |
125 | 127 | ||
@@ -129,26 +131,26 @@ namespace OpenSim | |||
129 | 131 | ||
130 | InventoryItem Item=Folder.Items[i]; | 132 | InventoryItem Item=Folder.Items[i]; |
131 | Descend.ItemData[i]=new InventoryDescendentsPacket.ItemDataBlock(); | 133 | Descend.ItemData[i]=new InventoryDescendentsPacket.ItemDataBlock(); |
132 | Descend.ItemData[i].ItemID=Item.ItemID;//new LLUUID("b7878441893b094917f791174bc8401c"); | 134 | Descend.ItemData[i].ItemID=Item.ItemID; |
133 | Descend.ItemData[i].AssetID=Item.AssetID;//new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | 135 | Descend.ItemData[i].AssetID=Item.AssetID; |
134 | Descend.ItemData[i].CreatorID=Item.CreatorID;//User_info.AgentID; | 136 | Descend.ItemData[i].CreatorID=Item.CreatorID; |
135 | Descend.ItemData[i].BaseMask=2147483647; | 137 | Descend.ItemData[i].BaseMask=FULL_MASK_PERMISSIONS; |
136 | Descend.ItemData[i].CreationDate=1000; | 138 | Descend.ItemData[i].CreationDate=1000; |
137 | Descend.ItemData[i].Description=enc.GetBytes(Item.Description+"\0"); | 139 | Descend.ItemData[i].Description=enc.GetBytes(Item.Description+"\0"); |
138 | Descend.ItemData[i].EveryoneMask=2147483647;; | 140 | Descend.ItemData[i].EveryoneMask=FULL_MASK_PERMISSIONS; |
139 | Descend.ItemData[i].Flags=1; | 141 | Descend.ItemData[i].Flags=1; |
140 | Descend.ItemData[i].FolderID=Item.FolderID;//new LLUUID("4fb2dab6-a987-da66-05ee-96ca82bccbf1"); | 142 | Descend.ItemData[i].FolderID=Item.FolderID; |
141 | Descend.ItemData[i].GroupID=new LLUUID("00000000-0000-0000-0000-000000000000"); | 143 | Descend.ItemData[i].GroupID=new LLUUID("00000000-0000-0000-0000-000000000000"); |
142 | Descend.ItemData[i].GroupMask=2147483647; | 144 | Descend.ItemData[i].GroupMask=FULL_MASK_PERMISSIONS; |
143 | Descend.ItemData[i].InvType=Item.InvType; | 145 | Descend.ItemData[i].InvType=Item.InvType; |
144 | Descend.ItemData[i].Name=enc.GetBytes(Item.Name+"\0"); | 146 | Descend.ItemData[i].Name=enc.GetBytes(Item.Name+"\0"); |
145 | Descend.ItemData[i].NextOwnerMask=2147483647; | 147 | Descend.ItemData[i].NextOwnerMask=FULL_MASK_PERMISSIONS; |
146 | Descend.ItemData[i].OwnerID=Item.OwnerID;//User_info.AgentID; | 148 | Descend.ItemData[i].OwnerID=Item.OwnerID; |
147 | Descend.ItemData[i].OwnerMask=2147483647;; | 149 | Descend.ItemData[i].OwnerMask=FULL_MASK_PERMISSIONS; |
148 | Descend.ItemData[i].SalePrice=100; | 150 | Descend.ItemData[i].SalePrice=100; |
149 | Descend.ItemData[i].SaleType=0; | 151 | Descend.ItemData[i].SaleType=0; |
150 | Descend.ItemData[i].Type=Item.Type;//libsecondlife.AssetSystem.Asset.ASSET_TYPE_WEARABLE_BODY; | 152 | Descend.ItemData[i].Type=Item.Type; |
151 | Descend.ItemData[i].CRC=libsecondlife.Helpers.InventoryCRC(1000,0,Descend.ItemData[i].InvType,Descend.ItemData[i].Type,Descend.ItemData[i].AssetID ,Descend.ItemData[i].GroupID,100,Descend.ItemData[i].OwnerID,Descend.ItemData[i].CreatorID,Descend.ItemData[i].ItemID,Descend.ItemData[i].FolderID,2147483647,1,2147483647,2147483647,2147483647); | 153 | Descend.ItemData[i].CRC=libsecondlife.Helpers.InventoryCRC(1000,0,Descend.ItemData[i].InvType,Descend.ItemData[i].Type,Descend.ItemData[i].AssetID ,Descend.ItemData[i].GroupID,100,Descend.ItemData[i].OwnerID,Descend.ItemData[i].CreatorID,Descend.ItemData[i].ItemID,Descend.ItemData[i].FolderID,FULL_MASK_PERMISSIONS,1,FULL_MASK_PERMISSIONS,FULL_MASK_PERMISSIONS,FULL_MASK_PERMISSIONS); |
152 | } | 154 | } |
153 | server.SendPacket(Descend,true,User_info); | 155 | server.SendPacket(Descend,true,User_info); |
154 | 156 | ||
@@ -177,26 +179,26 @@ namespace OpenSim | |||
177 | InventoryReply.AgentData.AgentID=User_info.AgentID; | 179 | InventoryReply.AgentData.AgentID=User_info.AgentID; |
178 | InventoryReply.InventoryData=new FetchInventoryReplyPacket.InventoryDataBlock[1]; | 180 | InventoryReply.InventoryData=new FetchInventoryReplyPacket.InventoryDataBlock[1]; |
179 | InventoryReply.InventoryData[0]=new FetchInventoryReplyPacket.InventoryDataBlock(); | 181 | InventoryReply.InventoryData[0]=new FetchInventoryReplyPacket.InventoryDataBlock(); |
180 | InventoryReply.InventoryData[0].ItemID=Item.ItemID;//new LLUUID("b7878441893b094917f791174bc8401c"); | 182 | InventoryReply.InventoryData[0].ItemID=Item.ItemID; |
181 | InventoryReply.InventoryData[0].AssetID=Item.AssetID;//new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | 183 | InventoryReply.InventoryData[0].AssetID=Item.AssetID; |
182 | InventoryReply.InventoryData[0].CreatorID=Item.CreatorID;//User_info.AgentID; | 184 | InventoryReply.InventoryData[0].CreatorID=Item.CreatorID; |
183 | InventoryReply.InventoryData[0].BaseMask=2147483647; | 185 | InventoryReply.InventoryData[0].BaseMask=FULL_MASK_PERMISSIONS; |
184 | InventoryReply.InventoryData[0].CreationDate=1000; | 186 | InventoryReply.InventoryData[0].CreationDate=1000; |
185 | InventoryReply.InventoryData[0].Description=enc.GetBytes( Item.Description+"\0"); | 187 | InventoryReply.InventoryData[0].Description=enc.GetBytes( Item.Description+"\0"); |
186 | InventoryReply.InventoryData[0].EveryoneMask=2147483647;; | 188 | InventoryReply.InventoryData[0].EveryoneMask=FULL_MASK_PERMISSIONS; |
187 | InventoryReply.InventoryData[0].Flags=1; | 189 | InventoryReply.InventoryData[0].Flags=1; |
188 | InventoryReply.InventoryData[0].FolderID=Item.FolderID;//new LLUUID("4fb2dab6-a987-da66-05ee-96ca82bccbf1"); | 190 | InventoryReply.InventoryData[0].FolderID=Item.FolderID; |
189 | InventoryReply.InventoryData[0].GroupID=new LLUUID("00000000-0000-0000-0000-000000000000"); | 191 | InventoryReply.InventoryData[0].GroupID=new LLUUID("00000000-0000-0000-0000-000000000000"); |
190 | InventoryReply.InventoryData[0].GroupMask=2147483647; | 192 | InventoryReply.InventoryData[0].GroupMask=FULL_MASK_PERMISSIONS; |
191 | InventoryReply.InventoryData[0].InvType=Item.InvType; | 193 | InventoryReply.InventoryData[0].InvType=Item.InvType; |
192 | InventoryReply.InventoryData[0].Name=enc.GetBytes(Item.Name+"\0"); | 194 | InventoryReply.InventoryData[0].Name=enc.GetBytes(Item.Name+"\0"); |
193 | InventoryReply.InventoryData[0].NextOwnerMask=2147483647; | 195 | InventoryReply.InventoryData[0].NextOwnerMask=FULL_MASK_PERMISSIONS; |
194 | InventoryReply.InventoryData[0].OwnerID=Item.OwnerID;//User_info.AgentID; | 196 | InventoryReply.InventoryData[0].OwnerID=Item.OwnerID; |
195 | InventoryReply.InventoryData[0].OwnerMask=2147483647;; | 197 | InventoryReply.InventoryData[0].OwnerMask=FULL_MASK_PERMISSIONS; |
196 | InventoryReply.InventoryData[0].SalePrice=100; | 198 | InventoryReply.InventoryData[0].SalePrice=100; |
197 | InventoryReply.InventoryData[0].SaleType=0; | 199 | InventoryReply.InventoryData[0].SaleType=0; |
198 | InventoryReply.InventoryData[0].Type=Item.Type;//libsecondlife.AssetSystem.Asset.ASSET_TYPE_WEARABLE_BODY; | 200 | InventoryReply.InventoryData[0].Type=Item.Type; |
199 | InventoryReply.InventoryData[0].CRC=libsecondlife.Helpers.InventoryCRC(1000,0,InventoryReply.InventoryData[0].InvType,InventoryReply.InventoryData[0].Type,InventoryReply.InventoryData[0].AssetID ,InventoryReply.InventoryData[0].GroupID,100,InventoryReply.InventoryData[0].OwnerID,InventoryReply.InventoryData[0].CreatorID,InventoryReply.InventoryData[0].ItemID,InventoryReply.InventoryData[0].FolderID,2147483647,1,2147483647,2147483647,2147483647); | 201 | InventoryReply.InventoryData[0].CRC=libsecondlife.Helpers.InventoryCRC(1000,0,InventoryReply.InventoryData[0].InvType,InventoryReply.InventoryData[0].Type,InventoryReply.InventoryData[0].AssetID ,InventoryReply.InventoryData[0].GroupID,100,InventoryReply.InventoryData[0].OwnerID,InventoryReply.InventoryData[0].CreatorID,InventoryReply.InventoryData[0].ItemID,InventoryReply.InventoryData[0].FolderID,FULL_MASK_PERMISSIONS,1,FULL_MASK_PERMISSIONS,FULL_MASK_PERMISSIONS,FULL_MASK_PERMISSIONS); |
200 | server.SendPacket(InventoryReply,true,User_info); | 202 | server.SendPacket(InventoryReply,true,User_info); |
201 | } | 203 | } |
202 | } | 204 | } |
@@ -226,7 +228,7 @@ namespace OpenSim | |||
226 | public LLUUID OwnerID; | 228 | public LLUUID OwnerID; |
227 | public LLUUID ItemID; | 229 | public LLUUID ItemID; |
228 | public LLUUID AssetID; | 230 | public LLUUID AssetID; |
229 | public LLUUID CreatorID=LLUUID.Zero;//new LLUUID("3d924400-038e-6ad9-920b-cfbb9b40585c"); | 231 | public LLUUID CreatorID=LLUUID.Zero; |
230 | public sbyte InvType; | 232 | public sbyte InvType; |
231 | public sbyte Type; | 233 | public sbyte Type; |
232 | public string Name; | 234 | public string Name; |
diff --git a/Login_manager.cs b/Login_manager.cs index c8251b6..dc90613 100644 --- a/Login_manager.cs +++ b/Login_manager.cs | |||
@@ -70,38 +70,43 @@ namespace OpenSim | |||
70 | runLoginProxy.Start(); | 70 | runLoginProxy.Start(); |
71 | } | 71 | } |
72 | 72 | ||
73 | private void RunLoginProxy() { | 73 | private void RunLoginProxy() |
74 | try { | 74 | { |
75 | for (;;) { | 75 | try |
76 | Socket client = loginServer.Accept(); | 76 | { |
77 | IPEndPoint clientEndPoint = (IPEndPoint)client.RemoteEndPoint; | 77 | for (;;) |
78 | { | ||
79 | Socket client = loginServer.Accept(); | ||
80 | IPEndPoint clientEndPoint = (IPEndPoint)client.RemoteEndPoint; | ||
78 | 81 | ||
79 | 82 | ||
80 | NetworkStream networkStream = new NetworkStream(client); | 83 | NetworkStream networkStream = new NetworkStream(client); |
81 | StreamReader networkReader = new StreamReader(networkStream); | 84 | StreamReader networkReader = new StreamReader(networkStream); |
82 | StreamWriter networkWriter = new StreamWriter(networkStream); | 85 | StreamWriter networkWriter = new StreamWriter(networkStream); |
83 | 86 | ||
84 | try | 87 | try |
85 | { | 88 | { |
86 | ProxyLogin(networkReader, networkWriter); | 89 | ProxyLogin(networkReader, networkWriter); |
87 | } | 90 | } |
88 | catch (Exception e) | 91 | catch (Exception e) |
89 | { | 92 | { |
90 | Console.WriteLine(e.Message); | 93 | Console.WriteLine(e.Message); |
91 | } | 94 | } |
92 | 95 | ||
93 | networkWriter.Close(); | 96 | networkWriter.Close(); |
94 | networkReader.Close(); | 97 | networkReader.Close(); |
95 | networkStream.Close(); | 98 | networkStream.Close(); |
96 | 99 | ||
97 | client.Close(); | 100 | client.Close(); |
98 | 101 | ||
99 | // send any packets queued for injection | 102 | // send any packets queued for injection |
100 | 103 | ||
101 | } | 104 | } |
102 | } catch (Exception e) { | 105 | } |
103 | Console.WriteLine(e.Message); | 106 | catch (Exception e) |
104 | Console.WriteLine(e.StackTrace); | 107 | { |
108 | Console.WriteLine(e.Message); | ||
109 | Console.WriteLine(e.StackTrace); | ||
105 | } | 110 | } |
106 | } | 111 | } |
107 | 112 | ||
diff --git a/Prim_manager.cs b/Prim_manager.cs index 56eccfc..856bffe 100644 --- a/Prim_manager.cs +++ b/Prim_manager.cs | |||
@@ -133,130 +133,110 @@ namespace OpenSim | |||
133 | /// <param name="rotation"></param> | 133 | /// <param name="rotation"></param> |
134 | public void UpdatePrimPosition(User_Agent_info User,LLVector3 position,uint LocalID,bool setRotation, LLQuaternion rotation) | 134 | public void UpdatePrimPosition(User_Agent_info User,LLVector3 position,uint LocalID,bool setRotation, LLQuaternion rotation) |
135 | { | 135 | { |
136 | PrimInfo pri=null; | 136 | PrimInfo pri=null; |
137 | foreach (KeyValuePair<libsecondlife.LLUUID,PrimInfo> kp in this.PrimList) | 137 | foreach (KeyValuePair<libsecondlife.LLUUID,PrimInfo> kp in this.PrimList) |
138 | { | 138 | { |
139 | if(kp.Value.LocalID==LocalID) | 139 | if(kp.Value.LocalID==LocalID) |
140 | { | 140 | { |
141 | pri=kp.Value; | 141 | pri=kp.Value; |
142 | } | 142 | } |
143 | } | 143 | } |
144 | if(pri==null) | 144 | if(pri==null) |
145 | { | 145 | { |
146 | return; | 146 | return; |
147 | } | 147 | } |
148 | uint ID=pri.LocalID; | 148 | uint ID=pri.LocalID; |
149 | libsecondlife.LLVector3 pos2=new LLVector3(position.X,position.Y,position.Z); | 149 | libsecondlife.LLVector3 pos2=new LLVector3(position.X,position.Y,position.Z); |
150 | libsecondlife.LLQuaternion rotation2; | 150 | libsecondlife.LLQuaternion rotation2; |
151 | if(!setRotation) | 151 | if(!setRotation) |
152 | { | 152 | { |
153 | pri.Position=pos2; | 153 | pri.Position=pos2; |
154 | rotation2=new LLQuaternion(pri.Rotation.X,pri.Rotation.Y,pri.Rotation.Z,pri.Rotation.W); | 154 | rotation2=new LLQuaternion(pri.Rotation.X,pri.Rotation.Y,pri.Rotation.Z,pri.Rotation.W); |
155 | } | 155 | } |
156 | else | 156 | else |
157 | { | 157 | { |
158 | rotation2=new LLQuaternion(rotation.X,rotation.Y,rotation.Z,rotation.W); | 158 | rotation2=new LLQuaternion(rotation.X,rotation.Y,rotation.Z,rotation.W); |
159 | 159 | pos2=pri.Position; | |
160 | pos2=pri.Position; | 160 | pri.Rotation=rotation; |
161 | pri.Rotation=rotation; | 161 | } |
162 | } | 162 | rotation2.W+=1; |
163 | rotation2.W+=1; | 163 | rotation2.X+=1; |
164 | rotation2.X+=1; | 164 | rotation2.Y+=1; |
165 | rotation2.Y+=1; | 165 | rotation2.Z+=1; |
166 | rotation2.Z+=1; | 166 | |
167 | 167 | byte[] bytes=new byte[60]; | |
168 | byte[] bytes=new byte[60]; | 168 | |
169 | 169 | ImprovedTerseObjectUpdatePacket im=new ImprovedTerseObjectUpdatePacket(); | |
170 | ImprovedTerseObjectUpdatePacket im=new ImprovedTerseObjectUpdatePacket(); | 170 | im.RegionData.RegionHandle=Globals.Instance.RegionHandle; |
171 | im.RegionData.RegionHandle=Globals.Instance.RegionHandle; | 171 | im.RegionData.TimeDilation=64096; |
172 | im.RegionData.TimeDilation=64096; | 172 | im.ObjectData=new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
173 | im.ObjectData=new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 173 | int i=0; |
174 | int i=0; | 174 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat=new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); |
175 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat=new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); | 175 | im.ObjectData[0]=dat; |
176 | im.ObjectData[0]=dat; | 176 | dat.TextureEntry=PrimTemplate.TextureEntry; |
177 | dat.TextureEntry=PrimTemplate.TextureEntry; | 177 | |
178 | //System.Console.WriteLine("new position is :"+position); | 178 | bytes[i++] = (byte)(ID % 256); |
179 | 179 | bytes[i++] = (byte)((ID >> 8) % 256); | |
180 | bytes[i++] = (byte)(ID % 256); | 180 | bytes[i++] = (byte)((ID >> 16) % 256); |
181 | bytes[i++] = (byte)((ID >> 8) % 256); | 181 | bytes[i++] = (byte)((ID >> 24) % 256); |
182 | bytes[i++] = (byte)((ID >> 16) % 256); | 182 | bytes[i++]=0; |
183 | bytes[i++] = (byte)((ID >> 24) % 256); | 183 | bytes[i++]=0;//1; |
184 | bytes[i++]=0; | ||
185 | bytes[i++]=0;//1; | ||
186 | 184 | ||
187 | // i+=14; | 185 | byte[] pb=pos2.GetBytes(); |
188 | // bytes[i++]=128; | 186 | pri.Position=pos2; |
189 | // bytes[i++]=63; | 187 | Array.Copy(pb,0,bytes,i,pb.Length); |
190 | byte[] pb=pos2.GetBytes(); | 188 | i+=12; |
191 | pri.Position=pos2; | 189 | ushort ac=32767; |
192 | Array.Copy(pb,0,bytes,i,pb.Length); | ||
193 | i+=12; | ||
194 | ushort ac=32767; | ||
195 | 190 | ||
196 | //vel | 191 | //vel |
197 | bytes[i++] = (byte)(ac % 256); | 192 | bytes[i++] = (byte)(ac % 256); |
198 | bytes[i++] = (byte)((ac >> 8) % 256); | 193 | bytes[i++] = (byte)((ac >> 8) % 256); |
199 | bytes[i++] = (byte)(ac % 256); | 194 | bytes[i++] = (byte)(ac % 256); |
200 | bytes[i++] = (byte)((ac >> 8) % 256); | 195 | bytes[i++] = (byte)((ac >> 8) % 256); |
201 | bytes[i++] = (byte)(ac % 256); | 196 | bytes[i++] = (byte)(ac % 256); |
202 | bytes[i++] = (byte)((ac >> 8) % 256); | 197 | bytes[i++] = (byte)((ac >> 8) % 256); |
203 | 198 | ||
204 | //accel | 199 | //accel |
205 | bytes[i++] = (byte)(ac % 256); | 200 | bytes[i++] = (byte)(ac % 256); |
206 | bytes[i++] = (byte)((ac >> 8) % 256); | 201 | bytes[i++] = (byte)((ac >> 8) % 256); |
207 | bytes[i++] = (byte)(ac % 256); | 202 | bytes[i++] = (byte)(ac % 256); |
208 | bytes[i++] = (byte)((ac >> 8) % 256); | 203 | bytes[i++] = (byte)((ac >> 8) % 256); |
209 | bytes[i++] = (byte)(ac % 256); | 204 | bytes[i++] = (byte)(ac % 256); |
210 | bytes[i++] = (byte)((ac >> 8) % 256); | 205 | bytes[i++] = (byte)((ac >> 8) % 256); |
211 | 206 | ||
212 | //if(setRotation) | 207 | ushort rw, rx,ry,rz; |
213 | //{ | 208 | rw=(ushort)(32768*rotation2.W); |
214 | 209 | rx=(ushort)(32768*rotation2.X); | |
215 | ushort rw, rx,ry,rz; | 210 | ry=(ushort)(32768*rotation2.Y); |
216 | rw=(ushort)(32768*rotation2.W); | 211 | rz=(ushort)(32768*rotation2.Z); |
217 | rx=(ushort)(32768*rotation2.X); | 212 | |
218 | ry=(ushort)(32768*rotation2.Y); | 213 | //rot |
219 | rz=(ushort)(32768*rotation2.Z); | 214 | bytes[i++] = (byte)(rx % 256); |
220 | 215 | bytes[i++] = (byte)((rx >> 8) % 256); | |
221 | //rot | 216 | bytes[i++] = (byte)(ry % 256); |
222 | bytes[i++] = (byte)(rx % 256); | 217 | bytes[i++] = (byte)((ry >> 8) % 256); |
223 | bytes[i++] = (byte)((rx >> 8) % 256); | 218 | bytes[i++] = (byte)(rz % 256); |
224 | bytes[i++] = (byte)(ry % 256); | 219 | bytes[i++] = (byte)((rz >> 8) % 256); |
225 | bytes[i++] = (byte)((ry >> 8) % 256); | 220 | bytes[i++] = (byte)(rw % 256); |
226 | bytes[i++] = (byte)(rz % 256); | 221 | bytes[i++] = (byte)((rw >> 8) % 256); |
227 | bytes[i++] = (byte)((rz >> 8) % 256); | 222 | |
228 | bytes[i++] = (byte)(rw % 256); | 223 | //rotation vel |
229 | bytes[i++] = (byte)((rw >> 8) % 256); | 224 | bytes[i++] = (byte)(ac % 256); |
230 | //} | 225 | bytes[i++] = (byte)((ac >> 8) % 256); |
231 | /*else | 226 | bytes[i++] = (byte)(ac % 256); |
232 | { | 227 | bytes[i++] = (byte)((ac >> 8) % 256); |
233 | bytes[i++] = (byte)(ac % 256); | 228 | bytes[i++] = (byte)(ac % 256); |
234 | bytes[i++] = (byte)((ac >> 8) % 256); | 229 | bytes[i++] = (byte)((ac >> 8) % 256); |
235 | bytes[i++] = (byte)(ac % 256); | 230 | |
236 | bytes[i++] = (byte)((ac >> 8) % 256); | 231 | dat.Data=bytes; |
237 | bytes[i++] = (byte)(ac % 256); | 232 | |
238 | bytes[i++] = (byte)((ac >> 8) % 256); | 233 | foreach (KeyValuePair<libsecondlife.LLUUID,AvatarData> kp in Agent_Manager.AgentList) |
239 | bytes[i++] = (byte)(ac % 256); | 234 | { |
240 | bytes[i++] = (byte)((ac >> 8) % 256); | 235 | if(kp.Value.NetInfo.AgentID!=User.AgentID) |
241 | }*/ | 236 | { |
242 | //rotation vel | 237 | server.SendPacket(im,true,kp.Value.NetInfo); |
243 | bytes[i++] = (byte)(ac % 256); | 238 | } |
244 | bytes[i++] = (byte)((ac >> 8) % 256); | 239 | } |
245 | bytes[i++] = (byte)(ac % 256); | ||
246 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
247 | bytes[i++] = (byte)(ac % 256); | ||
248 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
249 | |||
250 | dat.Data=bytes; | ||
251 | //server.SendPacket(im,true,user); | ||
252 | //should send to all users. | ||
253 | foreach (KeyValuePair<libsecondlife.LLUUID,AvatarData> kp in Agent_Manager.AgentList) | ||
254 | { | ||
255 | if(kp.Value.NetInfo.AgentID!=User.AgentID) | ||
256 | { | ||
257 | server.SendPacket(im,true,kp.Value.NetInfo); | ||
258 | } | ||
259 | } | ||
260 | } | 240 | } |
261 | 241 | ||
262 | /// <summary> | 242 | /// <summary> |
@@ -310,49 +290,50 @@ namespace OpenSim | |||
310 | public void ReadPrimDatabase(string name,User_Agent_info user) | 290 | public void ReadPrimDatabase(string name,User_Agent_info user) |
311 | { | 291 | { |
312 | StreamReader SR; | 292 | StreamReader SR; |
313 | string line; | 293 | string line; |
314 | SR=File.OpenText(name); | 294 | SR=File.OpenText(name); |
315 | string [] comp= new string[10]; | 295 | string [] comp= new string[10]; |
316 | string delimStr = " , "; | 296 | string delimStr = " , "; |
317 | char [] delimiter = delimStr.ToCharArray(); | 297 | char [] delimiter = delimStr.ToCharArray(); |
318 | |||
319 | line=SR.ReadLine(); | ||
320 | while(line!="end") | ||
321 | { | ||
322 | comp=line.Split(delimiter); | ||
323 | if(comp[0]=="ObjPack"){ | ||
324 | int num=Convert.ToInt32(comp[2]); | ||
325 | int start=Convert.ToInt32(comp[1]); | ||
326 | ObjectUpdatePacket objupdate=new ObjectUpdatePacket(); | ||
327 | objupdate.RegionData.RegionHandle=Globals.Instance.RegionHandle; | ||
328 | objupdate.RegionData.TimeDilation=64096; | ||
329 | objupdate.ObjectData=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[num]; | ||
330 | |||
331 | // int count=0; | ||
332 | string data_path = System.AppDomain.CurrentDomain.BaseDirectory + @"\data\"; | ||
333 | for(int cc=0; cc<num; cc++) | ||
334 | { | ||
335 | string filenam=data_path+@"prim_updates"+start+".dat"; | ||
336 | int i=0; | ||
337 | //FileInfo fInfo = new FileInfo("objectupate"+start+".dat"); | ||
338 | FileInfo fInfo = new FileInfo(filenam); | ||
339 | long numBytes = fInfo.Length; | ||
340 | //FileStream fStream = new FileStream("objectupate"+start+".dat", FileMode.Open, FileAccess.Read); | ||
341 | FileStream fStream = new FileStream(filenam, FileMode.Open, FileAccess.Read); | ||
342 | BinaryReader br = new BinaryReader(fStream); | ||
343 | byte [] data1 = br.ReadBytes((int)numBytes); | ||
344 | br.Close(); | ||
345 | fStream.Close(); | ||
346 | 298 | ||
347 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1,ref i); | ||
348 | objupdate.ObjectData[cc]=objdata; | ||
349 | start++; | ||
350 | } | ||
351 | server.SendPacket(objupdate,true,user); | ||
352 | line=SR.ReadLine(); | 299 | line=SR.ReadLine(); |
353 | } | 300 | while(line!="end") |
354 | } | 301 | { |
355 | SR.Close(); | 302 | comp=line.Split(delimiter); |
303 | if(comp[0]=="ObjPack") | ||
304 | { | ||
305 | int num=Convert.ToInt32(comp[2]); | ||
306 | int start=Convert.ToInt32(comp[1]); | ||
307 | ObjectUpdatePacket objupdate=new ObjectUpdatePacket(); | ||
308 | objupdate.RegionData.RegionHandle=Globals.Instance.RegionHandle; | ||
309 | objupdate.RegionData.TimeDilation=64096; | ||
310 | objupdate.ObjectData=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[num]; | ||
311 | |||
312 | // int count=0; | ||
313 | string data_path = System.AppDomain.CurrentDomain.BaseDirectory + @"\data\"; | ||
314 | for(int cc=0; cc<num; cc++) | ||
315 | { | ||
316 | string filenam=data_path+@"prim_updates"+start+".dat"; | ||
317 | int i=0; | ||
318 | //FileInfo fInfo = new FileInfo("objectupate"+start+".dat"); | ||
319 | FileInfo fInfo = new FileInfo(filenam); | ||
320 | long numBytes = fInfo.Length; | ||
321 | //FileStream fStream = new FileStream("objectupate"+start+".dat", FileMode.Open, FileAccess.Read); | ||
322 | FileStream fStream = new FileStream(filenam, FileMode.Open, FileAccess.Read); | ||
323 | BinaryReader br = new BinaryReader(fStream); | ||
324 | byte [] data1 = br.ReadBytes((int)numBytes); | ||
325 | br.Close(); | ||
326 | fStream.Close(); | ||
327 | |||
328 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata=new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1,ref i); | ||
329 | objupdate.ObjectData[cc]=objdata; | ||
330 | start++; | ||
331 | } | ||
332 | server.SendPacket(objupdate,true,user); | ||
333 | line=SR.ReadLine(); | ||
334 | } | ||
335 | } | ||
336 | SR.Close(); | ||
356 | } | 337 | } |
357 | } | 338 | } |
358 | 339 | ||
@@ -42,14 +42,14 @@ namespace OpenSim | |||
42 | /// <summary> | 42 | /// <summary> |
43 | /// Description of Server. | 43 | /// Description of Server. |
44 | /// </summary> | 44 | /// </summary> |
45 | public interface ServerCallback | 45 | public interface ServerCallback |
46 | { | 46 | { |
47 | //should replace with delegates | 47 | //should replace with delegates |
48 | void MainCallback(Packet pack, User_Agent_info User_info); | 48 | void MainCallback(Packet pack, User_Agent_info User_info); |
49 | void NewUserCallback(User_Agent_info User_info); | 49 | void NewUserCallback(User_Agent_info User_info); |
50 | void ErrorCallback(string text); | 50 | void ErrorCallback(string text); |
51 | } | 51 | } |
52 | public class Server | 52 | public class Server |
53 | { | 53 | { |
54 | /// <summary>A public reference to the client that this Simulator object | 54 | /// <summary>A public reference to the client that this Simulator object |
55 | /// is attached to</summary> | 55 | /// is attached to</summary> |
@@ -93,8 +93,6 @@ namespace OpenSim | |||
93 | } | 93 | } |
94 | 94 | ||
95 | private ServerCallback CallbackObject; | 95 | private ServerCallback CallbackObject; |
96 | //private NetworkManager Network; | ||
97 | // private Dictionary<PacketType, List<NetworkManager.PacketCallback>> Callbacks; | ||
98 | private uint Sequence = 0; | 96 | private uint Sequence = 0; |
99 | private object SequenceLock = new object(); | 97 | private object SequenceLock = new object(); |
100 | private byte[] RecvBuffer = new byte[4096]; | 98 | private byte[] RecvBuffer = new byte[4096]; |
@@ -102,12 +100,6 @@ namespace OpenSim | |||
102 | private byte[] ZeroOutBuffer = new byte[4096]; | 100 | private byte[] ZeroOutBuffer = new byte[4096]; |
103 | private Socket Connection = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); | 101 | private Socket Connection = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); |
104 | private AsyncCallback ReceivedData; | 102 | private AsyncCallback ReceivedData; |
105 | // Packets we sent out that need ACKs from the simulator | ||
106 | // private Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>(); | ||
107 | // Sequence numbers of packets we've received from the simulator | ||
108 | // private Queue<uint> Inbox; | ||
109 | // ACKs that are queued up to be sent to the simulator | ||
110 | //private Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>(); | ||
111 | private bool connected = false; | 103 | private bool connected = false; |
112 | private uint circuitCode; | 104 | private uint circuitCode; |
113 | private IPEndPoint ipEndPoint; | 105 | private IPEndPoint ipEndPoint; |
@@ -129,62 +121,38 @@ namespace OpenSim | |||
129 | public Server(ServerCallback s_callback) | 121 | public Server(ServerCallback s_callback) |
130 | { | 122 | { |
131 | 123 | ||
132 | this.CallbackObject=s_callback; | 124 | this.CallbackObject=s_callback; //should be using delegate |
133 | // Client = client; | 125 | AckTimer = new System.Timers.Timer(Settings.NETWORK_TICK_LENGTH); |
134 | // Network = client.Network; | 126 | AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); |
135 | // Callbacks = callbacks; | 127 | |
136 | // Region = new Region(client); | 128 | // Initialize the callback for receiving a new packet |
137 | // circuitCode = circuit; | 129 | ReceivedData = new AsyncCallback(this.OnReceivedData); |
138 | // Inbox = new Queue<uint>(Settings.INBOX_SIZE); | 130 | |
139 | AckTimer = new System.Timers.Timer(Settings.NETWORK_TICK_LENGTH); | 131 | // Client.Log("Connecting to " + ip.ToString() + ":" + port, Helpers.LogLevel.Info); |
140 | AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); | 132 | |
141 | 133 | try | |
142 | // Initialize the callback for receiving a new packet | 134 | { |
143 | ReceivedData = new AsyncCallback(this.OnReceivedData); | 135 | // Create an endpoint that we will be communicating with (need it in two |
144 | 136 | // types due to .NET weirdness) | |
145 | // Client.Log("Connecting to " + ip.ToString() + ":" + port, Helpers.LogLevel.Info); | 137 | // ipEndPoint = new IPEndPoint(ip, port); |
146 | 138 | ipEndPoint = new IPEndPoint(IPAddress.Any, Globals.Instance.IpPort); | |
147 | try | 139 | endPoint = (EndPoint)ipEndPoint; |
148 | { | 140 | |
149 | // Create an endpoint that we will be communicating with (need it in two | 141 | // Associate this simulator's socket with the given ip/port and start listening |
150 | // types due to .NET weirdness) | 142 | Connection.Bind(endPoint); |
151 | // ipEndPoint = new IPEndPoint(ip, port); | 143 | ipeSender = new IPEndPoint(IPAddress.Any, 0); |
152 | ipEndPoint = new IPEndPoint(IPAddress.Any, Globals.Instance.IpPort); | ||
153 | |||
154 | |||
155 | endPoint = (EndPoint)ipEndPoint; | ||
156 | |||
157 | // Associate this simulator's socket with the given ip/port and start listening | ||
158 | Connection.Bind(endPoint); | ||
159 | |||
160 | ipeSender = new IPEndPoint(IPAddress.Any, 0); | ||
161 | //The epSender identifies the incoming clients | 144 | //The epSender identifies the incoming clients |
162 | epSender = (EndPoint) ipeSender; | 145 | epSender = (EndPoint) ipeSender; |
163 | Connection.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); | 146 | Connection.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); |
164 | 147 | ||
165 | 148 | // Start the ACK timer | |
166 | // Start the ACK timer | 149 | AckTimer.Start(); |
167 | AckTimer.Start(); | 150 | } |
168 | 151 | catch (Exception e) | |
169 | 152 | { | |
170 | 153 | ||
171 | // Track the current time for timeout purposes | 154 | System.Console.WriteLine(e.Message); |
172 | //int start = Environment.TickCount; | 155 | } |
173 | |||
174 | /* while (true) | ||
175 | { | ||
176 | if (connected || Environment.TickCount - start > Settings.SIMULATOR_TIMEOUT) | ||
177 | { | ||
178 | return; | ||
179 | } | ||
180 | System.Threading.Thread.Sleep(10); | ||
181 | }*/ | ||
182 | } | ||
183 | catch (Exception e) | ||
184 | { | ||
185 | // Client.Log(e.ToString(), Helpers.LogLevel.Error); | ||
186 | System.Console.WriteLine(e.Message); | ||
187 | } | ||
188 | } | 156 | } |
189 | 157 | ||
190 | /// <summary> | 158 | /// <summary> |
@@ -292,9 +260,8 @@ namespace OpenSim | |||
292 | packet.Type != PacketType.LogoutRequest) | 260 | packet.Type != PacketType.LogoutRequest) |
293 | { | 261 | { |
294 | packet.Header.AckList = new uint[User_info.PendingAcks.Count]; | 262 | packet.Header.AckList = new uint[User_info.PendingAcks.Count]; |
295 | |||
296 | int i = 0; | 263 | int i = 0; |
297 | 264 | ||
298 | foreach (uint ack in User_info.PendingAcks.Values) | 265 | foreach (uint ack in User_info.PendingAcks.Values) |
299 | { | 266 | { |
300 | packet.Header.AckList[i] = ack; | 267 | packet.Header.AckList[i] = ack; |
@@ -345,37 +312,6 @@ namespace OpenSim | |||
345 | /// <param name="payload">The packet payload</param> | 312 | /// <param name="payload">The packet payload</param> |
346 | /// <param name="setSequence">Whether the second, third, and fourth bytes | 313 | /// <param name="setSequence">Whether the second, third, and fourth bytes |
347 | /// should be modified to the current stream sequence number</param> | 314 | /// should be modified to the current stream sequence number</param> |
348 | /* public void SendPacket(byte[] payload, bool setSequence) | ||
349 | { | ||
350 | if (connected) | ||
351 | { | ||
352 | try | ||
353 | { | ||
354 | if (setSequence && payload.Length > 3) | ||
355 | { | ||
356 | lock (SequenceLock) | ||
357 | { | ||
358 | payload[1] = (byte)(Sequence >> 16); | ||
359 | payload[2] = (byte)(Sequence >> 8); | ||
360 | payload[3] = (byte)(Sequence % 256); | ||
361 | Sequence++; | ||
362 | } | ||
363 | } | ||
364 | |||
365 | Connection.Send(payload, payload.Length, SocketFlags.None); | ||
366 | } | ||
367 | catch (SocketException e) | ||
368 | { | ||
369 | // Client.Log(e.ToString(), Helpers.LogLevel.Error); | ||
370 | } | ||
371 | } | ||
372 | else | ||
373 | { | ||
374 | // Client.Log("Attempted to send a " + payload.Length + " byte payload when " + | ||
375 | // "we are disconnected", Helpers.LogLevel.Warning); | ||
376 | } | ||
377 | } | ||
378 | */ | ||
379 | /// <summary> | 315 | /// <summary> |
380 | /// Returns Simulator Name as a String | 316 | /// Returns Simulator Name as a String |
381 | /// </summary> | 317 | /// </summary> |
@@ -615,56 +551,8 @@ namespace OpenSim | |||
615 | } | 551 | } |
616 | } | 552 | } |
617 | 553 | ||
618 | // this.callback_object.error("calling callback"); | ||
619 | this.CallbackObject.MainCallback(packet,User_info); | 554 | this.CallbackObject.MainCallback(packet,User_info); |
620 | // this.callback_object.error("finished"); | 555 | |
621 | // Fire the registered packet events | ||
622 | #region FireCallbacks | ||
623 | /* if (Callbacks.ContainsKey(packet.Type)) | ||
624 | { | ||
625 | List<NetworkManager.PacketCallback> callbackArray = Callbacks[packet.Type]; | ||
626 | |||
627 | // Fire any registered callbacks | ||
628 | foreach (NetworkManager.PacketCallback callback in callbackArray) | ||
629 | { | ||
630 | if (callback != null) | ||
631 | { | ||
632 | try | ||
633 | { | ||
634 | callback(packet, this); | ||
635 | } | ||
636 | catch (Exception e) | ||
637 | { | ||
638 | Client.Log("Caught an exception in a packet callback: " + e.ToString(), | ||
639 | Helpers.LogLevel.Error); | ||
640 | } | ||
641 | } | ||
642 | } | ||
643 | } | ||
644 | |||
645 | if (Callbacks.ContainsKey(PacketType.Default)) | ||
646 | { | ||
647 | List<NetworkManager.PacketCallback> callbackArray = Callbacks[PacketType.Default]; | ||
648 | |||
649 | // Fire any registered callbacks | ||
650 | foreach (NetworkManager.PacketCallback callback in callbackArray) | ||
651 | { | ||
652 | if (callback != null) | ||
653 | { | ||
654 | try | ||
655 | { | ||
656 | callback(packet, this); | ||
657 | } | ||
658 | catch (Exception e) | ||
659 | { | ||
660 | Client.Log("Caught an exception in a packet callback: " + e.ToString(), | ||
661 | Helpers.LogLevel.Error); | ||
662 | } | ||
663 | } | ||
664 | } | ||
665 | } | ||
666 | */ | ||
667 | #endregion FireCallbacks | ||
668 | } | 556 | } |
669 | 557 | ||
670 | private void AckTimer_Elapsed(object sender, ElapsedEventArgs ea) | 558 | private void AckTimer_Elapsed(object sender, ElapsedEventArgs ea) |
@@ -677,8 +565,8 @@ namespace OpenSim | |||
677 | { | 565 | { |
678 | User_Agent_info user=(User_Agent_info)this.User_agents[i]; | 566 | User_Agent_info user=(User_Agent_info)this.User_agents[i]; |
679 | 567 | ||
680 | SendAcks(user); | 568 | SendAcks(user); |
681 | ResendUnacked(user); | 569 | ResendUnacked(user); |
682 | } | 570 | } |
683 | } | 571 | } |
684 | } | 572 | } |
@@ -731,7 +619,7 @@ namespace OpenSim | |||
731 | } | 619 | } |
732 | } | 620 | } |
733 | 621 | ||
734 | public class User_Agent_info | 622 | public class User_Agent_info |
735 | { | 623 | { |
736 | public EndPoint endpoint; | 624 | public EndPoint endpoint; |
737 | public LLUUID AgentID; | 625 | public LLUUID AgentID; |