/// <summary> /// </summary> /// <param name="character"> /// </param> public static void AddCharacter(DBCharacter character) { using (IDbConnection conn = Connector.GetConnection()) { conn.Execute( "INSERT INTO characters (Name, FirstName, LastName, Textures0,Textures1,Textures2,Textures3,Textures4" + ",playfield, X,Y,Z,HeadingX,HeadingY,HeadingZ,HeadingW,Username) VALUES (@Name, @FirstName, " + "@LastName, @Textures0, @Textures1, @Textures3, @Textures4, @Playfield, @X, @Y, @Z, @HeadingX, @HeadingY, " + "@HeadingZ, @HeadingW, @Online,@username)", new { character.Name, character.FirstName, character.LastName, character.Textures0, character.Textures1, character.Textures2, character.Textures3, character.Textures4, character.Playfield, character.X, character.Y, character.Z, character.HeadingX, character.HeadingY, character.HeadingZ, character.HeadingW, Online = 0, username = character.Username }); } }
/// <summary> /// </summary> /// <param name="character"> /// </param> public static void AddCharacter(DBCharacter character) { using (IDbConnection conn = Connector.GetConnection()) { conn.Execute( "INSERT INTO characters (Name, FirstName, LastName, Textures0,Textures1,Textures2,Textures3,Textures4" + ",playfield, X,Y,Z,HeadingX,HeadingY,HeadingZ,HeadingW,Username) VALUES (@Name, @FirstName, " + "@LastName, @Textures0, @Textures1, @Textures3, @Textures4, @Playfield, @X, @Y, @Z, @HeadingX, @HeadingY, " + "@HeadingZ, @HeadingW, @Online,@username)", new { character.Name, character.FirstName, character.LastName, character.Textures0, character.Textures1, character.Textures2, character.Textures3, character.Textures4, character.Playfield, character.X, character.Y, character.Z, character.HeadingX, character.HeadingY, character.HeadingZ, character.HeadingW, Online = 0, username=character.Username }); } }
public static void UpdatePosition(DBCharacter db) { using (IDbConnection conn = Connector.GetConnection()) { conn.Execute( "UPDATE characters SET playfield = @Playfield, X = @X, Y = @Y, Z = @Z WHERE id=@Id", new { db.Playfield, db.X, db.Y, db.Z, db.Id }); } }
/// <summary> /// </summary> /// <param name="startInSL"> /// </param> /// <param name="charid"> /// </param> public void SendNameToStartPlayfield(bool startInSL, int charid) { DBCharacter dbCharacter = new DBCharacter { Id = charid, Playfield = 4001, X = 850, Y = 43, Z = 565 }; if (!startInSL) { dbCharacter.Playfield = 4582; dbCharacter.X = 939; dbCharacter.Y = 20; dbCharacter.Z = 732; } CharacterDao.UpdatePosition(dbCharacter); }