124 lines
2.9 KiB
Transact-SQL
124 lines
2.9 KiB
Transact-SQL
USE [LosaGame]
|
|
GO
|
|
|
|
/****** Object: StoredProcedure [dbo].[game_game_save] Script Date: 2017-12-07 오후 6:59:20 ******/
|
|
DROP PROCEDURE [dbo].[game_game_save]
|
|
GO
|
|
|
|
/****** Object: StoredProcedure [dbo].[game_game_save] Script Date: 2017-12-07 오후 6:59:20 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
|
|
|
|
--IF OBJECT_ID('dbo.game_practice_get_list','P') IS NOT NULL
|
|
--
|
|
-- DROP PROC dbo.game_practice_get_list
|
|
--
|
|
--GO
|
|
|
|
-- =============================================
|
|
-- Subject : dbo.game_practice_get_list
|
|
-- DBA :
|
|
-- DATE : 2014-03-03
|
|
-- Description : 훈련하기 데이터
|
|
-- =============================================
|
|
|
|
Create PROCEDURE [dbo].[game_game_save]
|
|
(
|
|
@accountIDX int
|
|
, @userState int
|
|
, @gameMoney bigint
|
|
, @conn_count int
|
|
, @connDate datetime
|
|
, @userLevel int
|
|
, @userEXP int
|
|
, @playTime int
|
|
, @regionType int
|
|
, @userFishingLevel int
|
|
, @userFishingEXP int
|
|
, @refillData int
|
|
, @userExcavationLevel int
|
|
, @userExcavationEXP int
|
|
, @init_time int
|
|
)
|
|
As
|
|
|
|
SET NOCOUNT ON
|
|
|
|
IF @userLevel < 50
|
|
BEGIN
|
|
-- 기존 루틴 그대로
|
|
UPDATE dbo.userGameDB
|
|
SET gameMoney = @gameMoney
|
|
, userState = @userState
|
|
, playTime = playTime + Round((@playTime/1000)/60,0)
|
|
, conn_count = @conn_count
|
|
, userLevel = @userLevel
|
|
, userEXP = @userEXP
|
|
, userFishingLevel = @userFishingLevel
|
|
, userFishingEXP = @userFishingEXP
|
|
, regionType = @regionType
|
|
, connDate = @connDate
|
|
, refillData = @refillData
|
|
, userExcavationLevel = @userExcavationLevel
|
|
, userExcavationEXP = @userExcavationEXP
|
|
, Practice = 0
|
|
WHERE accountIDX = @accountIDX
|
|
|
|
END
|
|
ELSE
|
|
BEGIN
|
|
--
|
|
IF( EXISTS( SELECT * FROM dbo.userRelativeLevelDB WITH( NOLOCK )
|
|
WHERE accountIDX = @accountIDX ) )
|
|
BEGIN
|
|
|
|
UPDATE dbo.userGameDB
|
|
SET gameMoney = @gameMoney
|
|
, userState = @userState
|
|
, playTime = playTime + Round((@playTime/1000)/60,0)
|
|
, conn_count = @conn_count
|
|
--, userLevel = @userLevel
|
|
, userEXP = @userEXP
|
|
, userFishingLevel = @userFishingLevel
|
|
, userFishingEXP = @userFishingEXP
|
|
, regionType = @regionType
|
|
, connDate = @connDate
|
|
, refillData = @refillData
|
|
, userExcavationLevel = @userExcavationLevel
|
|
, userExcavationEXP = @userExcavationEXP
|
|
, Practice = 0
|
|
WHERE accountIDX = @accountIDX
|
|
|
|
UPDATE dbo.userRelativeLevelDB
|
|
SET init_time = @init_time
|
|
WHERE accountIDX = @accountIDX
|
|
|
|
END
|
|
ELSE
|
|
BEGIN
|
|
-- 기존 루틴 그대로 : 혹시나 ?
|
|
UPDATE dbo.userGameDB
|
|
SET gameMoney = @gameMoney
|
|
, userState = @userState
|
|
, playTime = playTime + Round((@playTime/1000)/60,0)
|
|
, conn_count = @conn_count
|
|
, userLevel = @userLevel
|
|
, userEXP = @userEXP
|
|
, userFishingLevel = @userFishingLevel
|
|
, userFishingEXP = @userFishingEXP
|
|
, regionType = @regionType
|
|
, connDate = @connDate
|
|
, refillData = @refillData
|
|
, userExcavationLevel = @userExcavationLevel
|
|
, userExcavationEXP = @userExcavationEXP
|
|
, Practice = 0
|
|
WHERE accountIDX = @accountIDX
|
|
END
|
|
END
|
|
|