Ooooh, it's a long story... =) OK.
Before i've found this disconnect bug, people on my serv. told me, that they can't enter in game (already connected after exit). When they exited, character still remained in game i could see him, but couldn't disconnect him in any way. MEMB_STAT table show value "1". When i changed this value to "0" it not helped. Still got "you are already connected". Only server restart helped me. So, on my serv were about 7 restarts per day :pinch:
Here on ragezone i've found the guide about solving this problem. They said the problem was in stored procedures. I've changed my stored procedures, but... nothing. Still the same problem occured...
So, i reinstalled Windows, and restored default procedures back. After that, one man had "you are already connected" problem again. But in another way. I couldn't see his character in game. He was "online" only due to "1" value in MEMB_STAT table. And when i changed "1" to "0", man could enter in game! So THIS was problem with stored procedure. I've changed default procedures again and now we are happy! :strip:
If you haven't this problem, don't change stored procedures :)
So, we can write a little guide now =)
1. If you have red alert in CS and your players can't normally quit game, if they got disconnect and after disconnect can't login (you are already connected), uninstall SP2 or reinstall Windows and DO NOT update it. For Windows 2000 it seems, that buggy is SP4.
2. To avoid database disconnect problem, change stored procedures to these:
Connect
Code:
CREATE PROCEDURE WZ_CONNECT_MEMB
@memb___id varchar(10),
@ServerName varchar(50),
@IP varchar(20)
AS
Begin
set nocount on
Declare @find_id varchar(10)
Declare @ConnectStat tinyint
Set @find_id = 'NOT'
Set @ConnectStat = 1
select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
where I.memb___id = @memb___id
if( @find_id = 'NOT' )
begin
insert into MEMB_STAT (memb___id,ConnectStat,ServerName,IP,ConnectTM)
values(@memb___id, @ConnectStat, @ServerName, @IP, getdate())
end
else
update MEMB_STAT set ConnectStat = @ConnectStat,
ServerName = @ServerName,IP = @IP,
ConnectTM = getdate()
where memb___id = @memb___id
end
GO
Disconnect
Code:
CREATE PROCEDURE WZ_DISCONNECT_MEMB
@memb___id varchar(10)
AS
Begin
set nocount on
Declare @find_id varchar(10)
Declare @ConnectStat tinyint
Set @ConnectStat = 0
Set @find_id = 'NOT'
select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
where I.memb___id = @memb___id
if( @find_id <> 'NOT' )
begin
update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate()
where memb___id = @memb___id
end
end
GO
Tested on 1.02K.
It would be very nice to know, which one Windows update creates this bug. Only SP2 (SP4)? Or maybe no? This is interesting, because Windows without updates really sucks. I can't install Framework and other usable apps and security of unupdated Windows sucks too... =/
Note. Another topic about SP2 problem: http://forum.ragezone.com/f196/guide...-error-274467/
But i think that better is to reinstall Windows ;)