当前位置 >> 网站首页 >> 第5步修复记录在线账号

第5步修复记录在线账号

更新时间:2019-6-29 文章作者:363信息网 浏览次数:5

 

--//**********************************
--//** 登陆存储过程(将此文件所有内容覆盖到WZ_CONNECT_MEMB存储过程)
--//********************************
CREATE    PROCEDURE WZ_CONNECT_MEMB
@uid varchar(10),
@server varchar(20),
@uip varchar(20)
AS

Begin

BEGIN TRANSACTION

SET NOCOUNT ON

IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED) WHERE memb___id = @uid )
Begin
    UPDATE MEMB_STAT
        SET ip = @uip , connectstat = 1 , servername = @server , ConnectTM = (getdate())
        WHERE memb___id = @uid
End
ELSE
Begin
    INSERT INTO MEMB_STAT ( memb___id,ip,connectstat,servername)
        valueS (@uid,@uip,1,@server )
End
IF(@@Error <> 0 )
    ROLLBACK TRANSACTION
ELSE
    COMMIT TRANSACTION

--写入登录记录
IF EXISTS ( SELECT UserID FROM UserLogin WITH (READUNCOMMITTED) WHERE UserID = @uid )
Begin
    UPDATE UserLogin
        SET LoginIP=@uip,Server=@server,LoginTM = (getdate()),OnlineSec=0,GiveMoney=0,logoutTM=null
        WHERE UserID = @uid
End
ELSE
Begin
    INSERT INTO UserLogin (UserID,LoginIP,Server,LoginTM,OnlineSec,GiveMoney)
        values (@uid,@uip,@server,getdate(),0,0)
End
--自动封服务器不准进入的人物
declare @SmallestZS int
declare @LargestZS int
declare @Type int
select @Type=Type from SetServerList where ServerName=@server

if (@Type>0) begin

    select @SmallestZS=Smallest_ZS from SetServerList where ServerName=@server
    select @LargestZS=Largest_ZS from SetServerList where ServerName=@server

    if not (@SmallestZS is null) begin
    update character set ctlcode=(ctlcode | 0x81) where [name] not in
    (
        SELECT NAME FROM WEB_ZS WHERE (ACC = @uid) AND (ZSCS >= @LargestZS) AND (ZSCS <= @SmallestZS)
     ) AND (AccountID = @uid)
    end
end
DELETE FROM MEMB_STAT_GJ WHERE (memb___id = @uid  and servername=@server)
update character set ctlcode=(ctlcode | 0x81) where [name]  in
(
SELECT name FROM MEMB_STAT_GJ WHERE (memb___id = @uid)
) AND (AccountID = @uid)

-- 把卡在线的玩家T下线
Declare @Map int
Select @Map=MapNumber from Character Where AccountID = @uid
if (@Map=30)
begin
    UPDATE [MEMB_STAT] Set ConnectStat=0 where memb___id=@uid
end
else
if (@Map=31)
begin
    UPDATE [MEMB_STAT] Set ConnectStat=0 where memb___id=@uid
end
else
if (@Map=34)
begin
    UPDATE [MEMB_STAT] Set ConnectStat=0 where memb___id=@uid
end
-- 把卡在罗兰的帐号移动回勇者大陆
UPDATE [Character] SET MapNumber = 0, MapPosX = 130, MapPosY = 130 WHERE (MapNumber = 30) AND (AccountID = @uid) OR (MapNumber = 31) AND (AccountID = @uid) OR (MapNumber = 32) AND (AccountID = @uid) OR (MapNumber = 34) AND (AccountID = @uid) OR (MapNumber = 9) AND (AccountID = @uid) OR (MapNumber = 10) AND (AccountID = @uid) OR (MapNumber = 11) AND (AccountID = @uid) OR (MapNumber = 12) AND (AccountID = @uid) OR (MapNumber = 13) AND (AccountID = @uid) OR (MapNumber = 14) AND (AccountID = @uid) OR (MapNumber = 15) AND (AccountID = @uid) OR (MapNumber = 16) AND (AccountID = @uid) OR (MapNumber = 17) AND (AccountID = @uid) OR (MapNumber = 18) AND (AccountID = @uid) OR (MapNumber = 19) AND (AccountID = @uid) OR (MapNumber = 20) AND (AccountID = @uid) OR (MapNumber = 21) AND (AccountID = @uid) OR (MapNumber = 22) AND (AccountID = @uid) OR (MapNumber = 23) AND (AccountID = @uid) OR (MapNumber = 52) AND (AccountID = @uid) OR (MapNumber = 53) AND (AccountID = @uid)


SET NOCOUNT OFF
End
GO

------该资料由 363信息网 www.gw363.com 整理发布!