Skip to content

Commit

Permalink
Merge pull request #60 from MultiChat/database
Browse files Browse the repository at this point in the history
MultiChat 1.7.4
  • Loading branch information
OllieMartin authored Aug 1, 2019
2 parents 1d2e2e4 + c267dae commit af765fc
Show file tree
Hide file tree
Showing 28 changed files with 1,451 additions and 55 deletions.
227 changes: 227 additions & 0 deletions multichat/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xyz.olivermartin.multichat</groupId>
<artifactId>multichat</artifactId>
<version>1.7.4</version>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>xyz.olivermartin.bungee</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
<repository>
<id>sponge</id>
<url>http://repo.spongepowered.org/maven</url>
</repository>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId>
<version>7.1.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>error_prone_annotations</artifactId>
<groupId>com.google.errorprone</groupId>
</exclusion>
<exclusion>
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
<exclusion>
<artifactId>commons-lang3</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
</exclusion>
<exclusion>
<artifactId>guice</artifactId>
<groupId>com.google.inject</groupId>
</exclusion>
<exclusion>
<artifactId>caffeine</artifactId>
<groupId>com.github.ben-manes.caffeine</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.github.ben-manes.caffeine</groupId>
</exclusion>
<exclusion>
<artifactId>plugin-meta</artifactId>
<groupId>org.spongepowered</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-hocon</artifactId>
<groupId>org.spongepowered</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-gson</artifactId>
<groupId>org.spongepowered</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-yaml</artifactId>
<groupId>org.spongepowered</groupId>
</exclusion>
<exclusion>
<artifactId>flow-math</artifactId>
<groupId>com.flowpowered</groupId>
</exclusion>
<exclusion>
<artifactId>flow-noise</artifactId>
<groupId>com.flowpowered</groupId>
</exclusion>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.14-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>bungeecord-chat</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-config</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-event</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-protocol</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.14-SNAPSHOT</version>
<type>javadoc</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>bungeecord-chat</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-config</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-event</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-protocol</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>commons-lang</artifactId>
<groupId>commons-lang</groupId>
</exclusion>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
</exclusion>
<exclusion>
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-chat</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.6</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>bukkit</artifactId>
<groupId>org.bukkit</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.9.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

32 changes: 28 additions & 4 deletions multichat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@

<groupId>xyz.olivermartin.multichat</groupId>
<artifactId>multichat</artifactId>
<version>1.7.3</version>
<version>1.7.4</version>

<repositories>

<repository>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>

<repository>
<id>sponge</id>
<url>http://repo.spongepowered.org/maven</url>
Expand Down Expand Up @@ -43,6 +48,12 @@

<build>
<plugins>
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version> <configuration> <relocations> <relocation> <pattern>org.bstats</pattern>
<shadedPattern>xyz.olivermartin.bungee</shadedPattern> </relocation> </relocations>
</configuration> <executions> <execution> <phase>package</phase> <goals>
<goal>shade</goal> </goals> </execution> </executions> </plugin> -->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -57,6 +68,19 @@

<dependencies>

<!-- <dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bungeecord</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency> -->

<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.27.2.1</version>
</dependency>

<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId>
Expand All @@ -67,23 +91,23 @@
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.13-SNAPSHOT</version>
<version>1.14-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.13-SNAPSHOT</version>
<version>1.14-SNAPSHOT</version>
<type>javadoc</type>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.13.1-R0.1-SNAPSHOT</version>
<version>1.14.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

Expand Down
Binary file added multichat/releases/1.7.4/multichat-1.7.4.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static void sendCommandMessage(String command, ServerInfo server) {
e.printStackTrace();
}

server.sendData("multichat:action", stream.toByteArray());
server.sendData("multichat:act", stream.toByteArray());

}

Expand All @@ -107,7 +107,7 @@ public static void sendPlayerCommandMessage(String command, String playerRegex,
e.printStackTrace();
}

server.sendData("multichat:paction", stream.toByteArray());
server.sendData("multichat:pact", stream.toByteArray());

}

Expand Down Expand Up @@ -173,16 +173,16 @@ public static void sendPlayerChannelMessage(String playerName, String channel, C
e.printStackTrace();
}

server.sendData("multichat:channel", stream.toByteArray());
server.sendData("multichat:ch", stream.toByteArray());

DebugManager.log("Sent message on multichat:channel channel!");
DebugManager.log("Sent message on multichat:ch channel!");

}

@EventHandler
public static void onPluginMessage(PluginMessageEvent ev) {

if (! (ev.getTag().equals("multichat:comm") || ev.getTag().equals("multichat:chat") || ev.getTag().equals("multichat:prefix") || ev.getTag().equals("multichat:suffix") || ev.getTag().equals("multichat:world") || ev.getTag().equals("multichat:nick")) ) {
if (! (ev.getTag().equals("multichat:comm") || ev.getTag().equals("multichat:chat") || ev.getTag().equals("multichat:prefix") || ev.getTag().equals("multichat:suffix") || ev.getTag().equals("multichat:dn") || ev.getTag().equals("multichat:world") || ev.getTag().equals("multichat:nick")) ) {
return;
}

Expand Down Expand Up @@ -358,6 +358,46 @@ public static void onPluginMessage(PluginMessageEvent ev) {

}

if (ev.getTag().equals("multichat:dn")) {

DebugManager.log("[multichat:dn] Got an incoming channel message!");

ByteArrayInputStream stream = new ByteArrayInputStream(ev.getData());
DataInputStream in = new DataInputStream(stream);

try {

UUID uuid = UUID.fromString(in.readUTF());
String spigotDisplayName = in.readUTF();
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(uuid);

if (player == null) return;

synchronized (player) {

DebugManager.log("[multichat:dn] Player exists!");

Optional<PlayerMeta> opm = PlayerMetaManager.getInstance().getPlayer(uuid);

if (opm.isPresent()) {

DebugManager.log("[multichat:dn] Player meta exists!");

DebugManager.log("[multichat:dn] The displayname received is: " + spigotDisplayName);

opm.get().spigotDisplayName = spigotDisplayName;
PlayerMetaManager.getInstance().updateDisplayName(uuid);

}

}

} catch (IOException e) {
e.printStackTrace();
}

}

if (ev.getTag().equals("multichat:world")) {

ByteArrayInputStream stream = new ByteArrayInputStream(ev.getData());
Expand Down
Loading

0 comments on commit af765fc

Please sign in to comment.