Check
Code:
-- ----------------------------
-- Procedure structure for [WZ_SRV_UserJoinedGame]
-- ----------------------------
ALTER PROCEDURE [dbo].[WZ_SRV_UserJoinedGame]
@in_CustomerID int,
@in_CharID int,
@in_GameMapId int,
@in_GameServerId bigint,
@in_GamePos varchar(256)
AS
BEGIN
SET NOCOUNT ON;
-- store current user server location
update UsersData set
lastgamedate=GETDATE(),
GameServerId=@in_GameServerId
where CustomerID=@in_CustomerID
-- per char info
update UsersChars set
GameMapId=@in_GameMapId,
GameServerId=@in_GameServerId
where CharID=@in_CharID
update Accounts Set
Online = 1
WHERE CustomerID=@in_CustomerID
-- we're done
select 0 as ResultCode
END
Code:
-- ----------------------------
-- Procedure structure for [WZ_SRV_UserJoinedGame2]
-- ----------------------------
ALTER PROCEDURE [dbo].[WZ_SRV_UserJoinedGame2]
@in_CustomerID int,
@in_CharID int,
@in_GameMapId int,
@in_GameServerId bigint
AS
BEGIN
SET NOCOUNT ON;
-- check if game is still active or 90sec passed from last update (COPYPASTE_GAMECHECK, search for others)
declare @lastgamedate datetime
declare @Online int
declare @GameServerId int
select @GameServerId=GameServerId, @lastgamedate=lastgamedate from UsersData where CustomerID=@in_CustomerID
select @Online = Online FRom Accounts where CustomerID=@in_CustomerID
if(@GameServerId > 0 and @Online > 0) begin
select 7 as ResultCode, 'game still active' as ResultMsg
return
end
-- store current user server location
update UsersData set
lastgamedate=GETDATE(),
GameServerId=@in_GameServerId
where CustomerID=@in_CustomerID
-- per char info
update UsersChars set
GameMapId=@in_GameMapId,
GameServerId=@in_GameServerId
where CharID=@in_CharID
update Accounts set
Online = 1
WHERE CustomerID= @in_CustomerID
-- we're done
select 0 as ResultCode
END