You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainWindow.xaml.cs 62 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using System.Diagnostics;
  16. using System.Windows.Threading;
  17. using Grpc.Core;
  18. using Protobuf;
  19. using Playback;
  20. // 目前MainWindow还未复现的功能:
  21. // 部分errordisplayer
  22. // private void ReactToCommandline(),
  23. // private void Playback(string fileName, double pbSpeed = 2.0)
  24. // 交互:private void ClickToSetMode(object sender, RoutedEventArgs e)
  25. // private void Bonus()
  26. namespace Client
  27. {
  28. /// <summary>
  29. /// Interaction logic for MainWindow.xaml
  30. /// </summary>
  31. public partial class MainWindow : Window
  32. {
  33. public MainWindow()
  34. {
  35. unitHeight = unitWidth = unit = 13;
  36. bonusflag = true;
  37. timer = new DispatcherTimer
  38. {
  39. Interval = new TimeSpan(50000) // 每50ms刷新一次
  40. };
  41. timer.Tick += new EventHandler(Refresh); // 定时器初始化
  42. InitializeComponent();
  43. timer.Start();
  44. SetStatusBar();
  45. isClientStocked = true;
  46. isPlaybackMode = false;
  47. drawPicLock = new();
  48. listOfProp = new List<MessageOfProp>();
  49. listOfHuman = new List<MessageOfStudent>();
  50. listOfButcher = new List<MessageOfTricker>();
  51. listOfBullet=new List<MessageOfBullet>();
  52. listOfBombedBullet = new List<MessageOfBombedBullet>();
  53. listOfAll = new List<MessageOfAll>();
  54. listOfChest = new List<MessageOfChest>();
  55. listOfClassroom = new List<MessageOfClassroom>();
  56. listOfDoor = new List<MessageOfDoor>();
  57. listOfGate = new List<MessageOfGate>();
  58. WindowStartupLocation = WindowStartupLocation.CenterScreen;
  59. comInfo[0] = "127.0.0.1";
  60. comInfo[1] = "8888";
  61. comInfo[2] = "0";
  62. comInfo[3] = "1";
  63. comInfo[4] = "1";
  64. ConnectToServer(comInfo);
  65. OnReceive();
  66. //DrawMap();
  67. //ZoomMap();
  68. //MessageOfStudent kurei = new MessageOfStudent();
  69. //kurei.X = 10000;
  70. //kurei.Y = 20000;
  71. //kurei.Speed = 1000;
  72. //kurei.PlayerId = 0;
  73. //listOfHuman.Add(kurei);
  74. //MessageOfAll all= new MessageOfAll();
  75. //all.HiddenGateRefreshed = false;
  76. //listOfAll.Add(all);
  77. // ReactToCommandline();
  78. }
  79. private void SetStatusBar()
  80. {
  81. StatusBarsOfSurvivor = new StatusBarOfSurvivor[4];
  82. StatusBarsOfHunter = new StatusBarOfHunter(MainGrid, 3, 0);
  83. StatusBarsOfCircumstance = new StatusBarOfCircumstance(MainGrid, 1, 0);
  84. for (int i = 4; i < 8; i++)
  85. {
  86. StatusBarsOfSurvivor[i - 4] = new(MainGrid, i / 2 + 2, i % 2);
  87. }
  88. }
  89. // 获得地图信息,未更新数值
  90. private void GetMap(MessageOfMap obj)
  91. {
  92. int[,] map = new int[50, 50];
  93. try
  94. {
  95. for (int i = 0; i < 50; i++)
  96. {
  97. for (int j = 0; j < 50; j++)
  98. {
  99. map[i, j] = Convert.ToInt32(obj.Row[i].Col[j]) + 4;//与proto一致
  100. }
  101. }
  102. }
  103. catch
  104. {
  105. mapFlag = false;
  106. }
  107. finally
  108. {
  109. defaultMap = map;
  110. mapFlag = true;
  111. }
  112. }
  113. //private void Playback(string fileName, double pbSpeed = 2.0)
  114. //{
  115. // var pbClient = new PlaybackClient(fileName, pbSpeed);
  116. // int[,]? map;
  117. // if ((map = pbClient.ReadDataFromFile(dataDict, drawPicLock)) != null)
  118. // {
  119. // isClientStocked = false;
  120. // isPlaybackMode = true;
  121. // defaultMap = map;
  122. // mapFlag = true;
  123. // }
  124. // else
  125. // {
  126. // MessageBox.Show("Failed to read the playback file!");
  127. // isClientStocked = true;
  128. // }
  129. //}
  130. // 连接Server,comInfo[]的格式:0-ip 1- port 2-playerID 3-human/TrickerType 4-occupation
  131. private void ConnectToServer(string[] comInfo)
  132. {
  133. if (!isPlaybackMode)
  134. {
  135. if (comInfo.Length != 5)
  136. throw new Exception("注册信息有误!");
  137. playerID = Convert.ToInt64(comInfo[2]);
  138. Connect.Background = Brushes.Gray;
  139. string connect = new string(comInfo[0]);
  140. connect += ':';
  141. connect += comInfo[1];
  142. Channel channel = new Channel(connect, ChannelCredentials.Insecure);
  143. client = new AvailableService.AvailableServiceClient(channel);
  144. // 没判断连没连上
  145. PlayerMsg playerMsg = new PlayerMsg();
  146. playerMsg.PlayerId = playerID;
  147. playerType = Convert.ToInt64(comInfo[3]) switch
  148. {
  149. 0 => PlayerType.NullPlayerType,
  150. 1 => PlayerType.StudentPlayer,
  151. 2 => PlayerType.TrickerPlayer,
  152. };
  153. playerMsg.PlayerType=playerType;
  154. if (Convert.ToInt64(comInfo[3]) == 1)
  155. {
  156. humanOrButcher = true;
  157. }
  158. else if (Convert.ToInt64(comInfo[3]) == 2)
  159. {
  160. humanOrButcher = false;
  161. }
  162. if (playerType == PlayerType.StudentPlayer)
  163. {
  164. switch (Convert.ToInt64(comInfo[4]))
  165. {
  166. case 0:
  167. playerMsg.StudentType = StudentType.NullStudentType;
  168. break;
  169. case 1:
  170. playerMsg.StudentType = StudentType.Athlete;
  171. break;
  172. case 2:
  173. playerMsg.StudentType = StudentType._2;
  174. break;
  175. case 3:
  176. playerMsg.StudentType = StudentType._3;
  177. break;
  178. case 4:
  179. playerMsg.StudentType = StudentType._4;
  180. break;
  181. default:
  182. break;
  183. }
  184. }
  185. else if (playerType == PlayerType.TrickerPlayer)
  186. {
  187. switch (Convert.ToInt64(comInfo[4]))
  188. {
  189. case 0:
  190. playerMsg.TrickerType = TrickerType.NullTrickerType;
  191. break;
  192. case 1:
  193. playerMsg.TrickerType = TrickerType.Assassin;
  194. break;
  195. case 2:
  196. playerMsg.TrickerType = TrickerType._2;
  197. break;
  198. case 3:
  199. playerMsg.TrickerType = TrickerType._3;
  200. break;
  201. case 4:
  202. playerMsg.TrickerType = TrickerType._4;
  203. break;
  204. default:
  205. break;
  206. }
  207. }
  208. responseStream = client.AddPlayer(playerMsg);
  209. Connect.Background = Brushes.Transparent;
  210. isClientStocked = false;
  211. PorC.Content = "⏸";
  212. // 建立连接的同时加入人物
  213. }
  214. }
  215. // 绘制道具
  216. private void DrawProp(MessageOfProp data, string text)
  217. {
  218. TextBox icon = new()
  219. {
  220. FontSize = 10,
  221. Width = 20,
  222. Height = 20,
  223. Text = text,
  224. HorizontalAlignment = HorizontalAlignment.Left,
  225. VerticalAlignment = VerticalAlignment.Top,
  226. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  227. Background = Brushes.Transparent,
  228. BorderBrush = Brushes.Transparent,
  229. IsReadOnly = true
  230. };
  231. UpperLayerOfMap.Children.Add(icon);
  232. }
  233. private void ZoomMap()
  234. {
  235. for (int i = 0; i < 50; i++)
  236. {
  237. for (int j = 0; j < 50; j++)
  238. {
  239. if (mapPatches[i, j] != null)
  240. {
  241. mapPatches[i, j].Width = UpperLayerOfMap.ActualWidth / 50;
  242. mapPatches[i, j].Height = UpperLayerOfMap.ActualHeight / 50;
  243. mapPatches[i, j].HorizontalAlignment = HorizontalAlignment.Left;
  244. mapPatches[i, j].VerticalAlignment = VerticalAlignment.Top;
  245. mapPatches[i, j].Margin = new Thickness(UpperLayerOfMap.ActualWidth / 50 * j, UpperLayerOfMap.ActualHeight / 50 * i, 0, 0);
  246. }
  247. }
  248. }
  249. }
  250. private void DrawMap()
  251. {
  252. for (int i = 0; i < defaultMap.GetLength(0); i++)
  253. {
  254. for (int j = 0; j < defaultMap.GetLength(1); j++)
  255. {
  256. mapPatches[i, j] = new()
  257. {
  258. Width = unitWidth,
  259. Height = unitHeight,
  260. HorizontalAlignment = HorizontalAlignment.Left,
  261. VerticalAlignment = VerticalAlignment.Top,
  262. Margin = new Thickness(Width * (j), Height * (i), 0, 0)
  263. };
  264. // mapPatches[i, j].SetValue(Canvas.LeftProperty, (double)(Width / 65.5 * j));
  265. // mapPatches[i, j].SetValue(Canvas.TopProperty, (double)(Height / 56.5 * i)); // 用zoommap进行修改
  266. switch (defaultMap[i, j])
  267. {
  268. case 6:
  269. mapPatches[i, j].Fill = Brushes.Brown;
  270. mapPatches[i, j].Stroke = Brushes.Brown;
  271. break;//wall
  272. case 7:
  273. mapPatches[i, j].Fill = Brushes.Green;
  274. mapPatches[i, j].Stroke = Brushes.Green;
  275. break;//grass
  276. case 8:
  277. mapPatches[i, j].Fill = Brushes.LightPink;
  278. mapPatches[i, j].Stroke = Brushes.LightPink;
  279. break;//machine
  280. case 9:
  281. mapPatches[i, j].Fill = Brushes.LightSkyBlue;
  282. mapPatches[i, j].Stroke = Brushes.LightSkyBlue;
  283. break;//door
  284. case 10:
  285. foreach (var obj in listOfAll)
  286. {
  287. if(obj.HiddenGateRefreshed)
  288. {
  289. mapPatches[i, j].Fill = Brushes.LightSalmon;
  290. mapPatches[i, j].Stroke = Brushes.LightSalmon;
  291. }
  292. }
  293. break;//emergency
  294. case 11:
  295. mapPatches[i, j].Fill = Brushes.Gray;
  296. mapPatches[i, j].Stroke = Brushes.Gray;
  297. break;//window
  298. case 12:
  299. case 13:
  300. case 14:
  301. mapPatches[i, j].Fill = Brushes.Khaki;
  302. mapPatches[i, j].Stroke = Brushes.Khaki;
  303. break;//door
  304. case 15:
  305. mapPatches[i, j].Fill = Brushes.Orange;
  306. mapPatches[i, j].Stroke = Brushes.Orange;
  307. break;//chest
  308. default:
  309. break;
  310. }
  311. UnderLayerOfMap.Children.Add(mapPatches[i, j]);
  312. }
  313. }
  314. hasDrawed = true;
  315. }
  316. //三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  317. private void DrawLaser(Point source, double theta, double range, double Width) // 三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  318. {
  319. Point[] endPoint = new Point[4];
  320. Point target = new();
  321. target.X = source.X + range * Math.Cos(theta);
  322. target.Y = source.Y + range * Math.Sin(theta);
  323. endPoint[0].X = source.X + Width * Math.Cos(theta - Math.PI / 2);
  324. endPoint[0].Y = source.Y + Width * Math.Sin(theta - Math.PI / 2);
  325. endPoint[1].X = target.X + Width * Math.Cos(theta - Math.PI / 2);
  326. endPoint[1].Y = target.Y + Width * Math.Sin(theta - Math.PI / 2);
  327. endPoint[2].X = target.X + Width * Math.Cos(theta + Math.PI / 2);
  328. endPoint[2].Y = target.Y + Width * Math.Sin(theta + Math.PI / 2);
  329. endPoint[3].X = source.X + Width * Math.Cos(theta + Math.PI / 2);
  330. endPoint[3].Y = source.Y + Width * Math.Sin(theta + Math.PI / 2);
  331. Polygon laserIcon = new();
  332. laserIcon.Stroke = System.Windows.Media.Brushes.Red;
  333. laserIcon.Fill = System.Windows.Media.Brushes.Red;
  334. laserIcon.StrokeThickness = 2;
  335. laserIcon.HorizontalAlignment = HorizontalAlignment.Left;
  336. laserIcon.VerticalAlignment = VerticalAlignment.Top;
  337. PointCollection laserEndPoints = new();
  338. for (int i = 0; i < 4; i++)
  339. {
  340. laserEndPoints.Add(endPoint[i]);
  341. }
  342. laserIcon.Points = laserEndPoints;
  343. UpperLayerOfMap.Children.Add(laserIcon);
  344. }
  345. private async void OnReceive() // 已按照3.5版proto更新信息,但是左侧信息栏还未填充。log未更新,switch1,2,3更新log
  346. {
  347. try
  348. {
  349. while (responseStream != null && await responseStream.ResponseStream.MoveNext())
  350. {
  351. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行,否则画图时foreach会有bug
  352. {
  353. listOfHuman.Clear();
  354. listOfButcher.Clear();
  355. listOfProp.Clear();
  356. listOfBombedBullet.Clear();
  357. listOfBullet.Clear();
  358. listOfAll.Clear();
  359. listOfChest.Clear();
  360. listOfClassroom.Clear();
  361. listOfDoor.Clear();
  362. listOfGate.Clear();
  363. MessageToClient content = responseStream.ResponseStream.Current;
  364. switch (content.GameState)
  365. {
  366. case GameState.GameStart:
  367. foreach (var obj in content.ObjMessage)
  368. {
  369. switch (obj.MessageOfObjCase)
  370. {
  371. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  372. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  373. {
  374. human = obj.StudentMessage;
  375. }
  376. listOfHuman.Add(obj.StudentMessage);
  377. break;
  378. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  379. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  380. {
  381. butcher = obj.TrickerMessage;
  382. }
  383. listOfButcher.Add(obj.TrickerMessage);
  384. break;
  385. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  386. listOfProp.Add(obj.PropMessage);
  387. break;
  388. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  389. listOfBombedBullet.Add(obj.BombedBulletMessage);
  390. break;
  391. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  392. listOfBullet.Add(obj.BulletMessage);
  393. break;
  394. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  395. listOfChest.Add(obj.ChestMessage);
  396. break;
  397. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  398. listOfClassroom.Add(obj.ClassroomMessage);
  399. break;
  400. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  401. listOfDoor.Add(obj.DoorMessage);
  402. break;
  403. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  404. listOfGate.Add(obj.GateMessage);
  405. break;
  406. case MessageOfObj.MessageOfObjOneofCase.MapMessage:
  407. GetMap(obj.MapMessage);
  408. break;
  409. }
  410. }
  411. listOfAll.Add(content.AllMessage);
  412. break;
  413. case GameState.GameRunning:
  414. foreach (var obj in content.ObjMessage)
  415. {
  416. switch (obj.MessageOfObjCase)
  417. {
  418. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  419. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  420. {
  421. human = obj.StudentMessage;
  422. }
  423. listOfHuman.Add(obj.StudentMessage);
  424. break;
  425. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  426. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  427. {
  428. butcher = obj.TrickerMessage;
  429. }
  430. listOfButcher.Add(obj.TrickerMessage);
  431. break;
  432. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  433. listOfProp.Add(obj.PropMessage);
  434. break;
  435. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  436. listOfBombedBullet.Add(obj.BombedBulletMessage);
  437. break;
  438. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  439. listOfBullet.Add(obj.BulletMessage);
  440. break;
  441. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  442. listOfChest.Add(obj.ChestMessage);
  443. break;
  444. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  445. listOfClassroom.Add(obj.ClassroomMessage);
  446. break;
  447. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  448. listOfDoor.Add(obj.DoorMessage);
  449. break;
  450. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  451. listOfGate.Add(obj.GateMessage);
  452. break;
  453. }
  454. }
  455. listOfAll.Add(content.AllMessage);
  456. break;
  457. case GameState.GameEnd:
  458. foreach (var obj in content.ObjMessage)
  459. {
  460. switch (obj.MessageOfObjCase)
  461. {
  462. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  463. listOfHuman.Add(obj.StudentMessage);
  464. break;
  465. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  466. listOfButcher.Add(obj.TrickerMessage);
  467. break;
  468. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  469. listOfProp.Add(obj.PropMessage);
  470. break;
  471. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  472. listOfBombedBullet.Add(obj.BombedBulletMessage);
  473. break;
  474. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  475. listOfBullet.Add(obj.BulletMessage);
  476. break;
  477. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  478. listOfChest.Add(obj.ChestMessage);
  479. break;
  480. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  481. listOfClassroom.Add(obj.ClassroomMessage);
  482. break;
  483. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  484. listOfDoor.Add(obj.DoorMessage);
  485. break;
  486. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  487. listOfGate.Add(obj.GateMessage);
  488. break;
  489. }
  490. }
  491. listOfAll.Add(content.AllMessage);
  492. break;
  493. }
  494. }
  495. if (responseStream == null)
  496. {
  497. throw new Exception("Unconnected");
  498. }
  499. }
  500. }
  501. catch (Exception ex)
  502. {
  503. ErrorDisplayer error = new("Error: " + ex.ToString());
  504. error.Show();
  505. }
  506. }
  507. private int GetX(int x)
  508. {
  509. return x / 1000 + 1;
  510. }
  511. private int GetY(int y)
  512. {
  513. return y / 1000 + 1;
  514. }
  515. //待修改
  516. private bool CanSee(MessageOfStudent msg)
  517. {
  518. if (msg.PlayerState == PlayerState.Quit)
  519. return false;
  520. //if (playerID >= 2022 || teamID >= 2022)
  521. // return true;
  522. if (humanOrButcher && human != null)
  523. {
  524. if (human.Guid == msg.Guid) // 自己能看见自己
  525. return true;
  526. }
  527. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  528. return false;
  529. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
  530. return true;
  531. if (humanOrButcher && human != null)
  532. {
  533. if (msg.Place != human.Place)
  534. return false;
  535. }
  536. else if (!humanOrButcher && butcher != null)
  537. {
  538. if (msg.Place != butcher.Place)
  539. return false;
  540. }
  541. return true;
  542. }
  543. private bool CanSee(MessageOfTricker msg)
  544. {
  545. // if (playerID >= 2022 || teamID >= 2022)
  546. // return true;
  547. if (!humanOrButcher && butcher != null)
  548. {
  549. if (butcher.Guid == msg.Guid) // 自己能看见自己
  550. return true;
  551. }
  552. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  553. return false;
  554. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
  555. return true;
  556. if (humanOrButcher && human != null)
  557. {
  558. if (msg.Place != human.Place)
  559. return false;
  560. }
  561. else if (!humanOrButcher && butcher != null)
  562. {
  563. if (msg.Place != butcher.Place)
  564. return false;
  565. }
  566. return true;
  567. }
  568. private bool CanSee(MessageOfProp msg)
  569. {
  570. if (msg.Place == PlaceType.Land)
  571. return true;
  572. if (humanOrButcher && human != null)
  573. {
  574. if (msg.Place != human.Place)
  575. return false;
  576. }
  577. else if (!humanOrButcher && butcher != null)
  578. {
  579. if (msg.Place != butcher.Place)
  580. return false;
  581. }
  582. return true;
  583. }
  584. private bool CanSee(MessageOfBullet msg)
  585. {
  586. if (msg.Place == PlaceType.Land)
  587. return true;
  588. if (humanOrButcher && human != null)
  589. {
  590. if (msg.Place != human.Place)
  591. return false;
  592. }
  593. else if (!humanOrButcher && butcher != null)
  594. {
  595. if (msg.Place != butcher.Place)
  596. return false;
  597. }
  598. return true;
  599. }
  600. private void Refresh(object? sender, EventArgs e) // 已按照3.5版proto更新信息,circumstance栏未更新 log未更新
  601. {
  602. // Bonus();
  603. if (WindowState == WindowState.Maximized)
  604. MaxButton.Content = "❐";
  605. else
  606. MaxButton.Content = "🗖";
  607. if (StatusBarsOfSurvivor != null)
  608. for (int i = 4; i < 8; i++)
  609. {
  610. StatusBarsOfSurvivor[i - 4].SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  611. }
  612. if (StatusBarsOfHunter != null)
  613. StatusBarsOfHunter.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  614. if (StatusBarsOfCircumstance != null)
  615. StatusBarsOfCircumstance.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  616. // 完成窗口信息更新
  617. if (!isClientStocked)
  618. {
  619. unit = Math.Sqrt(UpperLayerOfMap.ActualHeight * UpperLayerOfMap.ActualWidth) / 50;
  620. unitHeight = UpperLayerOfMap.ActualHeight / 50;
  621. unitWidth = UpperLayerOfMap.ActualWidth / 50;
  622. try
  623. {
  624. // if (log != null)
  625. //{
  626. // string temp = "";
  627. // for (int i = 0; i < dataDict[GameObjType.Character].Count; i++)
  628. // {
  629. // temp += Convert.ToString(dataDict[GameObjType.Character][i].MessageOfCharacter.TeamID) + "\n";
  630. // }
  631. // log.Content = temp;
  632. // }
  633. UpperLayerOfMap.Children.Clear();
  634. // if ((communicator == null || !communicator.Client.IsConnected) && !isPlaybackMode)
  635. //{
  636. // UnderLayerOfMap.Children.Clear();
  637. // throw new Exception("Client is unconnected.");
  638. // }
  639. // else
  640. //{
  641. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行
  642. {
  643. foreach (var data in listOfAll)
  644. {
  645. StatusBarsOfCircumstance.SetValue(data);
  646. }
  647. if (!hasDrawed && mapFlag)
  648. DrawMap();
  649. foreach (var data in listOfHuman)
  650. {
  651. StatusBarsOfSurvivor[data.PlayerId].SetValue(data);
  652. if (CanSee(data))
  653. {
  654. Ellipse icon = new()
  655. {
  656. Width = unitWidth,
  657. Height = unitHeight,
  658. HorizontalAlignment = HorizontalAlignment.Left,
  659. VerticalAlignment = VerticalAlignment.Top,
  660. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  661. Fill = Brushes.BlueViolet,
  662. };
  663. UpperLayerOfMap.Children.Add(icon);
  664. }
  665. }
  666. foreach (var data in listOfButcher)
  667. {
  668. StatusBarsOfHunter.SetValue(data);
  669. if (CanSee(data))
  670. {
  671. Ellipse icon = new()
  672. {
  673. Width = unitWidth,
  674. Height = unitHeight,
  675. HorizontalAlignment = HorizontalAlignment.Left,
  676. VerticalAlignment = VerticalAlignment.Top,
  677. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  678. Fill = Brushes.Chocolate,
  679. };
  680. UpperLayerOfMap.Children.Add(icon);
  681. }
  682. }
  683. foreach (var data in listOfProp)
  684. {
  685. if (CanSee(data))
  686. {
  687. switch (data.Type)
  688. {
  689. case PropType.Key3:
  690. DrawProp(data, "🔧");
  691. break;
  692. case PropType.Key5:
  693. DrawProp(data, "🛡");
  694. break;
  695. case PropType.Key6:
  696. DrawProp(data, "♥");
  697. break;
  698. case PropType.Ptype4:
  699. DrawProp(data, "⛸");
  700. break;
  701. default:
  702. DrawProp(data, "");
  703. break;
  704. }
  705. }
  706. }
  707. foreach (var data in listOfBullet)
  708. {
  709. if (CanSee(data))
  710. {
  711. Ellipse icon = new()
  712. {
  713. Width = 10,
  714. Height = 10,
  715. HorizontalAlignment = HorizontalAlignment.Left,
  716. VerticalAlignment = VerticalAlignment.Top,
  717. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  718. Fill = Brushes.Red
  719. };
  720. UpperLayerOfMap.Children.Add(icon);
  721. }
  722. }
  723. foreach (var data in listOfBombedBullet)
  724. {
  725. switch (data.Type)
  726. {
  727. case BulletType.FastBullet:
  728. {
  729. Ellipse icon = new();
  730. double bombRange = data.BombRange / 1000;
  731. icon.Width = bombRange * unitWidth;
  732. icon.Height = bombRange * unitHeight;
  733. icon.HorizontalAlignment = HorizontalAlignment.Left;
  734. icon.VerticalAlignment = VerticalAlignment.Top;
  735. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  736. icon.Fill = Brushes.Red;
  737. UpperLayerOfMap.Children.Add(icon);
  738. break;
  739. }
  740. case BulletType.AtomBomb:
  741. {
  742. Ellipse icon = new Ellipse();
  743. double bombRange = data.BombRange / 1000;
  744. icon.Width = bombRange * unitWidth;
  745. icon.Height = bombRange * unitHeight;
  746. icon.HorizontalAlignment = HorizontalAlignment.Left;
  747. icon.VerticalAlignment = VerticalAlignment.Top;
  748. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  749. icon.Fill = Brushes.Red;
  750. UpperLayerOfMap.Children.Add(icon);
  751. break;
  752. }
  753. case BulletType.OrdinaryBullet:
  754. {
  755. Ellipse icon = new Ellipse();
  756. double bombRange = data.BombRange / 1000;
  757. icon.Width = bombRange * unitWidth;
  758. icon.Height = bombRange * unitHeight;
  759. icon.HorizontalAlignment = HorizontalAlignment.Left;
  760. icon.VerticalAlignment = VerticalAlignment.Top;
  761. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  762. icon.Fill = Brushes.Red;
  763. UpperLayerOfMap.Children.Add(icon);
  764. break;
  765. }
  766. /*case BulletType.LineBullet:
  767. {
  768. double bombRange = data.BombRange / 1000;
  769. DrawLaser(new Point(data.Y * unitWidth / 1000.0, data.X * unitHeight / 1000.0), -data.FacingDirection + Math.PI / 2, bombRange * unitHeight, 0.5 * unitWidth);
  770. break;
  771. }*/
  772. default:
  773. break;
  774. }
  775. }
  776. foreach (var data in listOfClassroom)
  777. {
  778. TextBox icon = new()
  779. {
  780. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  781. Width = unitWidth,
  782. Height = unitHeight,
  783. Text = Convert.ToString(data.Progress),
  784. HorizontalAlignment = HorizontalAlignment.Left,
  785. VerticalAlignment = VerticalAlignment.Top,
  786. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  787. //Margin = new Thickness(25,25, 0, 0),
  788. Background = Brushes.Transparent,
  789. BorderBrush = Brushes.Transparent,
  790. IsReadOnly = true
  791. };
  792. UpperLayerOfMap.Children.Add(icon);
  793. }
  794. foreach(var data in listOfChest)
  795. {
  796. TextBox icon = new()
  797. {
  798. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  799. Width = unitWidth,
  800. Height = unitHeight,
  801. Text = Convert.ToString(data.Progress),
  802. HorizontalAlignment = HorizontalAlignment.Left,
  803. VerticalAlignment = VerticalAlignment.Top,
  804. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  805. //Margin = new Thickness(25,25, 0, 0),
  806. Background = Brushes.Transparent,
  807. BorderBrush = Brushes.Transparent,
  808. IsReadOnly = true
  809. };
  810. UpperLayerOfMap.Children.Add(icon);
  811. }
  812. foreach(var data in listOfGate)
  813. {
  814. TextBox icon = new()
  815. {
  816. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  817. Width = unitWidth,
  818. Height = unitHeight,
  819. Text = Convert.ToString(data.Progress),
  820. HorizontalAlignment = HorizontalAlignment.Left,
  821. VerticalAlignment = VerticalAlignment.Top,
  822. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  823. //Margin = new Thickness(25,25, 0, 0),
  824. Background = Brushes.Transparent,
  825. BorderBrush = Brushes.Transparent,
  826. IsReadOnly = true
  827. };
  828. UpperLayerOfMap.Children.Add(icon);
  829. }
  830. foreach(var data in listOfDoor)
  831. {
  832. TextBox icon = new()
  833. {
  834. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  835. Width = unitWidth,
  836. Height = unitHeight,
  837. HorizontalAlignment = HorizontalAlignment.Left,
  838. VerticalAlignment = VerticalAlignment.Top,
  839. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  840. //Margin = new Thickness(25,25, 0, 0),
  841. Background = Brushes.Transparent,
  842. BorderBrush = Brushes.Transparent,
  843. IsReadOnly = true
  844. };
  845. if (data.IsOpen)
  846. {
  847. icon.Text = Convert.ToString("开");
  848. }
  849. else
  850. {
  851. icon.Text = Convert.ToString("闭");
  852. }
  853. UpperLayerOfMap.Children.Add(icon);
  854. }
  855. //}
  856. ZoomMap();
  857. }
  858. }
  859. catch (Exception exc)
  860. {
  861. ErrorDisplayer error = new("Error: " + exc.ToString());
  862. error.Show();
  863. isClientStocked = true;
  864. PorC.Content = "▶";
  865. }
  866. }
  867. counter++;
  868. }
  869. // 键盘控制,未完善
  870. private void KeyBoardControl(object sender, KeyEventArgs e)
  871. {
  872. if (!isPlaybackMode)
  873. {
  874. switch (e.Key)
  875. {
  876. case Key.W:
  877. case Key.NumPad8:
  878. MoveMsg msgW = new()
  879. {
  880. PlayerId = playerID,
  881. TimeInMilliseconds = 50,
  882. Angle = Math.PI
  883. };
  884. client.Move(msgW);
  885. break;
  886. case Key.NumPad2:
  887. case Key.S:
  888. MoveMsg msgS = new()
  889. {
  890. PlayerId = playerID,
  891. TimeInMilliseconds = 50,
  892. Angle = 0
  893. };
  894. client.Move(msgS);
  895. break;
  896. case Key.D:
  897. case Key.NumPad6:
  898. MoveMsg msgD = new()
  899. {
  900. PlayerId = playerID,
  901. TimeInMilliseconds = 50,
  902. Angle = Math.PI / 2
  903. };
  904. client.Move(msgD);
  905. break;
  906. case Key.A:
  907. case Key.NumPad4:
  908. MoveMsg msgA = new()
  909. {
  910. PlayerId = playerID,
  911. TimeInMilliseconds = 50,
  912. Angle = 3 * Math.PI / 2
  913. };
  914. client.Move(msgA);
  915. break;
  916. case Key.J:
  917. AttackMsg msgJ = new()
  918. {
  919. PlayerId = playerID,
  920. Angle = Math.PI
  921. };
  922. client.Attack(msgJ);
  923. break;
  924. case Key.F:
  925. PropMsg msgF = new()
  926. {
  927. PlayerId = playerID,
  928. };
  929. client.PickProp(msgF);
  930. break;
  931. case Key.E:
  932. PropMsg msgE = new()
  933. {
  934. PlayerId = playerID,
  935. };
  936. client.UseProp(msgE);
  937. break;
  938. case Key.Q:
  939. SkillMsg msgQ = new()
  940. {
  941. PlayerId = playerID,
  942. };
  943. client.UseSkill(msgQ);
  944. break;
  945. case Key.K:
  946. IDMsg msgK = new()
  947. {
  948. PlayerId = playerID,
  949. };
  950. client.StartLearning(msgK);
  951. break;
  952. default:
  953. break;
  954. }
  955. }
  956. }
  957. //鼠标双击
  958. private void Attack(object sender, RoutedEventArgs e)
  959. {
  960. if (!isPlaybackMode)
  961. {
  962. if (humanOrButcher&&human != null)
  963. {
  964. AttackMsg msgJ = new()
  965. {
  966. PlayerId = playerID
  967. };
  968. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  969. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  970. msgJ.Angle = Math.Atan2(mouseY - human.Y, mouseX - human.X);
  971. client.Attack(msgJ);
  972. }
  973. if (!humanOrButcher && butcher != null)
  974. {
  975. AttackMsg msgJ = new()
  976. {
  977. PlayerId = playerID
  978. };
  979. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  980. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  981. msgJ.Angle = Math.Atan2(mouseY - butcher.Y, mouseX - butcher.X);
  982. client.Attack(msgJ);
  983. }
  984. }
  985. }
  986. // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
  987. private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
  988. {
  989. if (!isClientStocked)
  990. {
  991. isClientStocked = true;
  992. PorC.Content = "▶";
  993. }
  994. else
  995. {
  996. isClientStocked = false;
  997. PorC.Content = "⏸";
  998. }
  999. }
  1000. // 未复现
  1001. private void ClickToConnect(object sender, RoutedEventArgs e)
  1002. {
  1003. }
  1004. // 窗口最大化、关闭、最小化、拖拽
  1005. private void ClickToMaxmize(object sender, RoutedEventArgs e)
  1006. {
  1007. if (WindowState != WindowState.Maximized)
  1008. WindowState = WindowState.Maximized;
  1009. else
  1010. WindowState = WindowState.Normal;
  1011. }
  1012. private void ClickToClose(object sender, RoutedEventArgs e)
  1013. {
  1014. Application.Current.Shutdown();
  1015. }
  1016. private void ClickToMinimize(object sender, RoutedEventArgs e)
  1017. {
  1018. WindowState = WindowState.Minimized;
  1019. }
  1020. private void DragWindow(object sender, RoutedEventArgs e)
  1021. {
  1022. DragMove();
  1023. }
  1024. // 寻求帮助、访问EESAST(部分功能未复原)
  1025. private void ClickForHelp(object sender, RoutedEventArgs e)
  1026. {
  1027. PleaseWait();
  1028. }
  1029. private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
  1030. {
  1031. try
  1032. {
  1033. _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
  1034. }
  1035. catch (Exception exc)
  1036. {
  1037. // ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
  1038. // error.Show();
  1039. }
  1040. }
  1041. // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
  1042. private void ClickToSetConnect(object sender, RoutedEventArgs e)
  1043. {
  1044. // ConnectRegister crg = new();
  1045. // crg.Show();
  1046. }
  1047. private void ClickToEnterVS(object sender, RoutedEventArgs e)
  1048. {
  1049. // try
  1050. //{
  1051. // if (!File.Exists("VSRoute.txt"))
  1052. // {
  1053. // File.Create("VSRoute.txt");
  1054. // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
  1055. // throw ex;
  1056. // }//创建路径文件
  1057. // using StreamReader sr = new("VSRoute.txt");
  1058. // _ = Process.Start(sr.ReadLine());
  1059. // }
  1060. // catch (Exception exc)
  1061. //{
  1062. // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
  1063. // error.Show();
  1064. // }
  1065. PleaseWait();
  1066. }
  1067. private void ClickForUpdate(object sender, RoutedEventArgs e)
  1068. {
  1069. PleaseWait();
  1070. }
  1071. private void ClickToCheckLadder(object sender, RoutedEventArgs e)
  1072. {
  1073. PleaseWait();
  1074. }
  1075. // 敬请期待函数
  1076. private void PleaseWait()
  1077. {
  1078. try
  1079. {
  1080. throw new Exception("敬请期待");
  1081. }
  1082. catch (Exception exc)
  1083. {
  1084. // ErrorDisplayer error = new(exc.Message);
  1085. // error.Show();
  1086. }
  1087. }
  1088. // 以下为Mainwindow自定义属性
  1089. private readonly DispatcherTimer timer; // 定时器
  1090. private long counter; // 预留的取时间变量
  1091. AvailableService.AvailableServiceClient client;
  1092. AsyncServerStreamingCall<MessageToClient>? responseStream;
  1093. private StatusBarOfSurvivor[] StatusBarsOfSurvivor;
  1094. private StatusBarOfHunter StatusBarsOfHunter;
  1095. private StatusBarOfCircumstance StatusBarsOfCircumstance;
  1096. private bool isClientStocked;
  1097. private bool isPlaybackMode;
  1098. private long playerID;
  1099. private PlayerType playerType;
  1100. private double unit;
  1101. private double unitHeight;
  1102. private double unitWidth;
  1103. private readonly Rectangle[,] mapPatches = new Rectangle[50, 50];
  1104. private List<MessageOfProp> listOfProp;
  1105. private List<MessageOfStudent> listOfHuman;
  1106. private List<MessageOfTricker> listOfButcher;
  1107. private List<MessageOfBullet> listOfBullet;
  1108. private List<MessageOfBombedBullet> listOfBombedBullet;
  1109. private List<MessageOfAll> listOfAll;
  1110. private List<MessageOfChest> listOfChest;
  1111. private List<MessageOfClassroom> listOfClassroom;
  1112. private List<MessageOfDoor> listOfDoor;
  1113. private List<MessageOfGate> listOfGate;
  1114. private object drawPicLock = new object();
  1115. private MessageOfStudent? human = null;
  1116. private MessageOfTricker? butcher = null;
  1117. private bool humanOrButcher;//true for human
  1118. private bool bonusflag;
  1119. private bool mapFlag = false;
  1120. private bool hasDrawed = false;
  1121. public int[,] defaultMap = new int[,] {{ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
  1122. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
  1123. { 6, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6 },
  1124. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
  1125. { 6, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
  1126. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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