[First RELEASE] Locator Proc. (INCOMPLETE and may suck)

Newbie Spellweaver
Joined
Oct 18, 2005
Messages
84
Reaction score
0
Hi here is MY locator Proc. It works but not quite complete. This was made by ME and only by me. Also it might be a little messy because of trying to find out the locator options. so here it is and also its attched:

Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spGetIPtoCountryList]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spGetIPtoCountryList]
AS
BEGIN
SELECT     IsBlock, RoutingURL
FROM         BlockCountryCode
ORDER BY CountryCode3
END


' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ServerStatus]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ServerStatus](
	[ServerID] [int] NOT NULL,
	[ServerName] [varchar](50) NOT NULL,
	[MaxPlayer] [int] NOT NULL CONSTRAINT [DF_ServerStatus_MaxPlayer]  DEFAULT ((2000)),
	[CurrPlayer] [int] NOT NULL CONSTRAINT [DF_ServerStatus_CurrPlayer]  DEFAULT ((0)),
	[Time] [varchar](20) NULL,
	[IP] [varchar](50) NOT NULL CONSTRAINT [DF_ServerStatus_IP]  DEFAULT ('127.0.0.1'),
	[Port] [int] NOT NULL,
	[Opened] [nchar](10) NOT NULL,
 CONSTRAINT [PK_ServerStatus] PRIMARY KEY CLUSTERED 
(
	[ServerID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[IPCountryCode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[IPCountryCode](
	[CountryCode3] [varchar](50) NOT NULL,
	[IPTo] [text] NULL,
	[IPFrom] [text] NULL,
 CONSTRAINT [PK_IPCountryCode] PRIMARY KEY CLUSTERED 
(
	[CountryCode3] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BlockCountryCode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[BlockCountryCode](
	[CountryCode3] [nchar](10) NOT NULL,
	[RoutingURL] [nvarchar](50) NULL,
	[IsBlock] [varchar](50) NULL CONSTRAINT [DF_BlockCountryCode_IsBlock]  DEFAULT (N'no')
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Locator]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Locator](
	[ServerID] [int] NOT NULL,
	[IP] [nvarchar](50) NULL,
	[Port] [int] NULL,
	[Opened] [int] NULL,
	[ServerName] [nchar](10) NULL,
	[Players] [int] NOT NULL CONSTRAINT [DF_Locator_Players]  DEFAULT ((0)),
 CONSTRAINT [PK_Locator] PRIMARY KEY CLUSTERED 
(
	[ServerID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LocatorLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[LocatorLog](
	[IP] [int] NOT NULL,
	[Port] [int] NOT NULL,
	[Count] [int] NOT NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spUpdateLocatorStatus]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spUpdateLocatorStatus]
	@ID INT,
	@uidPlayer INT,
	@CurrPlayer INT,
	@nCode INT,
	@Opened INT
AS
BEGIN
SET NOCOUNT ON;

UPDATE    Locator
SET              Players = @CurrPlayer, Opened = @Opened

END 




















' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spStartUpLocatorStatus]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spStartUpLocatorStatus]
@ID INT,
@dwIP varchar(50),
@nPort INT,
@Opened INT
AS
BEGIN

DECLARE @cnt INT
SELECT @cnt=COUNT(*)
FROM Locator
WHERE ServerID = @ID

IF @cnt = 0
INSERT INTO ServerStatus
(ServerID, IP, Port, Opened)
VALUES     (@ID,@dwIP,@nPort,1000)
END


' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spGetIPCountryCode]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spGetIPCountryCode]
AS
BEGIN
SELECT     CountryCode3, IPTo, IPFrom
FROM         IPCountryCode
ORDER BY CountryCode3
END





' 
END


PS. if anyone gets the locator to say run tell everyone else
 

Attachments

Bryan, Finally realized you are an idiot or what? lol.

We should release a competition here to see who brags more, BryaN or LG.
Who would win lol.

My server may suck but 98% of the procs i made by myself instead leech like an idiot.
 
I dont use these man so stfu i dont even want locator to work
 
That Procedures and tables would never work.

They are completely bad, LOL

Im sure of what i'm saying.

Ok so what i tried but if you say they are bad why don't you release yours or just help us get it to work. if your not going to release or help don't post saying other people work sucks when they tried.
 
I took a look they sould be able to start up the locator but if i'm correct its still going to show it up as dead

if i'm correct not 100% sure ;).
 
Msg 207, Level 16, State 1, Procedure spStartUpLocatorStatus, Line 16
Invalid column name 'IP'.
Msg 207, Level 16, State 1, Procedure spStartUpLocatorStatus, Line 16
Invalid column name 'Port'.
Msg 207, Level 16, State 1, Procedure spStartUpLocatorStatus, Line 16
Invalid column name 'Opened'.
 
what is this
ServerStatus
CONSTRAINT [PK_ServerStatus] PRIMARY KEY CLUSTERED
([ServerID] ASC)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
IPCountryCode
CONSTRAINT [PK_IPCountryCode] PRIMARY KEY CLUSTERED
([CountryCode3] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
Locator
CONSTRAINT [PK_Locator] PRIMARY KEY CLUSTERED
([ServerID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
 
This procedures and tables will never work.

All the names are incorrect.

I'm sorry, but i will never release anything at this forum.
Give thanks to LGKeiz.
 
First like we have the power to do that :/,
Second wouldnt releasing it help make lg disappear since more people come up with complete servers..

but i find this just really strange just because you dislike 2 people you going to ignore the rest of the forum..
 
Back