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 61 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191
  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] = "183.172.213.88";
  60. comInfo[1] = "8888";
  61. comInfo[2] = "4";
  62. comInfo[3] = "2";
  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._1;
  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._1;
  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. default:
  295. break;
  296. }
  297. UnderLayerOfMap.Children.Add(mapPatches[i, j]);
  298. }
  299. }
  300. hasDrawed = true;
  301. }
  302. //三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  303. private void DrawLaser(Point source, double theta, double range, double Width) // 三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  304. {
  305. Point[] endPoint = new Point[4];
  306. Point target = new();
  307. target.X = source.X + range * Math.Cos(theta);
  308. target.Y = source.Y + range * Math.Sin(theta);
  309. endPoint[0].X = source.X + Width * Math.Cos(theta - Math.PI / 2);
  310. endPoint[0].Y = source.Y + Width * Math.Sin(theta - Math.PI / 2);
  311. endPoint[1].X = target.X + Width * Math.Cos(theta - Math.PI / 2);
  312. endPoint[1].Y = target.Y + Width * Math.Sin(theta - Math.PI / 2);
  313. endPoint[2].X = target.X + Width * Math.Cos(theta + Math.PI / 2);
  314. endPoint[2].Y = target.Y + Width * Math.Sin(theta + Math.PI / 2);
  315. endPoint[3].X = source.X + Width * Math.Cos(theta + Math.PI / 2);
  316. endPoint[3].Y = source.Y + Width * Math.Sin(theta + Math.PI / 2);
  317. Polygon laserIcon = new();
  318. laserIcon.Stroke = System.Windows.Media.Brushes.Red;
  319. laserIcon.Fill = System.Windows.Media.Brushes.Red;
  320. laserIcon.StrokeThickness = 2;
  321. laserIcon.HorizontalAlignment = HorizontalAlignment.Left;
  322. laserIcon.VerticalAlignment = VerticalAlignment.Top;
  323. PointCollection laserEndPoints = new();
  324. for (int i = 0; i < 4; i++)
  325. {
  326. laserEndPoints.Add(endPoint[i]);
  327. }
  328. laserIcon.Points = laserEndPoints;
  329. UpperLayerOfMap.Children.Add(laserIcon);
  330. }
  331. private async void OnReceive() // 已按照3.5版proto更新信息,但是左侧信息栏还未填充。log未更新,switch1,2,3更新log
  332. {
  333. try
  334. {
  335. while (responseStream != null && await responseStream.ResponseStream.MoveNext())
  336. {
  337. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行,否则画图时foreach会有bug
  338. {
  339. listOfHuman.Clear();
  340. listOfButcher.Clear();
  341. listOfProp.Clear();
  342. listOfBombedBullet.Clear();
  343. listOfBullet.Clear();
  344. listOfAll.Clear();
  345. listOfChest.Clear();
  346. listOfClassroom.Clear();
  347. listOfDoor.Clear();
  348. listOfGate.Clear();
  349. MessageToClient content = responseStream.ResponseStream.Current;
  350. switch (content.GameState)
  351. {
  352. case GameState.GameStart:
  353. foreach (var obj in content.ObjMessage)
  354. {
  355. switch (obj.MessageOfObjCase)
  356. {
  357. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  358. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  359. {
  360. human = obj.StudentMessage;
  361. }
  362. listOfHuman.Add(obj.StudentMessage);
  363. break;
  364. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  365. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  366. {
  367. butcher = obj.TrickerMessage;
  368. }
  369. listOfButcher.Add(obj.TrickerMessage);
  370. break;
  371. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  372. listOfProp.Add(obj.PropMessage);
  373. break;
  374. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  375. listOfBombedBullet.Add(obj.BombedBulletMessage);
  376. break;
  377. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  378. listOfBullet.Add(obj.BulletMessage);
  379. break;
  380. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  381. listOfChest.Add(obj.ChestMessage);
  382. break;
  383. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  384. listOfClassroom.Add(obj.ClassroomMessage);
  385. break;
  386. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  387. listOfDoor.Add(obj.DoorMessage);
  388. break;
  389. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  390. listOfGate.Add(obj.GateMessage);
  391. break;
  392. case MessageOfObj.MessageOfObjOneofCase.MapMessage:
  393. GetMap(obj.MapMessage);
  394. break;
  395. }
  396. }
  397. listOfAll.Add(content.AllMessage);
  398. break;
  399. case GameState.GameRunning:
  400. foreach (var obj in content.ObjMessage)
  401. {
  402. switch (obj.MessageOfObjCase)
  403. {
  404. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  405. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  406. {
  407. human = obj.StudentMessage;
  408. }
  409. listOfHuman.Add(obj.StudentMessage);
  410. break;
  411. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  412. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  413. {
  414. butcher = obj.TrickerMessage;
  415. }
  416. listOfButcher.Add(obj.TrickerMessage);
  417. break;
  418. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  419. listOfProp.Add(obj.PropMessage);
  420. break;
  421. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  422. listOfBombedBullet.Add(obj.BombedBulletMessage);
  423. break;
  424. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  425. listOfBullet.Add(obj.BulletMessage);
  426. break;
  427. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  428. listOfChest.Add(obj.ChestMessage);
  429. break;
  430. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  431. listOfClassroom.Add(obj.ClassroomMessage);
  432. break;
  433. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  434. listOfDoor.Add(obj.DoorMessage);
  435. break;
  436. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  437. listOfGate.Add(obj.GateMessage);
  438. break;
  439. }
  440. }
  441. listOfAll.Add(content.AllMessage);
  442. break;
  443. case GameState.GameEnd:
  444. foreach (var obj in content.ObjMessage)
  445. {
  446. switch (obj.MessageOfObjCase)
  447. {
  448. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  449. listOfHuman.Add(obj.StudentMessage);
  450. break;
  451. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  452. listOfButcher.Add(obj.TrickerMessage);
  453. break;
  454. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  455. listOfProp.Add(obj.PropMessage);
  456. break;
  457. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  458. listOfBombedBullet.Add(obj.BombedBulletMessage);
  459. break;
  460. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  461. listOfBullet.Add(obj.BulletMessage);
  462. break;
  463. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  464. listOfChest.Add(obj.ChestMessage);
  465. break;
  466. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  467. listOfClassroom.Add(obj.ClassroomMessage);
  468. break;
  469. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  470. listOfDoor.Add(obj.DoorMessage);
  471. break;
  472. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  473. listOfGate.Add(obj.GateMessage);
  474. break;
  475. }
  476. }
  477. listOfAll.Add(content.AllMessage);
  478. break;
  479. }
  480. }
  481. if (responseStream == null)
  482. {
  483. throw new Exception("Unconnected");
  484. }
  485. }
  486. }
  487. catch (Exception ex)
  488. {
  489. ErrorDisplayer error = new("Error: " + ex.ToString());
  490. error.Show();
  491. }
  492. }
  493. private int GetX(int x)
  494. {
  495. return x / 1000 + 1;
  496. }
  497. private int GetY(int y)
  498. {
  499. return y / 1000 + 1;
  500. }
  501. //待修改
  502. private bool CanSee(MessageOfStudent msg)
  503. {
  504. if (msg.State == PlayerState.Quit)
  505. return false;
  506. //if (playerID >= 2022 || teamID >= 2022)
  507. // return true;
  508. if (humanOrButcher && human != null)
  509. {
  510. if (human.Guid == msg.Guid) // 自己能看见自己
  511. return true;
  512. }
  513. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  514. return false;
  515. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
  516. return true;
  517. if (humanOrButcher && human != null)
  518. {
  519. if (msg.Place != human.Place)
  520. return false;
  521. }
  522. else if (!humanOrButcher && butcher != null)
  523. {
  524. if (msg.Place != butcher.Place)
  525. return false;
  526. }
  527. return true;
  528. }
  529. private bool CanSee(MessageOfTricker msg)
  530. {
  531. // if (playerID >= 2022 || teamID >= 2022)
  532. // return true;
  533. if (!humanOrButcher && butcher != null)
  534. {
  535. if (butcher.Guid == msg.Guid) // 自己能看见自己
  536. return true;
  537. }
  538. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  539. return false;
  540. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
  541. return true;
  542. if (humanOrButcher && human != null)
  543. {
  544. if (msg.Place != human.Place)
  545. return false;
  546. }
  547. else if (!humanOrButcher && butcher != null)
  548. {
  549. if (msg.Place != butcher.Place)
  550. return false;
  551. }
  552. return true;
  553. }
  554. private bool CanSee(MessageOfProp msg)
  555. {
  556. if (msg.Place == PlaceType.Land)
  557. return true;
  558. if (humanOrButcher && human != null)
  559. {
  560. if (msg.Place != human.Place)
  561. return false;
  562. }
  563. else if (!humanOrButcher && butcher != null)
  564. {
  565. if (msg.Place != butcher.Place)
  566. return false;
  567. }
  568. return true;
  569. }
  570. private bool CanSee(MessageOfBullet msg)
  571. {
  572. if (msg.Place == PlaceType.Land)
  573. return true;
  574. if (humanOrButcher && human != null)
  575. {
  576. if (msg.Place != human.Place)
  577. return false;
  578. }
  579. else if (!humanOrButcher && butcher != null)
  580. {
  581. if (msg.Place != butcher.Place)
  582. return false;
  583. }
  584. return true;
  585. }
  586. private void Refresh(object? sender, EventArgs e) // 已按照3.5版proto更新信息,circumstance栏未更新 log未更新
  587. {
  588. // Bonus();
  589. if (WindowState == WindowState.Maximized)
  590. MaxButton.Content = "❐";
  591. else
  592. MaxButton.Content = "🗖";
  593. if (StatusBarsOfSurvivor != null)
  594. for (int i = 4; i < 8; i++)
  595. {
  596. StatusBarsOfSurvivor[i - 4].SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  597. }
  598. if (StatusBarsOfHunter != null)
  599. StatusBarsOfHunter.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  600. if (StatusBarsOfCircumstance != null)
  601. StatusBarsOfCircumstance.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  602. // 完成窗口信息更新
  603. if (!isClientStocked)
  604. {
  605. unit = Math.Sqrt(UpperLayerOfMap.ActualHeight * UpperLayerOfMap.ActualWidth) / 50;
  606. unitHeight = UpperLayerOfMap.ActualHeight / 50;
  607. unitWidth = UpperLayerOfMap.ActualWidth / 50;
  608. try
  609. {
  610. // if (log != null)
  611. //{
  612. // string temp = "";
  613. // for (int i = 0; i < dataDict[GameObjType.Character].Count; i++)
  614. // {
  615. // temp += Convert.ToString(dataDict[GameObjType.Character][i].MessageOfCharacter.TeamID) + "\n";
  616. // }
  617. // log.Content = temp;
  618. // }
  619. UpperLayerOfMap.Children.Clear();
  620. // if ((communicator == null || !communicator.Client.IsConnected) && !isPlaybackMode)
  621. //{
  622. // UnderLayerOfMap.Children.Clear();
  623. // throw new Exception("Client is unconnected.");
  624. // }
  625. // else
  626. //{
  627. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行
  628. {
  629. foreach (var data in listOfAll)
  630. {
  631. StatusBarsOfCircumstance.SetValue(data);
  632. }
  633. if (!hasDrawed && mapFlag)
  634. DrawMap();
  635. foreach (var data in listOfHuman)
  636. {
  637. StatusBarsOfSurvivor[data.PlayerId].SetValue(data);
  638. if (CanSee(data))
  639. {
  640. Ellipse icon = new()
  641. {
  642. Width = unitWidth,
  643. Height = unitHeight,
  644. HorizontalAlignment = HorizontalAlignment.Left,
  645. VerticalAlignment = VerticalAlignment.Top,
  646. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  647. Fill = Brushes.BlueViolet,
  648. };
  649. UpperLayerOfMap.Children.Add(icon);
  650. }
  651. }
  652. foreach (var data in listOfButcher)
  653. {
  654. StatusBarsOfHunter.SetValue(data);
  655. if (CanSee(data))
  656. {
  657. Ellipse icon = new()
  658. {
  659. Width = unitWidth,
  660. Height = unitHeight,
  661. HorizontalAlignment = HorizontalAlignment.Left,
  662. VerticalAlignment = VerticalAlignment.Top,
  663. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  664. Fill = Brushes.Chocolate,
  665. };
  666. UpperLayerOfMap.Children.Add(icon);
  667. }
  668. }
  669. foreach (var data in listOfProp)
  670. {
  671. if (CanSee(data))
  672. {
  673. switch (data.Type)
  674. {
  675. case PropType.Ptype1:
  676. DrawProp(data, "🔧");
  677. break;
  678. case PropType.Ptype2:
  679. DrawProp(data, "🛡");
  680. break;
  681. case PropType.Ptype3:
  682. DrawProp(data, "♥");
  683. break;
  684. case PropType.Ptype4:
  685. DrawProp(data, "⛸");
  686. break;
  687. default:
  688. DrawProp(data, "");
  689. break;
  690. }
  691. }
  692. }
  693. foreach (var data in listOfBullet)
  694. {
  695. if (CanSee(data))
  696. {
  697. Ellipse icon = new()
  698. {
  699. Width = 10,
  700. Height = 10,
  701. HorizontalAlignment = HorizontalAlignment.Left,
  702. VerticalAlignment = VerticalAlignment.Top,
  703. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  704. Fill = Brushes.Red
  705. };
  706. UpperLayerOfMap.Children.Add(icon);
  707. }
  708. }
  709. foreach (var data in listOfBombedBullet)
  710. {
  711. switch (data.Type)
  712. {
  713. case BulletType.FastBullet:
  714. {
  715. Ellipse icon = new();
  716. double bombRange = data.BombRange / 1000;
  717. icon.Width = bombRange * unitWidth;
  718. icon.Height = bombRange * unitHeight;
  719. icon.HorizontalAlignment = HorizontalAlignment.Left;
  720. icon.VerticalAlignment = VerticalAlignment.Top;
  721. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  722. icon.Fill = Brushes.Red;
  723. UpperLayerOfMap.Children.Add(icon);
  724. break;
  725. }
  726. case BulletType.AtomBomb:
  727. {
  728. Ellipse icon = new Ellipse();
  729. double bombRange = data.BombRange / 1000;
  730. icon.Width = bombRange * unitWidth;
  731. icon.Height = bombRange * unitHeight;
  732. icon.HorizontalAlignment = HorizontalAlignment.Left;
  733. icon.VerticalAlignment = VerticalAlignment.Top;
  734. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  735. icon.Fill = Brushes.Red;
  736. UpperLayerOfMap.Children.Add(icon);
  737. break;
  738. }
  739. case BulletType.OrdinaryBullet:
  740. {
  741. Ellipse icon = new Ellipse();
  742. double bombRange = data.BombRange / 1000;
  743. icon.Width = bombRange * unitWidth;
  744. icon.Height = bombRange * unitHeight;
  745. icon.HorizontalAlignment = HorizontalAlignment.Left;
  746. icon.VerticalAlignment = VerticalAlignment.Top;
  747. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  748. icon.Fill = Brushes.Red;
  749. UpperLayerOfMap.Children.Add(icon);
  750. break;
  751. }
  752. case BulletType.LineBullet:
  753. {
  754. double bombRange = data.BombRange / 1000;
  755. DrawLaser(new Point(data.Y * unitWidth / 1000.0, data.X * unitHeight / 1000.0), -data.FacingDirection + Math.PI / 2, bombRange * unitHeight, 0.5 * unitWidth);
  756. break;
  757. }
  758. default:
  759. break;
  760. }
  761. }
  762. foreach (var data in listOfClassroom)
  763. {
  764. TextBox icon = new()
  765. {
  766. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  767. Width = unitWidth,
  768. Height = unitHeight,
  769. Text = Convert.ToString(data.Progress),
  770. HorizontalAlignment = HorizontalAlignment.Left,
  771. VerticalAlignment = VerticalAlignment.Top,
  772. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  773. //Margin = new Thickness(25,25, 0, 0),
  774. Background = Brushes.Transparent,
  775. BorderBrush = Brushes.Transparent,
  776. IsReadOnly = true
  777. };
  778. UpperLayerOfMap.Children.Add(icon);
  779. }
  780. foreach(var data in listOfChest)
  781. {
  782. TextBox icon = new()
  783. {
  784. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  785. Width = unitWidth,
  786. Height = unitHeight,
  787. Text = Convert.ToString(data.Progress),
  788. HorizontalAlignment = HorizontalAlignment.Left,
  789. VerticalAlignment = VerticalAlignment.Top,
  790. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  791. //Margin = new Thickness(25,25, 0, 0),
  792. Background = Brushes.Transparent,
  793. BorderBrush = Brushes.Transparent,
  794. IsReadOnly = true
  795. };
  796. UpperLayerOfMap.Children.Add(icon);
  797. }
  798. foreach(var data in listOfGate)
  799. {
  800. TextBox icon = new()
  801. {
  802. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  803. Width = unitWidth,
  804. Height = unitHeight,
  805. Text = Convert.ToString(data.Progress),
  806. HorizontalAlignment = HorizontalAlignment.Left,
  807. VerticalAlignment = VerticalAlignment.Top,
  808. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  809. //Margin = new Thickness(25,25, 0, 0),
  810. Background = Brushes.Transparent,
  811. BorderBrush = Brushes.Transparent,
  812. IsReadOnly = true
  813. };
  814. UpperLayerOfMap.Children.Add(icon);
  815. }
  816. foreach(var data in listOfDoor)
  817. {
  818. TextBox icon = new()
  819. {
  820. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  821. Width = unitWidth,
  822. Height = unitHeight,
  823. HorizontalAlignment = HorizontalAlignment.Left,
  824. VerticalAlignment = VerticalAlignment.Top,
  825. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  826. //Margin = new Thickness(25,25, 0, 0),
  827. Background = Brushes.Transparent,
  828. BorderBrush = Brushes.Transparent,
  829. IsReadOnly = true
  830. };
  831. if (data.IsOpen)
  832. {
  833. icon.Text = Convert.ToString("开");
  834. }
  835. else
  836. {
  837. icon.Text = Convert.ToString("闭");
  838. }
  839. UpperLayerOfMap.Children.Add(icon);
  840. }
  841. //}
  842. ZoomMap();
  843. }
  844. }
  845. catch (Exception exc)
  846. {
  847. ErrorDisplayer error = new("Error: " + exc.ToString());
  848. error.Show();
  849. isClientStocked = true;
  850. PorC.Content = "▶";
  851. }
  852. }
  853. counter++;
  854. }
  855. // 键盘控制,未完善
  856. private void KeyBoardControl(object sender, KeyEventArgs e)
  857. {
  858. if (!isPlaybackMode)
  859. {
  860. switch (e.Key)
  861. {
  862. case Key.W:
  863. case Key.NumPad8:
  864. MoveMsg msgW = new()
  865. {
  866. PlayerId = playerID,
  867. TimeInMilliseconds = 50,
  868. Angle = Math.PI
  869. };
  870. client.Move(msgW);
  871. break;
  872. case Key.NumPad2:
  873. case Key.S:
  874. MoveMsg msgS = new()
  875. {
  876. PlayerId = playerID,
  877. TimeInMilliseconds = 50,
  878. Angle = 0
  879. };
  880. client.Move(msgS);
  881. break;
  882. case Key.D:
  883. case Key.NumPad6:
  884. MoveMsg msgD = new()
  885. {
  886. PlayerId = playerID,
  887. TimeInMilliseconds = 50,
  888. Angle = Math.PI / 2
  889. };
  890. client.Move(msgD);
  891. break;
  892. case Key.A:
  893. case Key.NumPad4:
  894. MoveMsg msgA = new()
  895. {
  896. PlayerId = playerID,
  897. TimeInMilliseconds = 50,
  898. Angle = 3 * Math.PI / 2
  899. };
  900. client.Move(msgA);
  901. break;
  902. case Key.J:
  903. AttackMsg msgJ = new()
  904. {
  905. PlayerId = playerID,
  906. Angle = Math.PI
  907. };
  908. client.Attack(msgJ);
  909. break;
  910. case Key.F:
  911. PropMsg msgF = new()
  912. {
  913. PlayerId = playerID,
  914. };
  915. client.PickProp(msgF);
  916. break;
  917. case Key.E:
  918. PropMsg msgE = new()
  919. {
  920. PlayerId = playerID,
  921. };
  922. client.UseProp(msgE);
  923. break;
  924. case Key.Q:
  925. SkillMsg msgQ = new()
  926. {
  927. PlayerId = playerID,
  928. };
  929. client.UseSkill(msgQ);
  930. break;
  931. case Key.K:
  932. IDMsg msgK = new()
  933. {
  934. PlayerId = playerID,
  935. };
  936. client.StartLearning(msgK);
  937. break;
  938. default:
  939. break;
  940. }
  941. }
  942. }
  943. //鼠标双击
  944. private void Attack(object sender, RoutedEventArgs e)
  945. {
  946. if (!isPlaybackMode)
  947. {
  948. if (humanOrButcher&&human != null)
  949. {
  950. AttackMsg msgJ = new()
  951. {
  952. PlayerId = playerID
  953. };
  954. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  955. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  956. msgJ.Angle = Math.Atan2(mouseY - human.Y, mouseX - human.X);
  957. client.Attack(msgJ);
  958. }
  959. if (!humanOrButcher && butcher != null)
  960. {
  961. AttackMsg msgJ = new()
  962. {
  963. PlayerId = playerID
  964. };
  965. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  966. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  967. msgJ.Angle = Math.Atan2(mouseY - butcher.Y, mouseX - butcher.X);
  968. client.Attack(msgJ);
  969. }
  970. }
  971. }
  972. // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
  973. private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
  974. {
  975. if (!isClientStocked)
  976. {
  977. isClientStocked = true;
  978. PorC.Content = "▶";
  979. }
  980. else
  981. {
  982. isClientStocked = false;
  983. PorC.Content = "⏸";
  984. }
  985. }
  986. // 未复现
  987. private void ClickToConnect(object sender, RoutedEventArgs e)
  988. {
  989. }
  990. // 窗口最大化、关闭、最小化、拖拽
  991. private void ClickToMaxmize(object sender, RoutedEventArgs e)
  992. {
  993. if (WindowState != WindowState.Maximized)
  994. WindowState = WindowState.Maximized;
  995. else
  996. WindowState = WindowState.Normal;
  997. }
  998. private void ClickToClose(object sender, RoutedEventArgs e)
  999. {
  1000. Application.Current.Shutdown();
  1001. }
  1002. private void ClickToMinimize(object sender, RoutedEventArgs e)
  1003. {
  1004. WindowState = WindowState.Minimized;
  1005. }
  1006. private void DragWindow(object sender, RoutedEventArgs e)
  1007. {
  1008. DragMove();
  1009. }
  1010. // 寻求帮助、访问EESAST(部分功能未复原)
  1011. private void ClickForHelp(object sender, RoutedEventArgs e)
  1012. {
  1013. PleaseWait();
  1014. }
  1015. private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
  1016. {
  1017. try
  1018. {
  1019. _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
  1020. }
  1021. catch (Exception exc)
  1022. {
  1023. // ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
  1024. // error.Show();
  1025. }
  1026. }
  1027. // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
  1028. private void ClickToSetConnect(object sender, RoutedEventArgs e)
  1029. {
  1030. // ConnectRegister crg = new();
  1031. // crg.Show();
  1032. }
  1033. private void ClickToEnterVS(object sender, RoutedEventArgs e)
  1034. {
  1035. // try
  1036. //{
  1037. // if (!File.Exists("VSRoute.txt"))
  1038. // {
  1039. // File.Create("VSRoute.txt");
  1040. // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
  1041. // throw ex;
  1042. // }//创建路径文件
  1043. // using StreamReader sr = new("VSRoute.txt");
  1044. // _ = Process.Start(sr.ReadLine());
  1045. // }
  1046. // catch (Exception exc)
  1047. //{
  1048. // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
  1049. // error.Show();
  1050. // }
  1051. PleaseWait();
  1052. }
  1053. private void ClickForUpdate(object sender, RoutedEventArgs e)
  1054. {
  1055. PleaseWait();
  1056. }
  1057. private void ClickToCheckLadder(object sender, RoutedEventArgs e)
  1058. {
  1059. PleaseWait();
  1060. }
  1061. // 敬请期待函数
  1062. private void PleaseWait()
  1063. {
  1064. try
  1065. {
  1066. throw new Exception("敬请期待");
  1067. }
  1068. catch (Exception exc)
  1069. {
  1070. // ErrorDisplayer error = new(exc.Message);
  1071. // error.Show();
  1072. }
  1073. }
  1074. // 以下为Mainwindow自定义属性
  1075. private readonly DispatcherTimer timer; // 定时器
  1076. private long counter; // 预留的取时间变量
  1077. AvailableService.AvailableServiceClient client;
  1078. AsyncServerStreamingCall<MessageToClient>? responseStream;
  1079. private StatusBarOfSurvivor[] StatusBarsOfSurvivor;
  1080. private StatusBarOfHunter StatusBarsOfHunter;
  1081. private StatusBarOfCircumstance StatusBarsOfCircumstance;
  1082. private bool isClientStocked;
  1083. private bool isPlaybackMode;
  1084. private long playerID;
  1085. private PlayerType playerType;
  1086. private double unit;
  1087. private double unitHeight;
  1088. private double unitWidth;
  1089. private readonly Rectangle[,] mapPatches = new Rectangle[50, 50];
  1090. private List<MessageOfProp> listOfProp;
  1091. private List<MessageOfStudent> listOfHuman;
  1092. private List<MessageOfTricker> listOfButcher;
  1093. private List<MessageOfBullet> listOfBullet;
  1094. private List<MessageOfBombedBullet> listOfBombedBullet;
  1095. private List<MessageOfAll> listOfAll;
  1096. private List<MessageOfChest> listOfChest;
  1097. private List<MessageOfClassroom> listOfClassroom;
  1098. private List<MessageOfDoor> listOfDoor;
  1099. private List<MessageOfGate> listOfGate;
  1100. private object drawPicLock = new object();
  1101. private MessageOfStudent? human = null;
  1102. private MessageOfTricker? butcher = null;
  1103. private bool humanOrButcher;//true for human
  1104. private bool bonusflag;
  1105. private bool mapFlag = false;
  1106. private bool hasDrawed = false;
  1107. 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, 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