shourya90

Untitled

May 10th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.01 KB | None | 0 0
  1. UNHANDLED EXCEPTION IN COMMAND reg FOR RESOURCE crazycnr
  2. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'System.Security.PermissionSet' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  3.    at MySql.Data.MySqlClient.MySqlConnection.AssertPermissions()
  4.    at MySql.Data.MySqlClient.MySqlConnection.Open()
  5.    at crazycnr.Accounts.register(Client player, String name) in Accounts.cs:line 42
  6.    --- End of inner exception stack trace ---
  7.    at object RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor)
  8.    at object System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(object obj, object[] parameters, object[] arguments)
  9.    at bool GTANetworkInternals.CommandParser.Parse(Client sender, string cmdRaw, string ourcmd, string[] args) in C:\Users\Adam\Documents\Git\comp-layer2\BootstrapperNC\Handlers\CommandHandler.cs:line 246
  10.  
  11.  
  12.  
  13.  
  14. [Command("reg")]
  15.         public void register(Client player, string name = "")
  16.         {
  17.            crazyConnection.Open();
  18.            MySqlCommand crazyCommand = crazyConnection.CreateCommand();
  19.            crazyCommand.CommandText = "INSERT INTO accounts (username, money, kills, deaths, level, xp) VALUES ('"+name+"', '0', '0', '0', '0', '0')";
  20.                                      
  21.  
  22.  
  23.  
  24.            PlayerModel playerModel = new PlayerModel();
  25.            crazyCommand.Parameters.AddWithValue(name, playerModel.username);
  26.            crazyCommand.Parameters.AddWithValue("0", playerModel.money);
  27.            crazyCommand.Parameters.AddWithValue("0", playerModel.kills);
  28.            crazyCommand.Parameters.AddWithValue("0", playerModel.deaths);
  29.            crazyCommand.Parameters.AddWithValue("0", playerModel.level);
  30.            crazyCommand.Parameters.AddWithValue("0", playerModel.xp);
  31.            crazyCommand.ExecuteNonQuery();
  32.            LoadCharacterData(player, playerModel);
  33.        
  34.         }
Add Comment
Please, Sign In to add comment