It has been a while. I could go on with a lot of excuses, but why bother. This is going to be a long post so bear with me.
This project was started as a little time-filler for when I would be bored, I had something to work on. I had motivation for the project - and I still have - but I can feel developing this feels different. Back in the day (when I was a noob), even if what I did was terrible, it gave me a bit of satisfaction, the satisfaction I lack nowadays. Maybe this is my own fault of trying a million projects (gonna mention it myself before somebody else does), or maybe it's because I've grown out of it, or because the section is dying. Whatever it is, it definitely affects me. Seeing how Cortex is doing, it makes me wonder if there's still a need for a development. If Cortex gets finishes, then what's left to do besides HTML5 development? (yeah, I could work on something HTML5 but that's far outside my league and client development doesn't interest me that much). Obviously, Habbo will launch a new client later this year - which honestly I wonder if we'll ever be able to create a retro from it - but that takes some time. Also, even when it comes out, who knows how long it'll take before real pro's figure out a way to create a retro from it. I definitely have plans to look into it, but again, I'm not a big pro.
I honestly am stuck. Partly I want to develop something, something I can be proud of (sorta...), but I'm not sure if it's the right time for it (if ever). I don't know whether to continue for the sole reason I can leave something I'm proud of, or not continue because it barely makes sense. The development was started as a sole R38 development for both Shockwave and Flash, but it brought v7 when I got the Lingo scripts for it. Shockwave already was EOL, and now Flash will reach EOL this year as well. I wonder, does it even make sense developing something for that? I know Quackster created Kepler even though Shockwave is EOL a few years already, but still. The sole reason I'd continue the development is to leave something I can be sort of proud of and release the first public-usable stable server that works for R38 both Shockwave and Flash and the first full v7 server ever publicly released. But is it worth the time?
I did write my "framework", and I can say I'm proud of how that turned out. I did do some client code for v7 (cause I was bored) and a minor amount for R38. Not much to say I would've wasted a lot of time, but enough to maybe consider going on. I'll definitely try posting updates here, but I can't promise anything 100%.
Now, a few things to mention about my code so far (the code I might or might not put on git depending on whether I'm lazy or not):
- Using .NET Core for multi platform
- Using dependency injection
- Using Entity Framework Core with migrations for easy usage
- Using the powerful PBKDF2 for hashing passwords
- Using DotNetty for easy networking
- Using C# 8.0
A few snippets of new code:
PHP Code:
public class PasswordHash
{
private const int SaltSize = 24; // size in bytes
private const int HashSize = 24; // size in bytes
private const int Iterations = 100000; // number of pbkdf2 iterations
public static byte[] GenerateSalt()
{
using var provider = new RNGCryptoServiceProvider();
byte[] salt = new byte[SaltSize];
provider.GetBytes(salt);
return salt;
}
public static byte[] Hash(string input, byte[] salt)
{
using Rfc2898DeriveBytes pbkdf2 = new Rfc2898DeriveBytes(input, salt, Iterations);
return pbkdf2.GetBytes(HashSize);
}
public static bool Verify(string password, Player player)
{
// This looks ugly... gotta look at this a bit more later but cba now
return Convert.ToBase64String(Hash(password, Convert.FromBase64String(player.Salt))).Equals(player.Password);
}
}
PHP Code:
public class HabboDbContext : DbContext
{
public HabboDbContext()
: base ()
{
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseMySql("Server=127.0.0.1;Database=stargazer_db;Uid=root;Pwd=ThisDatabaseIsNowCompromised;");
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Player>().Property(p => p.Motto).HasDefaultValue(string.Empty);
modelBuilder.Entity<Player>().Property(p => p.ConsoleMotto).HasDefaultValue(string.Empty);
modelBuilder.Entity<Player>().Property(p => p.Coins).HasDefaultValue(100);
modelBuilder.Entity<PlayerRole>().HasKey(pr => new {pr.PlayerId, pr.RoleId});
modelBuilder.Entity<PlayerRole>()
.HasOne(pr => pr.Player)
.WithMany(p => p.Roles)
.HasForeignKey(pr => pr.PlayerId);
modelBuilder.Entity<PlayerRole>()
.HasOne(pr => pr.Role)
.WithMany(r => r.Players)
.HasForeignKey(pr => pr.RoleId);
modelBuilder.Entity<Role>().HasData(
new Role() { Id = 1, Name = "User"},
new Role() { Id = 2, Name = "HabboX"},
new Role() { Id = 3, Name = "Silver Hobba"},
new Role() { Id = 4, Name = "Gold Hobba"},
new Role() { Id = 5, Name = "Moderator"},
new Role() { Id = 6, Name = "Management"});
}
public DbSet<Player> Players { get; set; }
public DbSet<Role> Roles { get; set; }
}
Also, since I haven't done this in a while I definitely want to thank a few people:
- Quackster: His archive website, shockwave installation stuff, helping with Lingo scripts and stuff (probably more I can't remember)
- Nillus: For some packet stuff from Blunk/Ion
- Everybody else: For being here
I don't ever regret being here or that I ever checked on here, it definitely helped me grow as both a person and a developer and I thank everyone for that.
If you're still reading, let me know what to do, continue with what my plans were, or do something else. I'm happy to get new ideas.