· 4 years ago · Aug 11, 2021, 07:48 PM
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Newtonsoft.Json;
6using Newtonsoft.Json.Converters;
7using Oxide.Core;
8using Oxide.Core.Libraries;
9using Oxide.Core.Libraries.Covalence;
10using Oxide.Core.Plugins;
11using UnityEngine;
12using Oxide.Game.Rust.Cui;
13using System.Globalization;
14#if RUST
15using UnityEngine.Networking;
16using System.Collections;
17using Random = System.Random;
18using Facepunch;
19#endif
20
21namespace Oxide.Plugins
22{
23 [Info("WipeVoter", "Kaysharp", "0.0.1")]
24 class WipeVoter : CovalencePlugin
25 {
26 private readonly Random _random = new Random();
27 private string permissionUse = "WipeVoter.use";
28 public static ConfigData config { get; set; }
29 private List<uint> Generating = new List<uint>();
30 private List<RustMaps> Maps = new List<RustMaps>();
31 public string nbMaps = String.Empty;
32 public string size = String.Empty;
33 #region Config
34 public class ConfigData
35 {
36 [JsonProperty(PropertyName = "Commands")]
37 public CommandsOptions Commands = new CommandsOptions();
38 [JsonProperty(PropertyName = "Options")]
39 public Options Settings = new Options();
40 [JsonProperty(PropertyName = "UI Options")]
41 public MenuOptions Menu { get; set; }
42 public class CommandsOptions
43 {
44 [JsonProperty(PropertyName = "Generate Mpas")]
45 public string Generate = "generate";
46 }
47
48 public class Options
49 {
50 [JsonProperty(PropertyName = "RustMaps API key")]
51 public string APIKey = "https://rustmaps.com/user/profile";
52
53 [JsonProperty(PropertyName = "Map size")]
54 public int size = 3500;
55
56 [JsonProperty(PropertyName = "staging")]
57 public bool staging = false;
58 [JsonProperty(PropertyName = "barren")]
59 public bool barren = false;
60
61 }
62 public class MenuOptions
63 {
64 [JsonProperty(PropertyName = "Panel Color")]
65 public UIColor Panel { get; set; }
66
67 [JsonProperty(PropertyName = "Disabled Color")]
68 public UIColor Disabled { get; set; }
69
70 [JsonProperty(PropertyName = "Color 1")]
71 public UIColor Color1 { get; set; }
72
73 [JsonProperty(PropertyName = "Color 2")]
74 public UIColor Color2 { get; set; }
75
76 [JsonProperty(PropertyName = "Color 3")]
77 public UIColor Color3 { get; set; }
78
79 [JsonProperty(PropertyName = "Color 4")]
80 public UIColor Color4 { get; set; }
81
82 [JsonProperty(PropertyName = "Default kit image URL")]
83 public string DefaultKitURL { get; set; }
84
85 [JsonProperty(PropertyName = "View kit icon URL")]
86 public string MagnifyIconURL { get; set; }
87 }
88
89 public class UIColor
90 {
91 public string Hex { get; set; }
92 public float Alpha { get; set; }
93
94 [JsonIgnore]
95 private string _color;
96
97 [JsonIgnore]
98 public string Get
99 {
100 get
101 {
102 if (string.IsNullOrEmpty(_color))
103 _color = UI.Color(Hex, Alpha);
104 return _color;
105 }
106 }
107 }
108
109 }
110
111 protected override void LoadConfig()
112 {
113 base.LoadConfig();
114 try
115 {
116 config = Config.ReadObject<ConfigData>();
117 if (config == null) throw new Exception();
118 }
119 catch
120 {
121 Config.WriteObject(config, false, $"{Interface.Oxide.ConfigDirectory}/{Name}.jsonError");
122 PrintError("The configuration file contains an error and has been replaced with a default config.\n" +
123 "The error configuration file was saved in the .jsonError extension");
124 LoadDefaultConfig();
125 }
126
127 SaveConfig();
128 }
129 protected override void LoadDefaultConfig() => config = new ConfigData();
130
131 protected override void SaveConfig() => Config.WriteObject(config);
132 protected override void LoadDefaultMessages() {
133 lang.RegisterMessages(new Dictionary<string, string> {
134 ["NoPermission"] = "You don't have the permission to use this command.",
135 ["args"] = "Must type number of maps to generate.",
136 ["GUI.Title"] = "Maps",
137 ["GUI.CreateNew"] = "Generate Maps",
138 ["UI.Title.Editor"] = "Generate simple map",
139 ["UI.Details"] = "Map Details",
140 ["UI.MapSize"] = "Map size",
141 ["UI.generate"] = "Generate",
142 ["UI.nb"] = "nb",
143 }, this);
144 }
145 string GetMsg(string key) => lang.GetMessage(key, this);
146 #endregion
147 private void OnServerInitialized()
148 {
149 AddCovalenceCommand(config.Commands.Generate, nameof(cmdGenerate));
150 AddCovalenceCommand("mapvote", nameof(cmdVote));
151 permission.RegisterPermission(permissionUse, this);
152 }
153 private void unload()
154 {
155 timer = null;
156 }
157 private void cmdGenerate(IPlayer player, string cmd, string[] args)
158 {
159 if (!player.HasPermission(permissionUse))
160 {
161 player.Reply(GetMsg("NoPermission"));
162 return;
163 }
164 if (args.Length == 0 || Int16.Parse(args[0]) > 5 )
165 {
166 player.Reply(GetMsg("args"));
167 return;
168 }
169 seedGenerate(Int16.Parse(args[0]));
170
171 }
172 private void cmdVote(IPlayer player, string cmd, string[] args)
173 {
174 if (!player.HasPermission(permissionUse))
175 {
176 player.Reply(GetMsg("NoPermission"));
177 return;
178 }
179 OpenKitGrid(BasePlayer.FindByID(ulong.Parse(player.Id)));
180 }
181 [Command("GUI.close")]
182 private void ccmdKitsClose(IPlayer player, string cmd, string[] args)
183 {
184 BasePlayer Player = player.Object as BasePlayer;
185 if (Player == null)
186 return;
187 CuiHelper.DestroyUi(Player, UI_MENU);
188 CuiHelper.DestroyUi(Player, UI_POPUP);
189 }
190 [Command("Map.Generate")]
191 private void ccmdCreateKit(IPlayer player, string cmd, string[] args)
192 {
193 BasePlayer Player = player.Object as BasePlayer;
194 if (Player == null)
195 return;
196
197 if (IsAdmin(Player))
198 {
199 OpenKitsEditor(Player);
200 }
201 }
202 [Command("Map.Save")]
203 private void ccmdGenerate(IPlayer player, string cmd, string[] args)
204 {
205 BasePlayer Player = player.Object as BasePlayer;
206 if (Player == null)
207 return;
208 if (IsAdmin(Player))
209 {
210 PrintWarning(nbMaps);
211 seedGenerate(Int16.Parse(nbMaps));
212 CuiHelper.DestroyUi(Player, UI_MENU);
213 CuiHelper.DestroyUi(Player, UI_POPUP);
214 }
215 }
216 [Command("Map.clear")]
217 private void ccmdClear(IPlayer player, string cmd, string[] args)
218 {
219 BasePlayer Player = player.Object as BasePlayer;
220 if (Player == null)
221 return;
222 CuiHelper.DestroyUi(Player, UI_MENU);
223 CuiHelper.DestroyUi(Player, UI_POPUP);
224 }
225 [Command("Map.set")]
226 private void ccmdSet(IPlayer player, string cmd, string[] args)
227 {
228
229 BasePlayer Player = player.Object as BasePlayer;
230 if (Player == null)
231 return;
232 if(args[0] == "nb")
233 {
234
235 var val = string.Join(" ", args.Skip(1));
236
237 nbMaps = (string)val;
238 PrintWarning(nbMaps);
239 }
240
241 }
242 #region Kit Grid View
243 private const string UI_MENU = "Maps.menu";
244 private const string UI_POPUP = "Maps.popup";
245 private void OpenKitGrid(BasePlayer player, int page = 0, ulong npcId = 0UL)
246 {
247 CuiElementContainer container = UI.BlurContainer(UI_MENU, new UI4(0.2f, 0.15f, 0.8f, 0.85f));
248
249 UI.Panel(container, UI_MENU,UI.Color("#232323", 1f), new UI4(0.005f, 0.93f, 0.995f, 0.99f));
250
251 UI.Label(container, UI_MENU, GetMsg("GUI.Title"), 20, new UI4(0.015f, 0.93f, 0.99f, 0.99f), TextAnchor.MiddleLeft);
252
253 UI.Button(container, UI_MENU, UI.Color("#007acc", 1f), "<b>×</b>", 20, new UI4(0.9575f, 0.9375f, 0.99f, 0.9825f), "GUI.close");
254
255 if (IsAdmin(player) && npcId == 0UL)
256 UI.Button(container, UI_MENU, UI.Color("#6a8b38", 1f), GetMsg("GUI.CreateNew"), 14, new UI4(0.85f, 0.9375f, 0.9525f, 0.9825f), "Map.Generate");
257
258 //CreateGridView(player, container, page, npcId);
259
260 CuiHelper.DestroyUi(player, UI_MENU);
261 CuiHelper.AddUi(player, container);
262 }
263 private bool IsAdmin(BasePlayer player) => permission.UserHasPermission(player.UserIDString, permissionUse);
264 #endregion
265 #region Kit Editor
266 private void OpenKitsEditor(BasePlayer player, bool overwrite = false)
267 {
268 CuiElementContainer container = UI.BlurContainer(UI_MENU, new UI4(0.2f, 0.15f, 0.8f, 0.85f));
269
270 UI.Panel(container, UI_MENU, UI.Color("#232323", 1f), new UI4(0.005f, 0.93f, 0.995f, 0.99f));
271
272 UI.Label(container, UI_MENU, GetMsg("UI.Title.Editor"), 20, new UI4(0.015f, 0.93f, 0.99f, 0.99f), TextAnchor.MiddleLeft);
273
274 UI.Button(container, UI_MENU, UI.Color("#007acc", 1f), "<b>×</b>", 20, new UI4(0.9575f, 0.9375f, 0.99f, 0.9825f), "GUI.close");
275
276 // Kit Options
277 AddTitleSperator(container, 0, GetMsg("UI.Details"));
278 AddInputField(container, 1, GetMsg("UI.nb"), "Seed", nbMaps);
279 AddInputField(container, 2, GetMsg("UI.MapSize"), "Size", size);
280
281 // Kit Items
282 //CreateKitLayout(player, container, kit);
283
284 // Kit Saving
285 UI.Button(container, UI_MENU, UI.Color("#6a8b38", 1f), GetMsg("UI.generate"), 14, new UI4(0.005f, 0.005f, 0.2475f, 0.045f), $"Map.Save {overwrite}");
286 CuiHelper.DestroyUi(player, UI_MENU);
287 CuiHelper.AddUi(player, container);
288 }
289 #endregion
290 #region UI Helper
291#if RUST
292 public static class UI
293 {
294 public static CuiElementContainer Container(string panelName, string color, UI4 dimensions, string parent = "Overlay")
295 {
296 CuiElementContainer container = new CuiElementContainer()
297 {
298 {
299 new CuiPanel
300 {
301 Image = { Color = color, Material = "assets/content/ui/uibackgroundblur-ingamemenu.mat" },
302 RectTransform = { AnchorMin = dimensions.GetMin(), AnchorMax = dimensions.GetMax() },
303 CursorEnabled = true
304 },
305 new CuiElement().Parent = parent,
306 panelName
307 }
308 };
309 return container;
310 }
311
312 public static CuiElementContainer BlurContainer(string panelName, UI4 dimensions, string color = "0 0 0 0.9")
313 {
314 CuiElementContainer container = new CuiElementContainer()
315 {
316 {
317 new CuiPanel
318 {
319 Image = {Color = color, Material = "assets/content/ui/uibackgroundblur-ingamemenu.mat"},
320 RectTransform = {AnchorMin = dimensions.GetMin(), AnchorMax = dimensions.GetMax()},
321 CursorEnabled = true
322 },
323 new CuiElement().Parent = "Hud",
324 panelName.ToString()
325 }
326 };
327 return container;
328 }
329
330 public static CuiElementContainer Popup(string panelName, string text, int size, UI4 dimensions, TextAnchor align = TextAnchor.MiddleCenter, string parent = "Overlay")
331 {
332 CuiElementContainer container = UI.Container(panelName, "0 0 0 0", dimensions);
333
334 UI.Label(container, panelName, text, size, UI4.Full, align);
335
336 return container;
337 }
338
339 public static void Panel(CuiElementContainer container, string panel, string color, UI4 dimensions)
340 {
341 container.Add(new CuiPanel
342 {
343 Image = { Color = color },
344 RectTransform = { AnchorMin = dimensions.GetMin(), AnchorMax = dimensions.GetMax() }
345 },
346 panel);
347 }
348
349 public static void Label(CuiElementContainer container, string panel, string text, int size, UI4 dimensions, TextAnchor align = TextAnchor.MiddleCenter)
350 {
351 container.Add(new CuiLabel
352 {
353 Text = { FontSize = size, Align = align, Text = text },
354 RectTransform = { AnchorMin = dimensions.GetMin(), AnchorMax = dimensions.GetMax() }
355 },
356 panel);
357 }
358
359 public static void Button(CuiElementContainer container, string panel, string color, string text, int size, UI4 dimensions, string command, TextAnchor align = TextAnchor.MiddleCenter)
360 {
361 container.Add(new CuiButton
362 {
363 Button = { Color = color, Command = command, FadeIn = 0f },
364 RectTransform = { AnchorMin = dimensions.GetMin(), AnchorMax = dimensions.GetMax() },
365 Text = { Text = text, FontSize = size, Align = align }
366 },
367 panel);
368 }
369
370 public static void ImageButton(CuiElementContainer container, string panel, string color, string png, UI4 dimensions, string command)
371 {
372 UI.Panel(container, panel, color, dimensions);
373 UI.Image(container, panel, png, dimensions);
374 UI.Button(container, panel, "0 0 0 0", string.Empty, 0, dimensions, command);
375 }
376
377 public static void Input(CuiElementContainer container, string panel, string text, int size, string command, UI4 dimensions, TextAnchor anchor = TextAnchor.MiddleLeft)
378 {
379 container.Add(new CuiElement
380 {
381 Name = CuiHelper.GetGuid(),
382 Parent = panel,
383 Components =
384 {
385 new CuiInputFieldComponent
386 {
387 Align = anchor,
388 CharsLimit = 300,
389 Command = command + text,
390 FontSize = size,
391 IsPassword = false,
392 Text = text
393 },
394 new CuiRectTransformComponent {AnchorMin = dimensions.GetMin(), AnchorMax = dimensions.GetMax() }
395 }
396 });
397 }
398
399 public static void Image(CuiElementContainer container, string panel, string png, UI4 dimensions)
400 {
401 container.Add(new CuiElement
402 {
403 Name = CuiHelper.GetGuid(),
404 Parent = panel,
405 Components =
406 {
407 new CuiRawImageComponent {Png = png },
408 new CuiRectTransformComponent { AnchorMin = dimensions.GetMin(), AnchorMax = dimensions.GetMax() }
409 }
410 });
411 }
412
413 public static void Toggle(CuiElementContainer container, string panel, string boxColor, int fontSize, UI4 dimensions, string command, bool isOn)
414 {
415 UI.Panel(container, panel, boxColor, dimensions);
416
417 if (isOn)
418 UI.Label(container, panel, "✔", fontSize, dimensions);
419
420 UI.Button(container, panel, "0 0 0 0", string.Empty, 0, dimensions, command);
421 }
422
423 public static string Color(string hexColor, float alpha)
424 {
425 if (hexColor.StartsWith("#"))
426 hexColor = hexColor.TrimStart('#');
427
428 int red = int.Parse(hexColor.Substring(0, 2), NumberStyles.AllowHexSpecifier);
429 int green = int.Parse(hexColor.Substring(2, 2), NumberStyles.AllowHexSpecifier);
430 int blue = int.Parse(hexColor.Substring(4, 2), NumberStyles.AllowHexSpecifier);
431
432 return $"{(double)red / 255} {(double)green / 255} {(double)blue / 255} {alpha}";
433 }
434 }
435
436 public class UI4
437 {
438 public float xMin, yMin, xMax, yMax;
439
440 public UI4(float xMin, float yMin, float xMax, float yMax)
441 {
442 this.xMin = xMin;
443 this.yMin = yMin;
444 this.xMax = xMax;
445 this.yMax = yMax;
446 }
447
448 public string GetMin() => $"{xMin} {yMin}";
449
450 public string GetMax() => $"{xMax} {yMax}";
451
452 private static UI4 _full;
453
454 public static UI4 Full
455 {
456 get
457 {
458 if (_full == null)
459 _full = new UI4(0, 0, 1, 1);
460 return _full;
461 }
462 }
463 }
464#endif
465 #endregion
466 #region Editor Helpers
467 private const string ICON_BACKGROUND_COLOR = "1 1 1 0.15";
468 private const float EDITOR_ELEMENT_HEIGHT = 0.04f;
469
470 private void AddInputField(CuiElementContainer container, int index, string title, string fieldName, object currentValue, int additionalHeight = 0)
471 {
472 float yMin = GetVerticalPos(index, 0.88f);
473 float yMax = yMin + EDITOR_ELEMENT_HEIGHT;
474
475 if (additionalHeight != 0)
476 yMin = GetVerticalPos(index + additionalHeight, 0.88f);
477
478 UI.Panel(container, UI_MENU, UI.Color("#d08822", 1f), new UI4(0.005f, yMin, 0.175f, yMax));
479 UI.Label(container, UI_MENU, title, 12, new UI4(0.01f, yMin, 0.175f, yMax - 0.0075f), TextAnchor.UpperLeft);
480
481 UI.Panel(container, UI_MENU, ICON_BACKGROUND_COLOR, new UI4(0.175f, yMin, 0.495f, yMax));
482
483 string label = GetInputLabel(currentValue);
484 if (!string.IsNullOrEmpty(label))
485 {
486 UI.Label(container, UI_MENU, label, 12, new UI4(0.18f, yMin, 0.47f, yMax - 0.0075f), TextAnchor.UpperLeft);
487 UI.Button(container, UI_MENU, UI.Color("#d85540", 1f), "X", 14, new UI4(0.47f, yMax - EDITOR_ELEMENT_HEIGHT, 0.495f, yMax), $"Map.Textclear {fieldName}");
488 }
489 else UI.Input(container, UI_MENU, string.Empty, 12, $"Map.set {fieldName}", new UI4(0.18f, yMin, 0.495f, yMax - 0.0075f), TextAnchor.UpperLeft);
490 }
491
492 private void AddTitleSperator(CuiElementContainer container, int index, string title)
493 {
494 float yMin = GetVerticalPos(index, 0.88f);
495 float yMax = yMin + EDITOR_ELEMENT_HEIGHT;
496
497 UI.Panel(container, UI_MENU, UI.Color("#007acc", 1f), new UI4(0.005f, yMin, 0.495f, yMax));
498 UI.Label(container, UI_MENU, title, 14, new UI4(0.01f, yMin, 0.495f, yMax), TextAnchor.MiddleLeft);
499 }
500
501 private void AddLabelField(CuiElementContainer container, int index, string title, string value, int additionalHeight = 0)
502 {
503 float yMin = GetVerticalPos(index, 0.88f);
504 float yMax = yMin + EDITOR_ELEMENT_HEIGHT;
505
506 if (additionalHeight != 0)
507 yMin = GetVerticalPos(index + additionalHeight, 0.88f);
508
509 UI.Panel(container, UI_MENU, UI.Color("#d08822", 1f), new UI4(0.005f, yMin, 0.175f, yMax));
510 UI.Label(container, UI_MENU, title, 12, new UI4(0.01f, yMin, 0.175f, yMax - 0.0075f), TextAnchor.UpperLeft);
511
512 UI.Panel(container, UI_MENU, ICON_BACKGROUND_COLOR, new UI4(0.175f, yMin, 0.495f, yMax));
513 UI.Label(container, UI_MENU, value, 12, new UI4(0.18f, yMin, 0.495f, yMax - 0.0075f), TextAnchor.UpperLeft);
514 }
515
516 private void AddToggleField(CuiElementContainer container, int index, string title, string fieldName, bool currentValue)
517 {
518 float yMin = GetVerticalPos(index, 0.88f);
519 float yMax = yMin + EDITOR_ELEMENT_HEIGHT;
520
521 UI.Panel(container, UI_MENU, UI.Color("#d08822", 1f), new UI4(0.005f, yMin, 0.175f, yMax));
522 UI.Label(container, UI_MENU, title, 14, new UI4(0.01f, yMin, 0.175f, yMax), TextAnchor.MiddleLeft);
523 UI.Toggle(container, UI_MENU, ICON_BACKGROUND_COLOR, 14, new UI4(0.175f, yMin, 0.205f, yMax), $"kits.creator {fieldName} {!currentValue}", currentValue);
524 }
525
526 private string GetInputLabel(object obj)
527 {
528 if (obj is string)
529 return string.IsNullOrEmpty(obj as string) ? null : obj.ToString();
530 else if (obj is int)
531 return (int)obj <= 0 ? null : obj.ToString();
532 else if (obj is float)
533 return (float)obj <= 0 ? null : obj.ToString();
534 return null;
535 }
536
537 private float GetVerticalPos(int i, float start = 0.9f) => start - (i * (EDITOR_ELEMENT_HEIGHT + 0.005f));
538 #endregion
539 #region Methods
540#if RUST
541 private void seedGenerate(int nb)
542 {
543 for (int i =0; i < nb; i++)
544 {
545 uint value = (uint)_random.Next(1,2147483647);
546 Generating.Add(value);
547 }
548 foreach(var seed in Generating)
549 {
550 PrintWarning(seed.ToString());
551 ServerMgr.Instance.StartCoroutine(PostRequest(seed));
552 }
553 }
554 private IEnumerator PostRequest(uint seed)
555 {
556 List<IMultipartFormSection> formData = new List<IMultipartFormSection>();
557 string link = String.Format("https://rustmaps.com/api/v2/maps/{0}/{1}?staging=false&barren=false",seed.ToString(),config.Settings.size);
558 formData.Add(new MultipartFormDataSection("staging=false&barren=false"));
559 UnityWebRequest www = UnityWebRequest.Post(link,formData);
560 www.SetRequestHeader("X-API-Key",config.Settings.APIKey);
561 www.SetRequestHeader("accept","application/json");
562 yield return www.SendWebRequest();
563 string response = System.Text.Encoding.UTF8.GetString(www.downloadHandler.data);
564 PrintWarning(www.responseCode.ToString());
565 PrintWarning(response);
566 Mapid Map = JsonConvert.DeserializeObject<Mapid>(www.downloadHandler.text);
567 PrintWarning(Map.Id);
568 string mapId = Map.Id;
569 if(www.responseCode == 409)
570 {
571 ServerMgr.Instance.StartCoroutine(GetRequest(String.Format("https://rustmaps.com/api/v2/maps/{0}",mapId)));
572 }
573 else if (www.responseCode == 200)
574 {
575 timer.Once(60, () =>
576 {
577 ServerMgr.Instance.StartCoroutine(GetRequest(String.Format("https://rustmaps.com/api/v2/maps/{0}",mapId),mapId));
578 });
579 }
580 }
581 private IEnumerator GetRequest(string uri,string mapId = null)
582 {
583 using (UnityWebRequest webRequest = UnityWebRequest.Get(uri))
584 {
585 // Request and wait for the desired page.
586 yield return webRequest.SendWebRequest();
587 if (webRequest.responseCode == 409)
588 {
589 PrintWarning(string.Format("Error: {0}", webRequest.error));
590 webRequest.Dispose();
591 yield break;
592 }
593 if(webRequest.responseCode == 200)
594 {
595 string response = System.Text.Encoding.UTF8.GetString(webRequest.downloadHandler.data);
596 RustMaps Map = JsonConvert.DeserializeObject<RustMaps>(webRequest.downloadHandler.text);
597 PrintWarning(Map.ImageIconUrl);
598 webRequest.Dispose();
599 Maps.Add(Map);
600 Generating.Remove(Convert.ToUInt32(Map.Seed));
601 webRequest.Dispose();
602 }else if(webRequest.responseCode == 409)
603 {
604 CurrentState Map = JsonConvert.DeserializeObject<CurrentState>(webRequest.downloadHandler.text);
605 PrintWarning(mapId+" : "+Map.currentState);
606 timer.Once(60, () =>
607 {
608 ServerMgr.Instance.StartCoroutine(GetRequest(String.Format("https://rustmaps.com/api/v2/maps/{0}",mapId),mapId));
609 });
610 }
611 }
612 }
613#endif
614 #endregion
615
616 // Root myDeserializedClass = JsonSerializer.Deserialize<Root>(myJsonResponse);
617 public class Monument
618 {
619 [JsonProperty(PropertyName ="prefab")]
620 public string Prefab { get; set; }
621
622 [JsonProperty(PropertyName ="monument")]
623 public string Monumentx { get; set; }
624
625 [JsonProperty(PropertyName ="biome")]
626 public string Biome { get; set; }
627
628 [JsonProperty(PropertyName ="x")]
629 public int X { get; set; }
630
631 [JsonProperty(PropertyName ="y")]
632 public int Y { get; set; }
633 }
634
635 public class RustMaps
636 {
637 [JsonProperty(PropertyName ="id")]
638 public string Id { get; set; }
639
640 [JsonProperty(PropertyName ="staging")]
641 public bool Staging { get; set; }
642
643 [JsonProperty(PropertyName ="seed")]
644 public int Seed { get; set; }
645
646 [JsonProperty(PropertyName ="size")]
647 public int Size { get; set; }
648
649 [JsonProperty(PropertyName ="monuments")]
650 public List<Monument> Monuments { get; set; }
651
652 [JsonProperty(PropertyName ="url")]
653 public string Url { get; set; }
654
655 [JsonProperty(PropertyName ="imageUrl")]
656 public string ImageUrl { get; set; }
657
658 [JsonProperty(PropertyName ="imageIconUrl")]
659 public string ImageIconUrl { get; set; }
660
661 [JsonProperty(PropertyName ="thumbnailUrl")]
662 public string ThumbnailUrl { get; set; }
663 }
664 public class Mapid
665 {
666 [JsonProperty(PropertyName ="mapId")]
667 public string Id { get; set; }
668 }
669 public class CurrentState
670 {
671 [JsonProperty(PropertyName ="currentState")]
672 public string currentState { get; set; }
673 }
674 }
675}
676
677