Feature wise, it looks like this:
- * An ODBCManager singleton, to wrap up th connect/disconnect and handles
* ODBCManager can execute a query and you can iterate over result set (all datareturned as strings)
* An abstraction of the account class data into DB tables
* Additional history fields (archival purpose for logins)
- Loading/saving accounts from DB rather than file
- Retrieve new accounts that are created in DB after load
Deal with deleted accounts after load
Add table for dealing with bans
Expose ODBCManager to JSEngine
Figure out how to do this from Linux
Here is the DDL:
Code: Select all
CREATE TABLE [dbo].[Account](
[AccountID] [int] NOT NULL,
[Username] [char](30) NOT NULL,
[Password] [char](30) NOT NULL,
[ContactDetails] [varchar](255) NULL,
[IsBanned] [bit] NOT NULL,
[IsSuspended] [bit] NOT NULL,
[IsPublic] [bit] NOT NULL,
[IsOnline] [bit] NOT NULL,
[IsSeer] [bit] NOT NULL,
[IsCounselor] [bit] NOT NULL,
[IsGM] [bit] NOT NULL,
[LastUpdated] [datetime] NOT NULL,
CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED
(
[AccountID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[AccountCharacters](
[AccountID] [int] NOT NULL,
[Serial] [int] NOT NULL CONSTRAINT [DF_AccountCharacters_Serial] DEFAULT ((-1))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountCharacters] WITH CHECK ADD CONSTRAINT [FK_AccountCharacters_Account] FOREIGN KEY([AccountID])
REFERENCES [dbo].[Account] ([AccountID])
GO
ALTER TABLE [dbo].[AccountCharacters] CHECK CONSTRAINT [FK_AccountCharacters_Account]
CREATE TABLE [dbo].[AccountLoginHistory](
[Username] [char](30) NOT NULL,
[Password] [char](30) NULL,
[IPAddress4] [char](16) NOT NULL,
[WhenAttempted] [datetime] NOT NULL,
[AttemptStatus] [smallint] NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[AccountLoginHistory] WITH CHECK ADD CONSTRAINT [FK_AccountLoginHistory_AttemptInfo] FOREIGN KEY([AttemptStatus])
REFERENCES [dbo].[AttemptInfo] ([AttemptStatus])
GO
ALTER TABLE [dbo].[AccountLoginHistory] CHECK CONSTRAINT [FK_AccountLoginHistory_AttemptInfo]
CREATE TABLE [dbo].[AttemptInfo](
[AttemptStatus] [smallint] IDENTITY(0,1) NOT NULL,
[Description] [varchar](32) NOT NULL,
CONSTRAINT [PK_AttemptInfo] PRIMARY KEY CLUSTERED
(
[AttemptStatus] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Thoughts and feedback are very welcome.