IRCClientView.cs 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782
  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 OpenSimulator 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.IO;
  30. using System.Net;
  31. using System.Net.Sockets;
  32. using System.Reflection;
  33. using System.Text;
  34. using System.Threading;
  35. using log4net;
  36. using OpenMetaverse;
  37. using OpenMetaverse.Packets;
  38. using OpenSim.Framework;
  39. using OpenSim.Framework.Client;
  40. using OpenSim.Framework.Monitoring;
  41. using OpenSim.Region.Framework.Scenes;
  42. namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
  43. {
  44. public delegate void OnIRCClientReadyDelegate(IRCClientView cv);
  45. public class IRCClientView : IClientAPI, IClientCore
  46. {
  47. public event OnIRCClientReadyDelegate OnIRCReady;
  48. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  49. private readonly TcpClient m_client;
  50. private readonly Scene m_scene;
  51. private UUID m_agentID = UUID.Random();
  52. public ISceneAgent SceneAgent { get; set; }
  53. public ViewerFlags ViewerFlags { get; private set; } = 0;
  54. public int PingTimeMS { get { return 0; } }
  55. private string m_username;
  56. private string m_nick;
  57. private bool m_hasNick = false;
  58. private bool m_hasUser = false;
  59. private bool m_connected = true;
  60. public List<uint> SelectedObjects {get; private set;}
  61. public IRCClientView(TcpClient client, Scene scene)
  62. {
  63. m_client = client;
  64. m_scene = scene;
  65. WorkManager.StartThread(InternalLoop, "IRCClientView");
  66. }
  67. private void SendServerCommand(string command)
  68. {
  69. SendCommand(":opensimircd " + command);
  70. }
  71. private void SendCommand(string command)
  72. {
  73. m_log.Info("[IRCd] Sending >>> " + command);
  74. byte[] buf = Util.UTF8.GetBytes(command + "\r\n");
  75. m_client.GetStream().BeginWrite(buf, 0, buf.Length, SendComplete, null);
  76. }
  77. private void SendComplete(IAsyncResult result)
  78. {
  79. m_log.Info("[IRCd] Send Complete.");
  80. }
  81. private string IrcRegionName
  82. {
  83. // I know &Channel is more technically correct, but people are used to seeing #Channel
  84. // Dont shoot me!
  85. get { return "#" + m_scene.RegionInfo.RegionName.Replace(" ", "-"); }
  86. }
  87. private void InternalLoop()
  88. {
  89. try
  90. {
  91. string strbuf = String.Empty;
  92. while (m_connected && m_client.Connected)
  93. {
  94. byte[] buf = new byte[8]; // RFC1459 defines max message size as 512.
  95. int count = m_client.GetStream().Read(buf, 0, buf.Length);
  96. string line = Util.UTF8.GetString(buf, 0, count);
  97. strbuf += line;
  98. string message = ExtractMessage(strbuf);
  99. if (message != null)
  100. {
  101. // Remove from buffer
  102. strbuf = strbuf.Remove(0, message.Length);
  103. m_log.Info("[IRCd] Recieving <<< " + message);
  104. message = message.Trim();
  105. // Extract command sequence
  106. string command = ExtractCommand(message);
  107. ProcessInMessage(message, command);
  108. }
  109. else
  110. {
  111. //m_log.Info("[IRCd] Recieved data, but not enough to make a message. BufLen is " + strbuf.Length +
  112. // "[" + strbuf + "]");
  113. if (strbuf.Length == 0)
  114. {
  115. m_connected = false;
  116. m_log.Info("[IRCd] Buffer zero, closing...");
  117. if (OnDisconnectUser != null)
  118. OnDisconnectUser();
  119. }
  120. }
  121. Thread.Sleep(0);
  122. Watchdog.UpdateThread();
  123. }
  124. }
  125. catch (IOException)
  126. {
  127. if (OnDisconnectUser != null)
  128. OnDisconnectUser();
  129. m_log.Warn("[IRCd] Disconnected client.");
  130. }
  131. catch (SocketException)
  132. {
  133. if (OnDisconnectUser != null)
  134. OnDisconnectUser();
  135. m_log.Warn("[IRCd] Disconnected client.");
  136. }
  137. Watchdog.RemoveThread();
  138. }
  139. private void ProcessInMessage(string message, string command)
  140. {
  141. m_log.Info("[IRCd] Processing [MSG:" + message + "] [COM:" + command + "]");
  142. if (command != null)
  143. {
  144. switch (command)
  145. {
  146. case "ADMIN":
  147. case "AWAY":
  148. case "CONNECT":
  149. case "DIE":
  150. case "ERROR":
  151. case "INFO":
  152. case "INVITE":
  153. case "ISON":
  154. case "KICK":
  155. case "KILL":
  156. case "LINKS":
  157. case "LUSERS":
  158. case "OPER":
  159. case "PART":
  160. case "REHASH":
  161. case "SERVICE":
  162. case "SERVLIST":
  163. case "SERVER":
  164. case "SQUERY":
  165. case "SQUIT":
  166. case "STATS":
  167. case "SUMMON":
  168. case "TIME":
  169. case "TRACE":
  170. case "VERSION":
  171. case "WALLOPS":
  172. case "WHOIS":
  173. case "WHOWAS":
  174. SendServerCommand("421 " + command + " :Command unimplemented");
  175. break;
  176. // Connection Commands
  177. case "PASS":
  178. break; // Ignore for now. I want to implement authentication later however.
  179. case "JOIN":
  180. IRC_SendReplyJoin();
  181. break;
  182. case "MODE":
  183. IRC_SendReplyModeChannel();
  184. break;
  185. case "USER":
  186. IRC_ProcessUser(message);
  187. IRC_Ready();
  188. break;
  189. case "USERHOST":
  190. string[] userhostArgs = ExtractParameters(message);
  191. if (userhostArgs[0] == ":" + m_nick)
  192. {
  193. SendServerCommand("302 :" + m_nick + "=+" + m_nick + "@" +
  194. ((IPEndPoint) m_client.Client.RemoteEndPoint).Address);
  195. }
  196. break;
  197. case "NICK":
  198. IRC_ProcessNick(message);
  199. IRC_Ready();
  200. break;
  201. case "TOPIC":
  202. IRC_SendReplyTopic();
  203. break;
  204. case "USERS":
  205. IRC_SendReplyUsers();
  206. break;
  207. case "LIST":
  208. break; // TODO
  209. case "MOTD":
  210. IRC_SendMOTD();
  211. break;
  212. case "NOTICE": // TODO
  213. break;
  214. case "WHO": // TODO
  215. IRC_SendNamesReply();
  216. IRC_SendWhoReply();
  217. break;
  218. case "PING":
  219. IRC_ProcessPing(message);
  220. break;
  221. // Special case, ignore this completely.
  222. case "PONG":
  223. break;
  224. case "QUIT":
  225. if (OnDisconnectUser != null)
  226. OnDisconnectUser();
  227. break;
  228. case "NAMES":
  229. IRC_SendNamesReply();
  230. break;
  231. case "PRIVMSG":
  232. IRC_ProcessPrivmsg(message);
  233. break;
  234. default:
  235. SendServerCommand("421 " + command + " :Unknown command");
  236. break;
  237. }
  238. }
  239. }
  240. private void IRC_Ready()
  241. {
  242. if (m_hasUser && m_hasNick)
  243. {
  244. SendServerCommand("001 " + m_nick + " :Welcome to OpenSimulator IRCd");
  245. SendServerCommand("002 " + m_nick + " :Running OpenSimVersion");
  246. SendServerCommand("003 " + m_nick + " :This server was created over 9000 years ago");
  247. SendServerCommand("004 " + m_nick + " :opensimirc r1 aoOirw abeiIklmnoOpqrstv");
  248. SendServerCommand("251 " + m_nick + " :There are 0 users and 0 services on 1 servers");
  249. SendServerCommand("252 " + m_nick + " 0 :operators online");
  250. SendServerCommand("253 " + m_nick + " 0 :unknown connections");
  251. SendServerCommand("254 " + m_nick + " 1 :channels formed");
  252. SendServerCommand("255 " + m_nick + " :I have 1 users, 0 services and 1 servers");
  253. SendCommand(":" + m_nick + " MODE " + m_nick + " :+i");
  254. SendCommand(":" + m_nick + " JOIN :" + IrcRegionName);
  255. // Rename to 'Real Name'
  256. SendCommand(":" + m_nick + " NICK :" + m_username.Replace(" ", ""));
  257. m_nick = m_username.Replace(" ", "");
  258. IRC_SendReplyJoin();
  259. IRC_SendChannelPrivmsg("System", "Welcome to OpenSimulator.");
  260. IRC_SendChannelPrivmsg("System", "You are in a maze of twisty little passages, all alike.");
  261. IRC_SendChannelPrivmsg("System", "It is pitch black. You are likely to be eaten by a grue.");
  262. if (OnIRCReady != null)
  263. OnIRCReady(this);
  264. }
  265. }
  266. private void IRC_SendReplyJoin()
  267. {
  268. IRC_SendReplyTopic();
  269. IRC_SendNamesReply();
  270. }
  271. private void IRC_SendReplyModeChannel()
  272. {
  273. SendServerCommand("324 " + m_nick + " " + IrcRegionName + " +n");
  274. //SendCommand(":" + IrcRegionName + " MODE +n");
  275. }
  276. private void IRC_ProcessUser(string message)
  277. {
  278. string[] userArgs = ExtractParameters(message);
  279. // TODO: unused: string username = userArgs[0];
  280. // TODO: unused: string hostname = userArgs[1];
  281. // TODO: unused: string servername = userArgs[2];
  282. string realname = userArgs[3].Replace(":", "");
  283. m_username = realname;
  284. m_hasUser = true;
  285. }
  286. private void IRC_ProcessNick(string message)
  287. {
  288. string[] nickArgs = ExtractParameters(message);
  289. string nickname = nickArgs[0].Replace(":","");
  290. m_nick = nickname;
  291. m_hasNick = true;
  292. }
  293. private void IRC_ProcessPing(string message)
  294. {
  295. string[] pingArgs = ExtractParameters(message);
  296. string pingHost = pingArgs[0];
  297. SendCommand("PONG " + pingHost);
  298. }
  299. private void IRC_ProcessPrivmsg(string message)
  300. {
  301. string[] privmsgArgs = ExtractParameters(message);
  302. if (privmsgArgs[0] == IrcRegionName)
  303. {
  304. if (OnChatFromClient != null)
  305. {
  306. OSChatMessage msg = new OSChatMessage
  307. {
  308. Sender = this,
  309. Channel = 0,
  310. From = Name,
  311. Message = privmsgArgs[1].Replace(":", ""),
  312. Scene = m_scene,
  313. SenderUUID = this.AgentId,
  314. Type = ChatTypeEnum.Say
  315. };
  316. OnChatFromClient(this, msg);
  317. }
  318. }
  319. else
  320. {
  321. // Handle as an IM, later.
  322. }
  323. }
  324. private void IRC_SendNamesReply()
  325. {
  326. EntityBase[] users = m_scene.Entities.GetAllByType<ScenePresence>();
  327. foreach (EntityBase user in users)
  328. {
  329. SendServerCommand("353 " + m_nick + " = " + IrcRegionName + " :" + user.Name.Replace(" ", ""));
  330. }
  331. SendServerCommand("366 " + IrcRegionName + " :End of /NAMES list");
  332. }
  333. private void IRC_SendWhoReply()
  334. {
  335. EntityBase[] users = m_scene.Entities.GetAllByType<ScenePresence>();
  336. foreach (EntityBase user in users)
  337. {
  338. /*SendServerCommand(String.Format("352 {0} {1} {2} {3} {4} {5} :0 {6}", IrcRegionName,
  339. user.Name.Replace(" ", ""), "nohost.com", "opensimircd",
  340. user.Name.Replace(" ", ""), 'H', user.Name));*/
  341. SendServerCommand("352 " + m_nick + " " + IrcRegionName + " n=" + user.Name.Replace(" ", "") + " fakehost.com " + user.Name.Replace(" ", "") + " H " + ":0 " + user.Name);
  342. //SendServerCommand("352 " + IrcRegionName + " " + user.Name.Replace(" ", "") + " nohost.com irc.opensimulator " + user.Name.Replace(" ", "") + " H " + ":0 " + user.Name);
  343. }
  344. SendServerCommand("315 " + m_nick + " " + IrcRegionName + " :End of /WHO list");
  345. }
  346. private void IRC_SendMOTD()
  347. {
  348. SendServerCommand("375 :- OpenSimulator Message of the day -");
  349. SendServerCommand("372 :- Hiya!");
  350. SendServerCommand("376 :End of /MOTD command");
  351. }
  352. private void IRC_SendReplyTopic()
  353. {
  354. SendServerCommand("332 " + IrcRegionName + " :OpenSimulator IRC Server");
  355. }
  356. private void IRC_SendReplyUsers()
  357. {
  358. EntityBase[] users = m_scene.Entities.GetAllByType<ScenePresence>();
  359. SendServerCommand("392 :UserID Terminal Host");
  360. if (users.Length == 0)
  361. {
  362. SendServerCommand("395 :Nobody logged in");
  363. return;
  364. }
  365. foreach (EntityBase user in users)
  366. {
  367. char[] nom = new char[8];
  368. char[] term = "terminal_".ToCharArray();
  369. char[] host = "hostname".ToCharArray();
  370. string userName = user.Name.Replace(" ","");
  371. for (int i = 0; i < nom.Length; i++)
  372. {
  373. if (userName.Length < i)
  374. nom[i] = userName[i];
  375. else
  376. nom[i] = ' ';
  377. }
  378. SendServerCommand("393 :" + nom + " " + term + " " + host + "");
  379. }
  380. SendServerCommand("394 :End of users");
  381. }
  382. private static string ExtractMessage(string buffer)
  383. {
  384. int pos = buffer.IndexOf("\r\n");
  385. if (pos == -1)
  386. return null;
  387. string command = buffer.Substring(0, pos + 2);
  388. return command;
  389. }
  390. private static string ExtractCommand(string msg)
  391. {
  392. string[] msgs = msg.Split(' ');
  393. if (msgs.Length < 2)
  394. {
  395. m_log.Warn("[IRCd] Dropped msg: " + msg);
  396. return null;
  397. }
  398. if (msgs[0].StartsWith(":"))
  399. return msgs[1];
  400. return msgs[0];
  401. }
  402. private static string[] ExtractParameters(string msg)
  403. {
  404. string[] msgs = msg.Split(' ');
  405. List<string> parms = new List<string>(msgs.Length);
  406. bool foundCommand = false;
  407. string command = ExtractCommand(msg);
  408. for (int i=0;i<msgs.Length;i++)
  409. {
  410. if (msgs[i] == command)
  411. {
  412. foundCommand = true;
  413. continue;
  414. }
  415. if (foundCommand != true)
  416. continue;
  417. if (i != 0 && msgs[i].StartsWith(":"))
  418. {
  419. List<string> tmp = new List<string>();
  420. for (int j=i;j<msgs.Length;j++)
  421. {
  422. tmp.Add(msgs[j]);
  423. }
  424. parms.Add(string.Join(" ", tmp.ToArray()));
  425. break;
  426. }
  427. parms.Add(msgs[i]);
  428. }
  429. return parms.ToArray();
  430. }
  431. #region Implementation of IClientAPI
  432. public Vector3 StartPos
  433. {
  434. get { return new Vector3(m_scene.RegionInfo.RegionSizeX * 0.5f, m_scene.RegionInfo.RegionSizeY * 0.5f, 50f); }
  435. set { }
  436. }
  437. public float StartFar { get; set; }
  438. public float FOV { get; set; } = 1.25f;
  439. public int viewHeight { get; set; } = 480;
  440. public int viewWidth { get; set; } = 640;
  441. public bool TryGet<T>(out T iface)
  442. {
  443. iface = default(T);
  444. return false;
  445. }
  446. public T Get<T>()
  447. {
  448. return default(T);
  449. }
  450. public UUID AgentId
  451. {
  452. get { return m_agentID; }
  453. }
  454. public UUID ScopeId { get { return UUID.Zero; } }
  455. public void Disconnect(string reason)
  456. {
  457. IRC_SendChannelPrivmsg("System", "You have been eaten by a grue. (" + reason + ")");
  458. m_connected = false;
  459. m_client.Close();
  460. }
  461. public void Disconnect()
  462. {
  463. IRC_SendChannelPrivmsg("System", "You have been eaten by a grue.");
  464. m_connected = false;
  465. m_client.Close();
  466. SceneAgent = null;
  467. }
  468. public UUID SessionId
  469. {
  470. get { return m_agentID; }
  471. }
  472. public UUID SecureSessionId
  473. {
  474. get { return m_agentID; }
  475. }
  476. public UUID ActiveGroupId
  477. {
  478. get { return UUID.Zero; }
  479. set {}
  480. }
  481. public string ActiveGroupName
  482. {
  483. get { return "IRCd User"; }
  484. set {}
  485. }
  486. public ulong ActiveGroupPowers
  487. {
  488. get { return 0; }
  489. set {}
  490. }
  491. public Dictionary<UUID, ulong> GetGroupPowers()
  492. {
  493. return new Dictionary<UUID, ulong>();
  494. }
  495. public void SetGroupPowers(Dictionary<UUID, ulong> powers) { }
  496. public ulong GetGroupPowers(UUID groupID)
  497. {
  498. return 0;
  499. }
  500. public bool IsGroupMember(UUID GroupID)
  501. {
  502. return false;
  503. }
  504. public string FirstName
  505. {
  506. get
  507. {
  508. string[] names = m_username.Split(' ');
  509. return names[0];
  510. }
  511. }
  512. public string LastName
  513. {
  514. get
  515. {
  516. string[] names = m_username.Split(' ');
  517. if (names.Length > 1)
  518. return names[1];
  519. return names[0];
  520. }
  521. }
  522. public IScene Scene
  523. {
  524. get { return m_scene; }
  525. }
  526. public int NextAnimationSequenceNumber
  527. {
  528. get { return 0; }
  529. set { }
  530. }
  531. public string Name
  532. {
  533. get { return m_username; }
  534. }
  535. public bool IsActive
  536. {
  537. get { return true; }
  538. set { if (!value) Disconnect("IsActive Disconnected?"); }
  539. }
  540. public bool IsLoggingOut
  541. {
  542. get { return false; }
  543. set { }
  544. }
  545. public bool SendLogoutPacketWhenClosing
  546. {
  547. set { }
  548. }
  549. public uint CircuitCode
  550. {
  551. get { return (uint)Random.Shared.Next(0,int.MaxValue); }
  552. }
  553. public IPEndPoint RemoteEndPoint
  554. {
  555. get { return (IPEndPoint)m_client.Client.RemoteEndPoint; }
  556. }
  557. #pragma warning disable 67
  558. public event GenericMessage OnGenericMessage;
  559. public event ImprovedInstantMessage OnInstantMessage;
  560. public event ChatMessage OnChatFromClient;
  561. public event TextureRequest OnRequestTexture;
  562. public event RezObject OnRezObject;
  563. public event ModifyTerrain OnModifyTerrain;
  564. public event BakeTerrain OnBakeTerrain;
  565. public event EstateChangeInfo OnEstateChangeInfo;
  566. public event EstateManageTelehub OnEstateManageTelehub;
  567. public event CachedTextureRequest OnCachedTextureRequest;
  568. public event SetAppearance OnSetAppearance;
  569. public event AvatarNowWearing OnAvatarNowWearing;
  570. public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
  571. public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv;
  572. public event UUIDNameRequest OnDetachAttachmentIntoInv;
  573. public event ObjectAttach OnObjectAttach;
  574. public event ObjectDeselect OnObjectDetach;
  575. public event ObjectDrop OnObjectDrop;
  576. public event StartAnim OnStartAnim;
  577. public event StopAnim OnStopAnim;
  578. public event ChangeAnim OnChangeAnim;
  579. public event LinkObjects OnLinkObjects;
  580. public event DelinkObjects OnDelinkObjects;
  581. public event RequestMapBlocks OnRequestMapBlocks;
  582. public event RequestMapName OnMapNameRequest;
  583. public event TeleportLocationRequest OnTeleportLocationRequest;
  584. public event DisconnectUser OnDisconnectUser;
  585. public event RequestAvatarProperties OnRequestAvatarProperties;
  586. public event SetAlwaysRun OnSetAlwaysRun;
  587. public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
  588. public event TeleportCancel OnTeleportCancel;
  589. public event DeRezObject OnDeRezObject;
  590. public event RezRestoreToWorld OnRezRestoreToWorld;
  591. public event Action<IClientAPI> OnRegionHandShakeReply;
  592. public event GenericCall1 OnRequestWearables;
  593. public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
  594. public event UpdateAgent OnPreAgentUpdate;
  595. public event UpdateAgent OnAgentUpdate;
  596. public event UpdateAgent OnAgentCameraUpdate;
  597. public event AgentRequestSit OnAgentRequestSit;
  598. public event AgentSit OnAgentSit;
  599. public event AvatarPickerRequest OnAvatarPickerRequest;
  600. public event Action<IClientAPI> OnRequestAvatarsData;
  601. public event AddNewPrim OnAddPrim;
  602. public event AgentDataUpdate OnAgentDataUpdateRequest;
  603. public event TeleportLocationRequest OnSetStartLocationRequest;
  604. public event RequestGodlikePowers OnRequestGodlikePowers;
  605. public event GodKickUser OnGodKickUser;
  606. public event ObjectDuplicate OnObjectDuplicate;
  607. public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
  608. public event GrabObject OnGrabObject;
  609. public event DeGrabObject OnDeGrabObject;
  610. public event MoveObject OnGrabUpdate;
  611. public event SpinStart OnSpinStart;
  612. public event SpinObject OnSpinUpdate;
  613. public event SpinStop OnSpinStop;
  614. public event UpdateShape OnUpdatePrimShape;
  615. public event ObjectExtraParams OnUpdateExtraParams;
  616. public event ObjectRequest OnObjectRequest;
  617. public event ObjectSelect OnObjectSelect;
  618. public event ObjectDeselect OnObjectDeselect;
  619. public event GenericCall7 OnObjectDescription;
  620. public event GenericCall7 OnObjectName;
  621. public event GenericCall7 OnObjectClickAction;
  622. public event GenericCall7 OnObjectMaterial;
  623. public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
  624. public event UpdatePrimFlags OnUpdatePrimFlags;
  625. public event UpdatePrimTexture OnUpdatePrimTexture;
  626. public event ClientChangeObject onClientChangeObject;
  627. public event UpdateVector OnUpdatePrimGroupPosition;
  628. public event UpdateVector OnUpdatePrimSinglePosition;
  629. public event UpdatePrimRotation OnUpdatePrimGroupRotation;
  630. public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
  631. public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition;
  632. public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
  633. public event UpdateVector OnUpdatePrimScale;
  634. public event UpdateVector OnUpdatePrimGroupScale;
  635. public event StatusChange OnChildAgentStatus;
  636. public event GenericCall2 OnStopMovement;
  637. public event Action<UUID> OnRemoveAvatar;
  638. public event ObjectPermissions OnObjectPermissions;
  639. public event CreateNewInventoryItem OnCreateNewInventoryItem;
  640. public event LinkInventoryItem OnLinkInventoryItem;
  641. public event CreateInventoryFolder OnCreateNewInventoryFolder;
  642. public event UpdateInventoryFolder OnUpdateInventoryFolder;
  643. public event MoveInventoryFolder OnMoveInventoryFolder;
  644. public event FetchInventoryDescendents OnFetchInventoryDescendents;
  645. public event PurgeInventoryDescendents OnPurgeInventoryDescendents;
  646. public event FetchInventory OnFetchInventory;
  647. public event RequestTaskInventory OnRequestTaskInventory;
  648. public event UpdateInventoryItem OnUpdateInventoryItem;
  649. public event CopyInventoryItem OnCopyInventoryItem;
  650. public event MoveInventoryItem OnMoveInventoryItem;
  651. public event RemoveInventoryFolder OnRemoveInventoryFolder;
  652. public event RemoveInventoryItem OnRemoveInventoryItem;
  653. public event UDPAssetUploadRequest OnAssetUploadRequest;
  654. public event XferReceive OnXferReceive;
  655. public event RequestXfer OnRequestXfer;
  656. public event ConfirmXfer OnConfirmXfer;
  657. public event AbortXfer OnAbortXfer;
  658. public event RezScript OnRezScript;
  659. public event UpdateTaskInventory OnUpdateTaskInventory;
  660. public event MoveTaskInventory OnMoveTaskItem;
  661. public event RemoveTaskInventory OnRemoveTaskItem;
  662. public event RequestAsset OnRequestAsset;
  663. public event UUIDNameRequest OnNameFromUUIDRequest;
  664. public event ParcelAccessListRequest OnParcelAccessListRequest;
  665. public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest;
  666. public event ParcelPropertiesRequest OnParcelPropertiesRequest;
  667. public event ParcelDivideRequest OnParcelDivideRequest;
  668. public event ParcelJoinRequest OnParcelJoinRequest;
  669. public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
  670. public event ParcelSelectObjects OnParcelSelectObjects;
  671. public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
  672. public event ParcelAbandonRequest OnParcelAbandonRequest;
  673. public event ParcelGodForceOwner OnParcelGodForceOwner;
  674. public event ParcelReclaim OnParcelReclaim;
  675. public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest;
  676. public event ParcelDeedToGroup OnParcelDeedToGroup;
  677. public event RegionInfoRequest OnRegionInfoRequest;
  678. public event EstateCovenantRequest OnEstateCovenantRequest;
  679. public event FriendActionDelegate OnApproveFriendRequest;
  680. public event FriendActionDelegate OnDenyFriendRequest;
  681. public event FriendshipTermination OnTerminateFriendship;
  682. public event GrantUserFriendRights OnGrantUserRights;
  683. public event MoneyTransferRequest OnMoneyTransferRequest;
  684. public event EconomyDataRequest OnEconomyDataRequest;
  685. public event MoneyBalanceRequest OnMoneyBalanceRequest;
  686. public event UpdateAvatarProperties OnUpdateAvatarProperties;
  687. public event ParcelBuy OnParcelBuy;
  688. public event RequestPayPrice OnRequestPayPrice;
  689. public event ObjectSaleInfo OnObjectSaleInfo;
  690. public event ObjectBuy OnObjectBuy;
  691. public event BuyObjectInventory OnBuyObjectInventory;
  692. public event RequestTerrain OnRequestTerrain;
  693. public event RequestTerrain OnUploadTerrain;
  694. public event ObjectIncludeInSearch OnObjectIncludeInSearch;
  695. public event UUIDNameRequest OnTeleportHomeRequest;
  696. public event ScriptAnswer OnScriptAnswer;
  697. public event AgentSit OnUndo;
  698. public event AgentSit OnRedo;
  699. public event LandUndo OnLandUndo;
  700. public event ForceReleaseControls OnForceReleaseControls;
  701. public event GodLandStatRequest OnLandStatRequest;
  702. public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
  703. public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
  704. public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
  705. public event SetEstateTerrainDetailTexture OnSetEstateTerrainDetailTexture;
  706. public event SetEstateTerrainTextureHeights OnSetEstateTerrainTextureHeights;
  707. public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest;
  708. public event SetRegionTerrainSettings OnSetRegionTerrainSettings;
  709. public event EstateRestartSimRequest OnEstateRestartSimRequest;
  710. public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest;
  711. public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest;
  712. public event SimulatorBlueBoxMessageRequest OnSimulatorBlueBoxMessageRequest;
  713. public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
  714. public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
  715. public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
  716. public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest;
  717. public event UUIDNameRequest OnUUIDGroupNameRequest;
  718. public event RegionHandleRequest OnRegionHandleRequest;
  719. public event ParcelInfoRequest OnParcelInfoRequest;
  720. public event RequestObjectPropertiesFamily OnObjectGroupRequest;
  721. public event ScriptReset OnScriptReset;
  722. public event GetScriptRunning OnGetScriptRunning;
  723. public event SetScriptRunning OnSetScriptRunning;
  724. public event Action<Vector3, bool, bool> OnAutoPilotGo;
  725. public event TerrainUnacked OnUnackedTerrain;
  726. public event ActivateGesture OnActivateGesture;
  727. public event DeactivateGesture OnDeactivateGesture;
  728. public event ObjectOwner OnObjectOwner;
  729. public event DirPlacesQuery OnDirPlacesQuery;
  730. public event DirFindQuery OnDirFindQuery;
  731. public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
  732. public event DirLandQuery OnDirLandQuery;
  733. public event DirPopularQuery OnDirPopularQuery;
  734. public event DirClassifiedQuery OnDirClassifiedQuery;
  735. public event EventInfoRequest OnEventInfoRequest;
  736. public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime;
  737. public event MapItemRequest OnMapItemRequest;
  738. public event OfferCallingCard OnOfferCallingCard;
  739. public event AcceptCallingCard OnAcceptCallingCard;
  740. public event DeclineCallingCard OnDeclineCallingCard;
  741. public event SoundTrigger OnSoundTrigger;
  742. public event StartLure OnStartLure;
  743. public event TeleportLureRequest OnTeleportLureRequest;
  744. public event NetworkStats OnNetworkStatsUpdate;
  745. public event ClassifiedInfoRequest OnClassifiedInfoRequest;
  746. public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
  747. public event ClassifiedDelete OnClassifiedDelete;
  748. public event ClassifiedGodDelete OnClassifiedGodDelete;
  749. public event EventNotificationAddRequest OnEventNotificationAddRequest;
  750. public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
  751. public event EventGodDelete OnEventGodDelete;
  752. public event ParcelDwellRequest OnParcelDwellRequest;
  753. public event UserInfoRequest OnUserInfoRequest;
  754. public event UpdateUserInfo OnUpdateUserInfo;
  755. public event RetrieveInstantMessages OnRetrieveInstantMessages;
  756. public event PickDelete OnPickDelete;
  757. public event PickGodDelete OnPickGodDelete;
  758. public event PickInfoUpdate OnPickInfoUpdate;
  759. public event AvatarNotesUpdate OnAvatarNotesUpdate;
  760. public event MuteListRequest OnMuteListRequest;
  761. public event AvatarInterestUpdate OnAvatarInterestUpdate;
  762. public event PlacesQuery OnPlacesQuery;
  763. public event FindAgentUpdate OnFindAgent;
  764. public event TrackAgentUpdate OnTrackAgent;
  765. public event NewUserReport OnUserReport;
  766. public event SaveStateHandler OnSaveState;
  767. public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
  768. public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
  769. public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
  770. public event FreezeUserUpdate OnParcelFreezeUser;
  771. public event EjectUserUpdate OnParcelEjectUser;
  772. public event ParcelBuyPass OnParcelBuyPass;
  773. public event ParcelGodMark OnParcelGodMark;
  774. public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
  775. public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
  776. public event SimWideDeletesDelegate OnSimWideDeletes;
  777. public event SendPostcard OnSendPostcard;
  778. public event ChangeInventoryItemFlags OnChangeInventoryItemFlags;
  779. public event MuteListEntryUpdate OnUpdateMuteListEntry;
  780. public event MuteListEntryRemove OnRemoveMuteListEntry;
  781. public event GodlikeMessage onGodlikeMessage;
  782. public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
  783. public event GenericCall2 OnUpdateThrottles;
  784. #pragma warning restore 67
  785. public int DebugPacketLevel { get; set; }
  786. public void InPacket(object NewPack)
  787. {
  788. }
  789. public void ProcessInPacket(Packet NewPack)
  790. {
  791. }
  792. public void Close()
  793. {
  794. Close(true, false);
  795. }
  796. public void Close(bool sendStop, bool force)
  797. {
  798. Disconnect();
  799. }
  800. public void Kick(string message)
  801. {
  802. Disconnect(message);
  803. }
  804. public void Start()
  805. {
  806. m_scene.AddNewAgent(this, PresenceType.User);
  807. // Mimicking LLClientView which gets always set appearance from client.
  808. AvatarAppearance appearance;
  809. m_scene.GetAvatarAppearance(this, out appearance);
  810. OnSetAppearance(this, appearance.Texture, (byte[])appearance.VisualParams.Clone(),appearance.AvatarSize, new WearableCacheItem[0]);
  811. }
  812. public void SendRegionHandshake()
  813. {
  814. m_log.Info("[IRCd ClientStack] Completing Handshake to Region");
  815. if (OnRegionHandShakeReply != null)
  816. {
  817. OnRegionHandShakeReply(this);
  818. }
  819. if (OnCompleteMovementToRegion != null)
  820. {
  821. OnCompleteMovementToRegion(this, false);
  822. }
  823. }
  824. public void Stop()
  825. {
  826. Disconnect();
  827. }
  828. public void SendWearables(AvatarWearable[] wearables, int serial)
  829. {
  830. }
  831. public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry, float hoverheight)
  832. {
  833. }
  834. public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List<CachedTextureResponseArg> cachedTextures)
  835. {
  836. }
  837. public void SendKillObject(List<uint> localID)
  838. {
  839. }
  840. public void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
  841. {
  842. }
  843. public void SendChatMessage(
  844. string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source, byte audible)
  845. {
  846. if (audible > 0 && message.Length > 0)
  847. IRC_SendChannelPrivmsg(fromName, message);
  848. }
  849. private void IRC_SendChannelPrivmsg(string fromName, string message)
  850. {
  851. SendCommand(":" + fromName.Replace(" ", "") + " PRIVMSG " + IrcRegionName + " :" + message);
  852. }
  853. public void SendInstantMessage(GridInstantMessage im)
  854. {
  855. // TODO
  856. }
  857. public void SendGenericMessage(string method, UUID invoice, List<string> message)
  858. {
  859. }
  860. public void SendGenericMessage(string method, UUID invoice, List<byte[]> message)
  861. {
  862. }
  863. public virtual bool CanSendLayerData()
  864. {
  865. return false;
  866. }
  867. public void SendLayerData()
  868. {
  869. }
  870. public void SendLayerData(int[] map)
  871. {
  872. }
  873. public void SendWindData(int version, Vector2[] windSpeeds)
  874. {
  875. }
  876. public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look)
  877. {
  878. }
  879. public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint)
  880. {
  881. }
  882. public AgentCircuitData RequestClientInfo()
  883. {
  884. return new AgentCircuitData();
  885. }
  886. public void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL)
  887. {
  888. }
  889. public void SendMapBlock(List<MapBlockData> mapBlocks, uint flag)
  890. {
  891. }
  892. public void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags)
  893. {
  894. }
  895. public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL)
  896. {
  897. }
  898. public void SendTeleportFailed(string reason)
  899. {
  900. }
  901. public void SendTeleportStart(uint flags)
  902. {
  903. }
  904. public void SendTeleportProgress(uint flags, string message)
  905. {
  906. }
  907. public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item)
  908. {
  909. }
  910. public void SendPayPrice(UUID objectID, int[] payPrice)
  911. {
  912. }
  913. public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
  914. {
  915. }
  916. public void SendEntityFullUpdateImmediate(ISceneEntity ent)
  917. {
  918. }
  919. public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
  920. {
  921. }
  922. public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
  923. {
  924. }
  925. public void ReprioritizeUpdates()
  926. {
  927. }
  928. public void FlushPrimUpdates()
  929. {
  930. }
  931. public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items, List<InventoryFolderBase> folders,
  932. int version, int descendents, bool fetchFolders, bool fetchItems)
  933. {
  934. }
  935. public void SendInventoryItemDetails(InventoryItemBase[] items)
  936. {
  937. }
  938. public void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId)
  939. {
  940. }
  941. public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId)
  942. {
  943. }
  944. public void SendRemoveInventoryItem(UUID itemID)
  945. {
  946. }
  947. public void SendRemoveInventoryItems(UUID[] items)
  948. {
  949. }
  950. public void SendTakeControls(int controls, bool passToAgent, bool TakeControls)
  951. {
  952. }
  953. public void SendTaskInventory(UUID taskID, short serial, byte[] fileName)
  954. {
  955. }
  956. public void SendBulkUpdateInventory(InventoryNodeBase node, UUID? transactionID = null)
  957. {
  958. }
  959. public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items)
  960. {
  961. }
  962. public void SendXferPacket(ulong xferID, uint packet,
  963. byte[] XferData, int XferDataOffset, int XferDatapktLen, bool isTaskInventory)
  964. {
  965. }
  966. public void SendAbortXferPacket(ulong xferID)
  967. {
  968. }
  969. public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
  970. {
  971. }
  972. public void SendAvatarPickerReply(UUID QueryID, List<UserData> users)
  973. {
  974. }
  975. public void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle)
  976. {
  977. }
  978. public void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID)
  979. {
  980. }
  981. public void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain, byte flags)
  982. {
  983. }
  984. public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
  985. {
  986. }
  987. public void SendAttachedSoundGainChange(UUID objectID, float gain)
  988. {
  989. }
  990. public void SendNameReply(UUID profileId, string firstname, string lastname)
  991. {
  992. }
  993. public void SendAlertMessage(string message)
  994. {
  995. IRC_SendChannelPrivmsg("Alert",message);
  996. }
  997. public void SendAgentAlertMessage(string message, bool modal)
  998. {
  999. }
  1000. public void SendAlertMessage(string message, string info)
  1001. {
  1002. }
  1003. public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
  1004. {
  1005. IRC_SendChannelPrivmsg(objectname,url);
  1006. }
  1007. public void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels)
  1008. {
  1009. }
  1010. public void SendViewerTime(Vector3 sunDir, float sunphase)
  1011. {
  1012. }
  1013. public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
  1014. {
  1015. }
  1016. public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] membershipType, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID)
  1017. {
  1018. }
  1019. public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
  1020. {
  1021. }
  1022. public void SendHealth(float health)
  1023. {
  1024. }
  1025. public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID)
  1026. {
  1027. }
  1028. public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID)
  1029. {
  1030. }
  1031. public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
  1032. {
  1033. }
  1034. public void SendEstateCovenantInformation(UUID covenant)
  1035. {
  1036. }
  1037. public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner)
  1038. {
  1039. }
  1040. public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
  1041. {
  1042. }
  1043. public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
  1044. {
  1045. }
  1046. public void SendForceClientSelectObjects(List<uint> objectIDs)
  1047. {
  1048. }
  1049. public void SendCameraConstraint(Vector4 ConstraintPlane)
  1050. {
  1051. }
  1052. public void SendLandObjectOwners(LandData land, List<UUID> groups, Dictionary<UUID, int> ownersAndCount)
  1053. {
  1054. }
  1055. public void SendLandParcelOverlay(byte[] data, int sequence_id)
  1056. {
  1057. }
  1058. public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time)
  1059. {
  1060. }
  1061. public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop)
  1062. {
  1063. }
  1064. public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
  1065. {
  1066. }
  1067. public void SendConfirmXfer(ulong xferID, uint PacketID)
  1068. {
  1069. }
  1070. public void SendXferRequest(ulong XferID, short AssetType, UUID vFileID, byte FilePath, byte[] FileName)
  1071. {
  1072. }
  1073. public void SendInitiateDownload(string simFileName, string clientFileName)
  1074. {
  1075. }
  1076. public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
  1077. {
  1078. }
  1079. public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
  1080. {
  1081. }
  1082. public void SendImageNotFound(UUID imageid)
  1083. {
  1084. }
  1085. public void SendShutdownConnectionNotice()
  1086. {
  1087. // TODO
  1088. }
  1089. public void SendSimStats(SimStats stats)
  1090. {
  1091. }
  1092. public void SendObjectPropertiesFamilyData(ISceneEntity Entity, uint RequestFlags)
  1093. {
  1094. }
  1095. public void SendObjectPropertiesReply(ISceneEntity entity)
  1096. {
  1097. }
  1098. public void SendAgentOffline(UUID[] agentIDs)
  1099. {
  1100. }
  1101. public void SendAgentOnline(UUID[] agentIDs)
  1102. {
  1103. }
  1104. public void SendFindAgent(UUID HunterID, UUID PreyID, double GlobalX, double GlobalY)
  1105. {
  1106. }
  1107. public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
  1108. {
  1109. }
  1110. public void SendAdminResponse(UUID Token, uint AdminLevel)
  1111. {
  1112. }
  1113. public void SendGroupMembership(GroupMembershipData[] GroupMembership)
  1114. {
  1115. }
  1116. public void SendGroupNameReply(UUID groupLLUID, string GroupName)
  1117. {
  1118. }
  1119. public void SendJoinGroupReply(UUID groupID, bool success)
  1120. {
  1121. }
  1122. public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success)
  1123. {
  1124. }
  1125. public void SendLeaveGroupReply(UUID groupID, bool success)
  1126. {
  1127. }
  1128. public void SendCreateGroupReply(UUID groupID, bool success, string message)
  1129. {
  1130. }
  1131. public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
  1132. {
  1133. }
  1134. public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running)
  1135. {
  1136. }
  1137. public void SendAsset(AssetRequestToClient req)
  1138. {
  1139. }
  1140. public void SendTexture(AssetBase TextureAsset)
  1141. {
  1142. }
  1143. public virtual void SetChildAgentThrottle(byte[] throttle)
  1144. {
  1145. }
  1146. public virtual void SetChildAgentThrottle(byte[] throttle,float factor)
  1147. {
  1148. }
  1149. public void SetAgentThrottleSilent(int throttle, int setting)
  1150. {
  1151. }
  1152. public byte[] GetThrottlesPacked(float multiplier)
  1153. {
  1154. return Array.Empty<byte>();
  1155. }
  1156. #pragma warning disable 0067
  1157. public event ViewerEffectEventHandler OnViewerEffect;
  1158. public event Action<IClientAPI> OnLogout;
  1159. public event Action<IClientAPI> OnConnectionClosed;
  1160. #pragma warning restore 0067
  1161. public void SendBlueBoxMessage(UUID FromAvatarID, string FromAvatarName, string Message)
  1162. {
  1163. IRC_SendChannelPrivmsg(FromAvatarName, Message);
  1164. }
  1165. public void SendLogoutPacket()
  1166. {
  1167. Disconnect();
  1168. }
  1169. public ClientInfo GetClientInfo()
  1170. {
  1171. return new ClientInfo();
  1172. }
  1173. public void SetClientInfo(ClientInfo info)
  1174. {
  1175. }
  1176. public void SetClientOption(string option, string value)
  1177. {
  1178. }
  1179. public string GetClientOption(string option)
  1180. {
  1181. return String.Empty;
  1182. }
  1183. public void Terminate()
  1184. {
  1185. Disconnect();
  1186. }
  1187. public void SendSetFollowCamProperties(UUID objectID, SortedDictionary<int, float> parameters)
  1188. {
  1189. }
  1190. public void SendClearFollowCamProperties(UUID objectID)
  1191. {
  1192. }
  1193. public void SendRegionHandle(UUID regoinID, ulong handle)
  1194. {
  1195. }
  1196. public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
  1197. {
  1198. }
  1199. public void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt)
  1200. {
  1201. }
  1202. public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data)
  1203. {
  1204. }
  1205. public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)
  1206. {
  1207. }
  1208. public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data)
  1209. {
  1210. }
  1211. public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data)
  1212. {
  1213. }
  1214. public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data)
  1215. {
  1216. }
  1217. public void SendDirLandReply(UUID queryID, DirLandReplyData[] data)
  1218. {
  1219. }
  1220. public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data)
  1221. {
  1222. }
  1223. public void SendEventInfoReply(EventData info)
  1224. {
  1225. }
  1226. public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List<Vector3> SpawnPoint)
  1227. {
  1228. }
  1229. public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
  1230. {
  1231. }
  1232. public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
  1233. {
  1234. }
  1235. public void SendAgentGroupDataUpdate(UUID avatarID, GroupMembershipData[] data)
  1236. {
  1237. }
  1238. public void SendOfferCallingCard(UUID srcID, UUID transactionID)
  1239. {
  1240. }
  1241. public void SendAcceptCallingCard(UUID transactionID)
  1242. {
  1243. }
  1244. public void SendDeclineCallingCard(UUID transactionID)
  1245. {
  1246. }
  1247. public void SendTerminateFriend(UUID exFriendID)
  1248. {
  1249. }
  1250. public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
  1251. {
  1252. }
  1253. 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)
  1254. {
  1255. }
  1256. public void SendAgentDropGroup(UUID groupID)
  1257. {
  1258. }
  1259. public void RefreshGroupMembership()
  1260. {
  1261. }
  1262. public void UpdateGroupMembership(GroupMembershipData[] data)
  1263. {
  1264. }
  1265. public void GroupMembershipRemove(UUID GroupID)
  1266. {
  1267. }
  1268. public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers)
  1269. {
  1270. }
  1271. public void SendAvatarNotesReply(UUID targetID, string text)
  1272. {
  1273. }
  1274. public void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks)
  1275. {
  1276. }
  1277. public void SendPickInfoReply(UUID pickID, UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled)
  1278. {
  1279. }
  1280. public void SendAvatarClassifiedReply(UUID targetID, Dictionary<UUID, string> classifieds)
  1281. {
  1282. }
  1283. public void SendAvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages)
  1284. {
  1285. }
  1286. public void SendParcelDwellReply(int localID, UUID parcelID, float dwell)
  1287. {
  1288. }
  1289. public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
  1290. {
  1291. }
  1292. public void SendUseCachedMuteList()
  1293. {
  1294. }
  1295. public void SendEmpytMuteList()
  1296. {
  1297. }
  1298. public void SendMuteListUpdate(string filename)
  1299. {
  1300. }
  1301. public bool AddGenericPacketHandler(string MethodName, GenericMessage handler)
  1302. {
  1303. return true;
  1304. }
  1305. #endregion
  1306. public void SendRebakeAvatarTextures(UUID textureID)
  1307. {
  1308. }
  1309. public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages)
  1310. {
  1311. }
  1312. public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt)
  1313. {
  1314. }
  1315. public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier)
  1316. {
  1317. }
  1318. public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
  1319. {
  1320. }
  1321. public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
  1322. {
  1323. }
  1324. public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
  1325. {
  1326. }
  1327. public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
  1328. {
  1329. }
  1330. public void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId)
  1331. {
  1332. }
  1333. public void SendAgentTerseUpdate(ISceneEntity presence)
  1334. {
  1335. }
  1336. public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data)
  1337. {
  1338. }
  1339. public void SendSelectedPartsProprieties(List<ISceneEntity> parts)
  1340. {
  1341. }
  1342. public void SendPartPhysicsProprieties(ISceneEntity entity)
  1343. {
  1344. }
  1345. public void SendPartFullUpdate(ISceneEntity ent, uint? parentID)
  1346. {
  1347. }
  1348. public int GetAgentThrottleSilent(int throttle)
  1349. {
  1350. return 0;
  1351. }
  1352. public uint GetViewerCaps()
  1353. {
  1354. return 0;
  1355. }
  1356. }
  1357. }