MyNpcCharacter.cs 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using System.Net;
  30. using OpenMetaverse;
  31. using OpenMetaverse.Packets;
  32. using OpenSim.Framework;
  33. using OpenSim.Region.Environment.Scenes;
  34. namespace OpenSim.Region.Examples.SimpleModule
  35. {
  36. public class MyNpcCharacter : IClientAPI
  37. {
  38. private uint movementFlag = 0;
  39. private short flyState = 0;
  40. private Quaternion bodyDirection = Quaternion.Identity;
  41. private short count = 0;
  42. private short frame = 0;
  43. private Scene m_scene;
  44. // disable warning: public events, part of the public API
  45. #pragma warning disable 67
  46. public event Action<IClientAPI> OnLogout;
  47. public event ObjectPermissions OnObjectPermissions;
  48. public event MoneyTransferRequest OnMoneyTransferRequest;
  49. public event ParcelBuy OnParcelBuy;
  50. public event Action<IClientAPI> OnConnectionClosed;
  51. public event ImprovedInstantMessage OnInstantMessage;
  52. public event ChatMessage OnChatFromClient;
  53. public event TextureRequest OnRequestTexture;
  54. public event RezObject OnRezObject;
  55. public event ModifyTerrain OnModifyTerrain;
  56. public event BakeTerrain OnBakeTerrain;
  57. public event SetAppearance OnSetAppearance;
  58. public event AvatarNowWearing OnAvatarNowWearing;
  59. public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
  60. public event UUIDNameRequest OnDetachAttachmentIntoInv;
  61. public event ObjectAttach OnObjectAttach;
  62. public event ObjectDeselect OnObjectDetach;
  63. public event ObjectDrop OnObjectDrop;
  64. public event StartAnim OnStartAnim;
  65. public event StopAnim OnStopAnim;
  66. public event LinkObjects OnLinkObjects;
  67. public event DelinkObjects OnDelinkObjects;
  68. public event RequestMapBlocks OnRequestMapBlocks;
  69. public event RequestMapName OnMapNameRequest;
  70. public event TeleportLocationRequest OnTeleportLocationRequest;
  71. public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
  72. public event DisconnectUser OnDisconnectUser;
  73. public event RequestAvatarProperties OnRequestAvatarProperties;
  74. public event SetAlwaysRun OnSetAlwaysRun;
  75. public event DeRezObject OnDeRezObject;
  76. public event Action<IClientAPI> OnRegionHandShakeReply;
  77. public event GenericCall2 OnRequestWearables;
  78. public event GenericCall2 OnCompleteMovementToRegion;
  79. public event UpdateAgent OnAgentUpdate;
  80. public event AgentRequestSit OnAgentRequestSit;
  81. public event AgentSit OnAgentSit;
  82. public event AvatarPickerRequest OnAvatarPickerRequest;
  83. public event Action<IClientAPI> OnRequestAvatarsData;
  84. public event AddNewPrim OnAddPrim;
  85. public event RequestGodlikePowers OnRequestGodlikePowers;
  86. public event GodKickUser OnGodKickUser;
  87. public event ObjectDuplicate OnObjectDuplicate;
  88. public event GrabObject OnGrabObject;
  89. public event ObjectSelect OnDeGrabObject;
  90. public event MoveObject OnGrabUpdate;
  91. public event ViewerEffectEventHandler OnViewerEffect;
  92. public event FetchInventory OnAgentDataUpdateRequest;
  93. public event FetchInventory OnUserInfoRequest;
  94. public event TeleportLocationRequest OnSetStartLocationRequest;
  95. public event UpdateShape OnUpdatePrimShape;
  96. public event ObjectExtraParams OnUpdateExtraParams;
  97. public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
  98. public event ObjectSelect OnObjectSelect;
  99. public event GenericCall7 OnObjectDescription;
  100. public event GenericCall7 OnObjectName;
  101. public event GenericCall7 OnObjectClickAction;
  102. public event GenericCall7 OnObjectMaterial;
  103. public event UpdatePrimFlags OnUpdatePrimFlags;
  104. public event UpdatePrimTexture OnUpdatePrimTexture;
  105. public event UpdateVector OnUpdatePrimGroupPosition;
  106. public event UpdateVector OnUpdatePrimSinglePosition;
  107. public event UpdatePrimRotation OnUpdatePrimGroupRotation;
  108. public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
  109. public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
  110. public event UpdateVector OnUpdatePrimScale;
  111. public event UpdateVector OnUpdatePrimGroupScale;
  112. public event StatusChange OnChildAgentStatus;
  113. public event GenericCall2 OnStopMovement;
  114. public event Action<UUID> OnRemoveAvatar;
  115. public event CreateNewInventoryItem OnCreateNewInventoryItem;
  116. public event CreateInventoryFolder OnCreateNewInventoryFolder;
  117. public event UpdateInventoryFolder OnUpdateInventoryFolder;
  118. public event MoveInventoryFolder OnMoveInventoryFolder;
  119. public event RemoveInventoryFolder OnRemoveInventoryFolder;
  120. public event RemoveInventoryItem OnRemoveInventoryItem;
  121. public event FetchInventoryDescendents OnFetchInventoryDescendents;
  122. public event PurgeInventoryDescendents OnPurgeInventoryDescendents;
  123. public event FetchInventory OnFetchInventory;
  124. public event RequestTaskInventory OnRequestTaskInventory;
  125. public event UpdateInventoryItem OnUpdateInventoryItem;
  126. public event CopyInventoryItem OnCopyInventoryItem;
  127. public event MoveInventoryItem OnMoveInventoryItem;
  128. public event UDPAssetUploadRequest OnAssetUploadRequest;
  129. public event RequestTerrain OnRequestTerrain;
  130. public event RequestTerrain OnUploadTerrain;
  131. public event XferReceive OnXferReceive;
  132. public event RequestXfer OnRequestXfer;
  133. public event ConfirmXfer OnConfirmXfer;
  134. public event AbortXfer OnAbortXfer;
  135. public event RezScript OnRezScript;
  136. public event UpdateTaskInventory OnUpdateTaskInventory;
  137. public event MoveTaskInventory OnMoveTaskItem;
  138. public event RemoveTaskInventory OnRemoveTaskItem;
  139. public event RequestAsset OnRequestAsset;
  140. public event GenericMessage OnGenericMessage;
  141. public event UUIDNameRequest OnNameFromUUIDRequest;
  142. public event UUIDNameRequest OnUUIDGroupNameRequest;
  143. public event ParcelPropertiesRequest OnParcelPropertiesRequest;
  144. public event ParcelDivideRequest OnParcelDivideRequest;
  145. public event ParcelJoinRequest OnParcelJoinRequest;
  146. public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
  147. public event ParcelAbandonRequest OnParcelAbandonRequest;
  148. public event ParcelGodForceOwner OnParcelGodForceOwner;
  149. public event ParcelReclaim OnParcelReclaim;
  150. public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest;
  151. public event ParcelAccessListRequest OnParcelAccessListRequest;
  152. public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest;
  153. public event ParcelSelectObjects OnParcelSelectObjects;
  154. public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
  155. public event ObjectDeselect OnObjectDeselect;
  156. public event RegionInfoRequest OnRegionInfoRequest;
  157. public event EstateCovenantRequest OnEstateCovenantRequest;
  158. public event EstateChangeInfo OnEstateChangeInfo;
  159. public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
  160. public event FriendActionDelegate OnApproveFriendRequest;
  161. public event FriendActionDelegate OnDenyFriendRequest;
  162. public event FriendshipTermination OnTerminateFriendship;
  163. public event EconomyDataRequest OnEconomyDataRequest;
  164. public event MoneyBalanceRequest OnMoneyBalanceRequest;
  165. public event UpdateAvatarProperties OnUpdateAvatarProperties;
  166. public event ObjectIncludeInSearch OnObjectIncludeInSearch;
  167. public event UUIDNameRequest OnTeleportHomeRequest;
  168. public event ScriptAnswer OnScriptAnswer;
  169. public event RequestPayPrice OnRequestPayPrice;
  170. public event ObjectSaleInfo OnObjectSaleInfo;
  171. public event ObjectBuy OnObjectBuy;
  172. public event BuyObjectInventory OnBuyObjectInventory;
  173. public event AgentSit OnUndo;
  174. public event ForceReleaseControls OnForceReleaseControls;
  175. public event GodLandStatRequest OnLandStatRequest;
  176. public event RequestObjectPropertiesFamily OnObjectGroupRequest;
  177. public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
  178. public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
  179. public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
  180. public event SetEstateTerrainDetailTexture OnSetEstateTerrainDetailTexture;
  181. public event SetEstateTerrainTextureHeights OnSetEstateTerrainTextureHeights;
  182. public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest;
  183. public event SetRegionTerrainSettings OnSetRegionTerrainSettings;
  184. public event EstateRestartSimRequest OnEstateRestartSimRequest;
  185. public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest;
  186. public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest;
  187. public event SimulatorBlueBoxMessageRequest OnSimulatorBlueBoxMessageRequest;
  188. public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
  189. public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
  190. public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
  191. public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest;
  192. public event ScriptReset OnScriptReset;
  193. public event GetScriptRunning OnGetScriptRunning;
  194. public event SetScriptRunning OnSetScriptRunning;
  195. public event UpdateVector OnAutoPilotGo;
  196. public event TerrainUnacked OnUnackedTerrain;
  197. public event RegionHandleRequest OnRegionHandleRequest;
  198. public event ParcelInfoRequest OnParcelInfoRequest;
  199. public event ActivateGesture OnActivateGesture;
  200. public event DeactivateGesture OnDeactivateGesture;
  201. public event ObjectOwner OnObjectOwner;
  202. public event DirPlacesQuery OnDirPlacesQuery;
  203. public event DirFindQuery OnDirFindQuery;
  204. public event DirLandQuery OnDirLandQuery;
  205. public event DirPopularQuery OnDirPopularQuery;
  206. public event DirClassifiedQuery OnDirClassifiedQuery;
  207. public event EventInfoRequest OnEventInfoRequest;
  208. public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime;
  209. public event MapItemRequest OnMapItemRequest;
  210. public event OfferCallingCard OnOfferCallingCard;
  211. public event AcceptCallingCard OnAcceptCallingCard;
  212. public event DeclineCallingCard OnDeclineCallingCard;
  213. public event SoundTrigger OnSoundTrigger;
  214. public event StartLure OnStartLure;
  215. public event TeleportLureRequest OnTeleportLureRequest;
  216. public event NetworkStats OnNetworkStatsUpdate;
  217. public event ClassifiedInfoRequest OnClassifiedInfoRequest;
  218. public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
  219. public event ClassifiedDelete OnClassifiedDelete;
  220. public event ClassifiedDelete OnClassifiedGodDelete;
  221. public event EventNotificationAddRequest OnEventNotificationAddRequest;
  222. public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
  223. public event EventGodDelete OnEventGodDelete;
  224. #pragma warning restore 67
  225. private UUID myID = UUID.Random();
  226. public MyNpcCharacter(Scene scene)
  227. {
  228. // startPos = new Vector3(128, (float)(Util.RandomClass.NextDouble()*100), 2);
  229. m_scene = scene;
  230. m_scene.EventManager.OnFrame += Update;
  231. }
  232. private Vector3 startPos = new Vector3(128, 128, 30);
  233. public virtual Vector3 StartPos
  234. {
  235. get { return startPos; }
  236. set { }
  237. }
  238. public virtual UUID AgentId
  239. {
  240. get { return myID; }
  241. }
  242. public UUID SessionId
  243. {
  244. get { return UUID.Zero; }
  245. }
  246. public UUID SecureSessionId
  247. {
  248. get { return UUID.Zero; }
  249. }
  250. public virtual string FirstName
  251. {
  252. get { return "Only"; }
  253. }
  254. private string lastName = "Today" + Util.RandomClass.Next(1, 1000);
  255. public virtual string LastName
  256. {
  257. get { return lastName; }
  258. }
  259. public virtual String Name
  260. {
  261. get { return FirstName + LastName; }
  262. }
  263. public bool IsActive
  264. {
  265. get { return true; }
  266. set { }
  267. }
  268. public UUID ActiveGroupId
  269. {
  270. get { return UUID.Zero; }
  271. }
  272. public string ActiveGroupName
  273. {
  274. get { return String.Empty; }
  275. }
  276. public ulong ActiveGroupPowers
  277. {
  278. get { return 0; }
  279. }
  280. public bool IsGroupMember(UUID groupID)
  281. {
  282. return false;
  283. }
  284. public ulong GetGroupPowers(UUID groupID)
  285. {
  286. return 0;
  287. }
  288. public virtual int NextAnimationSequenceNumber
  289. {
  290. get { return 1; }
  291. }
  292. public IScene Scene
  293. {
  294. get { return m_scene; }
  295. }
  296. public bool SendLogoutPacketWhenClosing
  297. {
  298. set { }
  299. }
  300. public virtual void ActivateGesture(UUID assetId, UUID gestureId)
  301. {
  302. }
  303. public virtual void SendWearables(AvatarWearable[] wearables, int serial)
  304. {
  305. }
  306. public virtual void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry)
  307. {
  308. }
  309. public virtual void Kick(string message)
  310. {
  311. }
  312. public virtual void SendStartPingCheck(byte seq)
  313. {
  314. }
  315. public virtual void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List<AvatarPickerReplyDataArgs> Data)
  316. {
  317. }
  318. public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle)
  319. {
  320. }
  321. public virtual void SendKillObject(ulong regionHandle, uint localID)
  322. {
  323. }
  324. public virtual void SetChildAgentThrottle(byte[] throttle)
  325. {
  326. }
  327. public byte[] GetThrottlesPacked(float multiplier)
  328. {
  329. return new byte[0];
  330. }
  331. public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId)
  332. {
  333. }
  334. public virtual void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName,
  335. UUID fromAgentID, byte source, byte audible)
  336. {
  337. }
  338. public virtual void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName,
  339. UUID fromAgentID, byte source, byte audible)
  340. {
  341. }
  342. public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp)
  343. {
  344. }
  345. public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, UUID transactionID, bool fromGroup, byte[] binaryBucket)
  346. {
  347. }
  348. public void SendGenericMessage(string method, List<string> message)
  349. {
  350. }
  351. public virtual void SendLayerData(float[] map)
  352. {
  353. }
  354. public virtual void SendLayerData(int px, int py, float[] map)
  355. {
  356. }
  357. public virtual void SendLayerData(int px, int py, float[] map, bool track)
  358. {
  359. }
  360. public virtual void SendWindData(Vector2[] windSpeeds) { }
  361. public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look)
  362. {
  363. }
  364. public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint)
  365. {
  366. }
  367. public virtual AgentCircuitData RequestClientInfo()
  368. {
  369. return new AgentCircuitData();
  370. }
  371. public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt,
  372. IPEndPoint newRegionExternalEndPoint, string capsURL)
  373. {
  374. }
  375. public virtual void SendMapBlock(List<MapBlockData> mapBlocks, uint flag)
  376. {
  377. }
  378. public virtual void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags)
  379. {
  380. }
  381. public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint,
  382. uint locationID, uint flags, string capsURL)
  383. {
  384. }
  385. public virtual void SendTeleportFailed(string reason)
  386. {
  387. }
  388. public virtual void SendTeleportLocationStart()
  389. {
  390. }
  391. public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance)
  392. {
  393. }
  394. public virtual void SendPayPrice(UUID objectID, int[] payPrice)
  395. {
  396. }
  397. public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID,
  398. uint avatarLocalID, Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation)
  399. {
  400. }
  401. public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID,
  402. Vector3 position, Vector3 velocity, Quaternion rotation)
  403. {
  404. }
  405. public virtual void SendCoarseLocationUpdate(List<Vector3> CoarseLocations)
  406. {
  407. }
  408. public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID)
  409. {
  410. }
  411. public virtual void SendDialog(string objectname, UUID objectID, UUID ownerID, string msg, UUID textureID, int ch, string[] buttonlabels)
  412. {
  413. }
  414. public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID,
  415. PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel,
  416. Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags,
  417. UUID objectID, UUID ownerID, string text, byte[] color,
  418. uint parentID,
  419. byte[] particleSystem, byte clickAction, byte material)
  420. {
  421. }
  422. public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID,
  423. PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel,
  424. Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags,
  425. UUID objectID, UUID ownerID, string text, byte[] color,
  426. uint parentID,
  427. byte[] particleSystem, byte clickAction, byte material, byte[] textureanimation,
  428. bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius)
  429. {
  430. }
  431. public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID,
  432. Vector3 position, Quaternion rotation, Vector3 velocity,
  433. Vector3 rotationalvelocity, byte state, UUID AssetId,
  434. UUID ownerID, int attachPoint)
  435. {
  436. }
  437. public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID,
  438. List<InventoryItemBase> items,
  439. List<InventoryFolderBase> folders,
  440. bool fetchFolders,
  441. bool fetchItems)
  442. {
  443. }
  444. public virtual void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item)
  445. {
  446. }
  447. public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item)
  448. {
  449. }
  450. public virtual void SendRemoveInventoryItem(UUID itemID)
  451. {
  452. }
  453. /// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see>
  454. public virtual void SendBulkUpdateInventory(InventoryItemBase item)
  455. {
  456. }
  457. public void SendBulkUpdateInventory(InventoryFolderBase folderBase)
  458. {}
  459. public UUID GetDefaultAnimation(string name)
  460. {
  461. return UUID.Zero;
  462. }
  463. public void SendTakeControls(int controls, bool passToAgent, bool TakeControls)
  464. {
  465. }
  466. public virtual void SendTaskInventory(UUID taskID, short serial, byte[] fileName)
  467. {
  468. }
  469. public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data)
  470. {
  471. }
  472. public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
  473. int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
  474. int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
  475. int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
  476. {
  477. }
  478. public virtual void SendNameReply(UUID profileId, string firstname, string lastname)
  479. {
  480. }
  481. public virtual void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID)
  482. {
  483. }
  484. public virtual void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain,
  485. byte flags)
  486. {
  487. }
  488. public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
  489. {
  490. }
  491. public void SendAttachedSoundGainChange(UUID objectID, float gain)
  492. {
  493. }
  494. public void SendAlertMessage(string message)
  495. {
  496. }
  497. public void SendAgentAlertMessage(string message, bool modal)
  498. {
  499. }
  500. public void SendSystemAlertMessage(string message)
  501. {
  502. }
  503. public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message,
  504. string url)
  505. {
  506. }
  507. public virtual void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args)
  508. {
  509. if (OnRegionHandShakeReply != null)
  510. {
  511. OnRegionHandShakeReply(this);
  512. }
  513. if (OnCompleteMovementToRegion != null)
  514. {
  515. OnCompleteMovementToRegion();
  516. }
  517. }
  518. public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
  519. {
  520. }
  521. public void SendConfirmXfer(ulong xferID, uint PacketID)
  522. {
  523. }
  524. public void SendXferRequest(ulong XferID, short AssetType, UUID vFileID, byte FilePath, byte[] FileName)
  525. {
  526. }
  527. public void SendInitiateDownload(string simFileName, string clientFileName)
  528. {
  529. }
  530. public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
  531. {
  532. }
  533. public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
  534. {
  535. }
  536. public void SendImageNotFound(UUID imageid)
  537. {
  538. }
  539. public void SendShutdownConnectionNotice()
  540. {
  541. }
  542. public void SendSimStats(SimStats stats)
  543. {
  544. }
  545. public void SendObjectPropertiesFamilyData(uint RequestFlags, UUID ObjectUUID, UUID OwnerID, UUID GroupID,
  546. uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask,
  547. uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category,
  548. UUID LastOwnerID, string ObjectName, string Description)
  549. {
  550. }
  551. public void SendObjectPropertiesReply(UUID ItemID, ulong CreationDate, UUID CreatorUUID, UUID FolderUUID, UUID FromTaskUUID,
  552. UUID GroupUUID, short InventorySerial, UUID LastOwnerUUID, UUID ObjectUUID,
  553. UUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName,
  554. string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask,
  555. uint BaseMask, byte saleType, int salePrice)
  556. {
  557. }
  558. public void SendAgentOffline(UUID[] agentIDs)
  559. {
  560. }
  561. public void SendAgentOnline(UUID[] agentIDs)
  562. {
  563. }
  564. public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot,
  565. Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
  566. {
  567. }
  568. public void SendAdminResponse(UUID Token, uint AdminLevel)
  569. {
  570. }
  571. public void SendGroupMembership(GroupMembershipData[] GroupMembership)
  572. {
  573. }
  574. private void Update()
  575. {
  576. frame++;
  577. if (frame > 20)
  578. {
  579. frame = 0;
  580. if (OnAgentUpdate != null)
  581. {
  582. AgentUpdateArgs pack = new AgentUpdateArgs();
  583. pack.ControlFlags = movementFlag;
  584. pack.BodyRotation = bodyDirection;
  585. OnAgentUpdate(this, pack);
  586. }
  587. if (flyState == 0)
  588. {
  589. movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY |
  590. (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG;
  591. flyState = 1;
  592. }
  593. else if (flyState == 1)
  594. {
  595. movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY |
  596. (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
  597. flyState = 2;
  598. }
  599. else
  600. {
  601. movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
  602. flyState = 0;
  603. }
  604. if (count >= 10)
  605. {
  606. if (OnChatFromClient != null)
  607. {
  608. OSChatMessage args = new OSChatMessage();
  609. args.Message = "Hey You! Get out of my Home. This is my Region";
  610. args.Channel = 0;
  611. args.From = FirstName + " " + LastName;
  612. args.Scene = m_scene;
  613. args.Position = new Vector3(128, 128, 26);
  614. args.Sender = this;
  615. args.Type = ChatTypeEnum.Shout;
  616. OnChatFromClient(this, args);
  617. }
  618. count = -1;
  619. }
  620. count++;
  621. }
  622. }
  623. public bool AddMoney(int debit)
  624. {
  625. return false;
  626. }
  627. public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase)
  628. {
  629. }
  630. public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
  631. {
  632. }
  633. public void SendViewerTime(int phase)
  634. {
  635. }
  636. public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember,
  637. string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL,
  638. UUID partnerID)
  639. {
  640. }
  641. public void SetDebugPacketLevel(int newDebug)
  642. {
  643. }
  644. public void InPacket(object NewPack)
  645. {
  646. }
  647. public void ProcessInPacket(Packet NewPack)
  648. {
  649. }
  650. public void Close(bool ShutdownCircuit)
  651. {
  652. }
  653. public void Stop()
  654. {
  655. }
  656. private uint m_circuitCode;
  657. public uint CircuitCode
  658. {
  659. get { return m_circuitCode; }
  660. set { m_circuitCode = value; }
  661. }
  662. public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
  663. {
  664. }
  665. public void SendLogoutPacket()
  666. {
  667. }
  668. public void Terminate()
  669. {
  670. }
  671. public ClientInfo GetClientInfo()
  672. {
  673. return null;
  674. }
  675. public void SetClientInfo(ClientInfo info)
  676. {
  677. }
  678. public void SendScriptQuestion(UUID objectID, string taskName, string ownerName, UUID itemID, int question)
  679. {
  680. }
  681. public void SendHealth(float health)
  682. {
  683. }
  684. public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID)
  685. {
  686. }
  687. public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID)
  688. {
  689. }
  690. public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
  691. {
  692. }
  693. public void SendEstateCovenantInformation(UUID covenant)
  694. {
  695. }
  696. public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner)
  697. {
  698. }
  699. public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
  700. {
  701. }
  702. public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID)
  703. {
  704. }
  705. public void SendForceClientSelectObjects(List<uint> objectIDs)
  706. {
  707. }
  708. public void SendLandObjectOwners(Dictionary<UUID, int> ownersAndCount)
  709. {
  710. }
  711. public void SendLandParcelOverlay(byte[] data, int sequence_id)
  712. {
  713. }
  714. public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time)
  715. {
  716. }
  717. public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, byte autoScale, string mediaType,
  718. string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop)
  719. {
  720. }
  721. public void SendGroupNameReply(UUID groupLLUID, string GroupName)
  722. {
  723. }
  724. public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
  725. {
  726. }
  727. public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running)
  728. {
  729. }
  730. public void SendAsset(AssetRequestToClient req)
  731. {
  732. }
  733. public void SendTexture(AssetBase TextureAsset)
  734. {
  735. }
  736. public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters)
  737. {
  738. }
  739. public void SendClearFollowCamProperties (UUID objectID)
  740. {
  741. }
  742. public void SendRegionHandle (UUID regoinID, ulong handle)
  743. {
  744. }
  745. public void SendParcelInfo (RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
  746. {
  747. }
  748. public void SetClientOption(string option, string value)
  749. {
  750. }
  751. public string GetClientOption(string option)
  752. {
  753. return string.Empty;
  754. }
  755. public void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt)
  756. {
  757. }
  758. public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data)
  759. {
  760. }
  761. public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)
  762. {
  763. }
  764. public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data)
  765. {
  766. }
  767. public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data)
  768. {
  769. }
  770. public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data)
  771. {
  772. }
  773. public void SendDirLandReply(UUID queryID, DirLandReplyData[] data)
  774. {
  775. }
  776. public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data)
  777. {
  778. }
  779. public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
  780. {
  781. }
  782. public void KillEndDone()
  783. {
  784. }
  785. public void SendEventInfoReply (EventData info)
  786. {
  787. }
  788. public void SendOfferCallingCard (UUID destID, UUID transactionID)
  789. {
  790. }
  791. public void SendAcceptCallingCard (UUID transactionID)
  792. {
  793. }
  794. public void SendDeclineCallingCard (UUID transactionID)
  795. {
  796. }
  797. public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
  798. {
  799. }
  800. public void SendJoinGroupReply(UUID groupID, bool success)
  801. {
  802. }
  803. public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool succss)
  804. {
  805. }
  806. public void SendLeaveGroupReply(UUID groupID, bool success)
  807. {
  808. }
  809. public void SendTerminateFriend(UUID exFriendID)
  810. {
  811. }
  812. #region IClientAPI Members
  813. public bool AddGenericPacketHandler(string MethodName, GenericMessage handler)
  814. {
  815. return true;
  816. }
  817. public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
  818. {
  819. }
  820. public void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, string simName, Vector3 globalPos, string parcelName, byte classifiedFlags, int price)
  821. {
  822. }
  823. public void SendAgentDropGroup(UUID groupID)
  824. {
  825. }
  826. public void SendAvatarNotesReply(UUID targetID, string text)
  827. {
  828. }
  829. public void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks)
  830. {
  831. }
  832. public void SendAvatarClassifiedReply(UUID targetID, Dictionary<UUID, string> classifieds)
  833. {
  834. }
  835. #endregion
  836. }
  837. }