Pages

Limit New Character Ran Online

[Guide]How to limit new character (RIP Extreme Server)
Well, as i know, in RIP Extreme Server, there are no limit for us to add new character, i mean using new character card, that was what i thought. But the owner had clarify :

 Originally Posted by geger009
the truth is..it has a limit..base on source code the limit is 16 for one account..
Still, if you want to limit it again, so user can only have a few number of character under 1 account, you can exec this query :

PHP Code:


USE [RanUserGO /****** Object:  StoredProcedure [dbo].[UpdateChaNumIncrease]    Script Date: 10/26/2012 03:29:39 ******/ 
/* 
edited by akuila 
*/ 
SET ANSI_NULLS ON 
GO 
SET QUOTED_IDENTIFIER ON 
GO 

ALTER PROCEDURE 
[dbo].[UpdateChaNumIncrease
    @
nUserNum int
    @
nReturn int OUTPUT AS     
    DECLARE 
        @
error_var int,  
        @
rowcount_var int
        @
curchar    int
        @
remain    int 
         
    SET NOCOUNT ON 
     
    SET 
@nReturn 
     
    select 
@curchar COUNT(1from RanGame1.dbo.ChaInfo where UserNum = @nUserNum and ChaDeleted 
    select 
@remain ChaRemain from UserInfo where UserNum = @nUserNum 
     
    
if(@curchar + @remain <= 12) -- change the number 12 to your maximum character allowed in 1 account 
    begin 
        UPDATE UserInfo 
        SET ChaRemain
=ChaRemain+
        WHERE UserNum
=@nUserNum     
         
        SELECT 
@error_var = @@ERROR, @rowcount_var = @@ROWCOUNT     
        
IF @error_var <> OR @rowcount_var 
        BEGIN 
               SET 
@nReturn = -
            SET NOCOUNT OFF 
            
RETURN @nReturn 
        END 
        
ELSE 
        
BEGIN 
               SET 
@nReturn 
            SET NOCOUNT OFF 
            
RETURN @nReturn 
        END 

    end 
     
    
-- this parti was trying to give a warning to user that they already have a maximum number of allowed character but not workingyou can remove it if you want
    -- 
well, if somebody know about thisplease tell me :) 
     
    else  
    
begin 
        SET 
@nReturn = -
        SET NOCOUNT OFF 
        
RETURN @nReturn 
    end  
note : change the number 12 to your maximum character allowed in 1 account
on this point, i believe you know what to do, right ?

known bugs :
- there are no error message to user in game when they already reached the maximum number of allowed character, so the new character card will always useable but will not increased the ChaRemain.

akuila
Ragezone