Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Your page needs to have a specific 'external' link/index name, like, the string above/below the page display title in the packet. It tries to open a page with a specific index name. There is where you buy the room promotion.
I don't know the index name but I think you can easily find it searching on anything with promotion stuff. Gluck.
Thank you : Leon saw my post helped me last night by saying the same thing, but I shortly went to bed without saying I fixed it -- was tired. I appreciate your help nonetheless.
I don't know if you can tell, but I'm working on room promotions.
Thank you : Leon saw my post helped me last night by saying the same thing, but I shortly went to bed without saying I fixed it -- was tired. I appreciate your help nonetheless.
I don't know if you can tell, but I'm working on room promotions.
Re: Icarus (Production) - Java Server [MySQL, Netty]
Changelog
Fixes
Fixed bug where user could walk about of teleporter while it was teleporting.
Fixed bug where it wasn't possible to teleport into a locked, or password protected room if the owner of that room was offline (weird bug I know).
Fixed bug where if multiple purchases of HC was performed, they wouldn't stack.
Fixed room deletion where the user who deletes their own room now has all their items saved back into their inventory.
Fixed bug where if an item was picked up or removed underneath the player which raises the players height, the player would be considered floating. Now the player's height adjusts to the next item down when the item has been removed/picked up.
Additions
Added permission system, along with the ability for permissions to be inherited.
Added feature to save custom room floor plans.
Added Lua integration which is now a plugin management system with event handling
Lua Plugin System
So with the Lua plugin system it's possible to change the functionality of the server without requiring any extensive Java knowledge, or without the need to download a Java IDE for the ability to create the plugin .jar files.
What is required is a Notepad program, which is what is used to write these plugins, and the methods/class names within Icarus too.
I've written an example called "BotPlugin" which will load 200 bots into a single room. Here is how it's handled, first with bot_plugin.lua
These method names have been inspired by Bukkit plugins for Minecraft I used to write. When the server first starts up, the "onEnable" is called if the plugin wishes to perform anything while the server loads.
And then it loads all the .lua files that have their paths stored in an array.
Code:
plugin_details = {
name = "BotPlugin",
author = "Quackster",
path = "plugins/BotPlugin"
}
event_register = {
"ROOM_ENTER_EVENT"
}
event_files = {
"room_events.lua"
}
[COLOR="#008000"]--[[
Called when the plugin first starts up, so the plugin can load data if needed
so when the event is called the plugin is ready
param: plugin instance
return: none
--]][/COLOR]
function onEnable(plugin)
-- If you want, use log.println() to show everyone this method being called
log:println(string.format('[Lua] Initialising plugin %s by %s', plugin:getName(), plugin:getAuthor()))
end
[COLOR="#008000"]
-- Load all event .lua files
-- If you delete this code, ABSOLUTELY NO events will work[/COLOR]
for i, file in ipairs(event_files) do
dofile (string.format('%s/events/%s', plugin_details.path, file))
end
Here is the room event handler (room_events.lua):
Code:
[COLOR="#008000"]--[[
Room enter event called when the user has entered a room
Called when a user has truly entered the room
param:
Player - person who entered room
Room - the room they entered
return: Boolean - event cancelled state
--]]
[/COLOR]function onRoomEnterEvent(player, room)
log:println("Room enter event called")
for i = 0, 200 - 1 do
local bot = createBot(room)
randomWalkEntity(bot)
end
return false
end
function createBot(room)
local bot = luajava.newInstance("org.alexdev.icarus.game.bot.Bot");
bot:getDetails():setName("RandomAlexBot")
bot:getDetails():setMotto("")
room:addEntity(bot)
return bot
end
function randomWalkEntity(entity)
local randomX = math.random(0, 25)
local randomY = math.random(0, 25)
entity:getRoomUser():walkTo(randomX, randomY)
plugin:runTaskLater(1, randomWalkEntity, { entity })
end
This will send a repeat call to randomWalkEntity(entity) every 1 second using the command I wrote called plugin:runTaskLater which will call a Lua function in a specified amount of seconds, along with using the function name and the array of parameters supplied.
I will be writing documentation on the plugin system in the future, for now I have created these events. Documentation is required for these events to know what parameters all of them require.
Re: Icarus (Production) - Java Server [MySQL, Netty]
As a proof of concept, I wrote the entire RCON/MUS server in Lua. It will probably need to be rewritten to handle things such as listening on a certain IP address/whitelist IP addresses but apart from that, it works :
You must be registered to see links
Code:
[COLOR="#008000"]--[[
The server socket handler for incoming RCON/MUS connections
@author: Quackster
--]][/COLOR]
function listenServer()
local server_socket = nil
log:println(string.format("[Rcon] Attempting to create RCON server on port %s", rcon_port))
server_socket = luajava.newInstance("java.net.ServerSocket", rcon_port);
log:println(string.format("[Rcon] RCON server listening on port %s", rcon_port))
log:println()
plugin:runTaskAsynchronously(waitForConnections, { server_socket })
end
[COLOR="#008000"]--[[
The function where the socket waits for incoming socket connections
and listens for data.
@author: Quackster
--]][/COLOR]
function waitForConnections(server_socket)
while (plugin:isClosed() == false) do
local socket = server_socket:accept()
log:println(string.format("Accepted connection from %s", socket:toString()))
local incoming_data = util:readToEnd(socket)
handleRconCommands(incoming_data)
socket:close()
end
end
[COLOR="#008000"]--[[
RCON command handler where it's possible to remote control
the server.
@author: Quackster
--]][/COLOR]
function handleRconCommands(incoming_data)
local rcon_data = util:split(incoming_data, ";")
local password = rcon_data:get(0)
local command = rcon_data:get(1)
-- Do not continue if the password is incorrect.
if password ~= rcon_password then
do return end
end
-- Find function in global namespace and call it.
_G[command_handlers[command]](rcon_data)
end
Code:
command_handlers = {
["ha"] = "cmdHotelAlert"
}
[COLOR="#008000"]--[[
This is to send hotel alerts remotely.
[USER=2000183830]para[/USER]meters:
rcon_data - split by ';' delimeter
Handler for RCON command : ha
Syntax : password;command;message
Example : password;ha;Hotel alert test!
--]][/COLOR]
function cmdHotelAlert(rcon_data)
local message = rcon_data:get(2)
local players = playerManager:getPlayers()
for i = 0, players:size() - 1 do
local player = players:get(i)
player:sendMessage(message)
end
end
Re: Icarus (Production) - Java Server [MySQL, Netty]
I've done a lot since I last posted which was only 5 days ago! I've updated to PRODUCTION-201709052204-426856518 build, which is the most recent Habbo build.
Now here's the changelog...
Targeted Offers
I've added targeted offers, which are special deals that run for a set amount of time before they expire, and they can only be bought once. Basically they look like this:
They will be able to be edited/deleted/added in the housekeeping, you can change the image, the text, how much credits (and/or other activity points such as duckets) cost, the items that can be purchased etc. In the housekeeping shown:
(if MUS/RCON is enabled, upon clicking submit, the targeted offers will be reloaded without restarting server)
Promotions
I've added room promotions, which is the typical feature of having a special entry in the events part of the navigator. It's sorted by the remaining time that is left, so lets say there's a room with 10 minutes and another with 20, the room with the fewer minutes left will be ordered first as that's how it works on Habbo.
Pets
The second feature I started has been pets, you can purchase them, place them - they walk around, and pick them up, they also support the feature where you can let others places their own pets in your room too, and when they're kicked they are placed into their owners inventory. Right now they're incomplete.
Groups
The third feature I've started on has been groups, you can purchase a group for a home room, view its group information, and delete the group, not much apart from that, the group feature is still complete.
Backend
Fun fact! Just today I stripped down Room.java from 629 lines to 202 lines.
Re: Icarus (Production) - Java Server [MySQL, Netty]
I love the updates, looks really good so far. I've been reading the source and you just improve more and more. I like that you refactor code while updating other things instead of just adding bunch of code, just to 'work'. Goodluck with this!
Re: Icarus (Production) - Java Server [MySQL, Netty]
This is so weird:
Code:
public void addEntity(Entity entity) {
this.addEntity(entity,
this.getModel().getDoorLocation().getX(),
this.getModel().getDoorLocation().getY(),
this.getModel().getDoorLocation().getRotation());
}
public void addEntity(Entity entity, int x, int y, int rotation) {
if (entity.getType() == EntityType.PLAYER) {
return;
}
}
So basically you have an addEntity method but you cannot call that on players which are actually also entities?
And in remove entity:
Code:
if (entity.getType() != EntityType.PLAYER) {
// Save coordinates of pet
if (entity.getType() == EntityType.PET) {
((Pet)entity).savePosition();
}
entity.dispose();
}
Why not use an interface or something so you don't have to check against the entity type? Also looking at this code entity is not disposed for players (Which makes me think there is a possible memory leak?).
Code:
public boolean hasRights(int userId, boolean ownerCheckOnly) {
Kind weird, why not make an isOwner(Habbo habbo) method?
Code:
public void dispose(boolean forceDisposal) {
if (forceDisposal) {
this.cleanupRoomData();
RoomManager.removeRoom(this.getData().getId());
} else {
--> if (this.getPlayers().size() > 0) {
return;
}
It is strange to see a dispose method not actually disposing if there are players in the room. Like, you expect it to dispose the room as thats what your method is named after... Unless you don't want to have it mimic a deconstructor, I think dispose is a bad name for a function that doesn't always dispose...
Instead of rushing with implementing features, take some good time to look at your design
public void addEntity(Entity entity) {
this.addEntity(entity,
this.getModel().getDoorLocation().getX(),
this.getModel().getDoorLocation().getY(),
this.getModel().getDoorLocation().getRotation());
}
public void addEntity(Entity entity, int x, int y, int rotation) {
if (entity.getType() == EntityType.PLAYER) {
return;
}
}
So basically you have an addEntity method but you cannot call that on players which are actually also entities?
And in remove entity:
Code:
if (entity.getType() != EntityType.PLAYER) {
// Save coordinates of pet
if (entity.getType() == EntityType.PET) {
((Pet)entity).savePosition();
}
entity.dispose();
}
Why not use an interface or something so you don't have to check against the entity type? Also looking at this code entity is not disposed for players (Which makes me think there is a possible memory leak?).
Code:
public boolean hasRights(int userId, boolean ownerCheckOnly) {
Kind weird, why not make an isOwner(Habbo habbo) method?
Code:
public void dispose(boolean forceDisposal) {
if (forceDisposal) {
this.cleanupRoomData();
RoomManager.removeRoom(this.getData().getId());
} else {
--> if (this.getPlayers().size() > 0) {
return;
}
It is strange to see a dispose method not actually disposing if there are players in the room. Like, you expect it to dispose the room as thats what your method is named after... Unless you don't want to have it mimic a deconstructor, I think dispose is a bad name for a function that doesn't always dispose...
Instead of rushing with implementing features, take some good time to look at your design
The snippet of code within Player.java takes care of being disposed, but after the refactoring I was still going to go over and check that everything gets nullified and is eligible for cleanup.
Re: Icarus (Production) - Java Server [MySQL, Netty]
Thanks for sharing this emu development! i loved your plugin manager so much that i decided to make my own plugin manager based on yours. I used luaj as you did and i used Rhino for javascript plugins.
You must be registered to see links
You must be registered to see links
i loved this because its simple and fast. thanks you again!
Thanks for sharing this emu development! i loved your plugin manager so much that i decided to make my own plugin manager based on yours. I used luaj as you did and i used Rhino for javascript plugins.
You must be registered to see links
You must be registered to see links
i loved this because its simple and fast. thanks you again!
Updates are looking really promising, I've been reading some of your commits on github and I must say you're good at keeping things simple. I love where this project is going, keep it up!
- Finally switched to using Gradle, so no more packaging jar shenanigans when people want to recompile.
- Switched from using BoneCP, as it's end of life, to HikariCP.
- Switched to using Lo4j logger, but I noticed that's end of life too, so I maybe need to use Log4j 2 if I want Java 9 compatibility in future.
- Now I've personally switched to IntelliJ over from Eclipse, but due to the nature of .gitignore and how Gradle can be imported into various IDE's, people can still use Eclipse if they wish (although I wouldn't recommend it...).
(Frontend...)
Switched to using Plus' catalogue, but I noticed there's a lot of customs and stuff that I just don't want, as I want to give a vanilla Habbo experience. I don't want customs filling up the furnidata, catalogue, etc. By scrubbing out the customs, it gives users a choice if they wish to add specific customs into their own server anyways.
So I ended up writing a converter that set all sprite ids in my database to -1 and then I read Habbo's official furnidata and then applied the sprite ids to the furniture that it could find, if it was the same class name and item type (wallitemtypes for wall items, and flooritemtypes for floor items, these tags can be found in the XML file).
The reason is that it helped distinguish to me what was a custom, and what was Habbo's official furni. Now Icarus is compatible with Habbo's official furnidata.xml
And I've also been organising the catalogue, by that I mean adding furni that is seemingly missing from from the catalogue, such as the lack of country flags that current Habbo retros have in regards to official Habbo, I mean seriously, there was no Australian flag until I redid the posters/wall decorations page... :glare:
The catalogues avaliable are also missing the dark iced furniture, and the dark pura furniture that Habbo currently has their catalogue, so right now I've added all of them and they just need to be configured (don't worry, the original Iced furniture is still there!) :
Oh, and I've also recounted the item definition ids, the catalogue page ids, the catalogue item ids from 1 upwards, because I noticed the later rows had like, ID 8000000+ when there was only 7000 rows in the database, but that's all fixed too. tt1:
It's still missing quite a few features, but it's the most complete server I've written myself so far. : I can't give an ETA on release, but I would appreciate it if people still kept replying to this thread.
It's been kind of dead lately even after posting updates :