Skip to content

Commit 3c3773d

Browse files
committed
ui fixes, and implement bungee
1 parent 9463fb0 commit 3c3773d

File tree

15 files changed

+327
-47
lines changed

15 files changed

+327
-47
lines changed

client/src/client/OpenAudioAppContainer.jsx

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { debugLog } from './services/debugging/DebugService';
1818
import { FadeToCtx, OAC } from '../components/contexts';
1919
import { VERSION } from '../build';
2020
import { isValidHttps } from './util/sslcheck';
21+
import { SeededTestData } from './config/TestData';
2122

2223
class OpenAudioAppContainer extends React.Component {
2324
static contextType = FadeToCtx;
@@ -78,24 +79,9 @@ class OpenAudioAppContainer extends React.Component {
7879
const url = new URL(window.location.href);
7980
const testMode = url.searchParams.get('testMode');
8081
if (testMode != null) {
81-
setBgColor('#c0392b');
82+
setBgColor('#818CF8');
8283
// set the global state to test mode
83-
setGlobalState({
84-
isLoading: false,
85-
clickLock: false,
86-
currentUser: {
87-
userName: 'Test User',
88-
uuid: 'b832a1b0-4843-4c73-9c83-2f8dad08d950',
89-
token: 'test',
90-
publicServerKey: 'test',
91-
},
92-
voiceState: {
93-
enabled: true,
94-
ready: true,
95-
isMutedServerSide: true,
96-
serverHasModeration: true,
97-
},
98-
});
84+
setGlobalState(SeededTestData);
9985
MessageModule.handleCountry('gb');
10086
return;
10187
}

client/src/client/config/TestData.jsx

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
const getRandomSpatialAudio = () => Math.random() < 0.5;
2+
3+
export const SeededTestData = {
4+
isLoading: false,
5+
clickLock: false,
6+
currentUser: {
7+
userName: 'Test User',
8+
uuid: 'b832a1b0-4843-4c73-9c83-2f8dad08d950',
9+
token: 'test',
10+
publicServerKey: 'test',
11+
},
12+
13+
lang: {
14+
serverName: 'play.imaginefun.net',
15+
},
16+
17+
voiceState: {
18+
enabled: true,
19+
ready: true,
20+
isMutedServerSide: true,
21+
serverHasModeration: true,
22+
peersHidden: false,
23+
24+
peers: {
25+
// Imagineers
26+
'e2afb937-6021-4b94-ba17-e6b5f0ec7685': {
27+
name: 'Midnightb',
28+
uuid: 'e2afb937-6021-4b94-ba17-e6b5f0ec7685',
29+
streamKey: 'e2afb937-6021-4b94-ba17-e6b5f0ec7685',
30+
speaking: getRandomSpatialAudio(),
31+
muted: false,
32+
loading: false,
33+
options: {
34+
spatialAudio: getRandomSpatialAudio(),
35+
visible: true,
36+
},
37+
displayName: 'Midnightb',
38+
displayUuid: 'e2afb937-6021-4b94-ba17-e6b5f0ec7685',
39+
},
40+
41+
// Devs
42+
'88243ba3-382f-4eb0-874f-c5831eb3c0a6': {
43+
name: 'ToetMats',
44+
uuid: '88243ba3-382f-4eb0-874f-c5831eb3c0a6',
45+
streamKey: '88243ba3-382f-4eb0-874f-c5831eb3c0a6',
46+
speaking: getRandomSpatialAudio(),
47+
muted: false,
48+
loading: false,
49+
options: {
50+
spatialAudio: getRandomSpatialAudio(),
51+
visible: true,
52+
},
53+
displayName: 'ToetMats',
54+
displayUuid: '88243ba3-382f-4eb0-874f-c5831eb3c0a6',
55+
},
56+
'f0c8657b-f384-4df6-9d66-e9f36c36ce8a': {
57+
name: 'MindGamesNl',
58+
uuid: 'f0c8657b-f384-4df6-9d66-e9f36c36ce8a',
59+
streamKey: 'f0c8657b-f384-4df6-9d66-e9f36c36ce8a',
60+
speaking: getRandomSpatialAudio(),
61+
muted: false,
62+
loading: false,
63+
options: {
64+
spatialAudio: getRandomSpatialAudio(),
65+
visible: true,
66+
},
67+
displayName: 'MindGamesNl',
68+
displayUuid: 'f0c8657b-f384-4df6-9d66-e9f36c36ce8a',
69+
},
70+
'601b4e30-e0b1-4f7b-af77-bf01a23be9de': {
71+
name: 'Cubits',
72+
uuid: '601b4e30-e0b1-4f7b-af77-bf01a23be9de',
73+
streamKey: '601b4e30-e0b1-4f7b-af77-bf01a23be9de',
74+
speaking: getRandomSpatialAudio(),
75+
muted: false,
76+
loading: false,
77+
options: {
78+
spatialAudio: getRandomSpatialAudio(),
79+
visible: true,
80+
},
81+
displayName: 'Cubits',
82+
displayUuid: '601b4e30-e0b1-4f7b-af77-bf01a23be9de',
83+
},
84+
'9f15bf38-96dd-4d0c-ba3b-cc6e447402ec': {
85+
name: 'DeJayDev',
86+
uuid: '9f15bf38-96dd-4d0c-ba3b-cc6e447402ec',
87+
streamKey: '9f15bf38-96dd-4d0c-ba3b-cc6e447402ec',
88+
speaking: getRandomSpatialAudio(),
89+
muted: false,
90+
loading: false,
91+
options: {
92+
spatialAudio: getRandomSpatialAudio(),
93+
visible: true,
94+
},
95+
displayName: 'DeJayDev',
96+
displayUuid: '9f15bf38-96dd-4d0c-ba3b-cc6e447402ec',
97+
},
98+
'7db73360-529c-4728-8935-40e62334226c': {
99+
name: 'RealInstantRamen',
100+
uuid: '7db73360-529c-4728-8935-40e62334226c',
101+
streamKey: '7db73360-529c-4728-8935-40e62334226c',
102+
speaking: getRandomSpatialAudio(),
103+
muted: false,
104+
loading: false,
105+
options: {
106+
spatialAudio: getRandomSpatialAudio(),
107+
visible: true,
108+
},
109+
displayName: 'RealInstantRamen',
110+
displayUuid: '7db73360-529c-4728-8935-40e62334226c',
111+
},
112+
113+
// Park Operators
114+
'5bf38c73-7fae-4144-a70e-b30b903a9658': {
115+
name: 'Jackets_',
116+
uuid: '5bf38c73-7fae-4144-a70e-b30b903a9658',
117+
streamKey: '5bf38c73-7fae-4144-a70e-b30b903a9658',
118+
speaking: getRandomSpatialAudio(),
119+
muted: false,
120+
loading: false,
121+
options: {
122+
spatialAudio: getRandomSpatialAudio(),
123+
visible: true,
124+
},
125+
displayName: 'Jackets_',
126+
displayUuid: '5bf38c73-7fae-4144-a70e-b30b903a9658',
127+
},
128+
'afb4bb27-0166-48d8-9478-9b96dc1efd09': {
129+
name: 'Foolish__Mortal',
130+
uuid: 'afb4bb27-0166-48d8-9478-9b96dc1efd09',
131+
streamKey: 'afb4bb27-0166-48d8-9478-9b96dc1efd09',
132+
speaking: getRandomSpatialAudio(),
133+
muted: false,
134+
loading: false,
135+
options: {
136+
spatialAudio: getRandomSpatialAudio(),
137+
visible: true,
138+
},
139+
displayName: 'Foolish__Mortal',
140+
displayUuid: 'afb4bb27-0166-48d8-9478-9b96dc1efd09',
141+
},
142+
'cc977440-03e1-4282-8996-6855dc912265': {
143+
name: 'Wuttles1',
144+
uuid: 'cc977440-03e1-4282-8996-6855dc912265',
145+
streamKey: 'cc977440-03e1-4282-8996-6855dc912265',
146+
speaking: getRandomSpatialAudio(),
147+
muted: false,
148+
loading: false,
149+
options: {
150+
spatialAudio: getRandomSpatialAudio(),
151+
visible: true,
152+
},
153+
displayName: 'Wuttles1',
154+
displayUuid: 'cc977440-03e1-4282-8996-6855dc912265',
155+
},
156+
'c5b29f32-5dba-4d85-8f2e-5bcd509f0589': {
157+
name: 'Yelyyah',
158+
uuid: 'c5b29f32-5dba-4d85-8f2e-5bcd509f0589',
159+
streamKey: 'c5b29f32-5dba-4d85-8f2e-5bcd509f0589',
160+
speaking: getRandomSpatialAudio(),
161+
muted: false,
162+
loading: false,
163+
options: {
164+
spatialAudio: getRandomSpatialAudio(),
165+
visible: true,
166+
},
167+
displayName: 'Yelyyah',
168+
displayUuid: 'c5b29f32-5dba-4d85-8f2e-5bcd509f0589',
169+
},
170+
'00db9369-d27b-4b73-bbec-38be7ac65950': {
171+
name: 'Godsgiftt',
172+
uuid: '00db9369-d27b-4b73-bbec-38be7ac65950',
173+
streamKey: '00db9369-d27b-4b73-bbec-38be7ac65950',
174+
speaking: getRandomSpatialAudio(),
175+
muted: false,
176+
loading: false,
177+
options: {
178+
spatialAudio: getRandomSpatialAudio(),
179+
visible: true,
180+
},
181+
displayName: 'Godsgiftt',
182+
displayUuid: '00db9369-d27b-4b73-bbec-38be7ac65950',
183+
},
184+
'd8c63cfd-67a1-4da4-b754-57bc3325cc16': {
185+
name: 'YetiSlippers',
186+
uuid: 'd8c63cfd-67a1-4da4-b754-57bc3325cc16',
187+
streamKey: 'd8c63cfd-67a1-4da4-b754-57bc3325cc16',
188+
speaking: getRandomSpatialAudio(),
189+
muted: false,
190+
loading: false,
191+
options: {
192+
spatialAudio: getRandomSpatialAudio(),
193+
visible: true,
194+
},
195+
displayName: 'YetiSlippers',
196+
displayUuid: 'd8c63cfd-67a1-4da4-b754-57bc3325cc16',
197+
},
198+
'c03e8c45-92ec-41ce-bbfb-de806aa4d38c': {
199+
name: 'Dispelsa',
200+
uuid: 'c03e8c45-92ec-41ce-bbfb-de806aa4d38c',
201+
streamKey: 'c03e8c45-92ec-41ce-bbfb-de806aa4d38c',
202+
speaking: getRandomSpatialAudio(),
203+
muted: false,
204+
loading: false,
205+
options: {
206+
spatialAudio: getRandomSpatialAudio(),
207+
visible: true,
208+
},
209+
displayName: 'Dispelsa',
210+
displayUuid: 'c03e8c45-92ec-41ce-bbfb-de806aa4d38c',
211+
},
212+
},
213+
},
214+
voiceChannels: {
215+
activeChannelId: 'staff-chat',
216+
channels: {
217+
'team-a': {
218+
name: 'private-channel',
219+
firstMembers: [
220+
{
221+
name: 'IModZombies4Fun',
222+
uuid: '6bed63db-beda-461f-a3a2-d138fd8e5bf4',
223+
},
224+
],
225+
},
226+
'staff-chat': {
227+
name: 'staff-chat',
228+
firstMembers: [
229+
{
230+
name: 'Mats',
231+
uuid: '88243ba3-382f-4eb0-874f-c5831eb3c0a6',
232+
},
233+
{
234+
name: 'Cubits',
235+
uuid: '601b4e30-e0b1-4f7b-af77-bf01a23be9de',
236+
},
237+
{
238+
name: 'Cameron_273',
239+
uuid: '3c94548c-c78d-4fe2-a27b-3cf29dfe4497',
240+
},
241+
],
242+
otherMembers: 6,
243+
},
244+
'off-topic': {
245+
name: 'off-topic',
246+
firstMembers: [
247+
{
248+
name: 'Izzy_29x',
249+
uuid: '6774cf2b-9185-4b53-993f-8e8339f4acae',
250+
},
251+
{
252+
name: 'Kai',
253+
uuid: '937acdcd-3170-42e4-9dc7-014aac719a4e',
254+
},
255+
],
256+
joinable: true,
257+
otherMembers: 0,
258+
},
259+
},
260+
},
261+
};

client/src/components/voice/VoicePeerBox.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,15 @@ function VoicePeerBox(props) {
8484
<div className="content-card bg-transparent border-transparent p-2">
8585
<div className="flex flex-wrap gap-4">
8686
{peers}
87-
<div className="h-full w-full text-center">
88-
<h2>{peerMessage}</h2>
87+
</div>
88+
<div
89+
className="bg-zinc-900/80 text-zinc-300 rounded-md px-3 py-2 text-sm font-medium flex items-center space-x-2 my-2"
90+
>
91+
<div className="flex items-center">
92+
<div className="w-2 h-2 bg-emerald-500 rounded-full animate-pulse mr-2" />
93+
<span>
94+
<h2>{peerMessage}</h2>
95+
</span>
8996
</div>
9097
</div>
9198
</div>

dev-resources/spawn-test-bungee-docker.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ cd plugin
77
./src/main/bash/post-build.sh
88
cd ..
99

10+
asdf local java adoptopenjdk-8.0.332+9
1011
mvn -T 4.5C clean install -Dmaven.test.skip=true
12+
asdf local java openjdk-21
1113

1214
# permission workaround
1315
rm -rf dev-resources/bungee-test/plugins/
1416
mkdir -p dev-resources/bungee-test/plugins/
1517
cp plugin/target/openaudiomc-*.jar dev-resources/bungee-test/plugins/
1618
cd dev-resources/bungee-test/
17-
docker-compose up --build
19+
docker-compose up --build

plugin/src/main/bash/data.bin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_NUM="1480"
1+
BUILD_NUM="1490"

plugin/src/main/java/com/craftmend/openaudiomc/generic/networking/handlers/ClientVoiceChanelInteractionHandler.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import com.craftmend.openaudiomc.generic.networking.abstracts.PayloadHandler;
66
import com.craftmend.openaudiomc.generic.networking.interfaces.Authenticatable;
77
import com.craftmend.openaudiomc.generic.networking.payloads.in.ClientVoiceInteractionPayload;
8+
import com.craftmend.openaudiomc.generic.node.packets.ClientUpdateStatePacket;
9+
import com.craftmend.openaudiomc.generic.node.packets.ForwardChannelUserInteractionPacket;
10+
import com.craftmend.openaudiomc.generic.platform.Platform;
11+
import com.craftmend.openaudiomc.generic.proxy.interfaces.UserHooks;
812
import com.craftmend.openaudiomc.spigot.modules.voicechat.VoiceChannelService;
913
import com.craftmend.openaudiomc.spigot.modules.voicechat.channels.Channel;
1014
import com.craftmend.openaudiomc.spigot.modules.voicechat.channels.ChannelEnterResponse;
@@ -18,7 +22,14 @@ public void onReceive(ClientVoiceInteractionPayload payload) {
1822

1923
ClientConnection connection = ((ClientConnection) authenticatable);
2024

21-
// todo: proxy to plugin if we're not spigot
25+
if (OpenAudioMc.getInstance().getPlatform() != Platform.SPIGOT) {
26+
UserHooks hooks = OpenAudioMc.getInstance().getInvoker().getUserHooks();
27+
hooks.sendPacket(connection.getUser(),
28+
new ForwardChannelUserInteractionPacket(payload)
29+
);
30+
return;
31+
}
32+
2233
VoiceChannelService voiceChannelService = OpenAudioMc.getService(VoiceChannelService.class);
2334

2435
switch (payload.getAction()) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import com.craftmend.openaudiomc.generic.networking.abstracts.PacketChannel;
55
import com.craftmend.openaudiomc.generic.networking.payloads.client.voice.channels.ClientChannelStatusPayload;
66

7-
public class ClientChannelStatusPacket extends AbstractPacket {
7+
public class PacketClientChannelStatusPacket extends AbstractPacket {
88

9-
public ClientChannelStatusPacket(String channel) {
9+
public PacketClientChannelStatusPacket(String channel) {
1010
super(
1111
new ClientChannelStatusPayload(channel),
1212
PacketChannel.CLIENT_OUT_CHANNEL_STATUS,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import com.craftmend.openaudiomc.generic.networking.abstracts.PacketChannel;
55
import com.craftmend.openaudiomc.generic.networking.payloads.client.voice.channels.ClientChannelsDisplayPayload;
66

7-
public class ClientChannelsDisplayPacket extends AbstractPacket {
7+
public class PacketClientChannelsDisplayPacket extends AbstractPacket {
88

9-
public ClientChannelsDisplayPacket(ClientChannelsDisplayPayload payload) {
9+
public PacketClientChannelsDisplayPacket(ClientChannelsDisplayPayload payload) {
1010
super(
1111
payload,
1212
PacketChannel.CLIENT_OUT_CHANNEL_LIST_PATCH,

0 commit comments

Comments
 (0)