Spaces:
Running
Running
htr
commited on
Commit
·
406dcaf
1
Parent(s):
f8b8303
- pom - Copy.xml +121 -0
- src/main/java/tqtk/XuLy/Worker.java +73 -21
- src/main/java/tqtk/XuLy/XuLyPacket.java +2 -2
pom - Copy.xml
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"
|
3 |
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
4 |
+
<modelVersion>4.0.0</modelVersion>
|
5 |
+
<parent>
|
6 |
+
<groupId>org.springframework.boot</groupId>
|
7 |
+
<artifactId>spring-boot-starter-parent</artifactId>
|
8 |
+
<version>2.7.7-SNAPSHOT</version>
|
9 |
+
<relativePath/> <!-- lookup parent from repository -->
|
10 |
+
</parent>
|
11 |
+
<groupId>com.example</groupId>
|
12 |
+
<artifactId>demo</artifactId>
|
13 |
+
<version>0.0.1-SNAPSHOT</version>
|
14 |
+
<name>demo</name>
|
15 |
+
<description>Demo project for Spring Boot</description>
|
16 |
+
<properties>
|
17 |
+
<java.version>11</java.version>
|
18 |
+
</properties>
|
19 |
+
<dependencies>
|
20 |
+
<dependency>
|
21 |
+
<groupId>org.apache.commons</groupId>
|
22 |
+
<artifactId>commons-lang3</artifactId>
|
23 |
+
<version>3.9</version>
|
24 |
+
</dependency>
|
25 |
+
<dependency>
|
26 |
+
<groupId>com.fasterxml.jackson.core</groupId>
|
27 |
+
<artifactId>jackson-annotations</artifactId>
|
28 |
+
<version>2.13.3</version>
|
29 |
+
|
30 |
+
</dependency>
|
31 |
+
<dependency>
|
32 |
+
<groupId>com.fasterxml.jackson.core</groupId>
|
33 |
+
<artifactId>jackson-core</artifactId>
|
34 |
+
<version>2.13.3</version>
|
35 |
+
|
36 |
+
</dependency>
|
37 |
+
<dependency>
|
38 |
+
<groupId>com.fasterxml.jackson.core</groupId>
|
39 |
+
<artifactId>jackson-databind</artifactId>
|
40 |
+
<version>2.12.7.1</version>
|
41 |
+
|
42 |
+
</dependency>
|
43 |
+
|
44 |
+
<dependency>
|
45 |
+
<groupId>org.springframework.boot</groupId>
|
46 |
+
<artifactId>spring-boot-starter-web</artifactId>
|
47 |
+
</dependency>
|
48 |
+
<dependency>
|
49 |
+
<groupId>org.springframework.boot</groupId>
|
50 |
+
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
51 |
+
</dependency>
|
52 |
+
<dependency>
|
53 |
+
<groupId>org.postgresql</groupId>
|
54 |
+
<artifactId>postgresql</artifactId>
|
55 |
+
<scope>runtime</scope>
|
56 |
+
</dependency>
|
57 |
+
<dependency>
|
58 |
+
<groupId>org.springframework.boot</groupId>
|
59 |
+
<artifactId>spring-boot-starter-test</artifactId>
|
60 |
+
<scope>test</scope>
|
61 |
+
</dependency>
|
62 |
+
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
|
63 |
+
<dependency>
|
64 |
+
<groupId>com.googlecode.json-simple</groupId>
|
65 |
+
<artifactId>json-simple</artifactId>
|
66 |
+
<version>1.1.1</version>
|
67 |
+
</dependency>
|
68 |
+
<dependency>
|
69 |
+
<groupId>org.apache.httpcomponents</groupId>
|
70 |
+
<artifactId>httpcore</artifactId>
|
71 |
+
<version>4.0-alpha6</version>
|
72 |
+
</dependency>
|
73 |
+
|
74 |
+
</dependencies>
|
75 |
+
|
76 |
+
<build>
|
77 |
+
<plugins>
|
78 |
+
<plugin>
|
79 |
+
<groupId>org.springframework.boot</groupId>
|
80 |
+
<artifactId>spring-boot-maven-plugin</artifactId>
|
81 |
+
</plugin>
|
82 |
+
</plugins>
|
83 |
+
</build>
|
84 |
+
<repositories>
|
85 |
+
<repository>
|
86 |
+
<id>spring-milestones</id>
|
87 |
+
<name>Spring Milestones</name>
|
88 |
+
<url>https://repo.spring.io/milestone</url>
|
89 |
+
<snapshots>
|
90 |
+
<enabled>false</enabled>
|
91 |
+
</snapshots>
|
92 |
+
</repository>
|
93 |
+
<repository>
|
94 |
+
<id>spring-snapshots</id>
|
95 |
+
<name>Spring Snapshots</name>
|
96 |
+
<url>https://repo.spring.io/snapshot</url>
|
97 |
+
<releases>
|
98 |
+
<enabled>false</enabled>
|
99 |
+
</releases>
|
100 |
+
</repository>
|
101 |
+
</repositories>
|
102 |
+
<pluginRepositories>
|
103 |
+
<pluginRepository>
|
104 |
+
<id>spring-milestones</id>
|
105 |
+
<name>Spring Milestones</name>
|
106 |
+
<url>https://repo.spring.io/milestone</url>
|
107 |
+
<snapshots>
|
108 |
+
<enabled>false</enabled>
|
109 |
+
</snapshots>
|
110 |
+
</pluginRepository>
|
111 |
+
<pluginRepository>
|
112 |
+
<id>spring-snapshots</id>
|
113 |
+
<name>Spring Snapshots</name>
|
114 |
+
<url>https://repo.spring.io/snapshot</url>
|
115 |
+
<releases>
|
116 |
+
<enabled>false</enabled>
|
117 |
+
</releases>
|
118 |
+
</pluginRepository>
|
119 |
+
</pluginRepositories>
|
120 |
+
|
121 |
+
</project>
|
src/main/java/tqtk/XuLy/Worker.java
CHANGED
@@ -213,7 +213,30 @@ public class Worker extends Thread {
|
|
213 |
GuiPacket(ss, "41102", list2);
|
214 |
Thread.sleep(5000);
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
}
|
|
|
217 |
}
|
218 |
}
|
219 |
} catch (Exception e) {
|
@@ -309,21 +332,44 @@ public class Worker extends Thread {
|
|
309 |
}
|
310 |
|
311 |
public void TruyNa() throws InterruptedException, IOException {
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
if (ss.getUserId().equals("2301230011011923")) {
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
}
|
323 |
}
|
324 |
-
|
|
|
325 |
}
|
326 |
-
} else {
|
327 |
|
328 |
List<String> list1 = new ArrayList<>();
|
329 |
list1.add(0, "0");
|
@@ -355,6 +401,7 @@ public class Worker extends Thread {
|
|
355 |
long playerId = 0;
|
356 |
String playerName = "";
|
357 |
String tmp = "";
|
|
|
358 |
Tqtk.sendMessage("tn " + ss.getStringName());
|
359 |
for (Object object : carMap1) {
|
360 |
idarea = (int) ((Map<Object, Object>) object).get("areaId");
|
@@ -366,14 +413,18 @@ public class Worker extends Thread {
|
|
366 |
playerName = (String) ((Map<Object, Object>) object).get("playerName");
|
367 |
playerName = playerName.toLowerCase();
|
368 |
list1.set(0, Integer.toString(id));
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
|
|
|
|
|
|
376 |
}
|
|
|
377 |
synchronized (tqtk.Tqtk.loaiTruyna) {
|
378 |
if (id != 0 && !Tqtk.loaiTruyna.contains(playerName)
|
379 |
&& !Tqtk.loaiTruyna.contains(Long.toString(playerId))
|
@@ -382,12 +433,13 @@ public class Worker extends Thread {
|
|
382 |
&& isAttacked == 0
|
383 |
&& level < 61) {
|
384 |
rs1 = GuiPacketTN(ss, "60606", list1);
|
385 |
-
|
|
|
|
|
386 |
if (tmp.contains("\"winside\":2") || tmp.contains("\"winside\": 2")) {
|
387 |
tqtk.Tqtk.loaiTruyna.add(playerName);
|
388 |
tqtk.Tqtk.loaiTruyna.add(Long.toString(playerId));
|
389 |
}
|
390 |
-
|
391 |
}
|
392 |
}
|
393 |
Thread.sleep(5000);
|
@@ -1428,7 +1480,7 @@ public class Worker extends Thread {
|
|
1428 |
TruyNa();
|
1429 |
}
|
1430 |
} catch (Exception e) {
|
1431 |
-
System.out.println("TruyNa .run() " + ss.getStringName());
|
1432 |
}
|
1433 |
}
|
1434 |
}.start();
|
|
|
213 |
GuiPacket(ss, "41102", list2);
|
214 |
Thread.sleep(5000);
|
215 |
|
216 |
+
} else if ("瀬名姫".equals(name) && trainflag == 0) {
|
217 |
+
// tmc stun
|
218 |
+
GuiPacket(ss, "41101", list1);
|
219 |
+
Thread.sleep(5000);
|
220 |
+
GuiPacket(ss, "41102", list2);
|
221 |
+
Thread.sleep(5000);
|
222 |
+
GuiPacket(ss, "41102", list2);
|
223 |
+
Thread.sleep(5000);
|
224 |
+
GuiPacket(ss, "41102", list2);
|
225 |
+
Thread.sleep(5000);
|
226 |
+
|
227 |
+
} else if ("渡辺守綱".equals(name) && trainflag == 0) {
|
228 |
+
// ha hau uyen tdxk
|
229 |
+
GuiPacket(ss, "41101", list1);
|
230 |
+
Thread.sleep(5000);
|
231 |
+
GuiPacket(ss, "41102", list2);
|
232 |
+
Thread.sleep(5000);
|
233 |
+
GuiPacket(ss, "41102", list2);
|
234 |
+
Thread.sleep(5000);
|
235 |
+
GuiPacket(ss, "41102", list2);
|
236 |
+
Thread.sleep(5000);
|
237 |
+
|
238 |
}
|
239 |
+
|
240 |
}
|
241 |
}
|
242 |
} catch (Exception e) {
|
|
|
332 |
}
|
333 |
|
334 |
public void TruyNa() throws InterruptedException, IOException {
|
335 |
+
try {
|
336 |
+
GuiPacketTN(ss, "11102", null);
|
337 |
+
Thread.sleep(5000);
|
338 |
+
} catch (Exception e) {
|
339 |
+
}
|
340 |
+
|
341 |
if (ss.getUserId().equals("2301230011011923")) {
|
342 |
+
try {
|
343 |
+
List<String> list1 = new ArrayList<>();
|
344 |
+
list1.add(0, "0");
|
345 |
+
|
346 |
+
if (Tqtk.listtruyna.size() > 0 && Tqtk.loaiTruyna.size() > 0) {
|
347 |
+
String id = "";
|
348 |
+
String PlayerName = "";
|
349 |
+
String PlayerId = "";
|
350 |
+
int AttactNum = 0;
|
351 |
+
for (TruyNa tn : Tqtk.listtruyna) {
|
352 |
+
id = tn.getId();
|
353 |
+
AttactNum = tn.getAttactNum();
|
354 |
+
PlayerName = tn.getPlayerName();
|
355 |
+
PlayerId = tn.getPlayerId();
|
356 |
+
Tqtk.sendMessage("tn " + PlayerName + " " + PlayerId + " " + AttactNum + " " + id);
|
357 |
+
synchronized (Tqtk.listtruyna) {
|
358 |
+
if (!Tqtk.loaiTruyna.contains(PlayerName)
|
359 |
+
&& !Tqtk.loaiTruyna.contains(PlayerId)
|
360 |
+
&& AttactNum != 0) {
|
361 |
+
list1.set(0, id);
|
362 |
+
GuiPacketTN(ss, "60606", list1);
|
363 |
+
}
|
364 |
+
|
365 |
+
}
|
366 |
+
Thread.sleep(5000);
|
367 |
}
|
368 |
}
|
369 |
+
} catch (Exception e) {
|
370 |
+
System.out.println("GuiPacketTN 2 " + e.getMessage());
|
371 |
}
|
372 |
+
} else if (ss.getUserId().equals("2301211923397199")) {
|
373 |
|
374 |
List<String> list1 = new ArrayList<>();
|
375 |
list1.add(0, "0");
|
|
|
401 |
long playerId = 0;
|
402 |
String playerName = "";
|
403 |
String tmp = "";
|
404 |
+
TruyNa tn = null;
|
405 |
Tqtk.sendMessage("tn " + ss.getStringName());
|
406 |
for (Object object : carMap1) {
|
407 |
idarea = (int) ((Map<Object, Object>) object).get("areaId");
|
|
|
413 |
playerName = (String) ((Map<Object, Object>) object).get("playerName");
|
414 |
playerName = playerName.toLowerCase();
|
415 |
list1.set(0, Integer.toString(id));
|
416 |
+
|
417 |
+
if (ss.getUserId().equals("2301211923397199")) {
|
418 |
+
synchronized (Tqtk.listtruyna) {
|
419 |
+
tn = new TruyNa();
|
420 |
+
tn.setAttactNum(attactNum);
|
421 |
+
tn.setId(Long.toString(id));
|
422 |
+
tn.setPlayerId(Long.toString(playerId));
|
423 |
+
tn.setPlayerName(playerName);
|
424 |
+
Tqtk.listtruyna.add(tn);
|
425 |
+
}
|
426 |
}
|
427 |
+
|
428 |
synchronized (tqtk.Tqtk.loaiTruyna) {
|
429 |
if (id != 0 && !Tqtk.loaiTruyna.contains(playerName)
|
430 |
&& !Tqtk.loaiTruyna.contains(Long.toString(playerId))
|
|
|
433 |
&& isAttacked == 0
|
434 |
&& level < 61) {
|
435 |
rs1 = GuiPacketTN(ss, "60606", list1);
|
436 |
+
if (rs1 != null) {
|
437 |
+
tmp = rs1.toString();
|
438 |
+
}
|
439 |
if (tmp.contains("\"winside\":2") || tmp.contains("\"winside\": 2")) {
|
440 |
tqtk.Tqtk.loaiTruyna.add(playerName);
|
441 |
tqtk.Tqtk.loaiTruyna.add(Long.toString(playerId));
|
442 |
}
|
|
|
443 |
}
|
444 |
}
|
445 |
Thread.sleep(5000);
|
|
|
1480 |
TruyNa();
|
1481 |
}
|
1482 |
} catch (Exception e) {
|
1483 |
+
System.out.println("TruyNa .run() " + e.getMessage() + " " + ss.getStringName());
|
1484 |
}
|
1485 |
}
|
1486 |
}.start();
|
src/main/java/tqtk/XuLy/XuLyPacket.java
CHANGED
@@ -285,7 +285,7 @@ public class XuLyPacket {
|
|
285 |
|
286 |
public static StringBuilder GuiPacketTN(SessionEntity ss, String code, List<String> list) throws UnknownHostException, IOException, InterruptedException {
|
287 |
BufferedWriter wr = null;
|
288 |
-
StringBuilder rp =
|
289 |
String message = "";
|
290 |
try {
|
291 |
message = Util.TaoMsg(code, list, ss);
|
@@ -294,7 +294,6 @@ public class XuLyPacket {
|
|
294 |
wr.write(message);
|
295 |
wr.flush();
|
296 |
|
297 |
-
rp = new StringBuilder("");
|
298 |
if (ss.getSocketTN().isConnected()) {
|
299 |
Thread.sleep(3 * 1000);
|
300 |
InputStream instr = ss.getSocketTN().getInputStream();
|
@@ -317,4 +316,5 @@ public class XuLyPacket {
|
|
317 |
}
|
318 |
|
319 |
}
|
|
|
320 |
}
|
|
|
285 |
|
286 |
public static StringBuilder GuiPacketTN(SessionEntity ss, String code, List<String> list) throws UnknownHostException, IOException, InterruptedException {
|
287 |
BufferedWriter wr = null;
|
288 |
+
StringBuilder rp = new StringBuilder("");
|
289 |
String message = "";
|
290 |
try {
|
291 |
message = Util.TaoMsg(code, list, ss);
|
|
|
294 |
wr.write(message);
|
295 |
wr.flush();
|
296 |
|
|
|
297 |
if (ss.getSocketTN().isConnected()) {
|
298 |
Thread.sleep(3 * 1000);
|
299 |
InputStream instr = ss.getSocketTN().getInputStream();
|
|
|
316 |
}
|
317 |
|
318 |
}
|
319 |
+
|
320 |
}
|