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 74 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512
  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. using CommandLine;
  21. // 目前MainWindow还未复现的功能:
  22. // private void ReactToCommandline(),
  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<MessageOfStudent>();
  49. listOfButcher = new List<MessageOfTricker>();
  50. listOfBullet=new List<MessageOfBullet>();
  51. listOfBombedBullet = new List<MessageOfBombedBullet>();
  52. listOfAll = new List<MessageOfAll>();
  53. listOfChest = new List<MessageOfChest>();
  54. listOfClassroom = new List<MessageOfClassroom>();
  55. listOfDoor = new List<MessageOfDoor>();
  56. listOfGate = new List<MessageOfGate>();
  57. WindowStartupLocation = WindowStartupLocation.CenterScreen;
  58. //comInfo[0] = "127.0.0.1";
  59. //comInfo[1] = "8888";
  60. //comInfo[2] = "0";
  61. //comInfo[3] = "1";
  62. //comInfo[4] = "1";
  63. //ConnectToServer(comInfo);
  64. //OnReceive();
  65. ReactToCommandline();
  66. }
  67. private void SetStatusBar()
  68. {
  69. StatusBarsOfSurvivor = new StatusBarOfSurvivor[4];
  70. StatusBarsOfHunter = new StatusBarOfHunter(MainGrid, 3, 0);
  71. StatusBarsOfCircumstance = new StatusBarOfCircumstance(MainGrid, 1, 0);
  72. for (int i = 4; i < 8; i++)
  73. {
  74. StatusBarsOfSurvivor[i - 4] = new(MainGrid, i / 2 + 2, i % 2);
  75. }
  76. }
  77. // 获得地图信息,未更新数值
  78. private void GetMap(MessageOfMap obj)
  79. {
  80. int[,] map = new int[50, 50];
  81. try
  82. {
  83. for (int i = 0; i < 50; i++)
  84. {
  85. for (int j = 0; j < 50; j++)
  86. {
  87. map[i, j] = Convert.ToInt32(obj.Row[i].Col[j]) + 4;//与proto一致
  88. }
  89. }
  90. }
  91. catch
  92. {
  93. mapFlag = false;
  94. }
  95. finally
  96. {
  97. defaultMap = map;
  98. mapFlag = true;
  99. }
  100. }
  101. private void ReactToCommandline()
  102. {
  103. string[] args = Environment.GetCommandLineArgs();
  104. if (args.Length == 2)
  105. {
  106. Playback(args[1]);
  107. return;
  108. }
  109. _ = Parser.Default.ParseArguments<ArgumentOptions>(args).WithParsed(o =>
  110. { options = o; });
  111. if (options == null || options.cl == false)
  112. {
  113. OnReceive();
  114. }
  115. else
  116. {
  117. //if (options.PlaybackFile == DefaultArgumentOptions.FileName)
  118. //{
  119. try
  120. {
  121. string[] comInfo = new string[5];
  122. comInfo[0] = options.Ip;
  123. comInfo[1] = options.Port;
  124. comInfo[2] = options.PlayerID;
  125. comInfo[3] = options.PlayerType;
  126. comInfo[4] = options.Occupation;
  127. ConnectToServer(comInfo);
  128. OnReceive();
  129. }
  130. catch
  131. {
  132. OnReceive();
  133. }
  134. //}
  135. //else
  136. //{
  137. // Playback(options.PlaybackFile, options.PlaybackSpeed);
  138. //}
  139. }
  140. }
  141. private void Playback(string fileName, double pbSpeed = 2.0)
  142. {
  143. var pbClient = new PlaybackClient(fileName, pbSpeed);
  144. int[,]? map;
  145. if ((map = pbClient.ReadDataFromFile(listOfProp, listOfHuman, listOfButcher, listOfBullet,listOfBombedBullet, listOfAll, listOfChest, listOfClassroom,listOfDoor, listOfGate, drawPicLock)) != null)
  146. {
  147. isClientStocked = false;
  148. isPlaybackMode = true;
  149. defaultMap = map;
  150. mapFlag = true;
  151. }
  152. else
  153. {
  154. MessageBox.Show("Failed to read the playback file!");
  155. isClientStocked = true;
  156. }
  157. }
  158. // 连接Server,comInfo[]的格式:0-ip 1- port 2-playerID 3-human/TrickerType 4-occupation
  159. private void ConnectToServer(string[] comInfo)
  160. {
  161. if (!isPlaybackMode)
  162. {
  163. if (comInfo.Length != 5)
  164. throw new Exception("注册信息有误!");
  165. playerID = Convert.ToInt64(comInfo[2]);
  166. Connect.Background = Brushes.Gray;
  167. string connect = new string(comInfo[0]);
  168. connect += ':';
  169. connect += comInfo[1];
  170. Channel channel = new Channel(connect, ChannelCredentials.Insecure);
  171. client = new AvailableService.AvailableServiceClient(channel);
  172. // 没判断连没连上
  173. PlayerMsg playerMsg = new PlayerMsg();
  174. playerMsg.PlayerId = playerID;
  175. playerType = Convert.ToInt64(comInfo[3]) switch
  176. {
  177. 0 => PlayerType.NullPlayerType,
  178. 1 => PlayerType.StudentPlayer,
  179. 2 => PlayerType.TrickerPlayer,
  180. };
  181. playerMsg.PlayerType=playerType;
  182. if (Convert.ToInt64(comInfo[3]) == 1)
  183. {
  184. humanOrButcher = true;
  185. }
  186. else if (Convert.ToInt64(comInfo[3]) == 2)
  187. {
  188. humanOrButcher = false;
  189. }
  190. if (playerType == PlayerType.StudentPlayer)
  191. {
  192. switch (Convert.ToInt64(comInfo[4]))
  193. {
  194. case 0:
  195. playerMsg.StudentType = StudentType.NullStudentType;
  196. break;
  197. case 1:
  198. playerMsg.StudentType = StudentType.Athlete;
  199. break;
  200. case 2:
  201. playerMsg.StudentType = StudentType._2;
  202. break;
  203. case 3:
  204. playerMsg.StudentType = StudentType._3;
  205. break;
  206. case 4:
  207. playerMsg.StudentType = StudentType._4;
  208. break;
  209. default:
  210. break;
  211. }
  212. }
  213. else if (playerType == PlayerType.TrickerPlayer)
  214. {
  215. switch (Convert.ToInt64(comInfo[4]))
  216. {
  217. case 0:
  218. playerMsg.TrickerType = TrickerType.NullTrickerType;
  219. break;
  220. case 1:
  221. playerMsg.TrickerType = TrickerType.Assassin;
  222. break;
  223. case 2:
  224. playerMsg.TrickerType = TrickerType._2;
  225. break;
  226. case 3:
  227. playerMsg.TrickerType = TrickerType._3;
  228. break;
  229. case 4:
  230. playerMsg.TrickerType = TrickerType._4;
  231. break;
  232. default:
  233. break;
  234. }
  235. }
  236. responseStream = client.AddPlayer(playerMsg);
  237. Connect.Background = Brushes.Transparent;
  238. isClientStocked = false;
  239. PorC.Content = "⏸";
  240. // 建立连接的同时加入人物
  241. }
  242. }
  243. // 绘制道具
  244. private void DrawProp(MessageOfProp data, string text)
  245. {
  246. TextBox icon = new()
  247. {
  248. FontSize = 10,
  249. Width = 20,
  250. Height = 20,
  251. Text = text,
  252. HorizontalAlignment = HorizontalAlignment.Left,
  253. VerticalAlignment = VerticalAlignment.Top,
  254. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  255. Background = Brushes.Transparent,
  256. BorderBrush = Brushes.Transparent,
  257. IsReadOnly = true
  258. };
  259. UpperLayerOfMap.Children.Add(icon);
  260. }
  261. private void ZoomMap()
  262. {
  263. for (int i = 0; i < 50; i++)
  264. {
  265. for (int j = 0; j < 50; j++)
  266. {
  267. if (mapPatches[i, j] != null)
  268. {
  269. mapPatches[i, j].Width = UpperLayerOfMap.ActualWidth / 50;
  270. mapPatches[i, j].Height = UpperLayerOfMap.ActualHeight / 50;
  271. mapPatches[i, j].HorizontalAlignment = HorizontalAlignment.Left;
  272. mapPatches[i, j].VerticalAlignment = VerticalAlignment.Top;
  273. mapPatches[i, j].Margin = new Thickness(UpperLayerOfMap.ActualWidth / 50 * j, UpperLayerOfMap.ActualHeight / 50 * i, 0, 0);
  274. }
  275. }
  276. }
  277. }
  278. private void DrawMap()
  279. {
  280. for (int i = 0; i < defaultMap.GetLength(0); i++)
  281. {
  282. for (int j = 0; j < defaultMap.GetLength(1); j++)
  283. {
  284. mapPatches[i, j] = new()
  285. {
  286. Width = unitWidth,
  287. Height = unitHeight,
  288. HorizontalAlignment = HorizontalAlignment.Left,
  289. VerticalAlignment = VerticalAlignment.Top,
  290. Margin = new Thickness(Width * (j), Height * (i), 0, 0)
  291. };
  292. // mapPatches[i, j].SetValue(Canvas.LeftProperty, (double)(Width / 65.5 * j));
  293. // mapPatches[i, j].SetValue(Canvas.TopProperty, (double)(Height / 56.5 * i)); // 用zoommap进行修改
  294. switch (defaultMap[i, j])
  295. {
  296. case 6:
  297. mapPatches[i, j].Fill = Brushes.Brown;
  298. mapPatches[i, j].Stroke = Brushes.Brown;
  299. break;//wall
  300. case 7:
  301. mapPatches[i, j].Fill = Brushes.Green;
  302. mapPatches[i, j].Stroke = Brushes.Green;
  303. break;//grass
  304. case 8:
  305. mapPatches[i, j].Fill = Brushes.LightPink;
  306. mapPatches[i, j].Stroke = Brushes.LightPink;
  307. break;//machine
  308. case 9:
  309. mapPatches[i, j].Fill = Brushes.LightSkyBlue;
  310. mapPatches[i, j].Stroke = Brushes.LightSkyBlue;
  311. break;//gate
  312. case 10:
  313. foreach (var obj in listOfAll)
  314. {
  315. if(obj.HiddenGateRefreshed)
  316. {
  317. mapPatches[i, j].Fill = Brushes.LightSalmon;
  318. mapPatches[i, j].Stroke = Brushes.LightSalmon;
  319. }
  320. }
  321. break;//emergency
  322. case 11:
  323. mapPatches[i, j].Fill = Brushes.Gray;
  324. mapPatches[i, j].Stroke = Brushes.Gray;
  325. break;//window
  326. case 12:
  327. case 13:
  328. case 14:
  329. mapPatches[i, j].Fill = Brushes.Khaki;
  330. mapPatches[i, j].Stroke = Brushes.Khaki;
  331. break;//door
  332. case 15:
  333. mapPatches[i, j].Fill = Brushes.Orange;
  334. mapPatches[i, j].Stroke = Brushes.Orange;
  335. break;//chest
  336. default:
  337. break;
  338. }
  339. UnderLayerOfMap.Children.Add(mapPatches[i, j]);
  340. }
  341. }
  342. hasDrawed = true;
  343. }
  344. //三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  345. private void DrawLaser(Point source, double theta, double range, double Width) // 三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  346. {
  347. Point[] endPoint = new Point[4];
  348. Point target = new();
  349. target.X = source.X + range * Math.Cos(theta);
  350. target.Y = source.Y + range * Math.Sin(theta);
  351. endPoint[0].X = source.X + Width * Math.Cos(theta - Math.PI / 2);
  352. endPoint[0].Y = source.Y + Width * Math.Sin(theta - Math.PI / 2);
  353. endPoint[1].X = target.X + Width * Math.Cos(theta - Math.PI / 2);
  354. endPoint[1].Y = target.Y + Width * Math.Sin(theta - Math.PI / 2);
  355. endPoint[2].X = target.X + Width * Math.Cos(theta + Math.PI / 2);
  356. endPoint[2].Y = target.Y + Width * Math.Sin(theta + Math.PI / 2);
  357. endPoint[3].X = source.X + Width * Math.Cos(theta + Math.PI / 2);
  358. endPoint[3].Y = source.Y + Width * Math.Sin(theta + Math.PI / 2);
  359. Polygon laserIcon = new();
  360. laserIcon.Stroke = System.Windows.Media.Brushes.Red;
  361. laserIcon.Fill = System.Windows.Media.Brushes.Red;
  362. laserIcon.StrokeThickness = 2;
  363. laserIcon.HorizontalAlignment = HorizontalAlignment.Left;
  364. laserIcon.VerticalAlignment = VerticalAlignment.Top;
  365. PointCollection laserEndPoints = new();
  366. for (int i = 0; i < 4; i++)
  367. {
  368. laserEndPoints.Add(endPoint[i]);
  369. }
  370. laserIcon.Points = laserEndPoints;
  371. UpperLayerOfMap.Children.Add(laserIcon);
  372. }
  373. private async void OnReceive() // 已按照3.5版proto更新信息,但是左侧信息栏还未填充。log未更新,switch1,2,3更新log
  374. {
  375. try
  376. {
  377. while (responseStream != null && await responseStream.ResponseStream.MoveNext())
  378. {
  379. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行,否则画图时foreach会有bug
  380. {
  381. listOfHuman.Clear();
  382. listOfButcher.Clear();
  383. listOfProp.Clear();
  384. listOfBombedBullet.Clear();
  385. listOfBullet.Clear();
  386. listOfAll.Clear();
  387. listOfChest.Clear();
  388. listOfClassroom.Clear();
  389. listOfDoor.Clear();
  390. listOfGate.Clear();
  391. MessageToClient content = responseStream.ResponseStream.Current;
  392. switch (content.GameState)
  393. {
  394. case GameState.GameStart:
  395. foreach (var obj in content.ObjMessage)
  396. {
  397. switch (obj.MessageOfObjCase)
  398. {
  399. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  400. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  401. {
  402. human = obj.StudentMessage;
  403. }
  404. listOfHuman.Add(obj.StudentMessage);
  405. break;
  406. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  407. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  408. {
  409. butcher = obj.TrickerMessage;
  410. }
  411. listOfButcher.Add(obj.TrickerMessage);
  412. break;
  413. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  414. listOfProp.Add(obj.PropMessage);
  415. break;
  416. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  417. listOfBombedBullet.Add(obj.BombedBulletMessage);
  418. break;
  419. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  420. listOfBullet.Add(obj.BulletMessage);
  421. break;
  422. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  423. listOfChest.Add(obj.ChestMessage);
  424. break;
  425. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  426. listOfClassroom.Add(obj.ClassroomMessage);
  427. break;
  428. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  429. listOfDoor.Add(obj.DoorMessage);
  430. break;
  431. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  432. listOfGate.Add(obj.GateMessage);
  433. break;
  434. case MessageOfObj.MessageOfObjOneofCase.MapMessage:
  435. GetMap(obj.MapMessage);
  436. break;
  437. }
  438. }
  439. listOfAll.Add(content.AllMessage);
  440. break;
  441. case GameState.GameRunning:
  442. foreach (var obj in content.ObjMessage)
  443. {
  444. switch (obj.MessageOfObjCase)
  445. {
  446. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  447. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  448. {
  449. human = obj.StudentMessage;
  450. }
  451. listOfHuman.Add(obj.StudentMessage);
  452. break;
  453. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  454. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  455. {
  456. butcher = obj.TrickerMessage;
  457. }
  458. listOfButcher.Add(obj.TrickerMessage);
  459. break;
  460. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  461. listOfProp.Add(obj.PropMessage);
  462. break;
  463. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  464. listOfBombedBullet.Add(obj.BombedBulletMessage);
  465. break;
  466. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  467. listOfBullet.Add(obj.BulletMessage);
  468. break;
  469. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  470. listOfChest.Add(obj.ChestMessage);
  471. break;
  472. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  473. listOfClassroom.Add(obj.ClassroomMessage);
  474. break;
  475. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  476. listOfDoor.Add(obj.DoorMessage);
  477. break;
  478. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  479. listOfGate.Add(obj.GateMessage);
  480. break;
  481. }
  482. }
  483. listOfAll.Add(content.AllMessage);
  484. break;
  485. case GameState.GameEnd:
  486. foreach (var obj in content.ObjMessage)
  487. {
  488. switch (obj.MessageOfObjCase)
  489. {
  490. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  491. listOfHuman.Add(obj.StudentMessage);
  492. break;
  493. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  494. listOfButcher.Add(obj.TrickerMessage);
  495. break;
  496. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  497. listOfProp.Add(obj.PropMessage);
  498. break;
  499. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  500. listOfBombedBullet.Add(obj.BombedBulletMessage);
  501. break;
  502. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  503. listOfBullet.Add(obj.BulletMessage);
  504. break;
  505. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  506. listOfChest.Add(obj.ChestMessage);
  507. break;
  508. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  509. listOfClassroom.Add(obj.ClassroomMessage);
  510. break;
  511. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  512. listOfDoor.Add(obj.DoorMessage);
  513. break;
  514. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  515. listOfGate.Add(obj.GateMessage);
  516. break;
  517. }
  518. }
  519. listOfAll.Add(content.AllMessage);
  520. break;
  521. }
  522. }
  523. if (responseStream == null)
  524. {
  525. throw new Exception("Unconnected");
  526. }
  527. }
  528. }
  529. catch (Exception ex)
  530. {
  531. ErrorDisplayer error = new("Error: " + ex.ToString());
  532. error.Show();
  533. }
  534. }
  535. private int GetX(int x)
  536. {
  537. return x / 1000 + 1;
  538. }
  539. private int GetY(int y)
  540. {
  541. return y / 1000 + 1;
  542. }
  543. //待修改
  544. private bool CanSee(MessageOfStudent msg)
  545. {
  546. if (msg.PlayerState == PlayerState.Quit)
  547. return false;
  548. //if (playerID >= 2022 || teamID >= 2022)
  549. // return true;
  550. if (humanOrButcher && human != null)
  551. {
  552. if (human.Guid == msg.Guid) // 自己能看见自己
  553. return true;
  554. }
  555. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  556. return false;
  557. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
  558. return true;
  559. if (humanOrButcher && human != null)
  560. {
  561. if (msg.Place != human.Place)
  562. return false;
  563. }
  564. else if (!humanOrButcher && butcher != null)
  565. {
  566. if (msg.Place != butcher.Place)
  567. return false;
  568. }
  569. return true;
  570. }
  571. private bool CanSee(MessageOfTricker msg)
  572. {
  573. // if (playerID >= 2022 || teamID >= 2022)
  574. // return true;
  575. if (!humanOrButcher && butcher != null)
  576. {
  577. if (butcher.Guid == msg.Guid) // 自己能看见自己
  578. return true;
  579. }
  580. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  581. return false;
  582. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
  583. return true;
  584. if (humanOrButcher && human != null)
  585. {
  586. if (msg.Place != human.Place)
  587. return false;
  588. }
  589. else if (!humanOrButcher && butcher != null)
  590. {
  591. if (msg.Place != butcher.Place)
  592. return false;
  593. }
  594. return true;
  595. }
  596. private bool CanSee(MessageOfProp msg)
  597. {
  598. if (msg.Place == PlaceType.Land)
  599. return true;
  600. if (humanOrButcher && human != null)
  601. {
  602. if (msg.Place != human.Place)
  603. return false;
  604. }
  605. else if (!humanOrButcher && butcher != null)
  606. {
  607. if (msg.Place != butcher.Place)
  608. return false;
  609. }
  610. return true;
  611. }
  612. private bool CanSee(MessageOfBullet msg)
  613. {
  614. if (msg.Place == PlaceType.Land)
  615. return true;
  616. if (humanOrButcher && human != null)
  617. {
  618. if (msg.Place != human.Place)
  619. return false;
  620. }
  621. else if (!humanOrButcher && butcher != null)
  622. {
  623. if (msg.Place != butcher.Place)
  624. return false;
  625. }
  626. return true;
  627. }
  628. private void Refresh(object? sender, EventArgs e) // 已按照3.5版proto更新信息,circumstance栏未更新 log未更新
  629. {
  630. // Bonus();
  631. if (WindowState == WindowState.Maximized)
  632. MaxButton.Content = "❐";
  633. else
  634. MaxButton.Content = "🗖";
  635. if (StatusBarsOfSurvivor != null)
  636. for (int i = 4; i < 8; i++)
  637. {
  638. StatusBarsOfSurvivor[i - 4].SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  639. }
  640. if (StatusBarsOfHunter != null)
  641. StatusBarsOfHunter.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  642. if (StatusBarsOfCircumstance != null)
  643. StatusBarsOfCircumstance.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  644. // 完成窗口信息更新
  645. if (!isClientStocked)
  646. {
  647. unit = Math.Sqrt(UpperLayerOfMap.ActualHeight * UpperLayerOfMap.ActualWidth) / 50;
  648. unitHeight = UpperLayerOfMap.ActualHeight / 50;
  649. unitWidth = UpperLayerOfMap.ActualWidth / 50;
  650. try
  651. {
  652. // if (log != null)
  653. //{
  654. // string temp = "";
  655. // for (int i = 0; i < dataDict[GameObjType.Character].Count; i++)
  656. // {
  657. // temp += Convert.ToString(dataDict[GameObjType.Character][i].MessageOfCharacter.TeamID) + "\n";
  658. // }
  659. // log.Content = temp;
  660. // }
  661. UpperLayerOfMap.Children.Clear();
  662. // if ((communicator == null || !communicator.Client.IsConnected) && !isPlaybackMode)
  663. //{
  664. // UnderLayerOfMap.Children.Clear();
  665. // throw new Exception("Client is unconnected.");
  666. // }
  667. // else
  668. //{
  669. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行
  670. {
  671. foreach (var data in listOfAll)
  672. {
  673. StatusBarsOfCircumstance.SetValue(data);
  674. }
  675. if (!hasDrawed && mapFlag)
  676. DrawMap();
  677. foreach (var data in listOfHuman)
  678. {
  679. StatusBarsOfSurvivor[data.PlayerId].SetValue(data);
  680. if (CanSee(data))
  681. {
  682. Ellipse icon = new()
  683. {
  684. Width = unitWidth,
  685. Height = unitHeight,
  686. HorizontalAlignment = HorizontalAlignment.Left,
  687. VerticalAlignment = VerticalAlignment.Top,
  688. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  689. Fill = Brushes.BlueViolet,
  690. };
  691. UpperLayerOfMap.Children.Add(icon);
  692. }
  693. }
  694. foreach (var data in listOfButcher)
  695. {
  696. StatusBarsOfHunter.SetValue(data);
  697. if (CanSee(data))
  698. {
  699. Ellipse icon = new()
  700. {
  701. Width = unitWidth,
  702. Height = unitHeight,
  703. HorizontalAlignment = HorizontalAlignment.Left,
  704. VerticalAlignment = VerticalAlignment.Top,
  705. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  706. Fill = Brushes.Chocolate,
  707. };
  708. UpperLayerOfMap.Children.Add(icon);
  709. }
  710. }
  711. foreach (var data in listOfProp)
  712. {
  713. if (CanSee(data))
  714. {
  715. switch (data.Type)
  716. {
  717. case PropType.Key3:
  718. DrawProp(data, "🔑");
  719. break;
  720. case PropType.Key5:
  721. DrawProp(data, "🔑");
  722. break;
  723. case PropType.Key6:
  724. DrawProp(data, "🔑");
  725. break;
  726. case PropType.AddSpeed:
  727. DrawProp(data, "⛸");
  728. break;
  729. case PropType.AddHpOrAp:
  730. DrawProp(data, "♥");
  731. break;
  732. case PropType.AddLifeOrAp:
  733. DrawProp(data, "🏅");
  734. break;
  735. case PropType.ShieldOrSpear:
  736. DrawProp(data, "🛡");
  737. break;
  738. default:
  739. DrawProp(data, "");
  740. break;
  741. }
  742. }
  743. }
  744. foreach (var data in listOfBullet)
  745. {
  746. if (CanSee(data))
  747. {
  748. Ellipse icon = new()
  749. {
  750. Width = 10,
  751. Height = 10,
  752. HorizontalAlignment = HorizontalAlignment.Left,
  753. VerticalAlignment = VerticalAlignment.Top,
  754. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  755. Fill = Brushes.Red
  756. };
  757. UpperLayerOfMap.Children.Add(icon);
  758. }
  759. }
  760. foreach (var data in listOfBombedBullet)
  761. {
  762. switch (data.Type)
  763. {
  764. case BulletType.FastBullet:
  765. {
  766. Ellipse icon = new();
  767. double bombRange = data.BombRange / 1000;
  768. icon.Width = bombRange * unitWidth;
  769. icon.Height = bombRange * unitHeight;
  770. icon.HorizontalAlignment = HorizontalAlignment.Left;
  771. icon.VerticalAlignment = VerticalAlignment.Top;
  772. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  773. icon.Fill = Brushes.Red;
  774. UpperLayerOfMap.Children.Add(icon);
  775. break;
  776. }
  777. case BulletType.AtomBomb:
  778. {
  779. Ellipse icon = new Ellipse();
  780. double bombRange = data.BombRange / 1000;
  781. icon.Width = bombRange * unitWidth;
  782. icon.Height = bombRange * unitHeight;
  783. icon.HorizontalAlignment = HorizontalAlignment.Left;
  784. icon.VerticalAlignment = VerticalAlignment.Top;
  785. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  786. icon.Fill = Brushes.Red;
  787. UpperLayerOfMap.Children.Add(icon);
  788. break;
  789. }
  790. case BulletType.OrdinaryBullet:
  791. {
  792. Ellipse icon = new Ellipse();
  793. double bombRange = data.BombRange / 1000;
  794. icon.Width = bombRange * unitWidth;
  795. icon.Height = bombRange * unitHeight;
  796. icon.HorizontalAlignment = HorizontalAlignment.Left;
  797. icon.VerticalAlignment = VerticalAlignment.Top;
  798. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  799. icon.Fill = Brushes.Red;
  800. UpperLayerOfMap.Children.Add(icon);
  801. break;
  802. }
  803. /*case BulletType.LineBullet:
  804. {
  805. double bombRange = data.BombRange / 1000;
  806. DrawLaser(new Point(data.Y * unitWidth / 1000.0, data.X * unitHeight / 1000.0), -data.FacingDirection + Math.PI / 2, bombRange * unitHeight, 0.5 * unitWidth);
  807. break;
  808. }*/
  809. default:
  810. break;
  811. }
  812. }
  813. foreach (var data in listOfClassroom)
  814. {
  815. TextBox icon = new()
  816. {
  817. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  818. Width = unitWidth,
  819. Height = unitHeight,
  820. Text = Convert.ToString(data.Progress),
  821. HorizontalAlignment = HorizontalAlignment.Left,
  822. VerticalAlignment = VerticalAlignment.Top,
  823. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  824. //Margin = new Thickness(25,25, 0, 0),
  825. Background = Brushes.Transparent,
  826. BorderBrush = Brushes.Transparent,
  827. IsReadOnly = true
  828. };
  829. UpperLayerOfMap.Children.Add(icon);
  830. }
  831. foreach(var data in listOfChest)
  832. {
  833. TextBox icon = new()
  834. {
  835. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  836. Width = unitWidth,
  837. Height = unitHeight,
  838. Text = Convert.ToString(data.Progress),
  839. HorizontalAlignment = HorizontalAlignment.Left,
  840. VerticalAlignment = VerticalAlignment.Top,
  841. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  842. //Margin = new Thickness(25,25, 0, 0),
  843. Background = Brushes.Transparent,
  844. BorderBrush = Brushes.Transparent,
  845. IsReadOnly = true
  846. };
  847. UpperLayerOfMap.Children.Add(icon);
  848. }
  849. foreach(var data in listOfGate)
  850. {
  851. TextBox icon = new()
  852. {
  853. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  854. Width = unitWidth,
  855. Height = unitHeight,
  856. Text = Convert.ToString(data.Progress),
  857. HorizontalAlignment = HorizontalAlignment.Left,
  858. VerticalAlignment = VerticalAlignment.Top,
  859. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  860. //Margin = new Thickness(25,25, 0, 0),
  861. Background = Brushes.Transparent,
  862. BorderBrush = Brushes.Transparent,
  863. IsReadOnly = true
  864. };
  865. UpperLayerOfMap.Children.Add(icon);
  866. }
  867. foreach(var data in listOfDoor)
  868. {
  869. TextBox icon = new()
  870. {
  871. FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
  872. Width = unitWidth,
  873. Height = unitHeight,
  874. HorizontalAlignment = HorizontalAlignment.Left,
  875. VerticalAlignment = VerticalAlignment.Top,
  876. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  877. //Margin = new Thickness(25,25, 0, 0),
  878. Background = Brushes.Transparent,
  879. BorderBrush = Brushes.Transparent,
  880. IsReadOnly = true
  881. };
  882. if (data.IsOpen)
  883. {
  884. icon.Text = Convert.ToString("开");
  885. }
  886. else
  887. {
  888. icon.Text = Convert.ToString("闭");
  889. }
  890. UpperLayerOfMap.Children.Add(icon);
  891. }
  892. //}
  893. ZoomMap();
  894. }
  895. }
  896. catch (Exception exc)
  897. {
  898. ErrorDisplayer error = new("Error: " + exc.ToString());
  899. error.Show();
  900. isClientStocked = true;
  901. PorC.Content = "▶";
  902. }
  903. }
  904. counter++;
  905. }
  906. // 键盘控制,未完善
  907. private void KeyBoardControl(object sender, KeyEventArgs e)
  908. {
  909. if (!isPlaybackMode)
  910. {
  911. if(Keyboard.Modifiers == ModifierKeys.Control)
  912. {
  913. switch (e.Key)
  914. {
  915. case Key.D1:
  916. PropMsg msgP1 = new()
  917. {
  918. PlayerId = playerID,
  919. PropType = PropType.AddSpeed,
  920. };
  921. client.PickProp(msgP1);
  922. break;
  923. case Key.D2:
  924. PropMsg msgP2 = new()
  925. {
  926. PlayerId = playerID,
  927. PropType = PropType.AddLifeOrAp,
  928. };
  929. client.PickProp(msgP2);
  930. break;
  931. case Key.D3:
  932. PropMsg msgP3 = new()
  933. {
  934. PlayerId = playerID,
  935. PropType = PropType.AddHpOrAp,
  936. };
  937. client.PickProp(msgP3);
  938. break;
  939. case Key.D4:
  940. PropMsg msgP4 = new()
  941. {
  942. PlayerId = playerID,
  943. PropType = PropType.ShieldOrSpear,
  944. };
  945. client.PickProp(msgP4);
  946. break;
  947. case Key.D5:
  948. PropMsg msgP5 = new()
  949. {
  950. PlayerId = playerID,
  951. PropType = PropType.Key3,
  952. };
  953. client.PickProp(msgP5);
  954. break;
  955. case Key.D6:
  956. PropMsg msgP6 = new()
  957. {
  958. PlayerId = playerID,
  959. PropType = PropType.Key5,
  960. };
  961. client.PickProp(msgP6);
  962. break;
  963. case Key.D7:
  964. PropMsg msgP7 = new()
  965. {
  966. PlayerId = playerID,
  967. PropType = PropType.Key6,
  968. };
  969. client.PickProp(msgP7);
  970. break;
  971. default:
  972. break;
  973. }
  974. }
  975. else if (Keyboard.Modifiers == ModifierKeys.Alt)
  976. {
  977. switch (e.Key)
  978. {
  979. case Key.D1:
  980. PropMsg msgP1 = new()
  981. {
  982. PlayerId = playerID,
  983. PropType = PropType.AddSpeed,
  984. };
  985. client.UseProp(msgP1);
  986. break;
  987. case Key.D2:
  988. PropMsg msgP2 = new()
  989. {
  990. PlayerId = playerID,
  991. PropType = PropType.AddLifeOrAp,
  992. };
  993. client.UseProp(msgP2);
  994. break;
  995. case Key.D3:
  996. PropMsg msgP3 = new()
  997. {
  998. PlayerId = playerID,
  999. PropType = PropType.AddHpOrAp,
  1000. };
  1001. client.UseProp(msgP3);
  1002. break;
  1003. case Key.D4:
  1004. PropMsg msgP4 = new()
  1005. {
  1006. PlayerId = playerID,
  1007. PropType = PropType.ShieldOrSpear,
  1008. };
  1009. client.UseProp(msgP4);
  1010. break;
  1011. case Key.D5:
  1012. PropMsg msgP5 = new()
  1013. {
  1014. PlayerId = playerID,
  1015. PropType = PropType.Key3,
  1016. };
  1017. client.UseProp(msgP5);
  1018. break;
  1019. case Key.D6:
  1020. PropMsg msgP6 = new()
  1021. {
  1022. PlayerId = playerID,
  1023. PropType = PropType.Key5,
  1024. };
  1025. client.UseProp(msgP6);
  1026. break;
  1027. case Key.D7:
  1028. PropMsg msgP7 = new()
  1029. {
  1030. PlayerId = playerID,
  1031. PropType = PropType.Key6,
  1032. };
  1033. client.UseProp(msgP7);
  1034. break;
  1035. default:
  1036. break;
  1037. }
  1038. }
  1039. else if(Keyboard.Modifiers == ModifierKeys.Shift)
  1040. {
  1041. switch (e.Key)
  1042. {
  1043. case Key.D1:
  1044. PropMsg msgP1 = new()
  1045. {
  1046. PlayerId = playerID,
  1047. PropType = PropType.AddSpeed,
  1048. };
  1049. client.ThrowProp(msgP1);
  1050. break;
  1051. case Key.D2:
  1052. PropMsg msgP2 = new()
  1053. {
  1054. PlayerId = playerID,
  1055. PropType = PropType.AddLifeOrAp,
  1056. };
  1057. client.ThrowProp(msgP2);
  1058. break;
  1059. case Key.D3:
  1060. PropMsg msgP3 = new()
  1061. {
  1062. PlayerId = playerID,
  1063. PropType = PropType.AddHpOrAp,
  1064. };
  1065. client.ThrowProp(msgP3);
  1066. break;
  1067. case Key.D4:
  1068. PropMsg msgP4 = new()
  1069. {
  1070. PlayerId = playerID,
  1071. PropType = PropType.ShieldOrSpear,
  1072. };
  1073. client.ThrowProp(msgP4);
  1074. break;
  1075. case Key.D5:
  1076. PropMsg msgP5 = new()
  1077. {
  1078. PlayerId = playerID,
  1079. PropType = PropType.Key3,
  1080. };
  1081. client.ThrowProp(msgP5);
  1082. break;
  1083. case Key.D6:
  1084. PropMsg msgP6 = new()
  1085. {
  1086. PlayerId = playerID,
  1087. PropType = PropType.Key5,
  1088. };
  1089. client.ThrowProp(msgP6);
  1090. break;
  1091. case Key.D7:
  1092. PropMsg msgP7 = new()
  1093. {
  1094. PlayerId = playerID,
  1095. PropType = PropType.Key6,
  1096. };
  1097. client.ThrowProp(msgP7);
  1098. break;
  1099. default:
  1100. break;
  1101. }
  1102. }
  1103. else if (Keyboard.Modifiers == ModifierKeys.Windows)
  1104. {
  1105. switch (e.Key)
  1106. {
  1107. case Key.D0:
  1108. SkillMsg msgS0 = new()
  1109. {
  1110. PlayerId = playerID,
  1111. SkillId = 0,
  1112. };
  1113. client.UseSkill(msgS0);
  1114. break;
  1115. case Key.D1:
  1116. SkillMsg msgS1 = new()
  1117. {
  1118. PlayerId = playerID,
  1119. SkillId = 1,
  1120. };
  1121. client.UseSkill(msgS1);
  1122. break;
  1123. case Key.D2:
  1124. SkillMsg msgS2 = new()
  1125. {
  1126. PlayerId = playerID,
  1127. SkillId = 2,
  1128. };
  1129. client.UseSkill(msgS2);
  1130. break;
  1131. default:
  1132. break;
  1133. }
  1134. }
  1135. else
  1136. {
  1137. switch (e.Key)
  1138. {
  1139. case Key.W:
  1140. case Key.NumPad8:
  1141. MoveMsg msgW = new()
  1142. {
  1143. PlayerId = playerID,
  1144. TimeInMilliseconds = 50,
  1145. Angle = Math.PI
  1146. };
  1147. client.Move(msgW);
  1148. break;
  1149. case Key.S:
  1150. case Key.NumPad2:
  1151. MoveMsg msgS = new()
  1152. {
  1153. PlayerId = playerID,
  1154. TimeInMilliseconds = 50,
  1155. Angle = 0
  1156. };
  1157. client.Move(msgS);
  1158. break;
  1159. case Key.D:
  1160. case Key.NumPad6:
  1161. MoveMsg msgD = new()
  1162. {
  1163. PlayerId = playerID,
  1164. TimeInMilliseconds = 50,
  1165. Angle = Math.PI / 2
  1166. };
  1167. client.Move(msgD);
  1168. break;
  1169. case Key.A:
  1170. case Key.NumPad4:
  1171. MoveMsg msgA = new()
  1172. {
  1173. PlayerId = playerID,
  1174. TimeInMilliseconds = 50,
  1175. Angle = 3 * Math.PI / 2
  1176. };
  1177. client.Move(msgA);
  1178. break;
  1179. case Key.J:
  1180. AttackMsg msgJ = new()
  1181. {
  1182. PlayerId = playerID,
  1183. Angle = Math.PI
  1184. };
  1185. client.Attack(msgJ);
  1186. break;
  1187. case Key.K:
  1188. IDMsg msgK = new()
  1189. {
  1190. PlayerId = playerID,
  1191. };
  1192. client.StartLearning(msgK);
  1193. break;
  1194. case Key.R:
  1195. TreatAndRescueMsg msgR = new()
  1196. {
  1197. PlayerId = playerID,
  1198. };
  1199. client.StartRescueMate(msgR);
  1200. break;
  1201. case Key.T:
  1202. TreatAndRescueMsg msgT = new()
  1203. {
  1204. PlayerId = playerID,
  1205. };
  1206. client.StartTreatMate(msgT);
  1207. break;
  1208. case Key.G:
  1209. IDMsg msgG = new()
  1210. {
  1211. PlayerId = playerID,
  1212. };
  1213. client.Graduate(msgG);
  1214. break;
  1215. case Key.H:
  1216. IDMsg msgH = new()
  1217. {
  1218. PlayerId = playerID,
  1219. };
  1220. client.StartOpenGate(msgH);
  1221. break;
  1222. case Key.O:
  1223. IDMsg msgO = new()
  1224. {
  1225. PlayerId = playerID,
  1226. };
  1227. client.OpenDoor(msgO);
  1228. break;
  1229. case Key.P:
  1230. IDMsg msgP = new()
  1231. {
  1232. PlayerId = playerID,
  1233. };
  1234. client.CloseDoor(msgP);
  1235. break;
  1236. case Key.U:
  1237. IDMsg msgU = new()
  1238. {
  1239. PlayerId = playerID,
  1240. };
  1241. client.SkipWindow(msgU);
  1242. break;
  1243. case Key.I:
  1244. IDMsg msgI = new()
  1245. {
  1246. PlayerId = playerID,
  1247. };
  1248. client.StartOpenChest(msgI);
  1249. break;
  1250. case Key.E:
  1251. IDMsg msgE = new()
  1252. {
  1253. PlayerId = playerID,
  1254. };
  1255. client.EndAllAction(msgE);
  1256. break;
  1257. default:
  1258. break;
  1259. }
  1260. }
  1261. }
  1262. }
  1263. //鼠标双击
  1264. private void Attack(object sender, RoutedEventArgs e)
  1265. {
  1266. if (!isPlaybackMode)
  1267. {
  1268. if (humanOrButcher&&human != null)
  1269. {
  1270. AttackMsg msgJ = new()
  1271. {
  1272. PlayerId = playerID
  1273. };
  1274. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  1275. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  1276. msgJ.Angle = Math.Atan2(mouseY - human.Y, mouseX - human.X);
  1277. client.Attack(msgJ);
  1278. }
  1279. if (!humanOrButcher && butcher != null)
  1280. {
  1281. AttackMsg msgJ = new()
  1282. {
  1283. PlayerId = playerID
  1284. };
  1285. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  1286. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  1287. msgJ.Angle = Math.Atan2(mouseY - butcher.Y, mouseX - butcher.X);
  1288. client.Attack(msgJ);
  1289. }
  1290. }
  1291. }
  1292. // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
  1293. private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
  1294. {
  1295. if (!isClientStocked)
  1296. {
  1297. isClientStocked = true;
  1298. PorC.Content = "▶";
  1299. }
  1300. else
  1301. {
  1302. isClientStocked = false;
  1303. PorC.Content = "⏸";
  1304. }
  1305. }
  1306. // 未复现
  1307. private void ClickToConnect(object sender, RoutedEventArgs e)
  1308. {
  1309. }
  1310. // 窗口最大化、关闭、最小化、拖拽
  1311. private void ClickToMaxmize(object sender, RoutedEventArgs e)
  1312. {
  1313. if (WindowState != WindowState.Maximized)
  1314. WindowState = WindowState.Maximized;
  1315. else
  1316. WindowState = WindowState.Normal;
  1317. }
  1318. private void ClickToClose(object sender, RoutedEventArgs e)
  1319. {
  1320. Application.Current.Shutdown();
  1321. }
  1322. private void ClickToMinimize(object sender, RoutedEventArgs e)
  1323. {
  1324. WindowState = WindowState.Minimized;
  1325. }
  1326. private void DragWindow(object sender, RoutedEventArgs e)
  1327. {
  1328. DragMove();
  1329. }
  1330. // 寻求帮助、访问EESAST(部分功能未复原)
  1331. private void ClickForHelp(object sender, RoutedEventArgs e)
  1332. {
  1333. PleaseWait();
  1334. }
  1335. private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
  1336. {
  1337. try
  1338. {
  1339. _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
  1340. }
  1341. catch (Exception exc)
  1342. {
  1343. // ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
  1344. // error.Show();
  1345. }
  1346. }
  1347. // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
  1348. private void ClickToSetConnect(object sender, RoutedEventArgs e)
  1349. {
  1350. // ConnectRegister crg = new();
  1351. // crg.Show();
  1352. }
  1353. private void ClickToEnterVS(object sender, RoutedEventArgs e)
  1354. {
  1355. // try
  1356. //{
  1357. // if (!File.Exists("VSRoute.txt"))
  1358. // {
  1359. // File.Create("VSRoute.txt");
  1360. // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
  1361. // throw ex;
  1362. // }//创建路径文件
  1363. // using StreamReader sr = new("VSRoute.txt");
  1364. // _ = Process.Start(sr.ReadLine());
  1365. // }
  1366. // catch (Exception exc)
  1367. //{
  1368. // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
  1369. // error.Show();
  1370. // }
  1371. PleaseWait();
  1372. }
  1373. private void ClickForUpdate(object sender, RoutedEventArgs e)
  1374. {
  1375. PleaseWait();
  1376. }
  1377. private void ClickToCheckLadder(object sender, RoutedEventArgs e)
  1378. {
  1379. PleaseWait();
  1380. }
  1381. // 敬请期待函数
  1382. private void PleaseWait()
  1383. {
  1384. try
  1385. {
  1386. throw new Exception("敬请期待");
  1387. }
  1388. catch (Exception exc)
  1389. {
  1390. // ErrorDisplayer error = new(exc.Message);
  1391. // error.Show();
  1392. }
  1393. }
  1394. // 以下为Mainwindow自定义属性
  1395. private readonly DispatcherTimer timer; // 定时器
  1396. private long counter; // 预留的取时间变量
  1397. AvailableService.AvailableServiceClient client;
  1398. AsyncServerStreamingCall<MessageToClient>? responseStream;
  1399. private StatusBarOfSurvivor[] StatusBarsOfSurvivor;
  1400. private StatusBarOfHunter StatusBarsOfHunter;
  1401. private StatusBarOfCircumstance StatusBarsOfCircumstance;
  1402. private bool isClientStocked;
  1403. private bool isPlaybackMode;
  1404. private long playerID;
  1405. private PlayerType playerType;
  1406. private double unit;
  1407. private double unitHeight;
  1408. private double unitWidth;
  1409. private readonly Rectangle[,] mapPatches = new Rectangle[50, 50];
  1410. private List<MessageOfProp> listOfProp;
  1411. private List<MessageOfStudent> listOfHuman;
  1412. private List<MessageOfTricker> listOfButcher;
  1413. private List<MessageOfBullet> listOfBullet;
  1414. private List<MessageOfBombedBullet> listOfBombedBullet;
  1415. private List<MessageOfAll> listOfAll;
  1416. private List<MessageOfChest> listOfChest;
  1417. private List<MessageOfClassroom> listOfClassroom;
  1418. private List<MessageOfDoor> listOfDoor;
  1419. private List<MessageOfGate> listOfGate;
  1420. private object drawPicLock = new object();
  1421. private MessageOfStudent? human = null;
  1422. private MessageOfTricker? butcher = null;
  1423. private bool humanOrButcher;//true for human
  1424. private bool bonusflag;
  1425. private bool mapFlag = false;
  1426. private bool hasDrawed = false;
  1427. 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 },
  1428. { 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 },
  1429. { 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 },
  1430. { 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 },
  1431. { 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 },
  1432. { 6, 0, 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