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 42 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  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. // 目前MainWindow还未复现的功能:
  20. // 部分errordisplayer
  21. // private void ReactToCommandline(),
  22. // private void Playback(string fileName, double pbSpeed = 2.0)
  23. // 交互:private void ClickToSetMode(object sender, RoutedEventArgs e)
  24. // private void Bonus()
  25. namespace Client
  26. {
  27. /// <summary>
  28. /// Interaction logic for MainWindow.xaml
  29. /// </summary>
  30. public partial class MainWindow : Window
  31. {
  32. public MainWindow()
  33. {
  34. unitHeight = unitWidth = unit = 13;
  35. bonusflag = true;
  36. timer = new DispatcherTimer
  37. {
  38. Interval = new TimeSpan(50000) // 每50ms刷新一次
  39. };
  40. timer.Tick += new EventHandler(Refresh); // 定时器初始化
  41. InitializeComponent();
  42. timer.Start();
  43. SetStatusBar();
  44. isClientStocked = true;
  45. isPlaybackMode = false;
  46. drawPicLock = new();
  47. listOfProp = new List<MessageOfProp>();
  48. listOfHuman = new List<MessageOfHuman>();
  49. listOfButcher = new List<MessageOfButcher>();
  50. WindowStartupLocation = WindowStartupLocation.CenterScreen;
  51. comInfo[0] = "183.172.208.156";
  52. comInfo[1] = "8888";
  53. comInfo[2] = "0";
  54. comInfo[3] = "1";
  55. comInfo[4] = "1";
  56. //ConnectToServer(comInfo);
  57. //OnReceive();
  58. DrawMap();
  59. ZoomMap();
  60. MessageOfHuman kurei = new MessageOfHuman();
  61. kurei.X = 10000;
  62. kurei.Y = 20000;
  63. kurei.Speed = 1000;
  64. kurei.PlayerId = 0;
  65. listOfHuman.Add(kurei);
  66. // ReactToCommandline();
  67. }
  68. private void SetStatusBar()
  69. {
  70. StatusBarsOfSurvivor = new StatusBarOfSurvivor[4];
  71. StatusBarsOfHunter = new StatusBarOfHunter(MainGrid, 3, 0);
  72. StatusBarsOfCircumstance = new StatusBarOfCircumstance(MainGrid, 1, 0);
  73. for (int i = 4; i < 8; i++)
  74. {
  75. StatusBarsOfSurvivor[i - 4] = new(MainGrid, i / 2 + 2, i % 2);
  76. }
  77. }
  78. // 连接Server,comInfo[]的格式:0-ip 1- port 2-playerID 3-playerType 4-human/butcherType
  79. private void ConnectToServer(string[] comInfo)
  80. {
  81. if (!isPlaybackMode)
  82. {
  83. if (comInfo.Length != 5)
  84. throw new Exception("注册信息有误!");
  85. playerID = Convert.ToInt64(comInfo[2]);
  86. Connect.Background = Brushes.Gray;
  87. string connect = new string(comInfo[0]);
  88. connect += ':';
  89. connect += comInfo[1];
  90. Channel channel = new Channel(connect, ChannelCredentials.Insecure);
  91. client = new AvailableService.AvailableServiceClient(channel);
  92. // 没判断连没连上
  93. PlayerMsg playerMsg = new PlayerMsg();
  94. playerMsg.PlayerId = playerID;
  95. playerType = Convert.ToInt64(comInfo[3]) switch
  96. {
  97. 0 => PlayerType.NullPlayerType,
  98. 1 => PlayerType.HumanPlayer,
  99. 2 => PlayerType.ButcherPlayer,
  100. };
  101. if (Convert.ToInt64(comInfo[3]) == 1)
  102. {
  103. humanOrButcher = true;
  104. }
  105. else if (Convert.ToInt64(comInfo[3]) == 2)
  106. {
  107. humanOrButcher = false;
  108. }
  109. playerMsg.PlayerType = playerType;
  110. if (playerType == PlayerType.HumanPlayer)
  111. {
  112. switch (Convert.ToInt64(comInfo[4]))
  113. {
  114. case 0:
  115. playerMsg.HumanType = HumanType.NullHumanType;
  116. break;
  117. case 1:
  118. playerMsg.HumanType = HumanType._1;
  119. break;
  120. case 2:
  121. playerMsg.HumanType = HumanType._2;
  122. break;
  123. case 3:
  124. playerMsg.HumanType = HumanType._3;
  125. break;
  126. case 4:
  127. playerMsg.HumanType = HumanType._4;
  128. break;
  129. default:
  130. break;
  131. }
  132. }
  133. else if (playerType == PlayerType.ButcherPlayer)
  134. {
  135. switch (Convert.ToInt64(comInfo[4]))
  136. {
  137. case 0:
  138. playerMsg.ButcherType = ButcherType.NullButcherType;
  139. break;
  140. case 1:
  141. playerMsg.ButcherType = ButcherType._1;
  142. break;
  143. case 2:
  144. playerMsg.ButcherType = ButcherType._2;
  145. break;
  146. case 3:
  147. playerMsg.ButcherType = ButcherType._3;
  148. break;
  149. case 4:
  150. playerMsg.ButcherType = ButcherType._4;
  151. break;
  152. default:
  153. break;
  154. }
  155. }
  156. responseStream = client.AddPlayer(playerMsg);
  157. Connect.Background = Brushes.Transparent;
  158. isClientStocked = false;
  159. PorC.Content = "⏸";
  160. // 建立连接的同时加入人物
  161. }
  162. }
  163. // 绘制道具
  164. private void DrawProp(MessageOfProp data, string text)
  165. {
  166. TextBox icon = new()
  167. {
  168. FontSize = 10,
  169. Width = 20,
  170. Height = 20,
  171. Text = text,
  172. HorizontalAlignment = HorizontalAlignment.Left,
  173. VerticalAlignment = VerticalAlignment.Top,
  174. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  175. Background = Brushes.Transparent,
  176. BorderBrush = Brushes.Transparent,
  177. IsReadOnly = true
  178. };
  179. UpperLayerOfMap.Children.Add(icon);
  180. }
  181. // 获得地图信息
  182. private void GetMap(MessageOfMap obj)
  183. {
  184. int[,] map = new int[50, 50];
  185. try
  186. {
  187. for (int i = 0; i < 50; i++)
  188. {
  189. for (int j = 0; j < 50; j++)
  190. {
  191. map[i, j] = Convert.ToInt32(obj.Row[i].Col[j]);
  192. }
  193. }
  194. }
  195. catch
  196. {
  197. mapFlag = false;
  198. }
  199. finally
  200. {
  201. defaultMap = map;
  202. mapFlag = true;
  203. }
  204. }
  205. private void ZoomMap()
  206. {
  207. for (int i = 0; i < 50; i++)
  208. {
  209. for (int j = 0; j < 50; j++)
  210. {
  211. if (mapPatches[i, j] != null)
  212. {
  213. mapPatches[i, j].Width = UpperLayerOfMap.ActualWidth / 50;
  214. mapPatches[i, j].Height = UpperLayerOfMap.ActualHeight / 50;
  215. mapPatches[i, j].HorizontalAlignment = HorizontalAlignment.Left;
  216. mapPatches[i, j].VerticalAlignment = VerticalAlignment.Top;
  217. mapPatches[i, j].Margin = new Thickness(UpperLayerOfMap.ActualWidth / 50 * j, UpperLayerOfMap.ActualHeight / 50 * i, 0, 0);
  218. }
  219. }
  220. }
  221. }
  222. private void DrawMap()
  223. {
  224. for (int i = 0; i < defaultMap.GetLength(0); i++)
  225. {
  226. for (int j = 0; j < defaultMap.GetLength(1); j++)
  227. {
  228. mapPatches[i, j] = new()
  229. {
  230. Width = unitWidth,
  231. Height = unitHeight,
  232. HorizontalAlignment = HorizontalAlignment.Left,
  233. VerticalAlignment = VerticalAlignment.Top,
  234. Margin = new Thickness(Width * (j), Height * (i), 0, 0)
  235. };
  236. // mapPatches[i, j].SetValue(Canvas.LeftProperty, (double)(Width / 65.5 * j));
  237. // mapPatches[i, j].SetValue(Canvas.TopProperty, (double)(Height / 56.5 * i)); // 用zoommap进行修改
  238. switch (defaultMap[i, j])
  239. {
  240. case 6:
  241. mapPatches[i, j].Fill = Brushes.Brown;
  242. mapPatches[i, j].Stroke = Brushes.Brown;
  243. break;
  244. case 7:
  245. mapPatches[i, j].Fill = Brushes.Green;
  246. mapPatches[i, j].Stroke = Brushes.Green;
  247. break;
  248. case 8:
  249. mapPatches[i, j].Fill = Brushes.LightPink;
  250. mapPatches[i, j].Stroke = Brushes.LightPink;
  251. break;//machine
  252. case 9:
  253. mapPatches[i, j].Fill = Brushes.LightSkyBlue;
  254. mapPatches[i, j].Stroke = Brushes.LightSkyBlue;
  255. break;//door
  256. case 10:
  257. mapPatches[i, j].Fill = Brushes.LightSalmon;
  258. mapPatches[i, j].Stroke = Brushes.LightSalmon;
  259. break;//emergency
  260. default:
  261. break;
  262. }
  263. UnderLayerOfMap.Children.Add(mapPatches[i, j]);
  264. }
  265. }
  266. hasDrawed = true;
  267. }
  268. //三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  269. private void DrawLaser(Point source, double theta, double range, double Width) // 三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  270. {
  271. Point[] endPoint = new Point[4];
  272. Point target = new();
  273. target.X = source.X + range * Math.Cos(theta);
  274. target.Y = source.Y + range * Math.Sin(theta);
  275. endPoint[0].X = source.X + Width * Math.Cos(theta - Math.PI / 2);
  276. endPoint[0].Y = source.Y + Width * Math.Sin(theta - Math.PI / 2);
  277. endPoint[1].X = target.X + Width * Math.Cos(theta - Math.PI / 2);
  278. endPoint[1].Y = target.Y + Width * Math.Sin(theta - Math.PI / 2);
  279. endPoint[2].X = target.X + Width * Math.Cos(theta + Math.PI / 2);
  280. endPoint[2].Y = target.Y + Width * Math.Sin(theta + Math.PI / 2);
  281. endPoint[3].X = source.X + Width * Math.Cos(theta + Math.PI / 2);
  282. endPoint[3].Y = source.Y + Width * Math.Sin(theta + Math.PI / 2);
  283. Polygon laserIcon = new();
  284. laserIcon.Stroke = System.Windows.Media.Brushes.Red;
  285. laserIcon.Fill = System.Windows.Media.Brushes.Red;
  286. laserIcon.StrokeThickness = 2;
  287. laserIcon.HorizontalAlignment = HorizontalAlignment.Left;
  288. laserIcon.VerticalAlignment = VerticalAlignment.Top;
  289. PointCollection laserEndPoints = new();
  290. for (int i = 0; i < 4; i++)
  291. {
  292. laserEndPoints.Add(endPoint[i]);
  293. }
  294. laserIcon.Points = laserEndPoints;
  295. UpperLayerOfMap.Children.Add(laserIcon);
  296. }
  297. private async void OnReceive() // log未更新,switch1,2更新log
  298. {
  299. try
  300. {
  301. while (responseStream != null && await responseStream.ResponseStream.MoveNext())
  302. {
  303. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行,否则画图时foreach会有bug
  304. {
  305. listOfHuman.Clear();
  306. listOfButcher.Clear();
  307. listOfProp.Clear();
  308. MessageToClient content = responseStream.ResponseStream.Current;
  309. switch (content.GameState)
  310. {
  311. case GameState.GameStart:
  312. foreach (var obj in content.HumanMessage)
  313. {
  314. if (humanOrButcher && obj.PlayerId == playerID)
  315. {
  316. human = obj;
  317. }
  318. listOfHuman.Add(obj);
  319. }
  320. foreach (var obj in content.ButcherMessage)
  321. {
  322. if (!humanOrButcher && obj.PlayerId == playerID)
  323. {
  324. butcher = obj;
  325. }
  326. listOfButcher.Add(obj);
  327. }
  328. foreach (var obj in content.PropMessage)
  329. {
  330. listOfProp.Add(obj);
  331. }
  332. GetMap(content.MapMessage);
  333. break;
  334. case GameState.GameRunning:
  335. foreach (var obj in content.HumanMessage)
  336. {
  337. if (humanOrButcher && obj.PlayerId == playerID)
  338. {
  339. human = obj;
  340. }
  341. listOfHuman.Add(obj);
  342. }
  343. foreach (var obj in content.ButcherMessage)
  344. {
  345. if (!humanOrButcher && obj.PlayerId == playerID)
  346. {
  347. butcher = obj;
  348. }
  349. listOfButcher.Add(obj);
  350. }
  351. foreach (var obj in content.PropMessage)
  352. {
  353. listOfProp.Add(obj);
  354. }
  355. if (!mapFlag)
  356. GetMap(content.MapMessage);
  357. break;
  358. case GameState.GameEnd:
  359. foreach (var obj in content.HumanMessage)
  360. {
  361. listOfHuman.Add(obj);
  362. }
  363. foreach (var obj in content.ButcherMessage)
  364. {
  365. listOfButcher.Add(obj);
  366. }
  367. foreach (var obj in content.PropMessage)
  368. {
  369. listOfProp.Add(obj);
  370. }
  371. break;
  372. }
  373. }
  374. }
  375. if (responseStream == null)
  376. {
  377. throw new Exception("Unconnected");
  378. }
  379. }
  380. catch (Exception ex)
  381. {
  382. ErrorDisplayer error = new("Error: "+ex.ToString());
  383. error.Show();
  384. }
  385. }
  386. private bool CanSee(MessageOfHuman msg)
  387. {
  388. if (msg.State == HumanState.Dead)
  389. return false;
  390. //if (playerID >= 2022 || teamID >= 2022)
  391. // return true;
  392. if (humanOrButcher && human != null)
  393. {
  394. if (human.Guid == msg.Guid) // 自己能看见自己
  395. return true;
  396. }
  397. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  398. return false;
  399. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Machine)
  400. return true;
  401. if (humanOrButcher && human != null)
  402. {
  403. if (msg.Place != human.Place)
  404. return false;
  405. }
  406. else if (!humanOrButcher && butcher != null)
  407. {
  408. if (msg.Place != butcher.Place)
  409. return false;
  410. }
  411. return true;
  412. }
  413. private bool CanSee(MessageOfButcher msg)
  414. {
  415. // if (playerID >= 2022 || teamID >= 2022)
  416. // return true;
  417. if (!humanOrButcher && butcher != null)
  418. {
  419. if (butcher.Guid == msg.Guid) // 自己能看见自己
  420. return true;
  421. }
  422. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  423. return false;
  424. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Machine)
  425. return true;
  426. if (humanOrButcher && human != null)
  427. {
  428. if (msg.Place != human.Place)
  429. return false;
  430. }
  431. else if (!humanOrButcher && butcher != null)
  432. {
  433. if (msg.Place != butcher.Place)
  434. return false;
  435. }
  436. return true;
  437. }
  438. private bool CanSee(MessageOfProp msg)
  439. {
  440. if (msg.Place == PlaceType.Land)
  441. return true;
  442. if (humanOrButcher && human != null)
  443. {
  444. if (msg.Place != human.Place)
  445. return false;
  446. }
  447. else if (!humanOrButcher && butcher != null)
  448. {
  449. if (msg.Place != butcher.Place)
  450. return false;
  451. }
  452. return true;
  453. }
  454. private void Refresh(object? sender, EventArgs e)
  455. {
  456. // Bonus();
  457. if (WindowState == WindowState.Maximized)
  458. MaxButton.Content = "❐";
  459. else
  460. MaxButton.Content = "🗖";
  461. if (StatusBarsOfSurvivor != null)
  462. for (int i = 4; i < 8; i++)
  463. {
  464. StatusBarsOfSurvivor[i - 4].SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  465. }
  466. if (StatusBarsOfHunter != null)
  467. StatusBarsOfHunter.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  468. if (StatusBarsOfCircumstance != null)
  469. StatusBarsOfCircumstance.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  470. // 完成窗口信息更新
  471. if (!isClientStocked)
  472. {
  473. unit = Math.Sqrt(UpperLayerOfMap.ActualHeight * UpperLayerOfMap.ActualWidth) / 50;
  474. unitHeight = UpperLayerOfMap.ActualHeight / 50;
  475. unitWidth = UpperLayerOfMap.ActualWidth / 50;
  476. try
  477. {
  478. // if (log != null)
  479. //{
  480. // string temp = "";
  481. // for (int i = 0; i < dataDict[GameObjType.Character].Count; i++)
  482. // {
  483. // temp += Convert.ToString(dataDict[GameObjType.Character][i].MessageOfCharacter.TeamID) + "\n";
  484. // }
  485. // log.Content = temp;
  486. // }
  487. UpperLayerOfMap.Children.Clear();
  488. // if ((communicator == null || !communicator.Client.IsConnected) && !isPlaybackMode)
  489. //{
  490. // UnderLayerOfMap.Children.Clear();
  491. // throw new Exception("Client is unconnected.");
  492. // }
  493. // else
  494. //{
  495. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行
  496. {
  497. if (!hasDrawed && mapFlag)
  498. DrawMap();
  499. foreach (var data in listOfHuman)
  500. {
  501. StatusBarsOfSurvivor[data.PlayerId].SetValue(data);
  502. if (CanSee(data))
  503. {
  504. Ellipse icon = new()
  505. {
  506. Width = unitWidth,
  507. Height = unitHeight,
  508. HorizontalAlignment = HorizontalAlignment.Left,
  509. VerticalAlignment = VerticalAlignment.Top,
  510. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  511. Fill = Brushes.BlueViolet,
  512. };
  513. UpperLayerOfMap.Children.Add(icon);
  514. }
  515. }
  516. foreach (var data in listOfButcher)
  517. {
  518. if (CanSee(data))
  519. {
  520. Ellipse icon = new()
  521. {
  522. Width = 10,
  523. Height = 10,
  524. HorizontalAlignment = HorizontalAlignment.Left,
  525. VerticalAlignment = VerticalAlignment.Top,
  526. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  527. Fill = Brushes.Black,
  528. };
  529. UpperLayerOfMap.Children.Add(icon);
  530. }
  531. }
  532. foreach (var data in listOfProp)
  533. {
  534. if (CanSee(data))
  535. {
  536. switch (data.Type)
  537. {
  538. case PropType.Ptype1:
  539. DrawProp(data, "🔧");
  540. break;
  541. case PropType.Ptype2:
  542. DrawProp(data, "🛡");
  543. break;
  544. case PropType.Ptype3:
  545. DrawProp(data, "♥");
  546. break;
  547. case PropType.Ptype4:
  548. DrawProp(data, "⛸");
  549. break;
  550. default:
  551. DrawProp(data, "");
  552. break;
  553. }
  554. }
  555. }
  556. //}
  557. ZoomMap();
  558. }
  559. }
  560. catch (Exception exc)
  561. {
  562. ErrorDisplayer error = new("Error: " + exc.ToString());
  563. error.Show();
  564. isClientStocked = true;
  565. PorC.Content = "▶";
  566. }
  567. }
  568. counter++;
  569. }
  570. // 键盘控制
  571. private void KeyBoardControl(object sender, KeyEventArgs e)
  572. {
  573. if (!isPlaybackMode)
  574. {
  575. switch (e.Key)
  576. {
  577. case Key.W:
  578. case Key.NumPad8:
  579. MoveMsg msgW = new()
  580. {
  581. PlayerId = playerID,
  582. TimeInMilliseconds = 50,
  583. Angle = Math.PI
  584. };
  585. client.Move(msgW);
  586. break;
  587. case Key.NumPad2:
  588. case Key.S:
  589. MoveMsg msgS = new()
  590. {
  591. PlayerId = playerID,
  592. TimeInMilliseconds = 50,
  593. Angle = 0
  594. };
  595. client.Move(msgS);
  596. break;
  597. case Key.D:
  598. case Key.NumPad6:
  599. MoveMsg msgD = new()
  600. {
  601. PlayerId = playerID,
  602. TimeInMilliseconds = 50,
  603. Angle = Math.PI / 2
  604. };
  605. client.Move(msgD);
  606. break;
  607. case Key.A:
  608. case Key.NumPad4:
  609. MoveMsg msgA = new()
  610. {
  611. PlayerId = playerID,
  612. TimeInMilliseconds = 50,
  613. Angle = 3 * Math.PI / 2
  614. };
  615. client.Move(msgA);
  616. break;
  617. case Key.J:
  618. AttackMsg msgJ = new()
  619. {
  620. PlayerId = playerID,
  621. Angle = Math.PI
  622. };
  623. client.Attack(msgJ);
  624. break;
  625. case Key.F:
  626. PickMsg msgF = new()
  627. {
  628. PlayerId = playerID,
  629. };
  630. client.PickProp(msgF);
  631. break;
  632. case Key.E:
  633. IDMsg msgE = new()
  634. {
  635. PlayerId = playerID,
  636. };
  637. client.UseProp(msgE);
  638. break;
  639. case Key.Q:
  640. IDMsg msgQ = new()
  641. {
  642. PlayerId = playerID,
  643. };
  644. client.UseSkill(msgQ);
  645. break;
  646. default:
  647. break;
  648. }
  649. }
  650. }
  651. //鼠标双击
  652. private void Attack(object sender, RoutedEventArgs e)
  653. {
  654. if (!isPlaybackMode)
  655. {
  656. if (humanOrButcher&&human != null)
  657. {
  658. AttackMsg msgJ = new()
  659. {
  660. PlayerId = playerID
  661. };
  662. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  663. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  664. msgJ.Angle = Math.Atan2(mouseY - human.Y, mouseX - human.X);
  665. client.Attack(msgJ);
  666. }
  667. if (!humanOrButcher && butcher != null)
  668. {
  669. AttackMsg msgJ = new()
  670. {
  671. PlayerId = playerID
  672. };
  673. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  674. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  675. msgJ.Angle = Math.Atan2(mouseY - butcher.Y, mouseX - butcher.X);
  676. client.Attack(msgJ);
  677. }
  678. }
  679. }
  680. // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
  681. private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
  682. {
  683. if (!isClientStocked)
  684. {
  685. isClientStocked = true;
  686. PorC.Content = "▶";
  687. }
  688. else
  689. {
  690. isClientStocked = false;
  691. PorC.Content = "⏸";
  692. }
  693. }
  694. // 未复现
  695. private void ClickToConnect(object sender, RoutedEventArgs e)
  696. {
  697. }
  698. // 窗口最大化、关闭、最小化、拖拽
  699. private void ClickToMaxmize(object sender, RoutedEventArgs e)
  700. {
  701. if (WindowState != WindowState.Maximized)
  702. WindowState = WindowState.Maximized;
  703. else
  704. WindowState = WindowState.Normal;
  705. }
  706. private void ClickToClose(object sender, RoutedEventArgs e)
  707. {
  708. Application.Current.Shutdown();
  709. }
  710. private void ClickToMinimize(object sender, RoutedEventArgs e)
  711. {
  712. WindowState = WindowState.Minimized;
  713. }
  714. private void DragWindow(object sender, RoutedEventArgs e)
  715. {
  716. DragMove();
  717. }
  718. // 寻求帮助、访问EESAST(部分功能未复原)
  719. private void ClickForHelp(object sender, RoutedEventArgs e)
  720. {
  721. PleaseWait();
  722. }
  723. private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
  724. {
  725. try
  726. {
  727. _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
  728. }
  729. catch (Exception exc)
  730. {
  731. // ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
  732. // error.Show();
  733. }
  734. }
  735. // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
  736. private void ClickToSetConnect(object sender, RoutedEventArgs e)
  737. {
  738. // ConnectRegister crg = new();
  739. // crg.Show();
  740. }
  741. private void ClickToEnterVS(object sender, RoutedEventArgs e)
  742. {
  743. // try
  744. //{
  745. // if (!File.Exists("VSRoute.txt"))
  746. // {
  747. // File.Create("VSRoute.txt");
  748. // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
  749. // throw ex;
  750. // }//创建路径文件
  751. // using StreamReader sr = new("VSRoute.txt");
  752. // _ = Process.Start(sr.ReadLine());
  753. // }
  754. // catch (Exception exc)
  755. //{
  756. // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
  757. // error.Show();
  758. // }
  759. PleaseWait();
  760. }
  761. private void ClickForUpdate(object sender, RoutedEventArgs e)
  762. {
  763. PleaseWait();
  764. }
  765. private void ClickToCheckLadder(object sender, RoutedEventArgs e)
  766. {
  767. PleaseWait();
  768. }
  769. // 敬请期待函数
  770. private void PleaseWait()
  771. {
  772. try
  773. {
  774. throw new Exception("敬请期待");
  775. }
  776. catch (Exception exc)
  777. {
  778. // ErrorDisplayer error = new(exc.Message);
  779. // error.Show();
  780. }
  781. }
  782. // 以下为Mainwindow自定义属性
  783. private readonly DispatcherTimer timer; // 定时器
  784. private long counter; // 预留的取时间变量
  785. AvailableService.AvailableServiceClient client;
  786. AsyncServerStreamingCall<MessageToClient>? responseStream;
  787. private StatusBarOfSurvivor[] StatusBarsOfSurvivor;
  788. private StatusBarOfHunter StatusBarsOfHunter;
  789. private StatusBarOfCircumstance StatusBarsOfCircumstance;
  790. private bool isClientStocked;
  791. private bool isPlaybackMode;
  792. private long playerID;
  793. private PlayerType playerType;
  794. private double unit;
  795. private double unitHeight;
  796. private double unitWidth;
  797. private readonly Rectangle[,] mapPatches = new Rectangle[50, 50];
  798. private List<MessageOfProp> listOfProp;
  799. private List<MessageOfHuman> listOfHuman;
  800. private List<MessageOfButcher> listOfButcher;
  801. private object drawPicLock = new object();
  802. private MessageOfHuman? human = null;
  803. private MessageOfButcher? butcher = null;
  804. private bool humanOrButcher;//true for human
  805. private bool bonusflag;
  806. private bool mapFlag = false;
  807. private bool hasDrawed = false;
  808. 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 },
  809. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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