- Joined
- Dec 11, 2010
- Messages
- 2,955
- Reaction score
- 2,688
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.
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
[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
[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
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
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;
}
}
if (entity.getType() != EntityType.PLAYER) {
// Save coordinates of pet
if (entity.getType() == EntityType.PET) {
((Pet)entity).savePosition();
}
entity.dispose();
}
public boolean hasRights(int userId, boolean ownerCheckOnly) {
public void dispose(boolean forceDisposal) {
if (forceDisposal) {
this.cleanupRoomData();
RoomManager.removeRoom(this.getData().getId());
} else {
--> if (this.getPlayers().size() > 0) {
return;
}
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?
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...Code:public void dispose(boolean forceDisposal) { if (forceDisposal) { this.cleanupRoomData(); RoomManager.removeRoom(this.getData().getId()); } else { --> if (this.getPlayers().size() > 0) { return; }
Instead of rushing with implementing features, take some good time to look at your design
Also looking at this code entity is not disposed for players (Which makes me think there is a possible memory leak?).
"your" RSA pcks unpad function is flawed. Sometimes it fails to unpad, never understood why.. I fixed it with this implementation:You must be registered to see links
"your" RSA pcks unpad function is flawed. Sometimes it fails to unpad, never understood why.. I fixed it with this implementation:You must be registered to see links
Should have used System.arraycopy instead of a for loop
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!Updates
Added
- Updated to PRODUCTION-201709192204-203982672
- Thumbnails now working 100% (the previous thumbnail picture gets deleted if user sets a new thumbnail, or deletes the room, to save disk space).
- Camera photos now purchasable.
- Place photo in room.
- Pickup photo.
- Delete photo.
- One way gates interaction added.
- User management in groups finished.
- Ability to disable thumbnail functions in server properties file.
- Ability to disable camera functions in server properties file.
Fixed
- Furniture interaction sometimes doesn't work while on rugs.
already love this emulator, just wondering how far it is already? when will we have some kind of release because i'd love to use this