Jonty, love the plugin. Had it running for about 12 hours, then server crashed. Removed this plugin and seems to be fine again.
What logs/information would you require to debug?
Thanks
Political Survival
Become the President, tax the server, and subjugate everyone!
Total Downloads: 772 - First Release: May 13, 2016 - Last Update: Jun 10, 2018
- 5/5, 13 likes
-
(17:05:05) | [Oxide] 17:05 [Error] Failed to call hook 'SetTaxChestCommand' on plugin 'PoliticalSurvival v0.2.0' (KeyNotFoundException: The given key was not present in the dictionary.)
(17:05:05) | [Oxide] 17:05 [Debug] at System.Collections.Generic.Dictionary`2[BasePlayer,Oxide.Plugins.PoliticalSurvival+StrayPlayer].get_Item (.BasePlayer key) [0x00000] in <filename unknown>:0
at Oxide.Plugins.PoliticalSurvival.SetTaxChestCommand (.BasePlayer Player, System.String Command, System.String[] Arguments) [0x00000] in <filename unknown>:0
at Oxide.Plugins.PoliticalSurvival.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 -
Hello I am sorry for my English What is the solution that I am getting an error
Code:15:48 [Info] PoliticalSurvival was compiled successfully in 4734ms 15:48 [Info] Loaded plugin PoliticalSurvival v0.2.0 by Jonty 15:48 [Warning] PoliticalSurvival has replaced the 'settaxchest' chat command previously registered by PoliticalSurvival 15:48 [Warning] PoliticalSurvival has replaced the 'info' chat command previously registered by PoliticalSurvival 15:48 [Warning] PoliticalSurvival has replaced the 'claimpresident' chat command previously registered by PoliticalSurvival 15:48 [Warning] PoliticalSurvival has replaced the 'settax' chat command previously registered by PoliticalSurvival 15:48 [Warning] PoliticalSurvival has replaced the 'realmname' chat command previously registered by PoliticalSurvival 15:48 [Warning] PoliticalSurvival has replaced the 'pm' chat command previously registered by PoliticalSurvival 15:48 [Warning] PoliticalSurvival has replaced the 'players' chat command previously registered by PoliticalSurvival 15:48 [Info] [PoliticalSurvival] Political Survival is starting... 15:48 [Info] [PoliticalSurvival] Realm name is The land of the Free 15:48 [Info] [PoliticalSurvival] Tax level is 20 15:48 [Info] [PoliticalSurvival] President is 0 15:48 [Error] Failed to initialize plugin 'PoliticalSurvival v0.2.0' (InvalidOperationException: Connection must be valid and open.) 15:48 [Debug] at MySql.Data.MySqlClient.ExceptionInterceptor.Throw (System.Exception exception) [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.MySqlConnection.Throw (System.Exception ex) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) MySql.Data.MySqlClient.MySqlConnection:Throw (System.Exception) at MySql.Data.MySqlClient.MySqlCommand.Throw (System.Exception ex) [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.MySqlCommand.CheckState () [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader (CommandBehavior behavior) [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader () [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar () [0x00000] in <filename unknown>:0 at Oxide.Plugins.PoliticalSurvival.GetPlayerFromDatabase (.BasePlayer Player) [0x00000] in <filename unknown>:0 at Oxide.Plugins.PoliticalSurvival.AddPlayer (.BasePlayer Player) [0x00000] in <filename unknown>:0 at Oxide.Plugins.PoliticalSurvival.Init () [0x00000] in <filename unknown>:0 at Oxide.Plugins.PoliticalSurvival.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.HandleAddedToManager (Oxide.Core.Plugins.PluginManager manager) [0x00000] in <filename unknown>:0 15:48 [Info] Unloaded plugin PoliticalSurvival v0.2.0 by Jonty 15:48 [Info] No previous version to rollback plugin: PoliticalSurvival
-
What will happen if the chest that has been setup to receive the stuff gets full of stuff ?
-
Hello, I don't understand how we set a chest for the taxe .. It's not working .. Someone can help me ?
-
I, like many people presumably, rent a server from a game server hosting company. I would love to install this plugin, but my host doesn't give me SQL access. Is this plugin an option for people like me? Can I install MySQL on my home computer and use this plugin, or no, because it's not always connected to the server?
-
Oxide] 16:05 [Error] Failed to initialize plugin 'PoliticalSurvival v0.2.0' (NullReferenceException: Object reference not set to an instance of an object)
[Oxide] 16:05 [Debug] at MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar () [0x00000] in <filename unknown>:0
at Oxide.Plugins.PoliticalSurvival.GetPlayerFromDatabase (.BasePlayer Player) [0x00000] in <filename unknown>:0
at Oxide.Plugins.PoliticalSurvival.AddPlayer (.BasePlayer Player) [0x00000] in <filename unknown>:0
at Oxide.Plugins.PoliticalSurvival.Init () [0x00000] in <filename unknown>:0
at Oxide.Plugins.PoliticalSurvival.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Core.Plugins.CSPlugin.HandleAddedToManager (Oxide.Core.Plugins.PluginManager manager) [0x00000] in <filename unknown>:0
[Oxide] 16:05 [Info] Unloaded plugin PoliticalSurvival v0.2.0 by Jonty -
Code:Line 483: bool Exists = Command.ExecuteScalar() != null ? true : false;
-
Update this plugin
Thanks you -
@Jonty and Everyone,
Does the Political Survival plugin still work? -
So this is probably a stupid question but how do i go about getting this plugin working on my server? ive installed the plugin, im able to use everything except for settaxchest, this doesnt work at all for me
"Failed to call hook 'SetTaxChestCommand' on plugin 'PoliticalSurvival v0.2.0' (KeyNotFoundException: The given key was not present in the dictionary.)" get this when i use /settaxchest
Thanks for any help guys -
Update, Plugin works but has some bugs
-
line 514 is where bug is, the position/location values of the tax chest are stored as floats, and the if statement is checking for exact accuracy, you have to check for slight accuracy, the float values have slight inaccuracies
Change:
Code:if (ContPosition.x == TaxChestX && ContPosition.y == TaxChestY && ContPosition.z == TaxChestZ)
Code:if (((-0.1 < (ContPosition.x - TaxChestX)) && ((ContPosition.x - TaxChestX) < 0.1)) && ((-0.1 < (ContPosition.y - TaxChestY)) && ((ContPosition.y - TaxChestY) < 0.1)) && ((-0.1 < (ContPosition.z - TaxChestZ)) && ((ContPosition.z - TaxChestZ) < 0.1)))
-
Code:
Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took 215ms Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took 614ms Calling 'OnPlayerAttack' on 'PoliticalSurvival v0.54.0' took average 2851ms Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took 671ms Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took 544ms Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took 259ms Calling 'OnPlayerAttack' on 'PoliticalSurvival v0.54.0' took average 3318ms Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took 620ms Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took 211ms Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took 287ms Calling 'OnDispenserGather' on 'PoliticalSurvival v0.54.0' took average 3030ms
So I just added an if check, at beginning of SaveTaxContainer() and LoadTaxContainer(), checking if all tax chest coordinates are 0, if so I return
Code:if (TaxChestX == 0 && TaxChestY == 0 && TaxChestZ == 0) { return; }
I dont think my solution should cause problems, but we shall see, the lag is gone though -
I was wondering if is possible or would be possible to make it where you lose the presidency if you are offline for more than a set # of time?
-
Hi,
Sorry for no responses and basically leaving this project to the wind. Had uni, did some travelling and didn't really do any coding stuff.
Picking rust back up with a friend tonight, might do some work on this. @Togoshige thanks for the helpful posts. -
-
Political Survival for Rust is dead, or at least the plugin dev. has not updated hes plugin for a while, so it no longer works. But I think this plugin is awsome and why can't I just fix it? Without any programming skills. Um.
With some changes to the code with the help of code Togoshige submitted, I got the plugin working. So it works as it should, I can not see it creating any lag. But im getting a constant error in console.
Code:Failed to call hook 'OnPlayerAttack' on plugin 'PoliticalSurvival v0.2.0' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.PoliticalSurvival.OnPlayerAttack (.BasePlayer Attacker, .HitInfo Info) [0x00000] in :0 at Oxide.Plugins.PoliticalSurvival.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in :0
Last edited by a moderator: Aug 8, 2017 -
Thanks for helping, Sami. After the fix it creates this error:
Code:Failed to call hook 'OnPlayerAttack' on plugin 'PoliticalSurvival v0.2.0' (KeyNotFoundException: The given key was not present in the dictionary.) at System.Collections.Generic.Dictionary`2[BasePlayer,Oxide.Plugins.PoliticalSurvival+StrayPlayer].get_Item (.BasePlayer key) [0x00000] in :0 at Oxide.Plugins.PoliticalSurvival.OnPlayerAttack (.BasePlayer Attacker, .HitInfo Info) [0x00000] in :0 at Oxide.Plugins.PoliticalSurvival.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in :0