|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using System.Diagnostics;
- using System.Windows.Threading;
- using Grpc.Core;
- using Protobuf;
- using Playback;
- using CommandLine;
-
- // 目前MainWindow还未复现的功能:
- // private void ReactToCommandline(),
- // private void ClickToSetMode(object sender, RoutedEventArgs e)
- // private void Bonus()
-
- namespace Client
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- unitHeight = unitWidth = unit = 13;
- bonusflag = true;
- timer = new DispatcherTimer
- {
- Interval = new TimeSpan(50000) // 每50ms刷新一次
- };
- timer.Tick += new EventHandler(Refresh); // 定时器初始化
- InitializeComponent();
- timer.Start();
- SetStatusBar();
- isClientStocked = true;
- isPlaybackMode = false;
- drawPicLock = new();
- listOfProp = new List<MessageOfProp>();
- listOfHuman = new List<MessageOfStudent>();
- listOfButcher = new List<MessageOfTricker>();
- listOfBullet=new List<MessageOfBullet>();
- listOfBombedBullet = new List<MessageOfBombedBullet>();
- listOfAll = new List<MessageOfAll>();
- listOfChest = new List<MessageOfChest>();
- listOfClassroom = new List<MessageOfClassroom>();
- listOfDoor = new List<MessageOfDoor>();
- listOfGate = new List<MessageOfGate>();
- WindowStartupLocation = WindowStartupLocation.CenterScreen;
- //comInfo[0] = "127.0.0.1";
- //comInfo[1] = "8888";
- //comInfo[2] = "0";
- //comInfo[3] = "1";
- //comInfo[4] = "1";
- //ConnectToServer(comInfo);
- //OnReceive();
- ReactToCommandline();
- }
-
-
- private void SetStatusBar()
- {
- StatusBarsOfSurvivor = new StatusBarOfSurvivor[4];
- StatusBarsOfHunter = new StatusBarOfHunter(MainGrid, 3, 0);
- StatusBarsOfCircumstance = new StatusBarOfCircumstance(MainGrid, 1, 0);
- for (int i = 4; i < 8; i++)
- {
- StatusBarsOfSurvivor[i - 4] = new(MainGrid, i / 2 + 2, i % 2);
- }
- }
-
- // 获得地图信息,未更新数值
- private void GetMap(MessageOfMap obj)
- {
- int[,] map = new int[50, 50];
- try
- {
- for (int i = 0; i < 50; i++)
- {
- for (int j = 0; j < 50; j++)
- {
- map[i, j] = Convert.ToInt32(obj.Row[i].Col[j]) + 4;//与proto一致
- }
- }
- }
- catch
- {
- mapFlag = false;
- }
- finally
- {
- defaultMap = map;
- mapFlag = true;
- }
- }
- private void ReactToCommandline()
- {
- string[] args = Environment.GetCommandLineArgs();
- if (args.Length == 2)
- {
- Playback(args[1]);
- return;
- }
- _ = Parser.Default.ParseArguments<ArgumentOptions>(args).WithParsed(o =>
- { options = o; });
- if (options == null || options.cl == false)
- {
- OnReceive();
- }
- else
- {
- //if (options.PlaybackFile == DefaultArgumentOptions.FileName)
- //{
- try
- {
- string[] comInfo = new string[5];
- comInfo[0] = options.Ip;
- comInfo[1] = options.Port;
- comInfo[2] = options.PlayerID;
- comInfo[3] = options.PlayerType;
- comInfo[4] = options.Occupation;
- ConnectToServer(comInfo);
- OnReceive();
- }
- catch
- {
- OnReceive();
- }
- //}
- //else
- //{
- // Playback(options.PlaybackFile, options.PlaybackSpeed);
- //}
- }
- }
- private void Playback(string fileName, double pbSpeed = 2.0)
- {
- var pbClient = new PlaybackClient(fileName, pbSpeed);
- int[,]? map;
- if ((map = pbClient.ReadDataFromFile(listOfProp, listOfHuman, listOfButcher, listOfBullet,listOfBombedBullet, listOfAll, listOfChest, listOfClassroom,listOfDoor, listOfGate, drawPicLock)) != null)
- {
- isClientStocked = false;
- isPlaybackMode = true;
- defaultMap = map;
- mapFlag = true;
- }
- else
- {
- MessageBox.Show("Failed to read the playback file!");
- isClientStocked = true;
- }
- }
-
- // 连接Server,comInfo[]的格式:0-ip 1- port 2-playerID 3-human/TrickerType 4-occupation
- private void ConnectToServer(string[] comInfo)
- {
- if (!isPlaybackMode)
- {
- if (comInfo.Length != 5)
- throw new Exception("注册信息有误!");
- playerID = Convert.ToInt64(comInfo[2]);
- Connect.Background = Brushes.Gray;
- string connect = new string(comInfo[0]);
- connect += ':';
- connect += comInfo[1];
- Channel channel = new Channel(connect, ChannelCredentials.Insecure);
- client = new AvailableService.AvailableServiceClient(channel);
- // 没判断连没连上
-
- PlayerMsg playerMsg = new PlayerMsg();
- playerMsg.PlayerId = playerID;
- playerType = Convert.ToInt64(comInfo[3]) switch
- {
- 0 => PlayerType.NullPlayerType,
- 1 => PlayerType.StudentPlayer,
- 2 => PlayerType.TrickerPlayer,
- };
- playerMsg.PlayerType=playerType;
- if (Convert.ToInt64(comInfo[3]) == 1)
- {
- humanOrButcher = true;
- }
- else if (Convert.ToInt64(comInfo[3]) == 2)
- {
- humanOrButcher = false;
- }
- if (playerType == PlayerType.StudentPlayer)
- {
- switch (Convert.ToInt64(comInfo[4]))
- {
- case 0:
- playerMsg.StudentType = StudentType.NullStudentType;
- break;
- case 1:
- playerMsg.StudentType = StudentType.Athlete;
- break;
- case 2:
- playerMsg.StudentType = StudentType._2;
- break;
- case 3:
- playerMsg.StudentType = StudentType._3;
- break;
- case 4:
- playerMsg.StudentType = StudentType._4;
- break;
- default:
- break;
- }
- }
- else if (playerType == PlayerType.TrickerPlayer)
- {
- switch (Convert.ToInt64(comInfo[4]))
- {
- case 0:
- playerMsg.TrickerType = TrickerType.NullTrickerType;
- break;
- case 1:
- playerMsg.TrickerType = TrickerType.Assassin;
- break;
- case 2:
- playerMsg.TrickerType = TrickerType._2;
- break;
- case 3:
- playerMsg.TrickerType = TrickerType._3;
- break;
- case 4:
- playerMsg.TrickerType = TrickerType._4;
- break;
- default:
- break;
- }
- }
- responseStream = client.AddPlayer(playerMsg);
- Connect.Background = Brushes.Transparent;
- isClientStocked = false;
- PorC.Content = "⏸";
- // 建立连接的同时加入人物
- }
- }
-
- // 绘制道具
- private void DrawProp(MessageOfProp data, string text)
- {
- TextBox icon = new()
- {
- FontSize = 10,
- Width = 20,
- Height = 20,
- Text = text,
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
- Background = Brushes.Transparent,
- BorderBrush = Brushes.Transparent,
- IsReadOnly = true
- };
- UpperLayerOfMap.Children.Add(icon);
- }
-
- private void ZoomMap()
- {
- for (int i = 0; i < 50; i++)
- {
- for (int j = 0; j < 50; j++)
- {
- if (mapPatches[i, j] != null)
- {
- mapPatches[i, j].Width = UpperLayerOfMap.ActualWidth / 50;
- mapPatches[i, j].Height = UpperLayerOfMap.ActualHeight / 50;
- mapPatches[i, j].HorizontalAlignment = HorizontalAlignment.Left;
- mapPatches[i, j].VerticalAlignment = VerticalAlignment.Top;
- mapPatches[i, j].Margin = new Thickness(UpperLayerOfMap.ActualWidth / 50 * j, UpperLayerOfMap.ActualHeight / 50 * i, 0, 0);
- }
- }
- }
- }
- private void DrawMap()
- {
- for (int i = 0; i < defaultMap.GetLength(0); i++)
- {
- for (int j = 0; j < defaultMap.GetLength(1); j++)
- {
- mapPatches[i, j] = new()
- {
- Width = unitWidth,
- Height = unitHeight,
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(Width * (j), Height * (i), 0, 0)
- };
- // mapPatches[i, j].SetValue(Canvas.LeftProperty, (double)(Width / 65.5 * j));
- // mapPatches[i, j].SetValue(Canvas.TopProperty, (double)(Height / 56.5 * i)); // 用zoommap进行修改
- switch (defaultMap[i, j])
- {
- case 6:
- mapPatches[i, j].Fill = Brushes.Brown;
- mapPatches[i, j].Stroke = Brushes.Brown;
- break;//wall
- case 7:
- mapPatches[i, j].Fill = Brushes.Green;
- mapPatches[i, j].Stroke = Brushes.Green;
- break;//grass
- case 8:
- mapPatches[i, j].Fill = Brushes.LightPink;
- mapPatches[i, j].Stroke = Brushes.LightPink;
- break;//machine
- case 9:
- mapPatches[i, j].Fill = Brushes.LightSkyBlue;
- mapPatches[i, j].Stroke = Brushes.LightSkyBlue;
- break;//gate
- case 10:
- foreach (var obj in listOfAll)
- {
- if(obj.HiddenGateRefreshed)
- {
- mapPatches[i, j].Fill = Brushes.LightSalmon;
- mapPatches[i, j].Stroke = Brushes.LightSalmon;
- }
- }
- break;//emergency
- case 11:
- mapPatches[i, j].Fill = Brushes.Gray;
- mapPatches[i, j].Stroke = Brushes.Gray;
- break;//window
- case 12:
- case 13:
- case 14:
- mapPatches[i, j].Fill = Brushes.Khaki;
- mapPatches[i, j].Stroke = Brushes.Khaki;
- break;//door
- case 15:
- mapPatches[i, j].Fill = Brushes.Orange;
- mapPatches[i, j].Stroke = Brushes.Orange;
- break;//chest
- default:
- break;
- }
- UnderLayerOfMap.Children.Add(mapPatches[i, j]);
- }
- }
- hasDrawed = true;
- }
-
- //三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
- private void DrawLaser(Point source, double theta, double range, double Width) // 三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
- {
- Point[] endPoint = new Point[4];
- Point target = new();
- target.X = source.X + range * Math.Cos(theta);
- target.Y = source.Y + range * Math.Sin(theta);
- endPoint[0].X = source.X + Width * Math.Cos(theta - Math.PI / 2);
- endPoint[0].Y = source.Y + Width * Math.Sin(theta - Math.PI / 2);
- endPoint[1].X = target.X + Width * Math.Cos(theta - Math.PI / 2);
- endPoint[1].Y = target.Y + Width * Math.Sin(theta - Math.PI / 2);
- endPoint[2].X = target.X + Width * Math.Cos(theta + Math.PI / 2);
- endPoint[2].Y = target.Y + Width * Math.Sin(theta + Math.PI / 2);
- endPoint[3].X = source.X + Width * Math.Cos(theta + Math.PI / 2);
- endPoint[3].Y = source.Y + Width * Math.Sin(theta + Math.PI / 2);
- Polygon laserIcon = new();
- laserIcon.Stroke = System.Windows.Media.Brushes.Red;
- laserIcon.Fill = System.Windows.Media.Brushes.Red;
- laserIcon.StrokeThickness = 2;
- laserIcon.HorizontalAlignment = HorizontalAlignment.Left;
- laserIcon.VerticalAlignment = VerticalAlignment.Top;
- PointCollection laserEndPoints = new();
- for (int i = 0; i < 4; i++)
- {
- laserEndPoints.Add(endPoint[i]);
- }
- laserIcon.Points = laserEndPoints;
- UpperLayerOfMap.Children.Add(laserIcon);
- }
-
- private async void OnReceive() // 已按照3.5版proto更新信息,但是左侧信息栏还未填充。log未更新,switch1,2,3更新log
- {
- try
- {
- while (responseStream != null && await responseStream.ResponseStream.MoveNext())
- {
- lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行,否则画图时foreach会有bug
- {
- listOfHuman.Clear();
- listOfButcher.Clear();
- listOfProp.Clear();
- listOfBombedBullet.Clear();
- listOfBullet.Clear();
- listOfAll.Clear();
- listOfChest.Clear();
- listOfClassroom.Clear();
- listOfDoor.Clear();
- listOfGate.Clear();
- MessageToClient content = responseStream.ResponseStream.Current;
- switch (content.GameState)
- {
- case GameState.GameStart:
- foreach (var obj in content.ObjMessage)
- {
- switch (obj.MessageOfObjCase)
- {
- case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
- if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
- {
- human = obj.StudentMessage;
- }
- listOfHuman.Add(obj.StudentMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
- if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
- {
- butcher = obj.TrickerMessage;
- }
- listOfButcher.Add(obj.TrickerMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.PropMessage:
- listOfProp.Add(obj.PropMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
- listOfBombedBullet.Add(obj.BombedBulletMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
- listOfBullet.Add(obj.BulletMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
- listOfChest.Add(obj.ChestMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
- listOfClassroom.Add(obj.ClassroomMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
- listOfDoor.Add(obj.DoorMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.GateMessage:
- listOfGate.Add(obj.GateMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.MapMessage:
- GetMap(obj.MapMessage);
- break;
- }
- }
- listOfAll.Add(content.AllMessage);
- break;
- case GameState.GameRunning:
- foreach (var obj in content.ObjMessage)
- {
- switch (obj.MessageOfObjCase)
- {
- case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
- if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
- {
- human = obj.StudentMessage;
- }
- listOfHuman.Add(obj.StudentMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
- if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
- {
- butcher = obj.TrickerMessage;
- }
- listOfButcher.Add(obj.TrickerMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.PropMessage:
- listOfProp.Add(obj.PropMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
- listOfBombedBullet.Add(obj.BombedBulletMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
- listOfBullet.Add(obj.BulletMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
- listOfChest.Add(obj.ChestMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
- listOfClassroom.Add(obj.ClassroomMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
- listOfDoor.Add(obj.DoorMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.GateMessage:
- listOfGate.Add(obj.GateMessage);
- break;
- }
- }
- listOfAll.Add(content.AllMessage);
- break;
-
- case GameState.GameEnd:
- foreach (var obj in content.ObjMessage)
- {
- switch (obj.MessageOfObjCase)
- {
- case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
- listOfHuman.Add(obj.StudentMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
- listOfButcher.Add(obj.TrickerMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.PropMessage:
- listOfProp.Add(obj.PropMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
- listOfBombedBullet.Add(obj.BombedBulletMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
- listOfBullet.Add(obj.BulletMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
- listOfChest.Add(obj.ChestMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
- listOfClassroom.Add(obj.ClassroomMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
- listOfDoor.Add(obj.DoorMessage);
- break;
- case MessageOfObj.MessageOfObjOneofCase.GateMessage:
- listOfGate.Add(obj.GateMessage);
- break;
- }
- }
- listOfAll.Add(content.AllMessage);
- break;
- }
- }
- if (responseStream == null)
- {
- throw new Exception("Unconnected");
- }
- }
- }
- catch (Exception ex)
- {
- ErrorDisplayer error = new("Error: " + ex.ToString());
- error.Show();
- }
- }
-
- private int GetX(int x)
- {
- return x / 1000 + 1;
- }
- private int GetY(int y)
- {
- return y / 1000 + 1;
- }
- //待修改
- private bool CanSee(MessageOfStudent msg)
- {
- if (msg.PlayerState == PlayerState.Quit)
- return false;
- //if (playerID >= 2022 || teamID >= 2022)
- // return true;
- if (humanOrButcher && human != null)
- {
- if (human.Guid == msg.Guid) // 自己能看见自己
- return true;
- }
- if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
- return false;
- if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
- return true;
- if (humanOrButcher && human != null)
- {
- if (msg.Place != human.Place)
- return false;
- }
- else if (!humanOrButcher && butcher != null)
- {
- if (msg.Place != butcher.Place)
- return false;
- }
- return true;
- }
-
- private bool CanSee(MessageOfTricker msg)
- {
- // if (playerID >= 2022 || teamID >= 2022)
- // return true;
- if (!humanOrButcher && butcher != null)
- {
- if (butcher.Guid == msg.Guid) // 自己能看见自己
- return true;
- }
- if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
- return false;
- if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
- return true;
- if (humanOrButcher && human != null)
- {
- if (msg.Place != human.Place)
- return false;
- }
- else if (!humanOrButcher && butcher != null)
- {
- if (msg.Place != butcher.Place)
- return false;
- }
- return true;
- }
-
- private bool CanSee(MessageOfProp msg)
- {
- if (msg.Place == PlaceType.Land)
- return true;
- if (humanOrButcher && human != null)
- {
- if (msg.Place != human.Place)
- return false;
- }
- else if (!humanOrButcher && butcher != null)
- {
- if (msg.Place != butcher.Place)
- return false;
- }
- return true;
- }
-
- private bool CanSee(MessageOfBullet msg)
- {
- if (msg.Place == PlaceType.Land)
- return true;
- if (humanOrButcher && human != null)
- {
- if (msg.Place != human.Place)
- return false;
- }
- else if (!humanOrButcher && butcher != null)
- {
- if (msg.Place != butcher.Place)
- return false;
- }
- return true;
- }
-
- private void Refresh(object? sender, EventArgs e) // 已按照3.5版proto更新信息,circumstance栏未更新 log未更新
- {
- // Bonus();
- if (WindowState == WindowState.Maximized)
- MaxButton.Content = "❐";
- else
- MaxButton.Content = "🗖";
- if (StatusBarsOfSurvivor != null)
- for (int i = 4; i < 8; i++)
- {
- StatusBarsOfSurvivor[i - 4].SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
- }
- if (StatusBarsOfHunter != null)
- StatusBarsOfHunter.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
- if (StatusBarsOfCircumstance != null)
- StatusBarsOfCircumstance.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
- // 完成窗口信息更新
-
- if (!isClientStocked)
- {
- unit = Math.Sqrt(UpperLayerOfMap.ActualHeight * UpperLayerOfMap.ActualWidth) / 50;
- unitHeight = UpperLayerOfMap.ActualHeight / 50;
- unitWidth = UpperLayerOfMap.ActualWidth / 50;
- try
- {
- // if (log != null)
- //{
- // string temp = "";
- // for (int i = 0; i < dataDict[GameObjType.Character].Count; i++)
- // {
- // temp += Convert.ToString(dataDict[GameObjType.Character][i].MessageOfCharacter.TeamID) + "\n";
- // }
- // log.Content = temp;
- // }
- UpperLayerOfMap.Children.Clear();
- // if ((communicator == null || !communicator.Client.IsConnected) && !isPlaybackMode)
- //{
- // UnderLayerOfMap.Children.Clear();
- // throw new Exception("Client is unconnected.");
- // }
- // else
- //{
- lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行
- {
- foreach (var data in listOfAll)
- {
- StatusBarsOfCircumstance.SetValue(data);
- }
- if (!hasDrawed && mapFlag)
- DrawMap();
- foreach (var data in listOfHuman)
- {
- StatusBarsOfSurvivor[data.PlayerId].SetValue(data);
- if (CanSee(data))
- {
- Ellipse icon = new()
- {
- Width = unitWidth,
- Height = unitHeight,
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
- Fill = Brushes.BlueViolet,
- };
- UpperLayerOfMap.Children.Add(icon);
- }
- }
- foreach (var data in listOfButcher)
- {
- StatusBarsOfHunter.SetValue(data);
- if (CanSee(data))
- {
- Ellipse icon = new()
- {
- Width = unitWidth,
- Height = unitHeight,
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
- Fill = Brushes.Chocolate,
- };
- UpperLayerOfMap.Children.Add(icon);
- }
- }
- foreach (var data in listOfProp)
- {
- if (CanSee(data))
- {
- switch (data.Type)
- {
- case PropType.Key3:
- DrawProp(data, "🔑");
- break;
- case PropType.Key5:
- DrawProp(data, "🔑");
- break;
- case PropType.Key6:
- DrawProp(data, "🔑");
- break;
- case PropType.AddSpeed:
- DrawProp(data, "⛸");
- break;
- case PropType.AddHpOrAp:
- DrawProp(data, "♥");
- break;
- case PropType.AddLifeOrAp:
- DrawProp(data, "🏅");
- break;
- case PropType.ShieldOrSpear:
- DrawProp(data, "🛡");
- break;
- default:
- DrawProp(data, "");
- break;
- }
- }
- }
- foreach (var data in listOfBullet)
- {
- if (CanSee(data))
- {
- Ellipse icon = new()
- {
- Width = 10,
- Height = 10,
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
- Fill = Brushes.Red
- };
- UpperLayerOfMap.Children.Add(icon);
- }
- }
- foreach (var data in listOfBombedBullet)
- {
- switch (data.Type)
- {
- case BulletType.FastBullet:
- {
- Ellipse icon = new();
- double bombRange = data.BombRange / 1000;
- icon.Width = bombRange * unitWidth;
- icon.Height = bombRange * unitHeight;
- icon.HorizontalAlignment = HorizontalAlignment.Left;
- icon.VerticalAlignment = VerticalAlignment.Top;
- icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
- icon.Fill = Brushes.Red;
- UpperLayerOfMap.Children.Add(icon);
- break;
- }
- case BulletType.AtomBomb:
- {
- Ellipse icon = new Ellipse();
- double bombRange = data.BombRange / 1000;
- icon.Width = bombRange * unitWidth;
- icon.Height = bombRange * unitHeight;
- icon.HorizontalAlignment = HorizontalAlignment.Left;
- icon.VerticalAlignment = VerticalAlignment.Top;
- icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
- icon.Fill = Brushes.Red;
- UpperLayerOfMap.Children.Add(icon);
- break;
- }
- case BulletType.OrdinaryBullet:
- {
- Ellipse icon = new Ellipse();
- double bombRange = data.BombRange / 1000;
- icon.Width = bombRange * unitWidth;
- icon.Height = bombRange * unitHeight;
- icon.HorizontalAlignment = HorizontalAlignment.Left;
- icon.VerticalAlignment = VerticalAlignment.Top;
- icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
- icon.Fill = Brushes.Red;
- UpperLayerOfMap.Children.Add(icon);
- break;
- }
- /*case BulletType.LineBullet:
- {
- double bombRange = data.BombRange / 1000;
- DrawLaser(new Point(data.Y * unitWidth / 1000.0, data.X * unitHeight / 1000.0), -data.FacingDirection + Math.PI / 2, bombRange * unitHeight, 0.5 * unitWidth);
- break;
- }*/
- default:
- break;
- }
- }
- foreach (var data in listOfClassroom)
- {
- TextBox icon = new()
- {
- FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
- Width = unitWidth,
- Height = unitHeight,
- Text = Convert.ToString(data.Progress),
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
- //Margin = new Thickness(25,25, 0, 0),
- Background = Brushes.Transparent,
- BorderBrush = Brushes.Transparent,
- IsReadOnly = true
- };
- UpperLayerOfMap.Children.Add(icon);
- }
- foreach(var data in listOfChest)
- {
- TextBox icon = new()
- {
- FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
- Width = unitWidth,
- Height = unitHeight,
- Text = Convert.ToString(data.Progress),
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
- //Margin = new Thickness(25,25, 0, 0),
- Background = Brushes.Transparent,
- BorderBrush = Brushes.Transparent,
- IsReadOnly = true
- };
- UpperLayerOfMap.Children.Add(icon);
- }
- foreach(var data in listOfGate)
- {
- TextBox icon = new()
- {
- FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
- Width = unitWidth,
- Height = unitHeight,
- Text = Convert.ToString(data.Progress),
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
- //Margin = new Thickness(25,25, 0, 0),
- Background = Brushes.Transparent,
- BorderBrush = Brushes.Transparent,
- IsReadOnly = true
- };
- UpperLayerOfMap.Children.Add(icon);
- }
- foreach(var data in listOfDoor)
- {
- TextBox icon = new()
- {
- FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
- Width = unitWidth,
- Height = unitHeight,
- HorizontalAlignment = HorizontalAlignment.Left,
- VerticalAlignment = VerticalAlignment.Top,
- Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
- //Margin = new Thickness(25,25, 0, 0),
- Background = Brushes.Transparent,
- BorderBrush = Brushes.Transparent,
- IsReadOnly = true
- };
- if (data.IsOpen)
- {
- icon.Text = Convert.ToString("开");
- }
- else
- {
- icon.Text = Convert.ToString("闭");
- }
- UpperLayerOfMap.Children.Add(icon);
- }
- //}
- ZoomMap();
- }
- }
- catch (Exception exc)
- {
- ErrorDisplayer error = new("Error: " + exc.ToString());
- error.Show();
- isClientStocked = true;
- PorC.Content = "▶";
- }
- }
- counter++;
- }
-
- // 键盘控制,未完善
- private void KeyBoardControl(object sender, KeyEventArgs e)
- {
- if (!isPlaybackMode)
- {
- if(Keyboard.Modifiers == ModifierKeys.Control)
- {
- switch (e.Key)
- {
- case Key.D1:
- PropMsg msgP1 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddSpeed,
- };
- client.PickProp(msgP1);
- break;
- case Key.D2:
- PropMsg msgP2 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddLifeOrAp,
- };
- client.PickProp(msgP2);
- break;
- case Key.D3:
- PropMsg msgP3 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddHpOrAp,
- };
- client.PickProp(msgP3);
- break;
- case Key.D4:
- PropMsg msgP4 = new()
- {
- PlayerId = playerID,
- PropType = PropType.ShieldOrSpear,
- };
- client.PickProp(msgP4);
- break;
- case Key.D5:
- PropMsg msgP5 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key3,
- };
- client.PickProp(msgP5);
- break;
- case Key.D6:
- PropMsg msgP6 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key5,
- };
- client.PickProp(msgP6);
- break;
- case Key.D7:
- PropMsg msgP7 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key6,
- };
- client.PickProp(msgP7);
- break;
- default:
- break;
- }
- }
- else if (Keyboard.Modifiers == ModifierKeys.Alt)
- {
- switch (e.Key)
- {
- case Key.D1:
- PropMsg msgP1 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddSpeed,
- };
- client.UseProp(msgP1);
- break;
- case Key.D2:
- PropMsg msgP2 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddLifeOrAp,
- };
- client.UseProp(msgP2);
- break;
- case Key.D3:
- PropMsg msgP3 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddHpOrAp,
- };
- client.UseProp(msgP3);
- break;
- case Key.D4:
- PropMsg msgP4 = new()
- {
- PlayerId = playerID,
- PropType = PropType.ShieldOrSpear,
- };
- client.UseProp(msgP4);
- break;
- case Key.D5:
- PropMsg msgP5 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key3,
- };
- client.UseProp(msgP5);
- break;
- case Key.D6:
- PropMsg msgP6 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key5,
- };
- client.UseProp(msgP6);
- break;
- case Key.D7:
- PropMsg msgP7 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key6,
- };
- client.UseProp(msgP7);
- break;
- default:
- break;
- }
- }
- else if(Keyboard.Modifiers == ModifierKeys.Shift)
- {
- switch (e.Key)
- {
- case Key.D1:
- PropMsg msgP1 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddSpeed,
- };
- client.ThrowProp(msgP1);
- break;
- case Key.D2:
- PropMsg msgP2 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddLifeOrAp,
- };
- client.ThrowProp(msgP2);
- break;
- case Key.D3:
- PropMsg msgP3 = new()
- {
- PlayerId = playerID,
- PropType = PropType.AddHpOrAp,
- };
- client.ThrowProp(msgP3);
- break;
- case Key.D4:
- PropMsg msgP4 = new()
- {
- PlayerId = playerID,
- PropType = PropType.ShieldOrSpear,
- };
- client.ThrowProp(msgP4);
- break;
- case Key.D5:
- PropMsg msgP5 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key3,
- };
- client.ThrowProp(msgP5);
- break;
- case Key.D6:
- PropMsg msgP6 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key5,
- };
- client.ThrowProp(msgP6);
- break;
- case Key.D7:
- PropMsg msgP7 = new()
- {
- PlayerId = playerID,
- PropType = PropType.Key6,
- };
- client.ThrowProp(msgP7);
- break;
- default:
- break;
- }
- }
- else if (Keyboard.Modifiers == ModifierKeys.Windows)
- {
- switch (e.Key)
- {
- case Key.D0:
- SkillMsg msgS0 = new()
- {
- PlayerId = playerID,
- SkillId = 0,
- };
- client.UseSkill(msgS0);
- break;
- case Key.D1:
- SkillMsg msgS1 = new()
- {
- PlayerId = playerID,
- SkillId = 1,
- };
- client.UseSkill(msgS1);
- break;
- case Key.D2:
- SkillMsg msgS2 = new()
- {
- PlayerId = playerID,
- SkillId = 2,
- };
- client.UseSkill(msgS2);
- break;
- default:
- break;
- }
- }
- else
- {
- switch (e.Key)
- {
- case Key.W:
- case Key.NumPad8:
- MoveMsg msgW = new()
- {
- PlayerId = playerID,
- TimeInMilliseconds = 50,
- Angle = Math.PI
- };
- client.Move(msgW);
- break;
- case Key.S:
- case Key.NumPad2:
- MoveMsg msgS = new()
- {
- PlayerId = playerID,
- TimeInMilliseconds = 50,
- Angle = 0
- };
- client.Move(msgS);
- break;
- case Key.D:
- case Key.NumPad6:
- MoveMsg msgD = new()
- {
- PlayerId = playerID,
- TimeInMilliseconds = 50,
- Angle = Math.PI / 2
- };
- client.Move(msgD);
- break;
- case Key.A:
- case Key.NumPad4:
- MoveMsg msgA = new()
- {
- PlayerId = playerID,
- TimeInMilliseconds = 50,
- Angle = 3 * Math.PI / 2
- };
- client.Move(msgA);
- break;
- case Key.J:
- AttackMsg msgJ = new()
- {
- PlayerId = playerID,
- Angle = Math.PI
- };
- client.Attack(msgJ);
- break;
- case Key.K:
- IDMsg msgK = new()
- {
- PlayerId = playerID,
- };
- client.StartLearning(msgK);
- break;
- case Key.R:
- TreatAndRescueMsg msgR = new()
- {
- PlayerId = playerID,
- };
- client.StartRescueMate(msgR);
- break;
- case Key.T:
- TreatAndRescueMsg msgT = new()
- {
- PlayerId = playerID,
- };
- client.StartTreatMate(msgT);
- break;
- case Key.G:
- IDMsg msgG = new()
- {
- PlayerId = playerID,
- };
- client.Graduate(msgG);
- break;
- case Key.H:
- IDMsg msgH = new()
- {
- PlayerId = playerID,
- };
- client.StartOpenGate(msgH);
- break;
- case Key.O:
- IDMsg msgO = new()
- {
- PlayerId = playerID,
- };
- client.OpenDoor(msgO);
- break;
- case Key.P:
- IDMsg msgP = new()
- {
- PlayerId = playerID,
- };
- client.CloseDoor(msgP);
- break;
- case Key.U:
- IDMsg msgU = new()
- {
- PlayerId = playerID,
- };
- client.SkipWindow(msgU);
- break;
- case Key.I:
- IDMsg msgI = new()
- {
- PlayerId = playerID,
- };
- client.StartOpenChest(msgI);
- break;
- case Key.E:
- IDMsg msgE = new()
- {
- PlayerId = playerID,
- };
- client.EndAllAction(msgE);
- break;
- default:
- break;
- }
- }
- }
- }
-
- //鼠标双击
- private void Attack(object sender, RoutedEventArgs e)
- {
- if (!isPlaybackMode)
- {
- if (humanOrButcher&&human != null)
- {
- AttackMsg msgJ = new()
- {
- PlayerId = playerID
- };
- double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
- double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
- msgJ.Angle = Math.Atan2(mouseY - human.Y, mouseX - human.X);
- client.Attack(msgJ);
- }
- if (!humanOrButcher && butcher != null)
- {
- AttackMsg msgJ = new()
- {
- PlayerId = playerID
- };
- double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
- double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
- msgJ.Angle = Math.Atan2(mouseY - butcher.Y, mouseX - butcher.X);
- client.Attack(msgJ);
- }
- }
- }
-
- // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
- private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
- {
- if (!isClientStocked)
- {
- isClientStocked = true;
- PorC.Content = "▶";
- }
- else
- {
- isClientStocked = false;
- PorC.Content = "⏸";
- }
- }
- // 未复现
- private void ClickToConnect(object sender, RoutedEventArgs e)
- {
- }
-
- // 窗口最大化、关闭、最小化、拖拽
- private void ClickToMaxmize(object sender, RoutedEventArgs e)
- {
- if (WindowState != WindowState.Maximized)
- WindowState = WindowState.Maximized;
- else
- WindowState = WindowState.Normal;
- }
- private void ClickToClose(object sender, RoutedEventArgs e)
- {
- Application.Current.Shutdown();
- }
- private void ClickToMinimize(object sender, RoutedEventArgs e)
- {
- WindowState = WindowState.Minimized;
- }
- private void DragWindow(object sender, RoutedEventArgs e)
- {
- DragMove();
- }
-
- // 寻求帮助、访问EESAST(部分功能未复原)
- private void ClickForHelp(object sender, RoutedEventArgs e)
- {
- PleaseWait();
- }
- private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
- {
- try
- {
- _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
- }
- catch (Exception exc)
- {
- // ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
- // error.Show();
- }
- }
-
- // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
- private void ClickToSetConnect(object sender, RoutedEventArgs e)
- {
- // ConnectRegister crg = new();
- // crg.Show();
- }
- private void ClickToEnterVS(object sender, RoutedEventArgs e)
- {
- // try
- //{
- // if (!File.Exists("VSRoute.txt"))
- // {
- // File.Create("VSRoute.txt");
- // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
- // throw ex;
- // }//创建路径文件
- // using StreamReader sr = new("VSRoute.txt");
- // _ = Process.Start(sr.ReadLine());
- // }
- // catch (Exception exc)
- //{
- // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
- // error.Show();
- // }
- PleaseWait();
- }
- private void ClickForUpdate(object sender, RoutedEventArgs e)
- {
- PleaseWait();
- }
- private void ClickToCheckLadder(object sender, RoutedEventArgs e)
- {
- PleaseWait();
- }
-
- // 敬请期待函数
- private void PleaseWait()
- {
- try
- {
- throw new Exception("敬请期待");
- }
- catch (Exception exc)
- {
- // ErrorDisplayer error = new(exc.Message);
- // error.Show();
- }
- }
-
- // 以下为Mainwindow自定义属性
- private readonly DispatcherTimer timer; // 定时器
- private long counter; // 预留的取时间变量
- AvailableService.AvailableServiceClient client;
- AsyncServerStreamingCall<MessageToClient>? responseStream;
- private StatusBarOfSurvivor[] StatusBarsOfSurvivor;
- private StatusBarOfHunter StatusBarsOfHunter;
- private StatusBarOfCircumstance StatusBarsOfCircumstance;
-
- private bool isClientStocked;
- private bool isPlaybackMode;
-
- private long playerID;
- private PlayerType playerType;
-
- private double unit;
- private double unitHeight;
- private double unitWidth;
- private readonly Rectangle[,] mapPatches = new Rectangle[50, 50];
-
- private List<MessageOfProp> listOfProp;
- private List<MessageOfStudent> listOfHuman;
- private List<MessageOfTricker> listOfButcher;
- private List<MessageOfBullet> listOfBullet;
- private List<MessageOfBombedBullet> listOfBombedBullet;
- private List<MessageOfAll> listOfAll;
- private List<MessageOfChest> listOfChest;
- private List<MessageOfClassroom> listOfClassroom;
- private List<MessageOfDoor> listOfDoor;
- private List<MessageOfGate> listOfGate;
- private object drawPicLock = new object();
- private MessageOfStudent? human = null;
- private MessageOfTricker? butcher = null;
- private bool humanOrButcher;//true for human
-
- private bool bonusflag;
- private bool mapFlag = false;
- private bool hasDrawed = false;
- 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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