Skip to content

Commit af765fc

Browse files
authored
Merge pull request #60 from MultiChat/database
MultiChat 1.7.4
2 parents 1d2e2e4 + c267dae commit af765fc

28 files changed

Lines changed: 1451 additions & 55 deletions
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>xyz.olivermartin.multichat</groupId>
5+
<artifactId>multichat</artifactId>
6+
<version>1.7.4</version>
7+
<build>
8+
<plugins>
9+
<plugin>
10+
<artifactId>maven-shade-plugin</artifactId>
11+
<version>3.1.0</version>
12+
<executions>
13+
<execution>
14+
<phase>package</phase>
15+
<goals>
16+
<goal>shade</goal>
17+
</goals>
18+
</execution>
19+
</executions>
20+
<configuration>
21+
<relocations>
22+
<relocation>
23+
<pattern>org.bstats</pattern>
24+
<shadedPattern>xyz.olivermartin.bungee</shadedPattern>
25+
</relocation>
26+
</relocations>
27+
</configuration>
28+
</plugin>
29+
<plugin>
30+
<artifactId>maven-compiler-plugin</artifactId>
31+
<version>3.1</version>
32+
<configuration>
33+
<source>1.8</source>
34+
<target>1.8</target>
35+
</configuration>
36+
</plugin>
37+
</plugins>
38+
</build>
39+
<repositories>
40+
<repository>
41+
<id>CodeMC</id>
42+
<url>https://repo.codemc.org/repository/maven-public</url>
43+
</repository>
44+
<repository>
45+
<id>sponge</id>
46+
<url>http://repo.spongepowered.org/maven</url>
47+
</repository>
48+
<repository>
49+
<id>bungeecord-repo</id>
50+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
51+
</repository>
52+
<repository>
53+
<id>spigot-repo</id>
54+
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
55+
</repository>
56+
<repository>
57+
<id>vault-repo</id>
58+
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
59+
</repository>
60+
<repository>
61+
<id>placeholderapi</id>
62+
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
63+
</repository>
64+
<repository>
65+
<id>jitpack.io</id>
66+
<url>https://jitpack.io</url>
67+
</repository>
68+
</repositories>
69+
<dependencies>
70+
<dependency>
71+
<groupId>org.spongepowered</groupId>
72+
<artifactId>spongeapi</artifactId>
73+
<version>7.1.0</version>
74+
<scope>provided</scope>
75+
<exclusions>
76+
<exclusion>
77+
<artifactId>error_prone_annotations</artifactId>
78+
<groupId>com.google.errorprone</groupId>
79+
</exclusion>
80+
<exclusion>
81+
<artifactId>gson</artifactId>
82+
<groupId>com.google.code.gson</groupId>
83+
</exclusion>
84+
<exclusion>
85+
<artifactId>commons-lang3</artifactId>
86+
<groupId>org.apache.commons</groupId>
87+
</exclusion>
88+
<exclusion>
89+
<artifactId>jsr305</artifactId>
90+
<groupId>com.google.code.findbugs</groupId>
91+
</exclusion>
92+
<exclusion>
93+
<artifactId>guice</artifactId>
94+
<groupId>com.google.inject</groupId>
95+
</exclusion>
96+
<exclusion>
97+
<artifactId>caffeine</artifactId>
98+
<groupId>com.github.ben-manes.caffeine</groupId>
99+
</exclusion>
100+
<exclusion>
101+
<artifactId>guava</artifactId>
102+
<groupId>com.github.ben-manes.caffeine</groupId>
103+
</exclusion>
104+
<exclusion>
105+
<artifactId>plugin-meta</artifactId>
106+
<groupId>org.spongepowered</groupId>
107+
</exclusion>
108+
<exclusion>
109+
<artifactId>configurate-hocon</artifactId>
110+
<groupId>org.spongepowered</groupId>
111+
</exclusion>
112+
<exclusion>
113+
<artifactId>configurate-gson</artifactId>
114+
<groupId>org.spongepowered</groupId>
115+
</exclusion>
116+
<exclusion>
117+
<artifactId>configurate-yaml</artifactId>
118+
<groupId>org.spongepowered</groupId>
119+
</exclusion>
120+
<exclusion>
121+
<artifactId>flow-math</artifactId>
122+
<groupId>com.flowpowered</groupId>
123+
</exclusion>
124+
<exclusion>
125+
<artifactId>flow-noise</artifactId>
126+
<groupId>com.flowpowered</groupId>
127+
</exclusion>
128+
<exclusion>
129+
<artifactId>asm</artifactId>
130+
<groupId>org.ow2.asm</groupId>
131+
</exclusion>
132+
</exclusions>
133+
</dependency>
134+
<dependency>
135+
<groupId>net.md-5</groupId>
136+
<artifactId>bungeecord-api</artifactId>
137+
<version>1.14-SNAPSHOT</version>
138+
<scope>provided</scope>
139+
<exclusions>
140+
<exclusion>
141+
<artifactId>bungeecord-chat</artifactId>
142+
<groupId>net.md-5</groupId>
143+
</exclusion>
144+
<exclusion>
145+
<artifactId>bungeecord-config</artifactId>
146+
<groupId>net.md-5</groupId>
147+
</exclusion>
148+
<exclusion>
149+
<artifactId>bungeecord-event</artifactId>
150+
<groupId>net.md-5</groupId>
151+
</exclusion>
152+
<exclusion>
153+
<artifactId>bungeecord-protocol</artifactId>
154+
<groupId>net.md-5</groupId>
155+
</exclusion>
156+
</exclusions>
157+
</dependency>
158+
<dependency>
159+
<groupId>net.md-5</groupId>
160+
<artifactId>bungeecord-api</artifactId>
161+
<version>1.14-SNAPSHOT</version>
162+
<type>javadoc</type>
163+
<scope>provided</scope>
164+
<exclusions>
165+
<exclusion>
166+
<artifactId>bungeecord-chat</artifactId>
167+
<groupId>net.md-5</groupId>
168+
</exclusion>
169+
<exclusion>
170+
<artifactId>bungeecord-config</artifactId>
171+
<groupId>net.md-5</groupId>
172+
</exclusion>
173+
<exclusion>
174+
<artifactId>bungeecord-event</artifactId>
175+
<groupId>net.md-5</groupId>
176+
</exclusion>
177+
<exclusion>
178+
<artifactId>bungeecord-protocol</artifactId>
179+
<groupId>net.md-5</groupId>
180+
</exclusion>
181+
</exclusions>
182+
</dependency>
183+
<dependency>
184+
<groupId>org.spigotmc</groupId>
185+
<artifactId>spigot-api</artifactId>
186+
<version>1.14.2-R0.1-SNAPSHOT</version>
187+
<scope>provided</scope>
188+
<exclusions>
189+
<exclusion>
190+
<artifactId>commons-lang</artifactId>
191+
<groupId>commons-lang</groupId>
192+
</exclusion>
193+
<exclusion>
194+
<artifactId>snakeyaml</artifactId>
195+
<groupId>org.yaml</groupId>
196+
</exclusion>
197+
<exclusion>
198+
<artifactId>gson</artifactId>
199+
<groupId>com.google.code.gson</groupId>
200+
</exclusion>
201+
<exclusion>
202+
<artifactId>bungeecord-chat</artifactId>
203+
<groupId>net.md-5</groupId>
204+
</exclusion>
205+
</exclusions>
206+
</dependency>
207+
<dependency>
208+
<groupId>net.milkbowl.vault</groupId>
209+
<artifactId>VaultAPI</artifactId>
210+
<version>1.6</version>
211+
<scope>provided</scope>
212+
<exclusions>
213+
<exclusion>
214+
<artifactId>bukkit</artifactId>
215+
<groupId>org.bukkit</groupId>
216+
</exclusion>
217+
</exclusions>
218+
</dependency>
219+
<dependency>
220+
<groupId>me.clip</groupId>
221+
<artifactId>placeholderapi</artifactId>
222+
<version>2.9.2</version>
223+
<scope>provided</scope>
224+
</dependency>
225+
</dependencies>
226+
</project>
227+

multichat/pom.xml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55

66
<groupId>xyz.olivermartin.multichat</groupId>
77
<artifactId>multichat</artifactId>
8-
<version>1.7.3</version>
8+
<version>1.7.4</version>
99

1010
<repositories>
1111

12+
<repository>
13+
<id>CodeMC</id>
14+
<url>https://repo.codemc.org/repository/maven-public</url>
15+
</repository>
16+
1217
<repository>
1318
<id>sponge</id>
1419
<url>http://repo.spongepowered.org/maven</url>
@@ -43,6 +48,12 @@
4348

4449
<build>
4550
<plugins>
51+
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>
52+
<version>3.1.0</version> <configuration> <relocations> <relocation> <pattern>org.bstats</pattern>
53+
<shadedPattern>xyz.olivermartin.bungee</shadedPattern> </relocation> </relocations>
54+
</configuration> <executions> <execution> <phase>package</phase> <goals>
55+
<goal>shade</goal> </goals> </execution> </executions> </plugin> -->
56+
4657
<plugin>
4758
<groupId>org.apache.maven.plugins</groupId>
4859
<artifactId>maven-compiler-plugin</artifactId>
@@ -57,6 +68,19 @@
5768

5869
<dependencies>
5970

71+
<!-- <dependency>
72+
<groupId>org.bstats</groupId>
73+
<artifactId>bstats-bungeecord</artifactId>
74+
<version>1.4</version>
75+
<scope>compile</scope>
76+
</dependency> -->
77+
78+
<dependency>
79+
<groupId>org.xerial</groupId>
80+
<artifactId>sqlite-jdbc</artifactId>
81+
<version>3.27.2.1</version>
82+
</dependency>
83+
6084
<dependency>
6185
<groupId>org.spongepowered</groupId>
6286
<artifactId>spongeapi</artifactId>
@@ -67,23 +91,23 @@
6791
<dependency>
6892
<groupId>net.md-5</groupId>
6993
<artifactId>bungeecord-api</artifactId>
70-
<version>1.13-SNAPSHOT</version>
94+
<version>1.14-SNAPSHOT</version>
7195
<type>jar</type>
7296
<scope>provided</scope>
7397
</dependency>
7498

7599
<dependency>
76100
<groupId>net.md-5</groupId>
77101
<artifactId>bungeecord-api</artifactId>
78-
<version>1.13-SNAPSHOT</version>
102+
<version>1.14-SNAPSHOT</version>
79103
<type>javadoc</type>
80104
<scope>provided</scope>
81105
</dependency>
82106

83107
<dependency>
84108
<groupId>org.spigotmc</groupId>
85109
<artifactId>spigot-api</artifactId>
86-
<version>1.13.1-R0.1-SNAPSHOT</version>
110+
<version>1.14.2-R0.1-SNAPSHOT</version>
87111
<scope>provided</scope>
88112
</dependency>
89113

249 KB
Binary file not shown.

multichat/src/main/java/xyz/olivermartin/multichat/bungee/BungeeComm.java

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static void sendCommandMessage(String command, ServerInfo server) {
8888
e.printStackTrace();
8989
}
9090

91-
server.sendData("multichat:action", stream.toByteArray());
91+
server.sendData("multichat:act", stream.toByteArray());
9292

9393
}
9494

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

110-
server.sendData("multichat:paction", stream.toByteArray());
110+
server.sendData("multichat:pact", stream.toByteArray());
111111

112112
}
113113

@@ -173,16 +173,16 @@ public static void sendPlayerChannelMessage(String playerName, String channel, C
173173
e.printStackTrace();
174174
}
175175

176-
server.sendData("multichat:channel", stream.toByteArray());
176+
server.sendData("multichat:ch", stream.toByteArray());
177177

178-
DebugManager.log("Sent message on multichat:channel channel!");
178+
DebugManager.log("Sent message on multichat:ch channel!");
179179

180180
}
181181

182182
@EventHandler
183183
public static void onPluginMessage(PluginMessageEvent ev) {
184184

185-
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")) ) {
185+
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")) ) {
186186
return;
187187
}
188188

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

359359
}
360360

361+
if (ev.getTag().equals("multichat:dn")) {
362+
363+
DebugManager.log("[multichat:dn] Got an incoming channel message!");
364+
365+
ByteArrayInputStream stream = new ByteArrayInputStream(ev.getData());
366+
DataInputStream in = new DataInputStream(stream);
367+
368+
try {
369+
370+
UUID uuid = UUID.fromString(in.readUTF());
371+
String spigotDisplayName = in.readUTF();
372+
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(uuid);
373+
374+
if (player == null) return;
375+
376+
synchronized (player) {
377+
378+
DebugManager.log("[multichat:dn] Player exists!");
379+
380+
Optional<PlayerMeta> opm = PlayerMetaManager.getInstance().getPlayer(uuid);
381+
382+
if (opm.isPresent()) {
383+
384+
DebugManager.log("[multichat:dn] Player meta exists!");
385+
386+
DebugManager.log("[multichat:dn] The displayname received is: " + spigotDisplayName);
387+
388+
opm.get().spigotDisplayName = spigotDisplayName;
389+
PlayerMetaManager.getInstance().updateDisplayName(uuid);
390+
391+
}
392+
393+
}
394+
395+
} catch (IOException e) {
396+
e.printStackTrace();
397+
}
398+
399+
}
400+
361401
if (ev.getTag().equals("multichat:world")) {
362402

363403
ByteArrayInputStream stream = new ByteArrayInputStream(ev.getData());

0 commit comments

Comments
 (0)