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