mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 15:36:27 +01:00
Merge branch 'dev' of https://git.krews.org/morningstar/Arcturus-Community into dev
Conflicts: README.md
This commit is contained in:
commit
4ea550f34e
23
README.md
23
README.md
@ -5,9 +5,9 @@ Arcturus Morningstar is as a fork of Arcturus Emulator by TheGeneral. Arcturus M
|
||||
|
||||
| Flash | Community Clients |
|
||||
| ------------- | ------------- |
|
||||
| [PRODUCTION-201611291003-338511768](https://git.krews.org/morningstar/apollyon/uploads/dc669a26613bf2356e48eb653734ab29/patched-habbo.swf) | [Nitro (Recommended)*](https://github.com/billsonnn/nitro-react) |
|
||||
| [PRODUCTION-201611291003-338511768](https://git.krews.org/morningstar/apollyon/uploads/dc669a26613bf2356e48eb653734ab29/patched-habbo.swf) | [Nitro (Recommended)*](https://git.krews.org/nitro) |
|
||||
|
||||
###### *Note to use Nitro you will need to use the following [plugin](https://github.com/dank074/ms-websockets) with Arcturus Morningstar #######
|
||||
###### *Note to use Nitro you will need to use the following [plugin](https://git.krews.org/nitro/ms-websockets/-/releases) with Arcturus Morningstar #######
|
||||
|
||||
|
||||
|
||||
@ -16,23 +16,25 @@ Arcturus Morningstar is as a fork of Arcturus Emulator by TheGeneral. Arcturus M
|
||||
[![image](https://img.shields.io/discord/557240155040251905?style=for-the-badge&logo=discord&color=7289DA&label=KREWS&logoColor=fff)](https://discord.gg/BzfFsTp)
|
||||
|
||||
## Download ##
|
||||
[![image](https://img.shields.io/badge/STABLE%20RELEASES-3.5.1-success.svg?style=for-the-badge&logo=appveyor)](https://git.krews.org/morningstar/Arcturus-Community/-/releases)
|
||||
[![image](https://img.shields.io/badge/STABLE%20RELEASES-3.5.2-success.svg?style=for-the-badge&logo=appveyor)](https://git.krews.org/morningstar/Arcturus-Community/-/releases)
|
||||
|
||||
[![image](https://img.shields.io/badge/DEVELOPER%20BUILDS-4.0-red.svg?style=for-the-badge&logo=appveyor)](https://git.krews.org/morningstar/Arcturus-Community/-/jobs) *
|
||||
|
||||
[![image](https://img.shields.io/badge/RECOMMENDED%20PLUGINS-blue.svg?style=for-the-badge&logo=)](https://git.krews.org/morningstar/archive)
|
||||
|
||||
###### * Note to use these builds you will need to run any database updates from [here] (https://git.krews.org/morningstar/Arcturus-Community/-/tree/dev/sqlupdates) #######
|
||||
###### *Note: MS 4.0 is expected to have changes to the Plugin API, backwards compatibility with Plugins is dependant on the plugin developer. #######
|
||||
|
||||
|
||||
### Branches ###
|
||||
There are two main branches in use on the Arcturus Morningstar git. Below the pros an
|
||||
There are two main branches in use on the Arcturus Morningstar git. Developers should target the 4.x branch for merge requests.
|
||||
|
||||
| master | Tested on a production hotel and is stable for every day use with no known serious exploits. |
|
||||
| ------------- | ------------- |
|
||||
| master * | The stable 3.x branch of Arcturus Morningstar. |
|
||||
|----------|------------------------------------------------|
|
||||
###### * Note: This branch is no longer being maintained except for Security Patches #######
|
||||
|
||||
| dev | The most up-to-date, but features may not work as intended. Use at your own risk. |
|
||||
| ------------- | ------------- |
|
||||
| dev* | The 4.x branch of Arcturus Morningstar. |
|
||||
|------|-----------------------------------------|
|
||||
###### * Note: This version is currently untested on a production hotel and is not recommended for daily use until a release has been made. #######
|
||||
|
||||
|
||||
|
||||
@ -45,7 +47,7 @@ There is no set timeframe on when new versions will be released or when the stab
|
||||
You can report problems via the [Issue Tracker](https://git.krews.org/morningstar/Arcturus-Community/issues)*
|
||||
###### * When making an bug report or a feature request use the template we provide so that it can be categorized correctly and we have more information to replicate a bug or implement a feature correctly. ######
|
||||
#### Can I contribute code to this project? ####
|
||||
Of Course! if you have fixed a bug from the git please feel free to do a [merge request](https://git.krews.org/morningstar/Arcturus-Community/issues)*
|
||||
Of Course! Please target the developer branch if you have fixed a bug from the git, and feel free to do a [merge request](https://git.krews.org/morningstar/Arcturus-Community/issues)*
|
||||
###### * Anyone is allowed to fork the project and make pull requests, we make no guarantee that pull requests will be approved into the project. Please Do NOT push code which does not replicate behaviour on habbo.com, instead make the behaviour configurable or as a plugin. ######
|
||||
|
||||
|
||||
@ -106,7 +108,6 @@ If we ever are to make paid features or plugins, we will not prevent or discoura
|
||||
- Stankman
|
||||
- Laynester
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.eu.habbo</groupId>
|
||||
<artifactId>Habbo</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<version>3.5.2</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
@ -37,7 +37,7 @@ public final class Emulator {
|
||||
|
||||
public final static int MAJOR = 3;
|
||||
public final static int MINOR = 5;
|
||||
public final static int BUILD = 1;
|
||||
public final static int BUILD = 2;
|
||||
public final static String PREVIEW = "";
|
||||
|
||||
public static final String version = "Arcturus Morningstar" + " " + MAJOR + "." + MINOR + "." + BUILD + " " + PREVIEW;
|
||||
@ -115,11 +115,13 @@ public final class Emulator {
|
||||
System.out.println("Warning, this is a beta build, this means that there may be unintended consequences so make sure you take regular backups while using this build. If you notice any issues you should make an issue on the Krews Git.");
|
||||
promptEnterKey();
|
||||
}
|
||||
LOGGER.info("eek. Has it really been a year?");
|
||||
System.out.println("");
|
||||
LOGGER.warn("Arcturus Morningstar 3.x is no longer accepting merge requests. Please target MS4 branches if you wish to contribute.");
|
||||
LOGGER.info("Follow our development at https://git.krews.org/morningstar/Arcturus-Community, ");
|
||||
System.out.println("");
|
||||
LOGGER.info("This project is for educational purposes only. This Emulator is an open-source fork of Arcturus created by TheGeneral.");
|
||||
LOGGER.info("Version: {}", version);
|
||||
LOGGER.info("Build: {}", build);
|
||||
LOGGER.info("Follow our development at https://git.krews.org/morningstar/Arcturus-Community");
|
||||
|
||||
long startTime = System.nanoTime();
|
||||
|
||||
|
@ -183,6 +183,10 @@ public class CatalogItem implements ISerialize, Runnable, Comparable<CatalogItem
|
||||
return this.orderNumber;
|
||||
}
|
||||
|
||||
public void setNeedsUpdate(boolean needsUpdate) {
|
||||
this.needsUpdate = needsUpdate;
|
||||
}
|
||||
|
||||
public synchronized void sellRare() {
|
||||
this.limitedSells++;
|
||||
|
||||
|
@ -674,9 +674,13 @@ public class CatalogManager {
|
||||
|
||||
page = this.getCatalogPage(pageId);
|
||||
|
||||
if (page == null)
|
||||
return false;
|
||||
|
||||
page.getCatalogItems().put(item.getId(), item);
|
||||
|
||||
item.setPageId(pageId);
|
||||
item.setNeedsUpdate(true);
|
||||
|
||||
item.run();
|
||||
return true;
|
||||
|
@ -27,7 +27,7 @@ public class AddYoutubePlaylistCommand extends Command {
|
||||
int itemId;
|
||||
|
||||
try {
|
||||
itemId = Integer.valueOf(params[1]);
|
||||
itemId = Integer.parseInt(params[1]);
|
||||
} catch (NumberFormatException e) {
|
||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_add_youtube_playlist.no_base_item"));
|
||||
return true;
|
||||
@ -45,7 +45,7 @@ public class AddYoutubePlaylistCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
|
||||
Emulator.getGameEnvironment().getItemManager().getYoutubeManager().addPlaylistToItem(Integer.valueOf(params[1]), playlist);
|
||||
Emulator.getGameEnvironment().getItemManager().getYoutubeManager().addPlaylistToItem(Integer.parseInt(params[1]), playlist);
|
||||
|
||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO `youtube_playlists` (`item_id`, `playlist_id`) VALUES (?, ?)")) {
|
||||
statement.setInt(1, itemId);
|
||||
|
@ -95,20 +95,15 @@ public class YoutubeManager {
|
||||
final String playlistId = set.getString("playlist_id");
|
||||
|
||||
youtubeDataLoaderPool.submit(() -> {
|
||||
ArrayList<YoutubePlaylist> playlists = this.playlists.getOrDefault(itemId, new ArrayList<>());
|
||||
|
||||
YoutubePlaylist playlist;
|
||||
|
||||
try {
|
||||
playlist = this.getPlaylistDataById(playlistId);
|
||||
if (playlist != null) {
|
||||
playlists.add(playlist);
|
||||
this.addPlaylistToItem(itemId, playlist);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Failed to load YouTube playlist {} ERROR: {}", playlistId, e);
|
||||
}
|
||||
|
||||
this.playlists.put(itemId, playlists);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -118,10 +118,17 @@ public class Habbo implements Runnable {
|
||||
|
||||
public boolean connect() {
|
||||
String ip = "";
|
||||
String ProxyIP = "";
|
||||
|
||||
if (!Emulator.getConfig().getBoolean("networking.tcp.proxy") && this.client.getChannel().remoteAddress() != null) {
|
||||
SocketAddress address = this.client.getChannel().remoteAddress();
|
||||
ip = ((InetSocketAddress) address).getAddress().getHostAddress();
|
||||
ProxyIP = "- no proxy server used";
|
||||
}
|
||||
else
|
||||
{
|
||||
SocketAddress address = this.client.getChannel().remoteAddress();
|
||||
ProxyIP = ((InetSocketAddress) address).getAddress().getHostAddress();
|
||||
}
|
||||
|
||||
if (Emulator.getPluginManager().isRegistered(UserGetIPAddressEvent.class, true)) {
|
||||
@ -149,7 +156,7 @@ public class Habbo implements Runnable {
|
||||
this.messenger.connectionChanged(this, true, false);
|
||||
|
||||
Emulator.getGameEnvironment().getRoomManager().loadRoomsForHabbo(this);
|
||||
LOGGER.info("{} logged in from IP {}", this.habboInfo.getUsername(), this.habboInfo.getIpLogin());
|
||||
LOGGER.info("{} logged in from IP {} using proxyserver {}", this.habboInfo.getUsername(), this.habboInfo.getIpLogin(), ProxyIP);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,9 @@ import gnu.trove.procedure.TIntObjectProcedure;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class InventoryItemsComposer extends MessageComposer implements TIntObjectProcedure<HabboItem> {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(InventoryItemsComposer.class);
|
||||
|
||||
@ -48,7 +51,7 @@ public class InventoryItemsComposer extends MessageComposer implements TIntObjec
|
||||
this.response.appendInt(habboItem.getId());
|
||||
this.response.appendInt(habboItem.getBaseItem().getSpriteId());
|
||||
|
||||
if (habboItem.getBaseItem().getName().equals("floor") || habboItem.getBaseItem().getName().equals("landscape") || habboItem.getBaseItem().getName().equals("wallpaper") || habboItem.getBaseItem().getName().equals("poster")) {
|
||||
if (habboItem.getBaseItem().getName().equals("floor") || habboItem.getBaseItem().getName().equals("landscape") || habboItem.getBaseItem().getName().equals("song_disk") || habboItem.getBaseItem().getName().equals("wallpaper") || habboItem.getBaseItem().getName().equals("poster")) {
|
||||
switch (habboItem.getBaseItem().getName()) {
|
||||
case "landscape":
|
||||
this.response.appendInt(4);
|
||||
@ -62,10 +65,11 @@ public class InventoryItemsComposer extends MessageComposer implements TIntObjec
|
||||
case "poster":
|
||||
this.response.appendInt(6);
|
||||
break;
|
||||
case "song_disk":
|
||||
this.response.appendInt(8);
|
||||
break;
|
||||
}
|
||||
|
||||
this.response.appendInt(0);
|
||||
this.response.appendString(habboItem.getExtradata());
|
||||
this.addExtraDataToResponse(habboItem);
|
||||
} else {
|
||||
if (habboItem.getBaseItem().getName().equals("gnome_box"))
|
||||
this.response.appendInt(13);
|
||||
@ -82,12 +86,25 @@ public class InventoryItemsComposer extends MessageComposer implements TIntObjec
|
||||
this.response.appendBoolean(true);
|
||||
this.response.appendInt(-1);
|
||||
|
||||
|
||||
if (habboItem.getBaseItem().getType() == FurnitureType.FLOOR) {
|
||||
this.response.appendString("");
|
||||
if(habboItem.getBaseItem().getName().equals("song_disk")) {
|
||||
List<String> extraDataAsList = Arrays.asList(habboItem.getExtradata().split("\n"));
|
||||
this.response.appendInt(Integer.valueOf(extraDataAsList.get(extraDataAsList.size() - 1)));
|
||||
return true;
|
||||
}
|
||||
this.response.appendInt(habboItem instanceof InteractionGift ? ((((InteractionGift) habboItem).getColorId() * 1000) + ((InteractionGift) habboItem).getRibbonId()) : 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
public void addExtraDataToResponse(HabboItem habboItem) {
|
||||
this.response.appendInt(0);
|
||||
this.response.appendString(habboItem.getExtradata());
|
||||
}
|
||||
|
||||
}
|
@ -7,11 +7,18 @@ import com.eu.habbo.threading.runnables.ChannelReadHandler;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.handler.codec.DecoderException;
|
||||
import io.netty.handler.codec.TooLongFrameException;
|
||||
import io.netty.handler.codec.UnsupportedMessageTypeException;
|
||||
import io.netty.handler.ssl.NotSslRecordException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.net.ssl.SSLException;
|
||||
import javax.net.ssl.SSLHandshakeException;
|
||||
import java.io.IOException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
@ChannelHandler.Sharable
|
||||
public class GameMessageHandler extends ChannelInboundHandlerAdapter {
|
||||
@ -60,13 +67,34 @@ public class GameMessageHandler extends ChannelInboundHandlerAdapter {
|
||||
return;
|
||||
}
|
||||
if (Emulator.getConfig().getBoolean("debug.mode")) {
|
||||
if (cause instanceof TooLongFrameException) {
|
||||
LOGGER.error("Disconnecting client, reason: \"" + cause.getMessage() + "\".");
|
||||
} else {
|
||||
LOGGER.error("Disconnecting client, exception in GameMessageHander.", cause);
|
||||
if (cause instanceof NotSslRecordException) {
|
||||
LOGGER.error("Plaintext received instead of ssl, closing channel");
|
||||
}
|
||||
else if (cause instanceof DecoderException) {
|
||||
LOGGER.error("Plaintext received instead of ssl, closing channel");
|
||||
}
|
||||
else if (cause instanceof TooLongFrameException) {
|
||||
LOGGER.error("Disconnecting client, reason " + cause.getMessage());
|
||||
}
|
||||
else if (cause instanceof SSLHandshakeException) {
|
||||
LOGGER.error("URL Request error from source " + ctx.channel().remoteAddress());
|
||||
}
|
||||
else if (cause instanceof NoSuchAlgorithmException) {
|
||||
LOGGER.error("Invalid SSL algorithm, only TLSv1.2 supported in the request");
|
||||
}
|
||||
else if (cause instanceof KeyManagementException) {
|
||||
LOGGER.error("Invalid SSL algorithm, only TLSv1.2 supported in the request");
|
||||
}
|
||||
else if (cause instanceof UnsupportedMessageTypeException) {
|
||||
LOGGER.error("There was an illegal SSL request from (X-forwarded-for/CF-Connecting-IP has not being injected yet!) " + ctx.channel().remoteAddress());
|
||||
}
|
||||
else if (cause instanceof SSLException) {
|
||||
LOGGER.error("SSL Problem: "+ cause.getMessage() + cause);
|
||||
}
|
||||
else {
|
||||
LOGGER.error("Disconnecting client, exception in GameMessageHandler.", cause);
|
||||
}
|
||||
}
|
||||
ctx.channel().close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user