Newbie Spellweaver
- Joined
- May 25, 2011
- Messages
- 77
- Reaction score
- 58
NexusServer v2
Current version: v2.0.0 r169 (SVN only)
A Habbo Hotel server core written in C++ using the Qt Framework.
Supported protocols: (Untested versions followed by a question mark, but are assumed to work)
Shockwave: v8? v9 v10? v11? v12? v13 v14 v15 v16 v17? v18? v19?
Supported protocols: (Untested versions followed by a question mark, but are assumed to work)
Shockwave: v8? v9 v10? v11? v12? v13 v14 v15 v16 v17? v18? v19?
Hello everyone, some of you may remember NexusServer, a project Ktae and I worked on in June-ish. Our servers are back up, and I've decided that though this isn't a project I can profit from (or even put into something like my portfolio,) I'd really like to finish it. A Few days ago Ktae wrote a nice socket/thread pooling/queue system, so using it I've decided to restart NexusServer. Most of the old code was hackish/stubs so I'll be starting pretty much from scratch.
Server specific features:
Code:
- C++ (Qt, multiplatform)
- Thread pooling system (currently in need of a few fixes)
- Thread safe packet broadcasting using Qt's Signal/Slot system
- QSql (Compatible with a wide array of drivers, from SQLite to MySQL to ODBC
- Optional native unix-like terminal implementation for windows and curses support
where applicable (incomplete)
- INI-style configuration
- language binding support
Currently implemented (but most likely incomplete) features:
Code:
- encoding (VL64/B64)
- non-sso login
- non-sso registration
- updating figure/motto/etc
- public room list (stub)
- private room categories
- room creation (the client does this improperly)
- room listing (complete)
- own room listing (complete)
- entering rooms
- room user listing (incomplete)
- chat
- temporary warping until pathfinding
- catalog
- hand (perfect)
- furniture (under dev)
- posters
- spaces (wallpaper/floor)
- console missions
- searching for users in the console
- friend requests (partial)
- messages (partial)
- public rooms (partial, currently only in the navigator)
Changelog:
Code:
Revision 169
-Cleaned up room.cpp
Revision 168
-Fixed public room entering
Revision 167
-repaired the heightmap db
Revision 166
-Continued implementing public rooms
Revision 165
-Fixed db, public room heightmaps
Revision 164
-Fixed a few things in the db, continued work on public rooms heightmap parser
Revision 163
-Continued implementing public rooms
Revision 162
-Added db table publicheights, imported public room heightmap and door location data
Revision 161
-Continued implementing public rooms, added new debugging string to lang file, started adding public room implementations into room.
Revision 160
-Cleaned up the debugging a bit
Revision 159
-Imported some of the public room data
Revision 158
-Implemented the public rooms navigator packet
Revision 157
-Updated public rooms db table, continued implementing public rooms in the navigator
Revision 156
-Started properly implementing public rooms, added DB table publicrooms
Revision 155
-Implemented Opcode::RequestUpdateRoomInfo, Opcode::RequestUpdateRoomName. Currently only descriptions and names are modifiable.
Revision 154
-Started implementing Opcode::RequestUpdateRoomInfo, Opcode::RequestUpdateRoomName
Revision 153
-Implemented Opcode::requestRollDie stub
Revision 152
-Started implementing Opcode::requestSendMessage
Revision 151
-Created table messages for the messenger/console
Revision 150
-Continued work on the friends list
Revision 149
-Fixed friend request DB error
Revision 148
-Continued implementing friends
Revision 147
-Continued implementing friend requests
Revision 146
-Implemented ConfigurationCore::getBool(key) and implemented some db options
Revision 145
-The config, db, and lang file are now loaded from the run directory not the static path they were using before.
Revision 144
-Fixed a few things, implemented Opcode::requestStop stub
Revision 143
-Fixed Opcode::RequestInitializeMessenger to work with console missions.
Revision 142
-Implemented Opcode::RequestSetConsoleMission, added consolemission to the accounts table.
Revision 141
-Cleaned up the startup debugging
Revision 140
-Switched the hardcoded strings in Protocol to with with the new language system
Revision 139
-Started implementing LanguageCore
Revision 138
-Started coding ConfigurationCore.
Revision 137
-Implemented temporary fusestring system, and implemented waving+drinks (though all functions are currently infinite)
Revision 136
-Implemented proper rotation on warp in prep for pathfinding
Revision 135
-Started implementing room modification
Revision 134
-Implemented room searching
Revision 133
-Committed updates since server downtime
Revision 132
-Started implementing friend requests
Revision 131
-Fixed female figures in the console search, users are now properly removed from the list of online clients.
Revision 130
-Cleaned up the opcodes a bit
Revision 129
-The hand is now properly updated when placing paint/flooring and when picking up items.
Revision 128
-Made furniture handling more efficient
Revision 127
-removed bool wallitem parameter from Furniture::Furniture
Revision 126
-Implemented picking up items
Revision 125
-Fixed the "Furniture is loading..." box if there is a poster in the room glitch
Revision 124
-Fixed some issues with the license
Revision 123
-Fixed hotel view disconnect crash
Revision 122
-Fixed room shifting
Revision 121
-Fixed room creation crashes (but it's still not proper)
Revision 120
-Fixed the "under" furniture/walls issue caused by doors
Revision 119
-Proper player locations are now sent when you enter a room, and users will now be placed at the door when they enter the room.
Revision 118
-Made warping pay attention to the heightmap
Revision 117
-Room furniture is now saved to/read from the DB when a room is unloaded/loaded.
Revision 116
-Furniture in a user's hand is now saved when they disconnect, and reloaded when they log in.
Revision 115
-Continued fixing re-ender poster data
Revision 114
-Credits are now updated when purchasing items (but not changed)
Revision 113
-Fixed "r" posters
Revision 112
-Started implementing sending poster info to the client when they re-enter the room
Revision 111
-Fixed the catalog
Revision 110
-Fixed buying posters, implemented posters :'D
Revision 109
-Started implementing purchasing posters
Revision 108
-Clients are now told when a user leaves the room
Revision 107
-Fixed the hand
Revision 106
-Fixed a bug
Revision 105
-Implemented spaces
Revision 104
-Started implementing spaces, changed default floor/wallpaper to match the old retail style
Revision 103
-Started implementing furniture DB saving, and fixed posters in the catalog
Revision 102
-User data is now saved to the DB when a user disconnects.
Revision 101
-Fixed multiplatform compiling
Revision 100
-Implemented furniture stacking
http://filebeam.com/8fdef8013c1f0d8639c3c46552599b5e.jpg
Revision 99
-Fixed a few things
Revision 98
-Implemented item signatures
Revision 97
-Did some testing
Revision 96
-Implemented furniture movement/rotation
Revision 94-95
-Fixed furniture placement
Revision 93
-Started implementing furniture
Revision 92
-Fixed hand page... leaking...
Revision 91
-Perfected the hand
Revision 90
-Got the hand... kinda... working.
Revision 89
-Made purchasing better
Revision 88
-Implemented Packet::appendTabString, Packet::appendCarriageString, Packet::appendTaggedString, and integrated them into Protocol
Revision 87
-Implemented Room::ownerid
Revision 86
-Started implementing the hand
Revision 85
-Fixed db, implemented Furniture
Revision 84
-Fixed switching rooms, changed furniture table structure
Revision 83
-Cleaned up the output, fixed a few things
Revision 82
-Started implementing Opcode::RequestPurchaseItem
Revision 81
-Fixed navigator bug
Revision 80
-Fixed the navigator packet :'D
Revision 79
-Fixed a couple things
Revision 78
-Implemented FurnitureProfile, FurnitureCore, fixed the "DG" stub
Revision 77
-Fixed the catalog :'D (added a few new stubs)
Revision 76
-Implemented console searching
Revision 75
-More catalog work
Revision 74
-Fixed DB, continued implementing catalog pages
Revision 73
-Implemented Opcode::RequestCatalogPages
Revision 72
-Added catalog data to the DB
Revision 71
-Fixed a couple issues
Revision 70
-Clients are now removed from their current room when they enter a new one
Revision 69
-Updated the license (currently in main and protocol)
Revision 68
-Started implementing FurnitureCore
Revision 67
-Started implementing Opcode::RequestSearchUsers
Revision 66
-Cleaned things up a bit, added 5 more threads to the default task system size
Revision 65
-Created table ProfileOverrides
Revision 64
-Fixed a couple things
Revision 63
-Hackey (but perfect?) club clothing implementation
Revision 62
-Fixed a few things
Revision 61
-Implemented Opcode::InitMessenger
Revision 60
-Renamed sendPacket(!Packet&) -> writeData(!Packet&), sendPacket is now reserved for sendPacket(Packet&)
Revision 59
-Implemented telling other clients when someone enters the room
Revision 58
-Implemented warping
Revision 57
-Added some debugging to try to fix an uncommon issue, added experimental license
Revision 56
-Clients now leave the room when they enter a new one.
Revision 55
-Implemented shout, whisper
Revision 54
-Cleaned up the output
Revision 53
-Implemented Opcode::RequestSay
Revision 52
-Implemented broadcasting packets to all clients in a room (Thanks Ktae)
Revision 51
-Made the hotel view button remove the client from the room
Revision 50
-Implemented room user listing
Revision 49
-Implemented linking clients to rooms
Revision 48
-Implemented more room info (stubs,) this is the result:
http://filebeam.com/9301b4cc1fc957dd4b0bb1e8c3fd05a3.jpg
Revision 45-47
-Implemented Opcode::RequestHeightmap
Revision 41-44
-Continued implementing room entering
Example of an implemented packet with the packet builder (private room category listing, incomplete but commented):
PHP:
--- at the beginning ---
int showfull = pak.readVL64();
int cat = pak.readVL64();
--- case 4 (private rooms root)? in the switch(cat) statement ---
query.prepare("SELECT id, title FROM roomcategories");
if(query.exec()){
Packet npak("C\\");
npak += showfull;
npak += cat;
npak += false; //?
npak += "Guest Rooms";
npak += 0;// current users
npak += 0;// max users
npak += 1;// parent id (should this be cat?)
//npak += 4;// rooms count
while (query.next()) {
npak += query.value(0).toInt();
npak += 2; //?
npak += query.value(1).toString();
npak += 0;//current visitors
npak += 0;//max visitors
npak += cat;
npak += false; //?
}
client->sendPacket(npak);
}
break;
--- another packet, full this time ---
case Opcode::RequestEnterRoom:
{
if(client->isInRoom)client->inRoom->removeClient(client); // remove the client from the current room
client->inRoom = Room::getRoom(pak.buffer.mid(pak.position,pak.buffer.length() - 5).toInt()); // D: plain text int
client->inRoom->addClient(client);
if(client->isInRoom){
Packet npak("@v");
npak += false; //?
npak += false; //?
npak += client->inRoom->id;
npak += client->inRoom->ownerstr;
npak += client->inRoom->model;
npak += client->inRoom->title;
npak += client->inRoom->description;
npak += true; //show owner
npak += true; //?
npak += false; //?
npak += 0; //current users
npak += 25; //max users
client->sendPacket(npak);
npak = Packet("Eb");
npak += 0;// category, nyi
client->sendPacket(npak);
}else{
//client->writeData("BKRoom not found!\001");
Packet err("BK");
err.appendRawLangString("error.room_not_found");
client->sendPacket(err);
}
break;
}
Also, some of the packets require slightly different handling, the packet system also supports methods for those, here is an example of that:
PHP:
case Opcode::RequestUserList:
{
Packet pae("@\\");
foreach(Client* pointer, client->inRoom->clients) {
pae.appendTaggedString('i', QString::number(pointer->userid));
pae.appendTaggedString('a', QString::number(pointer->userid));
pae.appendTaggedString('n', pointer->name);
pae.appendTaggedString('f', pointer->figure);
//pae.appendTaggedString('l', "5 5 1.0");
pae.appendRawString("l:");
pae.appendString(QString::number(pointer->xloc), ' ');
pae.appendString(QString::number(pointer->yloc), ' ');
pae.appendCarriageString(QString::number(pointer->zloc, 'f', 3));
pae.appendTaggedString('c', pointer->motto);
pae.appendTaggedString('s', pointer->gender);
pae.appendRawString("\rb:\x0d"); // yellow
}
client->sendPacket(pae);
break;
}
The latest code for the implementations of packets should always be available
You must be registered to see links
aswell.Possible future features/ideas:
Code:
- Remote control panel (desktop/possibly mobile)
- Server is set up to easily implement multiprotocol support in the future
- Javascript module system for easy server expansion
Known issues:
Code:
- Clients are not deleted quite properly yet, they can sometimes lead to a small (but not continuous) memory leak
This should be fixed once someone gets the time
- Poor error handling, sometimes a broken task can crash the server.
- A few packets are const char* stubs, and need to be updated, they include (server->client header):
- DU // encryption? thanks lab-hotel
- DA //date string/session variables?
- DZ //unknown registration
- DO //unknown registration
- CY //unknown registration
- Dt //?
- Dp //?
- Dy //?
- Dz //?
- DB //room load advertisement
- CP //unknown?
- @^ //unknown room related?
- @G // subscription information (stub)
- "Yay! It's being delivered now." message appears when the client sends AXCarryItem or whatever,
That packet is still unhandled so the client seems to be doing this all on it's own, maybe I need
to tell it NOT to do that?
- Some rugs are broken, the produce a PH box, this shouldn't be too hard to fix
- Sometimes the hand doesn't update when you place an item down so it stays in your hand,
it'l go away if you re-open the hand or put it down though, this shouldn't be too hard to fix
either. (items arent being duplicated, the client just isnt being updated correctly, this has been improved)
- If the server is spammed with an impossible amount of packets, the task system can break, a fix is currently in the works.
- The thread pool system is in need of some fixes (not hard ones though), some also pertaining to the above issue.
Here is a recent youtube video demonstrating the functionality of the server: (severely outdated) ( new video coming soon )
You must be registered to see links
And here are the old videos, more will be placed here as they become outdated:
You must be registered to see links
You must be registered to see links
You must be registered to see links
You must be registered to see links
I made showing some early stress testing of the server, this is outdated though.Screenshots:
How to compile:
Supported OS groups (Likely more not listed here):
Windows (2000?/XP/Vista/7/8) (With MSVC++/MingW)
Linux (With GCC)
Mac (With XCode)
Setting up Qt Creator on Windows:
-Download and install the
-Download and install
-Download and install the Qt SDK (online installer, or offline) from
Setting up Qt Creator on Linux: (Not universal, but you should be able to extrapolate)
-Download and install the package build-essential (GCC) (usually apt-get install build-essential)
-Download and install the following libraries:
-libglib2.0
-libSM
-libxrender
-libfontconfig
-libxext
(For debian and Ubuntu the command to do this is: sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev)
-Download the Qt SDK from
-Make the downloaded installer executable (chmod +x filename.bin)
-Run the installer (./filename.bin)
Setting up Qt Creator on Mac:
-Register as a developer on apple's website to download XCode (or find a mirror)
-install XCode (with the GNU C bindings, there should be a checkbox in the installer)
-Download and install the Qt SDK (online installer, or offline) from
Checking out and compiling NexusServer2:
-Install an SVN Client (apt-get isntall svn on linux, it comes with XCode on Mac, and I'd recommend
-Create a new folder for the NexusServer2 source.
-Check out the svn
-Open the .pro file you just checked out in QtCreator, you should be ready to compile!
Windows (2000?/XP/Vista/7/8) (With MSVC++/MingW)
Linux (With GCC)
Mac (With XCode)
Setting up Qt Creator on Windows:
-Download and install the
You must be registered to see links
-Download and install
You must be registered to see links
-Download and install the Qt SDK (online installer, or offline) from
You must be registered to see links
.Setting up Qt Creator on Linux: (Not universal, but you should be able to extrapolate)
-Download and install the package build-essential (GCC) (usually apt-get install build-essential)
-Download and install the following libraries:
-libglib2.0
-libSM
-libxrender
-libfontconfig
-libxext
(For debian and Ubuntu the command to do this is: sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev)
-Download the Qt SDK from
You must be registered to see links
.-Make the downloaded installer executable (chmod +x filename.bin)
-Run the installer (./filename.bin)
Setting up Qt Creator on Mac:
-Register as a developer on apple's website to download XCode (or find a mirror)
-install XCode (with the GNU C bindings, there should be a checkbox in the installer)
-Download and install the Qt SDK (online installer, or offline) from
You must be registered to see links
.Checking out and compiling NexusServer2:
-Install an SVN Client (apt-get isntall svn on linux, it comes with XCode on Mac, and I'd recommend
You must be registered to see links
for windows.)-Create a new folder for the NexusServer2 source.
-Check out the svn
You must be registered to see links
(svn co <url> for Linux and Mac, right click the folder and click "SVN Checkout..." for TortoiseSVN (windows))-Open the .pro file you just checked out in QtCreator, you should be ready to compile!
Links
Project's SVN:
You must be registered to see links
(active development)SVN Browser/source viewer:
You must be registered to see links
Old server SVN (buggy and depreciated):
You must be registered to see links
Old server root page (compiled downloads, somewhat dysfunctional):
You must be registered to see links
Testing sandbox:
You must be registered to see links
This project is far from complete, I expect it to be updated often.
We're looking for any help we can get on this project, that includes suggestions, so if you think you have something to contribute feel free to PM me or post here.
Last edited: