It's actually an index from PHPRetro (and I think this was used in v31 on Habbo as well). But I could use a difference index or make a switch so you can switch between indexes.
Printable View
No it won't. Refactoring is almost always guaranteed to be faster than starting from scratch again in order to get up to a certain standard.Quote:
Or should I rewrite it (which means it takes a longer time to get to the current point but most likely makes it go faster after that)
It's an official index that Habbo made, this existed around the time of when R38 was live on Habbo, actually. :ott1:
https://www.habboxforum.com/showthread.php?t=572056
Also I'd appreciate if you gave reasons why you're not a fan of the index rather than just saying "I don't like it" without any reason to back up your claim.
It doesn't matter. All the indexes from PHPRetro will be supported. Don't know if they're all official Habbo indexes but at least you got plenty of choice.
I like to thank @spreedblood for working on the source and trying to get it cleaner. Until he's done, there won't be any server updates. I might do some CMS updates this week, depends on how I feel this week.
Any examples on how he is making it cleaner? Because cleaner is quite subjective.
"sort of fucking it up"
In what way fucking it up? And I do know he's cleaning up the source and switching from Autofac to Microsoft Extensions. I just don't know ALL his ideas. And it's our development, in fact he did quit first but he promised me to "help me" "rewrite" it (AKA clean it up). I'll surely do my parts on the stuff I wrote to clean it up.
After that, I'll finish up the furni interactions and most likely start fixing the public rooms which are f*cked up for some reason.
Lol, wasn't I the one who added the furniture and public rooms to Aurora and then they mysteriously disappeared? :ott1:
Sorry for the lack of updates again. I'm not 100% sure when and if the rewrite is going to be done by Spreed. But anyways, I started writing a better source for my multi-version shockwave server (which will support v7, v9 and hopefully v13 too, maybe more versions will also be supported later).
I've looked a bit in the Lingo of v7 and saw some interesting stuff. Made it easier to figure out the navigator node structure (this structure is 100% figured out by me, I take no credits. I might post the structure eventually).
https://i.imgur.com/6Ow1XGZ.png
This isn't done in my own emulator, this was done in ION just to figure out the structure before I actually rewrote my Shockwave server just to make it easier
(don't think the R38 is abandoned, I've got some ideas for it. Also keep in mind the oldskool client was planned in the beginning anyways and is still part of this project).
Snippet of the server:
I'll give it a bit of time or I might rewrite the R38 on my own or just keep it the way it is. It works and should be stable anyways.PHP Code:using System;
using System.Data.Common;
using System.Threading.Tasks;
using Aurora.Database;
namespace Aurora.Game.Avatars
{
public class AvatarDao
{
private readonly DatabaseConnection _databaseConnection;
public AvatarDao(DatabaseConnection databaseConnection)
{
_databaseConnection = databaseConnection;
}
public async Task<Avatar> GetAvatarByName(string name)
{
Avatar avatar = null;
await _databaseConnection.Select(
"SELECT * FROM avatars WHERE name = [MENTION=1333344765]name[/MENTION] LIMIT 1",
async (reader) =>
{
if (await reader.ReadAsync())
{
avatar = new Avatar();
avatar.Fill(reader);
}
},
( [MENTION=1333344765]name[/MENTION]", name));
return avatar;
}
}
}
Since @spreedblood officially told me he won't be working on R38 anymore, I've decided to give the source a big clean myself. From now on, I'll be the only one working on the R38. However, this doesn't change anything, the only thing that'll happen is a new source and some things completely rewritten (room map stuff as height shit wasn't done that great).
95% of the code from the old source can be reused in a way, I hope to have the emulator rewritten by the end of this month, maybe end of next month. After that and a few of the really game breaking bugs are fixed, a test hotel will come up (scheduled and written down so I won't forgot).
Last, the name Aurora Emulator will be changed to Project Aurora, @Quackster please change the title of the topic to:
[C#, PHP, R38] Project Aurora
The focus of this thread will from now on only go towards R38. As soon as most/all of the R38 is done, a new thread will be made for oldskool, which for now won't be the main focus.
Nice to hear that you're going to start with that rewrite Josh, good luck! I look forward to try the test hotel :)
Database stuff will be rewritten too. The dao's will contain of a variable for the database "factory". That "factory" contains functions like "select", "insert", "update" etc. Example of how a select would be used:
(huge thanks to @spreedblood for this idea)PHP Code:public async Task<Player> GetPlayerBySSO(string ssoTicket)
{
Player player = null;
await _databaseFactory.Select(
"SELECT * FROM players WHERE sso_ticket = @ssoTicket LIMIT 1",
async (reader) =>
{
if (await reader.ReadAsync())
{
player = new Player(reader);
}
},
("@ssoTicket", ssoTicket));
return player;
}
Also, all message events will have the header in the event file rather than in the packet helper/library file. All message headers will automatically be added to the library if they implement IPacket. This means there's no possibility to make a packet file and test it only realizing you haven't added it to the list.
PHP Code:class SSOTicketMessageEvent : IPacket
{
public int Header => 204;
private readonly IPlayerController _playerController;
public SSOTicketMessageEvent(IPlayerController playerController)
{
_playerController = playerController;
}
public async Task Handle(Session session, Event message)
{
string sso = message.GetString();
Player player = await _playerController.GetPlayerBySSO(sso);
if (player != null)
{
session.Player = player;
session.QueueMessage(AuthenticationOKMessageComposer.Compose());
session.Flush();
}
else
{
await session.Disconnect();
}
}
}
(keep in mind, 204 is the shockwave header for SSO, I might add support for multiple headers later)PHP Code:public class PacketLibrary : IPacketLibrary
{
private readonly Dictionary<int, IPacket> _packetEvents;
private readonly ILogger<PacketLibrary> _logger;
public PacketLibrary(IEnumerable<IPacket> packetEvents, ILogger<PacketLibrary> logger)
{
_packetEvents = packetEvents.ToDictionary(packet => packet.Header, packet => packet);
_logger = logger;
}
public async Task TryHandle(Event message, Session session)
{
if (_packetEvents.TryGetValue(message.Header, out IPacket packet))
{
await packet.Handle(session, message);
_logger.LogInformation($"Handled packet event {packet.ToString()}");
}
else
{
_logger.LogWarning($"Unregistered packet event with header {message.Header} ({message.ToString()}");
}
}
public static void AddPacketEvents(ServiceCollection serviceDescriptors)
{
foreach (Type type in Assembly.GetExecutingAssembly().GetTypes())
{
if (type.GetInterfaces().Contains(typeof(IPacket)))
{
serviceDescriptors.AddSingleton(typeof(IPacket), type);
}
}
}
}