Welcome to RaGEZONE - MMORPG Development Forums (sponsored by tfn.gr) Mark forums read | View Forum Leaders
RaGEZONE - MMORPG Development Forums (sponsored by tfn.gr)

Knight Releases Discuss, [Share] Disconnect User Procedure at Knight Online forum; This is to be used with the recently released disconnect user program made by gregg. Code: alter Procedure DisconnectUsers as ...




Reply
Thread Tools
[Share] Disconnect User Procedure
 
 
Account Upgraded | Title Enabled!

Rank: Member


Reply With Quote
 
Join Date: Jun 2006
Location: in front of my computer
Posts: 277
10-24-2008, 03:57 AM
 
This is to be used with the recently released disconnect user program made by gregg.

Code:
alter Procedure DisconnectUsers
as
declare @struserid varchar(21), @old varchar(21),@count int, @count2 int
declare @row int

select @count = count(*) from knight_account.dbo.currentuser where strcharid in (select struserid from known_dupe)
while @count > 0
begin


DECLARE Backup_Cursor CURSOR FOR                                       
	SELECT distinct strcharid from knight_account.dbo.currentuser
where strcharid not in(select struserid from known_dupe)

	OPEN Backup_Cursor
	FETCH NEXT FROM Backup_Cursor INTO @strUserID

WHILE @@FETCH_STATUS = 0
BEGIN
	SELECT @row = count(*) 
	FROM USERDATA
	WHERE strUserID = @strUserID
select @count2 = count(*) from disconnect_user where userid = @struserid
	IF @row > 0
	BEGIN
	if @count2 < 1
begin
		insert into disconnect_user values (@struserid)
end
	END

	FETCH NEXT FROM Backup_Cursor INTO @strUserID
END

CLOSE Backup_Cursor
DEALLOCATE Backup_Cursor


end
You can use any table name you want instead of disconnect_user
you also may need to edit it to be customized for your server. The duper table name and whatnot. This is my contribution.
 
 
permalink
 

RaGEZONE is proudly sponsored by
 
Account Upgraded | Title Enabled!

Rank: Member


Reply With Quote
 
Join Date: Jun 2006
Location: in front of my computer
Posts: 277
10-24-2008, 03:59 AM
 
woops the procedure should be
Code:
alter Procedure DisconnectUsers
as
declare @struserid varchar(21), @old varchar(21),@count int, @count2 int
declare @row int

select @count = count(*) from knight_account.dbo.currentuser where strcharid in (select struserid from known_dupe)
while @count > 0
begin


DECLARE Backup_Cursor CURSOR FOR                                       
	SELECT distinct strcharid from knight_account.dbo.currentuser
where strcharid in (select struserid from known_dupe)

	OPEN Backup_Cursor
	FETCH NEXT FROM Backup_Cursor INTO @strUserID

WHILE @@FETCH_STATUS = 0
BEGIN
	SELECT @row = count(*) 
	FROM USERDATA
	WHERE strUserID = @strUserID
select @count2 = count(*) from disconnect_user where userid = @struserid
	IF @row > 0
	BEGIN
	if @count2 < 1
begin
		insert into disconnect_user values (@struserid)
end
	END

	FETCH NEXT FROM Backup_Cursor INTO @strUserID
END

CLOSE Backup_Cursor
DEALLOCATE Backup_Cursor


end
 
 
permalink
 

 
RaGEZONER

Rank: Omicron


Reply With Quote
 
Join Date: Jul 2008
Posts: 85
10-24-2008, 09:49 AM
 
this procedure will dc anyone thats in the disconnect_user table? so you have to manually put there names into that table or what?
 
 
permalink
 


 
KnightOnline Coder

Rank: Subscriber


Reply With Quote
 
Join Date: Dec 2006
Posts: 266
10-26-2008, 11:13 AM
 
Code:
	if @count2 < 1
begin
		insert into disconnect_user values (@struserid)
end
 
 
permalink
 

 
Account Upgraded | Title Enabled!

Rank: Member


Reply With Quote
 
Join Date: Jun 2006
Location: in front of my computer
Posts: 277
10-28-2008, 01:19 AM
 
why did you quote that?
 
 
permalink
 

 
Banned

Status: Banned


Reply With Quote
 
Join Date: Oct 2008
Posts: 9
11-01-2008, 03:42 AM
 
Quote: Originally Posted by spamman View Post
why did you quote that?
He quotes shit because he's unable to code shit himself.
 
 
permalink
 

 
Account Upgraded | Title Enabled!

Rank: Member


Reply With Quote
 
Join Date: Jun 2006
Location: in front of my computer
Posts: 277
11-01-2008, 04:56 AM
 
uh ok, thank you for the spam, But i explained what this procedure does.
 
 
permalink
 

 
Newbie

Rank: Omicron


Reply With Quote
 
Join Date: Oct 2008
Posts: 18
11-01-2008, 09:28 AM
 
.. ouch
 
 
permalink
 

 
Ultimate Member

Rank: New Blood


Reply With Quote
 
Join Date: May 2007
Posts: 159
11-09-2008, 08:23 AM
 
Should actually be CREATE PROCEDURE, instead of ALTER PROCEDURE, as they won't have the procedure to ALTER in the first place.
 
 
permalink
 

Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 11:55 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RaGEZONE © 2001 - 2008





 
Evade Blackbelt School