128 lines
4.0 KiB
Java
128 lines
4.0 KiB
Java
package p000;
|
|
|
|
import java.io.DataInputStream;
|
|
import java.io.DataOutputStream;
|
|
import java.io.IOException;
|
|
import javax.microedition.io.StreamConnection;
|
|
|
|
/* renamed from: av */
|
|
/* loaded from: microcounterstrike.jar:av.class */
|
|
public final class BluetoothControlChannel implements Runnable {
|
|
|
|
/* renamed from: c */
|
|
private StreamConnection connection94;
|
|
|
|
/* renamed from: a */
|
|
public DataInputStream input95;
|
|
|
|
/* renamed from: b */
|
|
public DataOutputStream output96;
|
|
|
|
/* renamed from: d */
|
|
private boolean flag97 = true;
|
|
|
|
public BluetoothControlChannel(StreamConnection streamConnection) {
|
|
this.connection94 = streamConnection;
|
|
try {
|
|
this.input95 = streamConnection.openDataInputStream();
|
|
this.output96 = streamConnection.openDataOutputStream();
|
|
} catch (IOException unused) {
|
|
readPacket136();
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX WARN: Type inference failed for: r0v1 */
|
|
/* JADX WARN: Type inference failed for: r0v14 */
|
|
/* JADX WARN: Type inference failed for: r0v3, types: [java.lang.Throwable] */
|
|
@Override // java.lang.Runnable
|
|
public final void run() throws InterruptedException {
|
|
boolean z = false;
|
|
while (true) {
|
|
?? r0 = z;
|
|
if (r0 != 0) {
|
|
return;
|
|
}
|
|
try {
|
|
try {
|
|
r0 = 50;
|
|
Thread.sleep(50L);
|
|
} catch (InterruptedException e) {
|
|
r0.printStackTrace();
|
|
}
|
|
MainUiCanvasBase abstractC0037fM227a = MainUiCanvasBase.getInstance();
|
|
switch (this.input95.readInt()) {
|
|
case 9002:
|
|
MapManager.getInstance().currentMapIndex = this.input95.readInt();
|
|
continue;
|
|
case 9003:
|
|
abstractC0037fM227a.value181 = 13;
|
|
abstractC0037fM227a.execute37();
|
|
GameLoadingThread.getInstance();
|
|
GameLoadingThread.showScreen95();
|
|
continue;
|
|
case 9004:
|
|
GameSessionLoop.getInstance().start();
|
|
z = true;
|
|
continue;
|
|
}
|
|
} catch (IOException unused) {
|
|
readPacket136();
|
|
return;
|
|
}
|
|
readPacket136();
|
|
return;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r0v4, types: [java.io.DataOutputStream, java.lang.Throwable] */
|
|
/* renamed from: a */
|
|
public final void sendPacket135() {
|
|
?? r0;
|
|
try {
|
|
this.output96.writeInt(1002);
|
|
r0 = this.output96;
|
|
r0.flush();
|
|
} catch (IOException e) {
|
|
r0.printStackTrace();
|
|
}
|
|
}
|
|
|
|
/* renamed from: b */
|
|
public final void readPacket136() {
|
|
execute138();
|
|
MainUiCanvasBase abstractC0037fM227a = MainUiCanvasBase.getInstance();
|
|
abstractC0037fM227a.value181 = 25;
|
|
abstractC0037fM227a.execute37();
|
|
}
|
|
|
|
/* renamed from: c */
|
|
public final void execute137() {
|
|
if (this.flag97) {
|
|
new Thread(this).start();
|
|
this.flag97 = false;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX WARN: Type inference failed for: r0v1, types: [boolean] */
|
|
/* JADX WARN: Type inference failed for: r0v2, types: [java.lang.Throwable] */
|
|
/* JADX WARN: Type inference failed for: r0v9, types: [javax.microedition.io.Connection, javax.microedition.io.StreamConnection] */
|
|
/* renamed from: d */
|
|
public final void execute138() {
|
|
?? r0 = this.flag97;
|
|
if (r0 != 0) {
|
|
return;
|
|
}
|
|
try {
|
|
this.flag97 = true;
|
|
this.input95.close();
|
|
this.output96.close();
|
|
r0 = this.connection94;
|
|
r0.close();
|
|
} catch (IOException e) {
|
|
r0.printStackTrace();
|
|
}
|
|
}
|
|
}
|