Files
micro-counter-strike-decomp…/p000/ConnectionManager.java
2026-03-18 12:51:32 +03:00

109 lines
3.0 KiB
Java

package p000;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import javax.microedition.io.StreamConnection;
/* renamed from: d */
/* loaded from: microcounterstrike.jar:d.class */
public final class ConnectionManager {
/* renamed from: d */
private static ConnectionManager connectionManager167;
/* renamed from: e */
private StreamConnection connection168;
/* renamed from: a */
public DataInputStream input169;
/* renamed from: b */
public DataOutputStream output170;
/* renamed from: c */
public boolean flag171 = true;
/* renamed from: a */
public static ConnectionManager getInstance(StreamConnection streamConnection) {
connectionManager167 = null;
connectionManager167 = new ConnectionManager(streamConnection);
return connectionManager167;
}
/* renamed from: a */
public static ConnectionManager getInstance_2() {
return connectionManager167;
}
/* renamed from: b */
public static void execute217() {
connectionManager167 = null;
}
private ConnectionManager(StreamConnection streamConnection) {
this.connection168 = streamConnection;
try {
this.input169 = new DataInputStream(streamConnection.openInputStream());
this.output170 = new DataOutputStream(streamConnection.openOutputStream());
execute219();
} catch (IOException e) {
execute218();
e.printStackTrace();
}
}
/* renamed from: g */
private void execute218() {
sendPacket223();
}
/* renamed from: h */
private void execute219() throws IOException {
this.output170.writeInt(9002);
this.output170.writeInt(MapManager.getInstance().currentMapIndex);
this.output170.flush();
}
/* renamed from: c */
public final void sendPacket220() throws IOException {
this.output170.writeInt(9003);
this.output170.flush();
}
/* renamed from: d */
public final void sendPacket221() throws IOException {
this.output170.writeInt(9004);
this.output170.flush();
}
/* renamed from: e */
public final void execute222() {
if (this.flag171) {
this.flag171 = false;
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v1, types: [boolean] */
/* JADX WARN: Type inference failed for: r0v10, types: [d] */
/* JADX WARN: Type inference failed for: r0v2, types: [java.lang.Throwable] */
/* renamed from: f */
public final void sendPacket223() {
?? r0 = this.flag171;
if (r0 != 0) {
return;
}
try {
this.flag171 = true;
this.input169.close();
this.output170.close();
this.connection168.close();
r0 = this;
r0.connection168 = null;
} catch (IOException e) {
r0.printStackTrace();
}
}
}