Hello,
(Please, read the whole thread before asking questions already in the thread, thank you)
Due to stuff happening (refer to
http://forum.ragezone.com/f331/php-r...4/#post8920734 to read the story, questions about it can be asked in a PM or Discord,
NOT in this thread!) I decided to rewrite Aurora to be better. The old source was messy and in some parts I was even confused by how things were done. Also, it was using SOME dependency injection stuff but it was still terrible. This doesn't mean the old source isn't used as much code is taken from the old source, making the time spent on it not for nothing.
The functionality isn't as big as it was before, but I decided to at least make a thread as things are going alright now. This project is a bit bigger than before, so I decided to call it Aurora PRO (10 cookies for anybody getting the reference... hint hint). All jokes aside, the project contains 3 versions, based on the same base (my own base I wrote myself), a v7 (there has never been a released v7 server) and R38 (both shockwave and flash compatible since this was the original project and the main project). The R38 is the main focus but the v7 one is something extra @
Quackster, don't make Kepler working on v7 thanks :( ) Okay, let's divide all the parts up:
Aurora Pro R38
Features:
- Login with SSO is working
- Catalog pages are working including items and deals (offers / packages whatever you want to call them)
- Friendlist is working (with incorrect user online check)
- Navigator frontpage is partly working (besides rooms, and categories)
CMS:
Will contain a CMS written from scratch in ASP DotNet Core (C#). Contain the style used around this time (HoloCMS/PHPRetro style). Might be multi template system and multi language system supported. No PHP cuz it's overused.
Extra information / cool stuff:
- Shockwave will have camera thanks to @
Quackster for telling me how to enable it
- Shockwave might get battleball / snowstorm (maybe, just maybe...)
Screens:
Snippets:
FlashSSOTicketMessageEvent (flash packet 415):
PHP Code:
class FlashSSOTicketMessageEvent : IPacket
{
public int Header => 415;
private readonly IPlayerController _playerController;
public FlashSSOTicketMessageEvent(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();
}
}
}
PlayerController:
PHP Code:
public class PlayerController : IPlayerController
{
private readonly IPlayerDao _dao;
private readonly Dictionary<int, Player> _players;
public PlayerController(IPlayerDao dao)
{
_dao = dao;
_players = new Dictionary<int, Player>();
}
public async Task<Player> GetPlayerById(int playerId)
{
if (_players.TryGetValue(playerId, out Player player))
{
return player;
}
player = await _dao.GetPlayerById(playerId);
_players.Add(playerId, player);
return player;
}
public async Task<Player> GetPlayerBySSO(string ssoTicket)
{
return await _dao.GetPlayerBySSO(ssoTicket);
}
}
PlayerDao:
PHP Code:
public class PlayerDao : IPlayerDao
{
private readonly DatabaseFactory _databaseFactory;
public PlayerDao(DatabaseFactory databaseFactory)
{
_databaseFactory = databaseFactory;
}
public async Task<Player> GetPlayerById(int playerId)
{
Player player = null;
await _databaseFactory.Select(
"SELECT * FROM players WHERE id = [MENTION=1235]Player[/MENTION]Id LIMIT 1",
async (reader) =>
{
if (await reader.ReadAsync())
{
player = new Player(reader);
}
},
( [MENTION=1235]Player[/MENTION]Id", playerId));
return player;
}
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;
}
}
Aurora v7
Features:
- Login is working
- Navigator nodes are working
- Own rooms list is working
- Going to private rooms is working (not 100% finished though)
- Loading items in a room is working (both floor and wall items)
- Catalog pages are working without items yet
CMS:
Won't contain a CMS, will purely be HTML with the layout used at that time. No login stuff or anything, v7 don't support SSO! (I might try to implement it if people really want to see it).
Extra information / cool stuff:
- Might be updated eventually to v9 with battleball
- Packets figured out reading the Lingo code (not going to mention names who helped me to prevent them being annoyed)
- Will contain a decently big CCT pack containing all the texts from various languages, badges and most of the room CCTs
Screens:
(I use the Dutch external texts; the emulator itself and database is English! Catalog is made by myself as close to Habbo's one was in terms of texts etc.)
Snippets:
None for now, no proirity. Most code besides packets is similar to R38 ones.
So, the main focus is on the R38 project. I might make a git repository soon, just not sure. Any other questions feel free to ask, ideas: feel free to ask (even if this means editing game files) and code tips feel free to point out.
Again: this is a rewrite which still uses lots of code from the old source, just done in a better way and slightly more clean.