diff --git a/RustPlusApi.sln b/RustPlusApi.sln index 3616f7c..614cefc 100644 --- a/RustPlusApi.sln +++ b/RustPlusApi.sln @@ -81,6 +81,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StrobeEntityLegacy", "RustP EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToggleEntityLegacy", "RustPlusApi\Examples\Legacy\ToggleEntityLegacy\ToggleEntityLegacy.csproj", "{172AAEAA-0F46-457C-9494-8BBEE5377D66}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SetSubscriptionLegacy", "RustPlusApi\Examples\Legacy\SetSubscriptionLegacy\SetSubscriptionLegacy.csproj", "{135FF8CD-4561-4DD8-897F-A5B898DCAF17}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CheckSubscriptionLegacy", "RustPlusApi\Examples\Legacy\CheckSubscritionLegacy\CheckSubscriptionLegacy.csproj", "{846C0B38-B7F8-454C-9E3C-40DC15E0D390}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__Events", "RustPlusApi\Examples\Legacy\__Events\__Events.csproj", "{630A388E-41EC-4AC1-9737-61759BA40164}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -231,6 +237,18 @@ Global {172AAEAA-0F46-457C-9494-8BBEE5377D66}.Debug|Any CPU.Build.0 = Debug|Any CPU {172AAEAA-0F46-457C-9494-8BBEE5377D66}.Release|Any CPU.ActiveCfg = Release|Any CPU {172AAEAA-0F46-457C-9494-8BBEE5377D66}.Release|Any CPU.Build.0 = Release|Any CPU + {135FF8CD-4561-4DD8-897F-A5B898DCAF17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {135FF8CD-4561-4DD8-897F-A5B898DCAF17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {135FF8CD-4561-4DD8-897F-A5B898DCAF17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {135FF8CD-4561-4DD8-897F-A5B898DCAF17}.Release|Any CPU.Build.0 = Release|Any CPU + {846C0B38-B7F8-454C-9E3C-40DC15E0D390}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {846C0B38-B7F8-454C-9E3C-40DC15E0D390}.Debug|Any CPU.Build.0 = Debug|Any CPU + {846C0B38-B7F8-454C-9E3C-40DC15E0D390}.Release|Any CPU.ActiveCfg = Release|Any CPU + {846C0B38-B7F8-454C-9E3C-40DC15E0D390}.Release|Any CPU.Build.0 = Release|Any CPU + {630A388E-41EC-4AC1-9737-61759BA40164}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {630A388E-41EC-4AC1-9737-61759BA40164}.Debug|Any CPU.Build.0 = Debug|Any CPU + {630A388E-41EC-4AC1-9737-61759BA40164}.Release|Any CPU.ActiveCfg = Release|Any CPU + {630A388E-41EC-4AC1-9737-61759BA40164}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -272,6 +290,9 @@ Global {F4BB95F4-2171-4087-889D-F65158AFD713} = {EBB661D0-93FF-4742-AF91-9036027CD136} {9A41A0A3-9FAD-42E2-BD22-E3B4E2DBA161} = {EBB661D0-93FF-4742-AF91-9036027CD136} {172AAEAA-0F46-457C-9494-8BBEE5377D66} = {EBB661D0-93FF-4742-AF91-9036027CD136} + {135FF8CD-4561-4DD8-897F-A5B898DCAF17} = {EBB661D0-93FF-4742-AF91-9036027CD136} + {846C0B38-B7F8-454C-9E3C-40DC15E0D390} = {EBB661D0-93FF-4742-AF91-9036027CD136} + {630A388E-41EC-4AC1-9737-61759BA40164} = {EBB661D0-93FF-4742-AF91-9036027CD136} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A4B4251F-ADA4-418D-95B5-27BA99A307A3} diff --git a/RustPlusApi/Examples/Legacy/CheckSubscritionLegacy/CheckSubscriptionLegacy.csproj b/RustPlusApi/Examples/Legacy/CheckSubscritionLegacy/CheckSubscriptionLegacy.csproj new file mode 100644 index 0000000..cb85ff3 --- /dev/null +++ b/RustPlusApi/Examples/Legacy/CheckSubscritionLegacy/CheckSubscriptionLegacy.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + diff --git a/RustPlusApi/Examples/Legacy/CheckSubscritionLegacy/Program.cs b/RustPlusApi/Examples/Legacy/CheckSubscritionLegacy/Program.cs new file mode 100644 index 0000000..2e287ce --- /dev/null +++ b/RustPlusApi/Examples/Legacy/CheckSubscritionLegacy/Program.cs @@ -0,0 +1,15 @@ +using Newtonsoft.Json; + +using RustPlusApi; + +using static __Constants.ExamplesConst; + +var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); +const uint entityId = 0; + +await rustPlus.ConnectAsync(); + +var message = await rustPlus.CheckSubscriptionLegacyAsync(entityId); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); + +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetClanChatChangesLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetClanChatChangesLegacy/Program.cs index eba974d..07c4f1a 100644 --- a/RustPlusApi/Examples/Legacy/GetClanChatChangesLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetClanChatChangesLegacy/Program.cs @@ -6,19 +6,15 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - // This method is not fully integrated in Rust so it will not work until the Clan update is released. - var message = await rustPlus.GetClanChatLegacyAsync(); - - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); -}; - -rustPlus.MessageReceived += (_, message) => +rustPlus.NotificationReceived += (_, message) => { if (message.Broadcast is not { ClanChanged: not null }) return; Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); }; -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.ConnectAsync(); + +// This method is not fully integrated in Rust, so it will not work until the Clan update is released. +var message = await rustPlus.GetClanChatLegacyAsync(); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetClanChatLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetClanChatLegacy/Program.cs index 45ca5cf..8bc73aa 100644 --- a/RustPlusApi/Examples/Legacy/GetClanChatLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetClanChatLegacy/Program.cs @@ -6,14 +6,11 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - // This method is not fully integrated in Rust so it will not work until the Clan update is released. - var message = await rustPlus.GetClanChatLegacyAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +await rustPlus.ConnectAsync(); - rustPlus.Dispose(); -}; +// This method is not fully integrated in Rust, so it will not work until the Clan update is released. +var message = await rustPlus.GetClanChatLegacyAsync(); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetEntityChangesLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetEntityChangesLegacy/Program.cs index dda9a6e..fc9b2b5 100644 --- a/RustPlusApi/Examples/Legacy/GetEntityChangesLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetEntityChangesLegacy/Program.cs @@ -7,18 +7,14 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); const uint entityId = 3716008; -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.GetEntityInfoLegacyAsync(entityId); - - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); -}; - -rustPlus.MessageReceived += (_, message) => +rustPlus.NotificationReceived += (_, message) => { if (message.Broadcast is not { EntityChanged: not null }) return; Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); }; -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.ConnectAsync(); + +var message = await rustPlus.GetEntityInfoLegacyAsync(entityId); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetInfoLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetInfoLegacy/Program.cs index a229e26..f3a9475 100644 --- a/RustPlusApi/Examples/Legacy/GetInfoLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetInfoLegacy/Program.cs @@ -6,13 +6,9 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.GetTeamChatLegacyAsync(); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +var message = await rustPlus.GetInfoLegacyAsync(); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetMapLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetMapLegacy/Program.cs index ce8a8d5..a602739 100644 --- a/RustPlusApi/Examples/Legacy/GetMapLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetMapLegacy/Program.cs @@ -4,17 +4,13 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.GetMapLegacyAsync(); +await rustPlus.ConnectAsync(); - if (message.Response.Error is not null) return; +var message = await rustPlus.GetMapLegacyAsync(); - File.WriteAllBytes("map.jpg", message.Response.Map.JpgImage.ToByteArray()); +if (message.Response.Error is not null) return; - Console.WriteLine($"Image saved under: {Directory.GetCurrentDirectory()}"); +File.WriteAllBytes("map.jpg", message.Response.Map.JpgImage.ToByteArray()); +Console.WriteLine($"Image saved under: {Directory.GetCurrentDirectory()}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetMapMarkersLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetMapMarkersLegacy/Program.cs index 42f268b..0de624d 100644 --- a/RustPlusApi/Examples/Legacy/GetMapMarkersLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetMapMarkersLegacy/Program.cs @@ -6,13 +6,9 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.GetMapMarkersLegacyAsync(); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +var message = await rustPlus.GetMapMarkersLegacyAsync(); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetTeamChatChangesLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetTeamChatChangesLegacy/Program.cs index eb3eb14..c1f4d6e 100644 --- a/RustPlusApi/Examples/Legacy/GetTeamChatChangesLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetTeamChatChangesLegacy/Program.cs @@ -6,18 +6,14 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.GetTeamChatLegacyAsync(); - - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); -}; - -rustPlus.MessageReceived += (_, message) => +rustPlus.NotificationReceived += (_, message) => { if (message.Broadcast is not { TeamMessage: not null }) return; Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); }; -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.ConnectAsync(); + +var message = await rustPlus.GetTeamChatLegacyAsync(); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetTeamChatLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetTeamChatLegacy/Program.cs index a229e26..5528c6d 100644 --- a/RustPlusApi/Examples/Legacy/GetTeamChatLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetTeamChatLegacy/Program.cs @@ -6,13 +6,9 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.GetTeamChatLegacyAsync(); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +var message = await rustPlus.GetTeamChatLegacyAsync(); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetTeamInfoLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetTeamInfoLegacy/Program.cs index a120907..24d365f 100644 --- a/RustPlusApi/Examples/Legacy/GetTeamInfoLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetTeamInfoLegacy/Program.cs @@ -6,13 +6,9 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.GetTeamInfoLegacyAsync(); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +var message = await rustPlus.GetTeamInfoLegacyAsync(); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/GetTimeLegacy/Program.cs b/RustPlusApi/Examples/Legacy/GetTimeLegacy/Program.cs index d788532..4d80e2a 100644 --- a/RustPlusApi/Examples/Legacy/GetTimeLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/GetTimeLegacy/Program.cs @@ -6,13 +6,9 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.GetTimeLegacyAsync(); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +var message = await rustPlus.GetTimeLegacyAsync(); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/PromoteToLeader/Program.cs b/RustPlusApi/Examples/Legacy/PromoteToLeader/Program.cs index 58ba8b1..7cf5af2 100644 --- a/RustPlusApi/Examples/Legacy/PromoteToLeader/Program.cs +++ b/RustPlusApi/Examples/Legacy/PromoteToLeader/Program.cs @@ -7,13 +7,9 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); const ulong steamId = 0; -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.PromoteToLeaderLegacyAsync(steamId); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +var message = await rustPlus.PromoteToLeaderLegacyAsync(steamId); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/SendTeamMessageLegacy/Program.cs b/RustPlusApi/Examples/Legacy/SendTeamMessageLegacy/Program.cs index b7e769c..bf33e90 100644 --- a/RustPlusApi/Examples/Legacy/SendTeamMessageLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/SendTeamMessageLegacy/Program.cs @@ -7,13 +7,9 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); const string teamMessage = "Hello world!"; -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.SendTeamMessageLegacyAsync(teamMessage); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +var message = await rustPlus.SendTeamMessageLegacyAsync(teamMessage); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/SetEntityValueLegacy/Program.cs b/RustPlusApi/Examples/Legacy/SetEntityValueLegacy/Program.cs index 99acdbc..ec80e93 100644 --- a/RustPlusApi/Examples/Legacy/SetEntityValueLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/SetEntityValueLegacy/Program.cs @@ -8,13 +8,9 @@ const uint entityId = 0; const bool value = true; -rustPlus.Connected += async (_, _) => -{ - var message = await rustPlus.SetEntityValueLegacyAsync(entityId, value); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +var message = await rustPlus.SetEntityValueLegacyAsync(entityId, value); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/SetSubscriptionLegacy/Program.cs b/RustPlusApi/Examples/Legacy/SetSubscriptionLegacy/Program.cs new file mode 100644 index 0000000..0a69af4 --- /dev/null +++ b/RustPlusApi/Examples/Legacy/SetSubscriptionLegacy/Program.cs @@ -0,0 +1,15 @@ +using Newtonsoft.Json; + +using RustPlusApi; + +using static __Constants.ExamplesConst; + +var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); +const uint entityId = 0; + +await rustPlus.ConnectAsync(); + +var message = await rustPlus.SetSubscriptionLegacyAsync(entityId); +Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); + +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/SetSubscriptionLegacy/SetSubscriptionLegacy.csproj b/RustPlusApi/Examples/Legacy/SetSubscriptionLegacy/SetSubscriptionLegacy.csproj new file mode 100644 index 0000000..cb85ff3 --- /dev/null +++ b/RustPlusApi/Examples/Legacy/SetSubscriptionLegacy/SetSubscriptionLegacy.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + diff --git a/RustPlusApi/Examples/Legacy/StrobeEntityLegacy/Program.cs b/RustPlusApi/Examples/Legacy/StrobeEntityLegacy/Program.cs index 8b16622..d22b778 100644 --- a/RustPlusApi/Examples/Legacy/StrobeEntityLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/StrobeEntityLegacy/Program.cs @@ -5,13 +5,9 @@ var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); const uint entityId = 0; -rustPlus.Connected += async (_, _) => -{ - await rustPlus.StrobeEntityLegacyAsync(entityId); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Strobed entity: {entityId}"); +await rustPlus.StrobeEntityLegacyAsync(entityId); +Console.WriteLine($"Strobe entity: {entityId}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/ToggleEntityLegacy/Program.cs b/RustPlusApi/Examples/Legacy/ToggleEntityLegacy/Program.cs index a104522..634792e 100644 --- a/RustPlusApi/Examples/Legacy/ToggleEntityLegacy/Program.cs +++ b/RustPlusApi/Examples/Legacy/ToggleEntityLegacy/Program.cs @@ -3,15 +3,11 @@ using static __Constants.ExamplesConst; var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); -const uint entityId = 85942; +const uint entityId = 0; -rustPlus.Connected += async (_, _) => -{ - await rustPlus.ToogleEntityValueLegacyAsync(entityId); +await rustPlus.ConnectAsync(); - Console.WriteLine($"Toggled entity: {entityId}"); +await rustPlus.ToggleEntityValueLegacyAsync(entityId); +Console.WriteLine($"Toggled entity: {entityId}"); - rustPlus.Dispose(); -}; - -await rustPlus.ConnectAsync(); \ No newline at end of file +await rustPlus.DisconnectAsync(); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/__Events/Program.cs b/RustPlusApi/Examples/Legacy/__Events/Program.cs new file mode 100644 index 0000000..0cd2867 --- /dev/null +++ b/RustPlusApi/Examples/Legacy/__Events/Program.cs @@ -0,0 +1,38 @@ +using Newtonsoft.Json; + +using RustPlusApi; + +using RustPlusContracts; + +using static __Constants.ExamplesConst; + +var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); + +rustPlus.Connecting += (_, _) => Console.WriteLine("Connecting..."); +rustPlus.Connected += (_, _) => Console.WriteLine("Connected..."); + +rustPlus.SendingRequest += (_, _) => Console.WriteLine("Sending request..."); +rustPlus.RequestSent += (_, message) => Console.WriteLine($"Request:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); + +// Message is always triggered (notification + response) +rustPlus.MessageReceived += (_, message) => Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); + +rustPlus.NotificationReceived += (_, message) => Console.WriteLine($"Notification:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); +rustPlus.ResponseReceived += (_, message) => Console.WriteLine($"Response:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); + +rustPlus.Disconnecting += (_, _) => Console.WriteLine("Disconnecting..."); +rustPlus.Disconnected += (_, _) => Console.WriteLine("Disconnected..."); + +rustPlus.ErrorOccurred += (_, ex) => Console.WriteLine($"Error:\n{ex}"); + +await rustPlus.ConnectAsync(); + +// Change this part as you wish +var request = new AppRequest +{ + GetTime = new AppEmpty() +}; +await rustPlus.SendRequestAsync(request); + +await rustPlus.DisconnectAsync(); +Console.WriteLine("Every task went well"); \ No newline at end of file diff --git a/RustPlusApi/Examples/Legacy/__Events/__Events.csproj b/RustPlusApi/Examples/Legacy/__Events/__Events.csproj new file mode 100644 index 0000000..476e35a --- /dev/null +++ b/RustPlusApi/Examples/Legacy/__Events/__Events.csproj @@ -0,0 +1,14 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + diff --git a/RustPlusApi/RustPlusApi/Data/ServerMapMonument.cs b/RustPlusApi/RustPlusApi/Data/ServerMapMonument.cs index bdfac16..ba5c9aa 100644 --- a/RustPlusApi/RustPlusApi/Data/ServerMapMonument.cs +++ b/RustPlusApi/RustPlusApi/Data/ServerMapMonument.cs @@ -2,7 +2,7 @@ { public class ServerMapMonument { - public string? Token { get; set; } + public string? Name { get; set; } public float? X { get; set; } public float? Y { get; set; } } diff --git a/RustPlusApi/RustPlusApi/Extensions/AppMapToModel.cs b/RustPlusApi/RustPlusApi/Extensions/AppMapToModel.cs index d6ec42e..362dfd3 100644 --- a/RustPlusApi/RustPlusApi/Extensions/AppMapToModel.cs +++ b/RustPlusApi/RustPlusApi/Extensions/AppMapToModel.cs @@ -27,7 +27,7 @@ public static ServerMapMonument ToServerMapMonument(this Monument appMapMonument { return new ServerMapMonument { - Token = appMapMonument.Token, + Name = appMapMonument.Name, X = appMapMonument.X, Y = appMapMonument.Y }; diff --git a/RustPlusApi/RustPlusApi/Protobuf/RustPlusContracts.cs b/RustPlusApi/RustPlusApi/Protobuf/RustPlusContracts.cs index 0b8056e..3562440 100644 --- a/RustPlusApi/RustPlusApi/Protobuf/RustPlusContracts.cs +++ b/RustPlusApi/RustPlusApi/Protobuf/RustPlusContracts.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: rustpluscontracts.proto +// source: RustPlusContracts.proto // #pragma warning disable 1591, 0612, 3021, 8981 #region Designer generated code @@ -11,20 +11,20 @@ using scg = global::System.Collections.Generic; namespace RustPlusContracts { - /// Holder for reflection information generated from rustpluscontracts.proto - public static partial class RustpluscontractsReflection { + /// Holder for reflection information generated from RustPlusContracts.proto + public static partial class RustPlusContractsReflection { #region Descriptor - /// File descriptor for rustpluscontracts.proto + /// File descriptor for RustPlusContracts.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static RustpluscontractsReflection() { + static RustPlusContractsReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChdydXN0cGx1c2NvbnRyYWN0cy5wcm90bxIRUnVzdFBsdXNDb250cmFjdHMi", + "ChdSdXN0UGx1c0NvbnRyYWN0cy5wcm90bxIRUnVzdFBsdXNDb250cmFjdHMi", "HwoHVmVjdG9yMhIJCgF4GAEgASgCEgkKAXkYAiABKAIiKgoHVmVjdG9yMxIJ", "CgF4GAEgASgCEgkKAXkYAiABKAISCQoBehgDIAEoAiI1CgdWZWN0b3I0EgkK", "AXgYASABKAISCQoBeRgCIAEoAhIJCgF6GAMgASgCEgkKAXcYBCABKAIiKAoF", @@ -124,83 +124,90 @@ static RustpluscontractsReflection() { "BW5leHVzGA0gASgJEg8KB25leHVzSWQYDiABKAUSEQoJbmV4dXNab25lGA8g", "ASgJImUKB0FwcFRpbWUSGAoQZGF5TGVuZ3RoTWludXRlcxgBIAIoAhIRCgl0", "aW1lU2NhbGUYAiACKAISDwoHc3VucmlzZRgDIAIoAhIOCgZzdW5zZXQYBC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FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::RustPlusContracts.AppEntityType), typeof(global::RustPlusContracts.AppMarkerType), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::RustPlusContracts.AppEntityType), typeof(global::RustPlusContracts.AppMarkerType), typeof(global::RustPlusContracts.IconType), typeof(global::RustPlusContracts.IconColor), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.Vector2), global::RustPlusContracts.Vector2.Parser, new[]{ "X", "Y" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.Vector3), global::RustPlusContracts.Vector3.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.Vector4), global::RustPlusContracts.Vector4.Parser, new[]{ "X", "Y", "Z", "W" }, null, null, null, null), @@ -227,11 +234,11 @@ static RustpluscontractsReflection() { new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppFlag), global::RustPlusContracts.AppFlag.Parser, new[]{ "Value" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppInfo), global::RustPlusContracts.AppInfo.Parser, new[]{ "Name", "HeaderImage", "Url", "Map", "MapSize", "WipeTime", "Players", "MaxPlayers", "QueuedPlayers", "Seed", "Salt", "LogoImage", "Nexus", "NexusId", "NexusZone" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppTime), global::RustPlusContracts.AppTime.Parser, new[]{ "DayLengthMinutes", "TimeScale", "Sunrise", "Sunset", "Time" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppMap), global::RustPlusContracts.AppMap.Parser, new[]{ "Width", "Height", "JpgImage", "OceanMargin", "Monuments", "Background" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppMap.Types.Monument), global::RustPlusContracts.AppMap.Types.Monument.Parser, new[]{ "Token", "X", "Y" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppMap), global::RustPlusContracts.AppMap.Parser, new[]{ "Width", "Height", "JpgImage", "OceanMargin", "Monuments", "Background" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppMap.Types.Monument), global::RustPlusContracts.AppMap.Types.Monument.Parser, new[]{ "Name", "X", "Y" }, null, null, null, null)}), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppEntityInfo), global::RustPlusContracts.AppEntityInfo.Parser, new[]{ "Type", "Payload" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppEntityPayload), global::RustPlusContracts.AppEntityPayload.Parser, new[]{ "Value", "Items", "Capacity", "HasProtection", "ProtectionExpiry" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppEntityPayload.Types.Item), global::RustPlusContracts.AppEntityPayload.Types.Item.Parser, new[]{ "ItemId", "Quantity", "ItemIsBlueprint" }, null, null, null, null)}), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppTeamInfo), global::RustPlusContracts.AppTeamInfo.Parser, new[]{ "LeaderSteamId", "Members", "MapNotes", "LeaderMapNotes" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppTeamInfo.Types.Member), global::RustPlusContracts.AppTeamInfo.Types.Member.Parser, new[]{ "SteamId", "Name", "X", "Y", "IsOnline", "SpawnTime", "IsAlive", "DeathTime" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppTeamInfo.Types.Note), global::RustPlusContracts.AppTeamInfo.Types.Note.Parser, new[]{ "Type", "X", "Y" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppTeamInfo.Types.Note), global::RustPlusContracts.AppTeamInfo.Types.Note.Parser, new[]{ "Type", "X", "Y", "Icon", "Colour", "Name" }, null, null, null, null)}), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppTeamMessage), global::RustPlusContracts.AppTeamMessage.Parser, new[]{ "SteamId", "Name", "Message", "Color", "Time" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppTeamChat), global::RustPlusContracts.AppTeamChat.Parser, new[]{ "Messages" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppMarker), global::RustPlusContracts.AppMarker.Parser, new[]{ "Id", "Type", "X", "Y", "SteamId", "Rotation", "Radius", "Color1", "Color2", "Alpha", "Name", "OutOfStock", "SellOrders" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::RustPlusContracts.AppMarker.Types.SellOrder), global::RustPlusContracts.AppMarker.Types.SellOrder.Parser, new[]{ "ItemId", "Quantity", "CurrencyId", "CostPerItem", "AmountInStock", "ItemIsBlueprint", "CurrencyIsBlueprint", "ItemCondition", "ItemConditionMax" }, null, null, null, null)}), @@ -262,7 +269,7 @@ public enum AppEntityType { } public enum AppMarkerType { - [pbr::OriginalName("Undefined")] Undefined = 0, + [pbr::OriginalName("Death")] Death = 0, [pbr::OriginalName("Player")] Player = 1, [pbr::OriginalName("Explosion")] Explosion = 2, [pbr::OriginalName("VendingMachine")] VendingMachine = 3, @@ -273,6 +280,30 @@ public enum AppMarkerType { [pbr::OriginalName("PatrolHelicopter")] PatrolHelicopter = 8, } + public enum IconType { + [pbr::OriginalName("Default")] Default = 0, + [pbr::OriginalName("Money")] Money = 1, + [pbr::OriginalName("Home")] Home = 2, + [pbr::OriginalName("Drop")] Drop = 3, + [pbr::OriginalName("Sight")] Sight = 4, + [pbr::OriginalName("Shield")] Shield = 5, + [pbr::OriginalName("Skull")] Skull = 6, + [pbr::OriginalName("Bed")] Bed = 7, + [pbr::OriginalName("Sleep")] Sleep = 8, + [pbr::OriginalName("Gun")] Gun = 9, + [pbr::OriginalName("Rock")] Rock = 10, + [pbr::OriginalName("Chest")] Chest = 11, + } + + public enum IconColor { + [pbr::OriginalName("Yellow")] Yellow = 0, + [pbr::OriginalName("Blue")] Blue = 1, + [pbr::OriginalName("Green")] Green = 2, + [pbr::OriginalName("Red")] Red = 3, + [pbr::OriginalName("Purple")] Purple = 4, + [pbr::OriginalName("Cyan")] Cyan = 5, + } + #endregion #region Messages @@ -291,7 +322,7 @@ public sealed partial class Vector2 : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[0]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -549,7 +580,7 @@ public sealed partial class Vector3 : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[1]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -859,7 +890,7 @@ public sealed partial class Vector4 : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[2]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1221,7 +1252,7 @@ public sealed partial class Half3 : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[3]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1531,7 +1562,7 @@ public sealed partial class Color : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[4]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1892,7 +1923,7 @@ public sealed partial class Ray : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[5]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2137,7 +2168,7 @@ public sealed partial class ClanActionResult : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[6]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2493,7 +2524,7 @@ public sealed partial class ClanInfo : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[7]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4750,7 +4781,7 @@ public sealed partial class ClanLog : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[8]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5450,7 +5481,7 @@ public sealed partial class ClanInvitations : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[9]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5947,7 +5978,7 @@ public sealed partial class AppRequest : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[10]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7228,7 +7259,7 @@ public sealed partial class AppMessage : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[11]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7473,7 +7504,7 @@ public sealed partial class AppResponse : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[12]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8322,7 +8353,7 @@ public sealed partial class AppBroadcast : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[13]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8750,7 +8781,7 @@ public sealed partial class AppEmpty : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[14]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8902,7 +8933,7 @@ public sealed partial class AppSendMessage : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[15]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -9106,7 +9137,7 @@ public sealed partial class AppSetEntityValue : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[16]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -9312,7 +9343,7 @@ public sealed partial class AppPromoteToLeader : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[18]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -9720,7 +9751,7 @@ public sealed partial class AppSuccess : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[19]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[19]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -9872,7 +9903,7 @@ public sealed partial class AppError : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[20]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[20]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -10076,7 +10107,7 @@ public sealed partial class AppFlag : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[21]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[21]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -10282,7 +10313,7 @@ public sealed partial class AppInfo : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[22]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[22]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -11209,7 +11240,7 @@ public sealed partial class AppTime : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[23]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[23]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -11623,7 +11654,7 @@ public sealed partial class AppMap : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[24]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[24]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -12085,7 +12116,7 @@ public Monument() { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Monument(Monument other) : this() { _hasBits0 = other._hasBits0; - token_ = other.token_; + name_ = other.name_; x_ = other.x_; y_ = other.y_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); @@ -12097,30 +12128,30 @@ public Monument Clone() { return new Monument(this); } - /// Field number for the "token" field. - public const int TokenFieldNumber = 1; - private readonly static string TokenDefaultValue = ""; + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private readonly static string NameDefaultValue = ""; - private string token_; + private string name_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Token { - get { return token_ ?? TokenDefaultValue; } + public string Name { + get { return name_ ?? NameDefaultValue; } set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Gets whether the "token" field is set + /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasToken { - get { return token_ != null; } + public bool HasName { + get { return name_ != null; } } - /// Clears the value of the "token" field + /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearToken() { - token_ = null; + public void ClearName() { + name_ = null; } /// Field number for the "x" field. @@ -12192,7 +12223,7 @@ public bool Equals(Monument other) { if (ReferenceEquals(other, this)) { return true; } - if (Token != other.Token) return false; + if (Name != other.Name) return false; if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; return Equals(_unknownFields, other._unknownFields); @@ -12202,7 +12233,7 @@ public bool Equals(Monument other) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasToken) hash ^= Token.GetHashCode(); + if (HasName) hash ^= Name.GetHashCode(); if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); if (_unknownFields != null) { @@ -12223,9 +12254,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (HasToken) { + if (HasName) { output.WriteRawTag(10); - output.WriteString(Token); + output.WriteString(Name); } if (HasX) { output.WriteRawTag(21); @@ -12245,9 +12276,9 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasToken) { + if (HasName) { output.WriteRawTag(10); - output.WriteString(Token); + output.WriteString(Name); } if (HasX) { output.WriteRawTag(21); @@ -12267,8 +12298,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasToken) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); + if (HasName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } if (HasX) { size += 1 + 4; @@ -12288,8 +12319,8 @@ public void MergeFrom(Monument other) { if (other == null) { return; } - if (other.HasToken) { - Token = other.Token; + if (other.HasName) { + Name = other.Name; } if (other.HasX) { X = other.X; @@ -12313,7 +12344,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Token = input.ReadString(); + Name = input.ReadString(); break; } case 21: { @@ -12340,7 +12371,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Token = input.ReadString(); + Name = input.ReadString(); break; } case 21: { @@ -12378,7 +12409,7 @@ public sealed partial class AppEntityInfo : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[25]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[25]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -12630,7 +12661,7 @@ public sealed partial class AppEntityPayload : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[26]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[26]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -13336,7 +13367,7 @@ public sealed partial class AppTeamInfo : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[27]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[27]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14216,6 +14247,9 @@ public Note(Note other) : this() { type_ = other.type_; x_ = other.x_; y_ = other.y_; + icon_ = other.icon_; + colour_ = other.colour_; + name_ = other.name_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -14306,6 +14340,86 @@ public void ClearY() { _hasBits0 &= ~4; } + /// Field number for the "icon" field. + public const int IconFieldNumber = 5; + private readonly static global::RustPlusContracts.IconType IconDefaultValue = global::RustPlusContracts.IconType.Default; + + private global::RustPlusContracts.IconType icon_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::RustPlusContracts.IconType Icon { + get { if ((_hasBits0 & 8) != 0) { return icon_; } else { return IconDefaultValue; } } + set { + _hasBits0 |= 8; + icon_ = value; + } + } + /// Gets whether the "icon" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIcon { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "icon" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIcon() { + _hasBits0 &= ~8; + } + + /// Field number for the "colour" field. + public const int ColourFieldNumber = 6; + private readonly static global::RustPlusContracts.IconColor ColourDefaultValue = global::RustPlusContracts.IconColor.Yellow; + + private global::RustPlusContracts.IconColor colour_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::RustPlusContracts.IconColor Colour { + get { if ((_hasBits0 & 16) != 0) { return colour_; } else { return ColourDefaultValue; } } + set { + _hasBits0 |= 16; + colour_ = value; + } + } + /// Gets whether the "colour" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasColour { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "colour" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearColour() { + _hasBits0 &= ~16; + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 7; + private readonly static string NameDefaultValue = ""; + + private string name_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_ ?? NameDefaultValue; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasName { + get { return name_ != null; } + } + /// Clears the value of the "name" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearName() { + name_ = null; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -14324,6 +14438,9 @@ public bool Equals(Note other) { if (Type != other.Type) return false; if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; + if (Icon != other.Icon) return false; + if (Colour != other.Colour) return false; + if (Name != other.Name) return false; return Equals(_unknownFields, other._unknownFields); } @@ -14334,6 +14451,9 @@ public override int GetHashCode() { if (HasType) hash ^= Type.GetHashCode(); if (HasX) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); if (HasY) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); + if (HasIcon) hash ^= Icon.GetHashCode(); + if (HasColour) hash ^= Colour.GetHashCode(); + if (HasName) hash ^= Name.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -14364,6 +14484,18 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(37); output.WriteFloat(Y); } + if (HasIcon) { + output.WriteRawTag(40); + output.WriteEnum((int) Icon); + } + if (HasColour) { + output.WriteRawTag(48); + output.WriteEnum((int) Colour); + } + if (HasName) { + output.WriteRawTag(58); + output.WriteString(Name); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -14386,6 +14518,18 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(37); output.WriteFloat(Y); } + if (HasIcon) { + output.WriteRawTag(40); + output.WriteEnum((int) Icon); + } + if (HasColour) { + output.WriteRawTag(48); + output.WriteEnum((int) Colour); + } + if (HasName) { + output.WriteRawTag(58); + output.WriteString(Name); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -14405,6 +14549,15 @@ public int CalculateSize() { if (HasY) { size += 1 + 4; } + if (HasIcon) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Icon); + } + if (HasColour) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Colour); + } + if (HasName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -14426,6 +14579,15 @@ public void MergeFrom(Note other) { if (other.HasY) { Y = other.Y; } + if (other.HasIcon) { + Icon = other.Icon; + } + if (other.HasColour) { + Colour = other.Colour; + } + if (other.HasName) { + Name = other.Name; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -14453,6 +14615,18 @@ public void MergeFrom(pb::CodedInputStream input) { Y = input.ReadFloat(); break; } + case 40: { + Icon = (global::RustPlusContracts.IconType) input.ReadEnum(); + break; + } + case 48: { + Colour = (global::RustPlusContracts.IconColor) input.ReadEnum(); + break; + } + case 58: { + Name = input.ReadString(); + break; + } } } #endif @@ -14480,6 +14654,18 @@ public void MergeFrom(pb::CodedInputStream input) { Y = input.ReadFloat(); break; } + case 40: { + Icon = (global::RustPlusContracts.IconType) input.ReadEnum(); + break; + } + case 48: { + Colour = (global::RustPlusContracts.IconColor) input.ReadEnum(); + break; + } + case 58: { + Name = input.ReadString(); + break; + } } } } @@ -14507,7 +14693,7 @@ public sealed partial class AppTeamMessage : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[28]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[28]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14917,7 +15103,7 @@ public sealed partial class AppTeamChat : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[29]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[29]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -15096,7 +15282,7 @@ public sealed partial class AppMarker : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[30]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[30]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -15168,7 +15354,7 @@ public void ClearId() { /// Field number for the "type" field. public const int TypeFieldNumber = 2; - private readonly static global::RustPlusContracts.AppMarkerType TypeDefaultValue = global::RustPlusContracts.AppMarkerType.Undefined; + private readonly static global::RustPlusContracts.AppMarkerType TypeDefaultValue = global::RustPlusContracts.AppMarkerType.Death; private global::RustPlusContracts.AppMarkerType type_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -16516,7 +16702,7 @@ public sealed partial class AppMapMarkers : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[31]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[31]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -16694,7 +16880,7 @@ public sealed partial class AppClanInfo : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[32]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[32]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -16893,7 +17079,7 @@ public sealed partial class AppClanMessage : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[33]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[33]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -17252,7 +17438,7 @@ public sealed partial class AppClanChat : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[34]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[34]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -17431,7 +17617,7 @@ public sealed partial class AppNexusAuth : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[35]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[35]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -17688,7 +17874,7 @@ public sealed partial class AppTeamChanged : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[36]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[36]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -17939,7 +18125,7 @@ public sealed partial class AppNewTeamMessage : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[37]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[37]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18138,7 +18324,7 @@ public sealed partial class AppEntityChanged : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[38]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[38]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18389,7 +18575,7 @@ public sealed partial class AppClanChanged : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[39]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[39]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18588,7 +18774,7 @@ public sealed partial class AppNewClanMessage : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[40]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[40]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18839,7 +19025,7 @@ public sealed partial class AppCameraSubscribe : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[42]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[42]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -19295,7 +19481,7 @@ public sealed partial class AppCameraInfo : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[43]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[43]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -19709,7 +19895,7 @@ public sealed partial class AppCameraRays : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::RustPlusContracts.RustpluscontractsReflection.Descriptor.MessageTypes[44]; } + get { return global::RustPlusContracts.RustPlusContractsReflection.Descriptor.MessageTypes[44]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] diff --git a/RustPlusApi/RustPlusApi/Protobuf/RustPlusContracts.proto b/RustPlusApi/RustPlusApi/Protobuf/RustPlusContracts.proto index 74db62b..2c673b8 100644 --- a/RustPlusApi/RustPlusApi/Protobuf/RustPlusContracts.proto +++ b/RustPlusApi/RustPlusApi/Protobuf/RustPlusContracts.proto @@ -120,7 +120,7 @@ enum AppEntityType { } enum AppMarkerType { - Undefined = 0; + Death = 0; Player = 1; Explosion = 2; VendingMachine = 3; @@ -255,7 +255,7 @@ message AppMap { optional string background = 6; message Monument { - required string token = 1; + required string name = 1; required float x = 2; required float y = 3; } @@ -301,9 +301,36 @@ message AppTeamInfo { required int32 type = 2; required float x = 3; required float y = 4; + required IconType icon = 5; + required IconColor colour = 6; + optional string name = 7; } } +enum IconType { + Default = 0; + Money = 1; + Home = 2; + Drop = 3; + Sight = 4; + Shield = 5; + Skull = 6; + Bed = 7; + Sleep = 8; + Gun = 9; + Rock = 10; + Chest = 11; +} + +enum IconColor { + Yellow = 0; + Blue = 1; + Green = 2; + Red = 3; + Purple = 4; + Cyan = 5; +} + message AppTeamMessage { required uint64 steamId = 1; required string name = 2; diff --git a/RustPlusApi/RustPlusApi/RustPlusLegacy.cs b/RustPlusApi/RustPlusApi/RustPlusLegacy.cs index 6150cb8..88b56b7 100644 --- a/RustPlusApi/RustPlusApi/RustPlusLegacy.cs +++ b/RustPlusApi/RustPlusApi/RustPlusLegacy.cs @@ -12,8 +12,23 @@ namespace RustPlusApi /// Your player token acquired with FCM. /// Specifies whether to use the Facepunch proxy. public class RustPlusLegacy(string server, int port, ulong playerId, int playerToken, bool useFacepunchProxy = false) - : RustPlusBase(server, port, playerId, playerToken, useFacepunchProxy) + : RustPlusSocket(server, port, playerId, playerToken, useFacepunchProxy) { + /// + /// Checks the subscription status for a specific entity in the Rust+ server asynchronously. + /// + /// The ID of the entity to check the subscription for. + /// The subscription status. + public async Task CheckSubscriptionLegacyAsync(uint entityId) + { + var request = new AppRequest + { + CheckSubscription = new AppEmpty(), + EntityId = entityId + }; + return await SendRequestAsync(request); + } + /// /// Retrieves the clan chat from the Rust+ server asynchronously. /// @@ -173,6 +188,25 @@ public async Task SetEntityValueLegacyAsync(uint entityId, bool valu return await SendRequestAsync(request); } + /// + /// Sets the subscription status for a specific entity in the Rust+ server asynchronously. + /// + /// The ID of the entity to set the subscription for. + /// Specifies whether to enable push notifications for the entity. Default is true. + /// The response from the server. + public async Task SetSubscriptionLegacyAsync(uint entityId, bool enablePushNotification = true) + { + var request = new AppRequest + { + SetSubscription = new AppFlag + { + Value = enablePushNotification + }, + EntityId = entityId + }; + return await SendRequestAsync(request); + } + /// /// Strobes an entity in the Rust+ server asynchronously. /// @@ -191,7 +225,7 @@ public async Task StrobeEntityLegacyAsync(uint entityId, int timeoutMilliseconds /// /// The ID of the entity. /// A task representing the asynchronous operation. - public async Task ToogleEntityValueLegacyAsync(uint entityId) + public async Task ToggleEntityValueLegacyAsync(uint entityId) { var entityInfo = await GetEntityInfoLegacyAsync(entityId); var value = entityInfo.Response.EntityInfo.Payload.Value; diff --git a/RustPlusApi/RustPlusApi/RustPlusBase.cs b/RustPlusApi/RustPlusApi/RustPlusSocket.cs similarity index 50% rename from RustPlusApi/RustPlusApi/RustPlusBase.cs rename to RustPlusApi/RustPlusApi/RustPlusSocket.cs index 983ffbc..c1cc3c3 100644 --- a/RustPlusApi/RustPlusApi/RustPlusBase.cs +++ b/RustPlusApi/RustPlusApi/RustPlusSocket.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System.Collections.Concurrent; +using System.Diagnostics; using System.Net.WebSockets; using Google.Protobuf; @@ -19,27 +20,43 @@ namespace RustPlusApi /// Your Steam ID. /// Your player token acquired with FCM. /// Specifies whether to use the Facepunch proxy. - public abstract class RustPlusBase(string server, int port, ulong playerId, int playerToken, bool useFacepunchProxy = false) : IDisposable + public abstract class RustPlusSocket(string server, int port, ulong playerId, int playerToken, bool useFacepunchProxy = false) : IDisposable { private ClientWebSocket? _webSocket; + private uint _seq; - private readonly Dictionary> _seqCallbacks = []; + + private readonly ConcurrentQueue _sendQueue = new(); + private readonly ConcurrentQueue> _responseQueue = new(); + + private readonly CancellationTokenSource _cancellationTokenSource = new(); + private CancellationToken _cancellationToken; public event EventHandler? Connecting; public event EventHandler? Connected; - public event EventHandler? MessageReceived; + + public event EventHandler? SendingRequest; public event EventHandler? RequestSent; + + public event EventHandler? MessageReceived; + public event EventHandler? NotificationReceived; + public event EventHandler? ResponseReceived; + + public event EventHandler? Disconnecting; public event EventHandler? Disconnected; + public event EventHandler? ErrorOccurred; /// /// Connects to the Rust+ server asynchronously. /// + /// A task representing the asynchronous operation. public async Task ConnectAsync() { _webSocket = new ClientWebSocket(); _webSocket.Options.KeepAliveInterval = TimeSpan.FromSeconds(20); - var address = useFacepunchProxy + + var uri = useFacepunchProxy ? new Uri($"wss://companion-rust.facepunch.com/game/{server}/{port}") : new Uri($"ws://{server}:{port}"); @@ -47,77 +64,141 @@ public async Task ConnectAsync() try { - await _webSocket.ConnectAsync(address, CancellationToken.None); + await _webSocket.ConnectAsync(uri, CancellationToken.None); + + _ = Task.Run(ReceiveAsync, _cancellationToken); + _ = Task.Run(ProcessSendQueueAsync, _cancellationToken); + + _cancellationToken = _cancellationTokenSource.Token; + Connected?.Invoke(this, EventArgs.Empty); - await ReceiveMessagesAsync(); } catch (Exception ex) { + Debug.WriteLine($"Exception occured on ConnectAsync: {ex}"); ErrorOccurred?.Invoke(this, ex); - Dispose(); } } /// - /// Receives messages from the Rust+ server asynchronously. + /// Sends a request to the Rust+ server asynchronously. /// + /// The request to send. /// A task representing the asynchronous operation. - protected async Task ReceiveMessagesAsync() + public async Task SendRequestAsync(AppRequest request) + { + var tcs = new TaskCompletionSource(); + var seq = Interlocked.Increment(ref _seq); + + request.Seq = seq; + request.PlayerId = playerId; + request.PlayerToken = playerToken; + + SendingRequest?.Invoke(this, EventArgs.Empty); + + _sendQueue.Enqueue(request); + _responseQueue.Enqueue(tcs); + + RequestSent?.Invoke(this, request); + + return await tcs.Task; + } + + /// + /// Processes the send queue asynchronously. + /// + /// A task representing the asynchronous operation. + private async Task ProcessSendQueueAsync() + { + while (IsConnected()) + { + if (_sendQueue.TryDequeue(out var request)) + { + var buffer = request.ToByteArray(); + await _webSocket!.SendAsync(new ArraySegment(buffer), WebSocketMessageType.Binary, true, _cancellationToken); + } + await Task.Delay(100, _cancellationToken); + } + } + + /// + /// Receives data from the Rust+ server asynchronously. + /// + /// A task representing the asynchronous operation. + private async Task ReceiveAsync() { const int bufferSize = 1024; var buffer = new byte[bufferSize]; - try + while (IsConnected()) { - while (_webSocket!.State == WebSocketState.Open) + try { var receiveBuffer = new List(); WebSocketReceiveResult result; do { - result = await _webSocket.ReceiveAsync(new ArraySegment(buffer), CancellationToken.None); + result = await _webSocket!.ReceiveAsync(new ArraySegment(buffer), _cancellationToken); receiveBuffer.AddRange(buffer.Take(result.Count)); } while (!result.EndOfMessage); var messageData = receiveBuffer.ToArray(); var message = AppMessage.Parser.ParseFrom(messageData); - HandleResponse(message); + + MessageReceived?.Invoke(this, message); + + if (message.Response?.Seq == 0) + { + NotificationReceived?.Invoke(this, message); + ParseNotification(message.Broadcast); + } + else + ResponseReceived?.Invoke(this, message); + + if (_responseQueue.TryDequeue(out var tcs)) + tcs.SetResult(message); + } + catch (OperationCanceledException) + { + break; + } + catch (WebSocketException ex) + { + Debug.WriteLine($"Disconnected from the Rust+ socket due to a WebSocketException: {ex}"); + ErrorOccurred?.Invoke(this, ex); + } + catch (Exception ex) + { + Debug.WriteLine($"Disconnected from the Rust+ socket due to an Exception: {ex}"); + ErrorOccurred?.Invoke(this, ex); } - } - catch (WebSocketException ex) - { - Debug.WriteLine($"Disconnected from the Rust+ socket due to a WebSocketException: {ex}"); - ErrorOccurred?.Invoke(this, ex); - } - catch (Exception ex) - { - Debug.WriteLine($"Disconnected from the Rust+ socket due to an Exception: {ex}"); - ErrorOccurred?.Invoke(this, ex); - } - finally - { - Dispose(); } } /// - /// Handles the response received from the Rust+ server. + /// Disconnects from the Rust+ server asynchronously. /// - /// The AppMessage received from the server. - protected void HandleResponse(AppMessage message) + /// A task representing the asynchronous operation. + public async Task DisconnectAsync() { - if (message.Response != null - && message.Response.Seq != 0 - && _seqCallbacks.ContainsKey((int)message.Response.Seq)) + if (!IsConnected()) return; + + Disconnecting?.Invoke(this, EventArgs.Empty); + + // Not sure about that + while (!_responseQueue.IsEmpty) { - var tcs = _seqCallbacks[(int)message.Response.Seq]; - tcs.SetResult(message); - _seqCallbacks.Remove((int)message.Response.Seq); - return; + await Task.Delay(50, CancellationToken.None); } - MessageReceived?.Invoke(this, message); - ParseNotification(message.Broadcast); + + // For some reason I have to wait + await Task.Delay(1000, CancellationToken.None).ContinueWith(async (t) => + { + await _webSocket!.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None); + }, CancellationToken.None); + + Disconnected?.Invoke(this, EventArgs.Empty); } /// @@ -126,43 +207,10 @@ protected void HandleResponse(AppMessage message) /// The AppBroadcast received from the server. protected virtual void ParseNotification(AppBroadcast? broadcast) { } - /// - /// Sends a request to the Rust+ server asynchronously. - /// - /// The request to send. - /// A task representing the asynchronous operation. - public async Task SendRequestAsync(AppRequest request) - { - var seq = ++_seq; - var tcs = new TaskCompletionSource(); - _seqCallbacks[(int)seq] = tcs; - - request.Seq = seq; - request.PlayerId = playerId; - request.PlayerToken = playerToken; - - var requestData = request.ToByteArray(); - var buffer = new ArraySegment(requestData); - await _webSocket!.SendAsync(buffer, WebSocketMessageType.Binary, true, CancellationToken.None); - RequestSent?.Invoke(this, request); - - return await tcs.Task; - } - /// /// Disposes the Rust+ API client and disconnects from the Rust+ server. /// - public void Dispose() - { - if (_webSocket is not { State: WebSocketState.Open }) return; - - _webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Connection closed by client.", CancellationToken.None).Wait(); - _webSocket.Dispose(); - - Disconnected?.Invoke(this, EventArgs.Empty); - - SuppressFinalize(this); - } + public void Dispose() => SuppressFinalize(this); /// /// Checks if the client is connected to the Rust+ socket.