Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

Experienced Elementalist
Joined
Jun 5, 2013
Messages
256
Reaction score
163
Hello ! RageZone !

I'll show you how to remove the blocking of your account on the source as DooMv3 & ISS Untouched

Open RSUpdate.sln:

And Go Updater.cpp:
Code:
case CLoginHelper::ANS_SecurityLock:
      {
        loginErrMsg_ = "Your account is locked";
        MessageBox(NULL, "Account was locked due to suspicious activity.\n\nPlease check your email for instructions on how to unlock it or you can reset password, that will also unlock your account.", "Login", MB_OK | MB_ICONEXCLAMATION);
        break;
      }

Replace for:
Code:
[COLOR=#006400]/*case CLoginHelper::ANS_SecurityLock:[/COLOR]
[COLOR=#006400]      {[/COLOR]
[COLOR=#006400]        loginErrMsg_ = "Your account is locked";[/COLOR]
[COLOR=#006400]        MessageBox(NULL, "Account was locked due to suspicious activity.\n\nPlease check your email for instructions on how to unlock it or you can reset password, that will also unlock your account.", "Login", MB_OK | MB_ICONEXCLAMATION);[/COLOR]
[COLOR=#006400]        break;[/COLOR]
[COLOR=#006400]      } */[/COLOR]

Go WOLoginHelper.cpp:
Search:
Code:
else if(AccountStatus == 102)
        loginAnswerCode = ANS_SecurityLock;

Replace for:
Code:
[COLOR=#006400]/*else if(AccountStatus == 102)[/COLOR]
[COLOR=#006400]        loginAnswerCode = ANS_SecurityLock;*/[/COLOR]

And Search:
Code:
ANS_SecurityLock,

Replace for:
Code:
[COLOR=#006400]//ANS_SecurityLock,[/COLOR]

And Rebuil Release ! (Do not forget to change the update of your launcher before Rebuild)
--------------------------------------------------------------------------------------------------------------------------------------

Go Database:
Go in WZ_ACCOUNT_SecurityCheckForLock in function !

Replace all code for:
Code:
ALTER PROCEDURE [dbo].[WZ_ACCOUNT_SecurityCheckForLock]    @in_CustomerID int,
    @in_IP varchar(100),
    @in_Country varchar(50),
    @[I][B][URL="http://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]_NeedLock int out
AS
BEGIN
    SET NOCOUNT ON;


    -- this procedure is local to SQL
    -- select 0 as ResultCode


    -- account is fine by default
    set @[I][B][URL="http://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]_NeedLock = 0
    
    -- get last login info
    declare @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP varchar(32)
    declare @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginCountry varchar(32) = ''
    select @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP=lastloginIP, @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginCountry=lastloginCountry from Accounts where CustomerID=@in_CustomerID


    -- decouple IPs
    declare @ip1 varchar(32)    -- last login ip 'X.y.z.w'
    declare @ip2 varchar(32)    -- last login ip 'x.Y.z.w'
    declare @ip3 varchar(32)    -- last login ip 'x.y.Z.w'
    declare @ip4 varchar(32)    -- last login ip 'x.y.z.W'
    declare @ip5 varchar(32)    -- same for @in_IP
    declare @ip6 varchar(32)
    declare @ip7 varchar(32)
    declare @ip8 varchar(32)
    declare @n1 int
    declare @n2 int
    declare @n3 int


    set @n1  = charindex('.', @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP)
    set @ip1 = substring @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP, 1, @n1 - 1)
    set @n2  = charindex('.', @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP, @n1 + 1)
    set @ip2 = substring @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP, @n1 + 1, @n2 - 1 - @n1)
    set @n3  = charindex('.', @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP, @n2 + 1)
    set @ip3 = substring @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP, @n2 + 1, @n3 - 1 - @n2)
    set @ip4 = substring @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP, @n3 + 1, 999)


    set @n1  = charindex('.', @in_IP)
    set @ip5 = substring(@in_IP, 1, @n1 - 1)
    set @n2  = charindex('.', @in_IP, @n1 + 1)
    set @ip6 = substring(@in_IP, @n1 + 1, @n2 - 1 - @n1)
    set @n3  = charindex('.', @in_IP, @n2 + 1)
    set @ip7 = substring(@in_IP, @n2 + 1, @n3 - 1 - @n2)
    set @ip8 = substring(@in_IP, @n3 + 1, 999)


    declare @[I][B][URL="http://forum.ragezone.com/members/845253.html"]Network[/URL][/B][/I] varchar(32) = @ip5 + '.' + @ip6


    -- do not lock if we have that IP whitelisted
    if exists (select CustomerID from AccountIpWhitelist where CustomerID=@in_CustomerID and IP @[I][B][URL="http://forum.ragezone.com/members/845253.html"]Network[/URL][/B][/I]) begin
        return
    end
    
    -- lock if country changed
    if @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginCountry <> '' and @in_Country <> '' and @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginCountry <> @in_Country)
    begin
        set @[I][B][URL="http://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]_NeedLock = 1
        exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
        return
    end
    
    -- lock if first 2 octets is changed
    if(@ip1 <> @ip5 or @ip2 <> @ip6) 
    begin
        -- special case - we ignore first login attempt if password was reset and add that network to whitelist
        if @[I][B][URL="http://forum.ragezone.com/members/2000122825.html"]last[/URL][/B][/I]loginIP = '0.0.0.0')
        begin
            insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(), @[I][B][URL="http://forum.ragezone.com/members/845253.html"]Network[/URL][/B][/I], @in_Country)
            return
        end


        -- ip changed, block
        set @[I][B][URL="http://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]_NeedLock = 0
        exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
        return
    end
    
    -- for first time logins - if there was no whitelist entries - add current IP there
    declare @NumEntries int = 0
    select @NumEntries=COUNT(*) from AccountIpWhitelist where CustomerID=@in_CustomerID
    if(@NumEntries = 0) begin
        insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(), @[I][B][URL="http://forum.ragezone.com/members/845253.html"]Network[/URL][/B][/I], @in_Country)
    end


    return
END

And delete:
WZ_ACCOUNT_SecurityLock And WZ_ACCOUNT_SecurityUnlock function !

Credit: Me !
And Save all your changes


The tutorial is finished! You know how to remove the account lock!

 
Junior Spellweaver
Joined
Oct 20, 2014
Messages
146
Reaction score
14
why ppl need to remove the unlock ? this is security for fakemails , isnt it ?
 
Newbie Spellweaver
Joined
Oct 24, 2013
Messages
15
Reaction score
1
i try this WZ_ACCOUNT_SecurityCheckForLock in function !

ALTER PROCEDURE [dbo].[WZ_ACCOUNT_SecurityCheckForLock] @in_CustomerID int,
@in_IP varchar(100),
@in_Country varchar(50),
@Out_NeedLock int out
AS
BEGIN
SET NOCOUNT ON;




-- this procedure is local to SQL
-- select 0 as ResultCode




-- account is fine by default
set @Out_NeedLock = 0

-- get last login info
declare @lastloginCountry varchar(32) = ''
select @lastloginCountry=lastloginCountry from Accounts where CustomerID=@in_CustomerID




-- decouple IPs
declare @ip1 varchar(32) -- last login ip 'X.y.z.w'
declare @ip2 varchar(32) -- last login ip 'x.Y.z.w'
declare @ip3 varchar(32) -- last login ip 'x.y.Z.w'
declare @ip4 varchar(32) -- last login ip 'x.y.z.W'
declare @ip5 varchar(32) -- same for @in_IP
declare @ip6 varchar(32)
declare @ip7 varchar(32)
declare @ip8 varchar(32)
declare @n1 int
declare @n2 int
declare @n3 int





set @n1 = charindex('.', @in_IP)
set @ip5 = substring(@in_IP, 1, @n1 - 1)
set @n2 = charindex('.', @in_IP, @n1 + 1)
set @ip6 = substring(@in_IP, @n1 + 1, @n2 - 1 - @n1)
set @n3 = charindex('.', @in_IP, @n2 + 1)
set @ip7 = substring(@in_IP, @n2 + 1, @n3 - 1 - @n2)
set @ip8 = substring(@in_IP, @n3 + 1, 999)




declare @Network varchar(32) = @ip5 + '.' + @ip6




-- do not lock if we have that IP whitelisted
if exists (select CustomerID from AccountIpWhitelist where CustomerID=@in_CustomerID ) begin
return
end

-- lock if country changed
if (@lastloginCountry <> '' and @in_Country <> '' and @lastloginCountry <> @in_Country)
begin
set @Out_NeedLock = 1
exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
return
end

-- lock if first 2 octets is changed
if(@ip1 <> @ip5 or @ip2 <> @ip6)
begin
-- special case - we ignore first login attempt if password was reset and add that network to whitelist
begin
insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(), @Network, @in_Country)
return
end




-- ip changed, block
set @Out_NeedLock = 0
exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
return
end

-- for first time logins - if there was no whitelist entries - add current IP there
declare @NumEntries int = 0
select @NumEntries=COUNT(*) from AccountIpWhitelist where CustomerID=@in_CustomerID
if(@NumEntries = 0) begin
insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(), @Network, @in_Country)
end




return
END


withou error save function what do i right ?
 
Experienced Elementalist
Joined
Jun 5, 2013
Messages
256
Reaction score
163
Re: [Tutorial] Disable the account lock | DooMV3 &amp; Untouched I:SS

Search:
Code:
[B][I]-- ip changed, block[/I][/B]
Bellow:
Code:
[B][I]set @[I][B][URL="http://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]_NeedLock = 1[/I][/B]
Set:
Code:
[B][I]set @[I][B][URL="http://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]_NeedLock = 0[/I][/B]



why ppl need to remove the unlock ? this is security for fakemails , isnt it ?
Followed the tutorial, that his works best!
 
Newbie Spellweaver
Joined
Aug 1, 2016
Messages
12
Reaction score
1
Re: [Tutorial] Disable the account lock | DooMV3 &amp; Untouched I:SS

This works in Untouched Source V3?
I can not change the WZ_ACCOUNT_SecurityCheckForLock
 
Newbie Spellweaver
Joined
Apr 14, 2013
Messages
36
Reaction score
8
Re: [Tutorial] Disable the account lock | DooMV3 &amp; Untouched I:SS

Search:
Code:
[B][I]-- ip changed, block[/I][/B]
Bellow:
Code:
[B][I]set @[I][B][URL="http://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]_NeedLock = 1[/I][/B]
Set:
Code:
[B][I]set @[I][B][URL="http://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]_NeedLock = 0[/I][/B]




Followed the tutorial, that his works best!

Work it :)
 
Newbie Spellweaver
Joined
Apr 2, 2012
Messages
94
Reaction score
26
try
Code:
USE [Warz]
GO

/****** Object:  StoredProcedure [dbo].[WZ_ACCOUNT_SecurityCheckForLock]    Script Date: 12/08/2016 09:14:31 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WZ_ACCOUNT_SecurityCheckForLock]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WZ_ACCOUNT_SecurityCheckForLock]
GO

USE [Warz]
GO

/****** Object:  StoredProcedure [dbo].[WZ_ACCOUNT_SecurityCheckForLock]    Script Date: 12/08/2016 09:14:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[WZ_ACCOUNT_SecurityCheckForLock]
@in_CustomerID int,
@in_IP varchar(100),
@in_Country varchar(50),
  [USER=1333447295]Out[/USER]_NeedLock int out
AS
BEGIN

SET NOCOUNT ON;

-- this procedure is local to SQL
-- select 0 as ResultCode

-- account is fine by default
set  [USER=1333447295]Out[/USER]_NeedLock = 0

-- get last login info
declare  [USER=2000122825]last[/USER]loginCountry varchar(32) = ''
select  [USER=2000122825]last[/USER]loginCountry=lastloginCountry from Accounts where CustomerID=@in_CustomerID

-- decouple IPs
declare @ip1 varchar(32) -- last login ip 'X.y.z.w'
declare @ip2 varchar(32) -- last login ip 'x.Y.z.w'
declare @ip3 varchar(32) -- last login ip 'x.y.Z.w'
declare @ip4 varchar(32) -- last login ip 'x.y.z.W'
declare @ip5 varchar(32) -- same for @in_IP
declare @ip6 varchar(32)
declare @ip7 varchar(32)
declare @ip8 varchar(32)
declare @n1 int
declare @n2 int
declare @n3 int

set @n1 = charindex('.', @in_IP)
set @ip5 = substring(@in_IP, 1, @n1 - 1)
set @n2 = charindex('.', @in_IP, @n1 + 1)
set @ip6 = substring(@in_IP, @n1 + 1, @n2 - 1 - @n1)
set @n3 = charindex('.', @in_IP, @n2 + 1)
set @ip7 = substring(@in_IP, @n2 + 1, @n3 - 1 - @n2)
set @ip8 = substring(@in_IP, @n3 + 1, 999)

declare  [USER=845253]Network[/USER] varchar(32) = @ip5 + '.' + @ip6

-- do not lock if we have that IP whitelisted
if exists (select CustomerID from AccountIpWhitelist where CustomerID=@in_CustomerID ) begin
return
end

-- lock if country changed
if   [USER=2000122825]last[/USER]loginCountry <> '' and @in_Country <> '' and  [USER=2000122825]last[/USER]loginCountry <> @in_Country)
begin
set  [USER=1333447295]Out[/USER]_NeedLock = 1
exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
return
end

-- lock if first 2 octets is changed
if(@ip1 <> @ip5 or @ip2 <> @ip6) 
begin
-- special case - we ignore first login attempt if password was reset and add that network to whitelist
begin
insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(),  [USER=845253]Network[/USER], @in_Country)
return
end

-- ip changed, block
set  [USER=1333447295]Out[/USER]_NeedLock = 0
exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
return
end

-- for first time logins - if there was no whitelist entries - add current IP there
declare @NumEntries int = 0
select @NumEntries=COUNT(*) from AccountIpWhitelist where CustomerID=@in_CustomerID
if(@NumEntries = 0) begin
insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(),  [USER=845253]Network[/USER], @in_Country)
end

return
END

GO
Code:
USE
Warz
GO
UPDATE [Warz].[dbo].[Accounts]
   SET [AccountStatus] = 100
 
GO
USE
Warz
GO
UPDATE [Warz].[dbo].[UsersData]
   SET [AccountStatus] = 100
GO
 
Last edited:
Back
Top