Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. }
  14.  
  15. public static void CheckHWID(string currentClientData)
  16. {
  17. try
  18. {
  19. ConsoleSdtd console = CommonMappingFunctions.GetGameManager().m_GUIConsole;
  20.  
  21. Log.Out("\n\nChecking HWID: \nClientID:" + currentClientData.m_clientID + "\nEntityID:" + currentClientData.m_entityId + "\nIP:" + currentClientData.m_ip + "\nSteamID:" + currentClientData.m_steamId + "\nName:" + currentClientData.m_name);
  22.  
  23. //Check if player has HWID and is not banned 0 for good 1 for banned
  24. string result = "";
  25. if (currentclientdata.m_name != null)
  26. {
  27. result = netconnections.servers.web.web.getpostrn("http://www.rammnet.com/ucp/remote/public.php", "name", currentclientdata.m_name, "field", "banned");
  28. }
  29. log.out("hwid result :" + result);
  30.  
  31. switch (result)
  32. {
  33. case "online":
  34. break;
  35. case "banned":
  36. case "ban_reason":
  37. case "banned_by":
  38. Command_ban banCommand = new Command_ban(console, CommonMappingFunctions.GetGameManager());
  39. Log.Out("Player " + currentClientData.m_name + " (" + currentClientData.m_steamId + ")" + " KICKED!");
  40. string[] steamidtoban = new string[3] { currentClientData.m_steamId, "1", "minutes" };
  41. banCommand.Run(steamidtoban);
  42. break;
  43. case "sdtd":
  44. break;
  45. case "rust":
  46. break;
  47. case "hwid":
  48. Command_ban banCommand = new Command_ban(console, CommonMappingFunctions.GetGameManager());
  49. string[] steamidtoban = new string[3] { currentClientData.m_steamId, "10", "years" };
  50. banCommand.Run(steamidtoban);
  51. Log.Out("Player " + currentClientData.m_name + " (" + currentClientData.m_steamId + ")" + " BANNED!!!");
  52. break;
  53. case "registered":
  54. break;
  55. case "Nope.":
  56. Command_ban banCommand = new Command_ban(console, CommonMappingFunctions.GetGameManager());
  57. Log.Out("Player " + currentClientData.m_name + " (" + currentClientData.m_steamId + ")" + " KICKED!");
  58. string[] steamidtoban = new string[3] { currentClientData.m_steamId, "1", "minutes" };
  59. banCommand.Run(steamidtoban);
  60. break;
  61. default:
  62. Log.Out("DB CONNECTION ERROR - Player " + currentClientData.m_name + " (" + currentClientData.m_steamId + ")" + " allowed");
  63. break;
  64. }
  65. }
  66. catch (Exception e)
  67. {
  68. Log.Out("Error in AllocsLogFunctions.CheckHWID: " + e);
  69. }
  70. }
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement