USE [Game]
GO
/****** Object: StoredProcedure [dbo].[msp_character_create] Script Date: 7/19/2016 4:30:50 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[msp_character_create]
-- Add the parameters for the stored procedure here
(@mir_userid nvarchar(25), @char_name nvarchar(30), @char_hair tinyint, @char_sex tinyint, @char_job tinyint)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--100- 未知错误
--101 无法创建超过4个角色
--102 该角色名已经存在
--103 该角色名已经存在
--104+ 未知错误
--110
--111
--112
--113
--114
declare @charcount int
--if(dbo.vmsf_CheckMainDB()==0) --是否为主数据库 1=yes,0-no
--begin
-- OPENQUERY (linked_server ,'query')
--end
----------
--if (dbo.vmsf_CheckLoginId(@mir_userid)=0) --检查用户ID是否存在 并且未被封号(1=ok,0=no)
-- return 100
--
--if exists (select 1 from TBL_GlobalCharacter where FLD_CHARACTERNAME = @char_name) --检查角色名是否已经存在
-- return 102
declare @errorcode int
--
--EXEC @errorcode=[RAccount].[Account].[dbo].[rmsp_character_create] @mir_userid=@mir_userid,@char_name=@char_name
if(@errorcode>0)
return @errorcode
select @charcount=count(1) from TBL_CHARACTER where FLD_UserId=@mir_userid and FLD_DELETED=0
if(@charcount>=4) --检查拥有角色是否达到4个
return 101
-- Insert statements for procedure here
INSERT into TBL_CHARACTER (
FLD_CHARACTER, FLD_USERID, FLD_DELETED,FLD_UPDATEDATETIME, FLD_DBVERSION,
FLD_MAPNAME,FLD_CX, FLD_CY, FLD_DIR, FLD_HAIR,
FLD_HAIRCOLORR, FLD_HAIRCOLORG, FLD_HAIRCOLORB,FLD_SEX, FLD_JOB,
FLD_LEVEL, FLD_GOLD,FLD_HOMEMAP, FLD_HOMEX, FLD_HOMEY, FLD_PKPOINT,
FLD_ALLOWPARTY, FLD_FREEGULITYCOUNT, FLD_ATTACKMODE,FLD_FIGHTZONEDIE, FLD_BODYLUCK,
FLD_INCHEALTH,FLD_INCSPELL, FLD_INCHEALING, FLD_BONUSAPPLY,FLD_BONUSPOINT,
FLD_HUNGRYSTATE, FLD_TESTSERVERRESETCOUNT,
FLD_CGHUSETIME, FLD_ENABLEGRECALL, FLD_BYTES_1, FLD_HORSERACE, FLD_MAKEDATE)
VALUES
( @char_name, @mir_userid, 0, GETDATE(), 0,
'', 0, 0, 0, @char_hair,
0, 0, 0, @char_sex, @char_job,
0, 0,'', 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, GETDATE())
--insert into TBL_GlobalCharacter (FLD_CHARACTERNAME) values (@char_name)
select FLD_CHARACTER=@char_name, FLD_JOB=@char_job, FLD_HAIR=@char_hair, FLD_LEVEL=0, FLD_SEX=@char_sex
return 0
END
USE [Game]
GO
/****** Object: StoredProcedure [dbo].[msp_character_delete] Script Date: 7/19/2016 4:33:01 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[msp_character_delete]
-- Add the parameters for the stored procedure here
(@mir_userid nvarchar(21) , @char_name nvarchar(30), @user_password nvarchar(30))
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
--101- 删除过程中出现了一个错误
--102 您输入的密码是无效的
--103+ 删除过程中出现了一个错误
--insert into TBL_Temp_LOG (FLD_P1,FLD_P2,FLD_P3,FLD_P4,FLD_P5) values('msp_character_delete',@mir_userid,@char_name,@user_password,GETDATE())
UPDATE TBL_CHARACTER SET FLD_DELETED=1 WHERE FLD_CHARACTER=@char_name and FLD_USERID=@mir_userid and EXISTS(select FLD_PASSWORD from GSPAccount.dbo.TBL_ACCOUNT where FLD_USERID=@mir_userid and FLD_PASSWORD=@user_password)
--101
--return 102
--UPDATE TBL_CHARACTER SET FLD_DELETED=1 WHERE FLD_CHARACTER=@char_name and FLD_DELETED=0 and FLD_USERID=@mir_userid and exists(select FLD_USERID from [RAccount].[Account].[dbo].[TBL_ACCOUNT] where FLD_USERID=@mir_userid and FLD_PASSWORD=@user_password)
--select 102
if(@@ROWCOUNT>0)
begin
--EXEC [RAccount].[Account].[dbo].[rmsp_character_delete] @mir_userid=@mir_userid,@char_name=@char_name
update TBL_GlobalCharacter set FLD_deleted=1 where FLD_CharacterName=@char_name
return 0
end
else
begin
return 102
end
SET NOCOUNT OFF;
END
Hopefully.No problem Now we just need to fix the login procedure, if you enter an incorrect password with Capitals and characters like "@&^AW^#@" you can freeze the loginserver for a moment and cause an SQL connect error.
Dj just fixed it for Uncharted, as we all the storage procedures I hope he could post the fixes
Hopefully.
I have come across a problem. Only one of my characters seem to always get disconnect after selection screen. I have heard of this problem with other servers. Reboots do not fix it.
http://i.imgur.com/uvYmBTl.png
Is this a known problem?
That did fix it thanks.Ive also heard of this problem but ive never had it myself. Does changing the characters map via sql help at all?
Hopefully.
I have come across a problem. Only one of my characters seem to always get disconnect after selection screen. I have heard of this problem with other servers. Reboots do not fix it.
http://i.imgur.com/uvYmBTl.png
Is this a known problem?
ALTER PROCEDURE [dbo].[msp_character_map_info] -- Add the parameters for the stored procedure here
(@mir_userid nvarchar(25),@char_name nvarchar(30))
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
-- if exists(select 1 from [Account].dbo.TBL_ACCOUNT where FLD_LOGINID=@mir_userid)
--begin
if exists(select 1 from TBL_CHARACTER where FLD_USERID=@mir_userid)
begin
SELECT FLD_MAPNAME FROM TBL_CHARACTER WHERE FLD_CHARACTER=@char_name
end
--end
END