- Joined
- Dec 19, 2014
- Messages
- 1,448
- Reaction score
- 7,404
thank you for code
it is generating a new ID for each new login from the same user
![]()
help-me please
....
Alter all for this
To view the content, you need to sign in or register
To view the content, you need to sign in or registerHelp me
![]()
lol
Why bother? These guys that msg like that are not fit to dev a game, or even call themselves developers.
i will update my signature now for the fun of it.
Tutorial for Hardware ID Ban by Yuri-BR
Solution RSUpdate > WOLoginHelper.cpp
Search for:PHP:#include "SteamHelper.h"
Add:PHP:#include "HWInfo.h"
Search for:PHP:SaveUserName();
Add:PHP:LoadComputerToken();
Search for:PHP:req.AddParam("password", passwd);
Add:PHP:req.AddParam("computerid", hardwareid);
Search for:PHP:bool CLoginHelper::LoadUserName() { // query for game registry node HKEY hKey; int hr; hr = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Arktos Entertainment Group\\WarZ", 0, KEY_ALL_ACCESS, &hKey); if(hr != ERROR_SUCCESS) return true; DWORD size = sizeof(username); hr = RegQueryValueEx(hKey, "username", NULL, NULL, (BYTE*)username, &size); RegCloseKey(hKey); return true; }
Add:PHP:bool CLoginHelper::LoadComputerToken(){ HKEY hKey; int hr; hr = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\House of Warrior Interactive\\WarZ", 0, KEY_ALL_ACCESS, &hKey); if(hr != ERROR_SUCCESS) { CreateComputerToken(); return true; } DWORD size = sizeof(hardwareid); hr = RegQueryValueEx(hKey, "hardwareid", NULL, NULL, (BYTE*)hardwareid, &size); RegCloseKey(hKey); return true; } void CLoginHelper::CreateComputerToken() { HKEY hKey; int hr; hr = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\House of Warrior Interactive\\WarZ", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL); if(hr == ERROR_SUCCESS) { CHWInfo g_HardwareInfo; g_HardwareInfo.Grab(); sprintf(hardwareid, "0x%I64x", g_HardwareInfo.uniqueId); // Hardware ID By Yuri-BR DWORD size = strlen(hardwareid) + 1; hr = RegSetValueEx(hKey, "hardwareid", NULL, REG_SZ, (BYTE*)hardwareid, size); RegCloseKey(hKey); } }
WOLoginHelper.h
Search for:PHP:char passwd[128];
Add:PHP:char hardwareid[50];
Search for:PHP:bool LoadUserName();
Add:PHP:bool LoadComputerToken(); void CreateComputerToken();
Solution WZBackend-ASP.NET > api_login.aspx.cs
Search for:PHP:string password = web.Param("password");
Add:PHP:string computerid = web.Param("computerid");
Search for:PHP:sqcmd.Parameters.AddWithValue("@in_Password", password);
Add:PHP:sqcmd.Parameters.AddWithValue("@in_HardwareID", computerid);
SQL Server 2008 > Run this script in the database
HWID_LogPHP:USE [WarZ] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[HWID_Log]( [id] [int] IDENTITY(1,1) NOT NULL, [CustomerID] [int] NOT NULL, [ip] [nvarchar](50) NOT NULL, [HardwareID] [nvarchar](50) NOT NULL, [time] [datetime] NOT NULL, CONSTRAINT [PK_LoginLog] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO
HWID_BanPHP:USE [WarZ] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[HWID_Ban]( [HardwareID] [nvarchar](50) NOT NULL, [Reason] [nvarchar](200) NOT NULL, CONSTRAINT [PK_MacBan] PRIMARY KEY CLUSTERED ( [HardwareID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO
Navicat > WarZ > dbo > function > WZ_ACCOUNT_LOGIN
Search for:PHP:@in_EMail varchar(100),
Add:PHP:@in_HardwareID varchar(50),
Search for:PHP:exec WZ_ACCOUNT_LOGIN_EXEC @in_IP,
Add:PHP:@in_HardwareID,
WZ_ACCOUNT_LOGIN_EXEC
Search for:PHP:@in_IP varchar(100),
Add:PHP:@in_HardwareID varchar(50),
Search for:PHP:-- check if game is still active or 90sec passed from last update (COPYPASTE_GAMECHECK, search for others) if(@GameServerId > 0 and DATEDIFF(second, [USER=1333422059]LASTGAME[/USER]date, GETDATE()) < 90) begin select 0 as LoginResult, [USER=25895]Custom[/USER]erID as CustomerID, 70 as AccountStatus, -- game still active code 0 as SessionID, 0 as IsDeveloper return end
Add:PHP:-- Ban por Hardware ID by Yuri-BR IF (EXISTS(SELECT * FROM HWID_Ban WHERE HardwareID = @in_HardwareID)) BEGIN select 3 as LoginResult, [USER=25895]Custom[/USER]erID as CustomerID, 200 as AccountStatus, 0 as SessionID, 0 as IsDeveloper return END
Search for:PHP:INSERT INTO Logins (CustomerID, LoginTime, IP, LoginSource) VALUES [USER=25895]Custom[/USER]erID, GETDATE(), @in_IP, 0)
Add:PHP:-- Insert to HWID_Log --if @in_HardwareID != '' --begin INSERT INTO HWID_Log (CustomerID, ip, HardwareID, time) VALUES [USER=25895]Custom[/USER]erID,@in_IP,@in_HardwareID,GETDATE()) --end
Add message for Ban Hardware ID and Fix
LauncherConfig.cpp
Search for:PHP:accountBannedMessage = r3dReadCFG_S(configFile, group, "accountBannedMessage", "Your account has been permanently banned");
Add:PHP:accountHWBannedMessage = r3dReadCFG_S(configFile, group, "accountHWBannedMessage", "Your account has been banned by HardwareID");
LauncherConfig.h
Search for:PHP:std::string accountBannedMessage;
Add:PHP:std::string accountHWBannedMessage;
In Updater.cpp
Search for:PHP:case CLoginHelper::ANS_Banned: loginErrMsg_ = "Your account has been permanently banned"; MessageBox(NULL, gLauncherConfig.accountBannedMessage.c_str(), "Login", MB_OK | MB_ICONSTOP); break;
Add:PHP:case CLoginHelper::ANS_HWBanned: loginErrMsg_ = "Your account has been banned by Hardware ID"; MessageBox(NULL, gLauncherConfig.accountHWBannedMessage.c_str(), "Login", MB_OK | MB_ICONSTOP); break;
WOLoginHelper.cpp
Search for:PHP:else if(AccountStatus == 201) loginAnswerCode = ANS_Frozen;
Add:PHP:else if(AccountStatus == 202) loginAnswerCode = ANS_HWBanned;
WOLoginHelper.h // Thanks for reminding me @DNC
Search for:PHP:ANS_Banned,
Add:PHP:ANS_HWBanned,
Navicat > WarZ > dbo > function > WZ_ACCOUNT_LOGIN_EXEC
Search for:PHP:if [USER=1333383561]Accounts[/USER]tatus >= 200) begin select 3 as LoginResult, [USER=25895]Custom[/USER]erID as CustomerID, [USER=1333383561]Accounts[/USER]tatus as AccountStatus, 0 as SessionID, 0 as IsDeveloper return end
Add:PHP:if [USER=1333383561]Accounts[/USER]tatus >= 202) begin select 3 as LoginResult, [USER=25895]Custom[/USER]erID as CustomerID, [USER=1333383561]Accounts[/USER]tatus as AccountStatus, 0 as SessionID, 0 as IsDeveloper return end
Search for:PHP:-- Ban por Hardware ID by Yuri-BR IF (EXISTS(SELECT * FROM HWID_Ban WHERE HardwareID = @in_HardwareID)) BEGIN select 3 as LoginResult, [USER=25895]Custom[/USER]erID as CustomerID, 200 as AccountStatus, 0 as SessionID, 0 as IsDeveloper return END
Replace for:PHP:-- Ban por Hardware ID by Yuri-BR IF (EXISTS(SELECT * FROM HWID_Ban WHERE HardwareID = @in_HardwareID)) BEGIN update UsersData set AccountStatus=202 WHERE CustomerID [USER=25895]Custom[/USER]erID select 3 as LoginResult, [USER=25895]Custom[/USER]erID as CustomerID, 202 as AccountStatus, 0 as SessionID, 0 as IsDeveloper return END
To ban a player, you need to add the Hardware id of player in table HWID_Ban