24 lines
647 B
Java
24 lines
647 B
Java
package com.simulationservice.service;
|
|
import java.io.IOException;
|
|
import java.lang.*;
|
|
import com.simulationservice.service.CustomThread;
|
|
/**
|
|
* 生成保障需求线程,用于对各个作战单元的资源消耗进行判断产生需求
|
|
*/
|
|
public class DemandThread extends CustomThread {
|
|
|
|
@Override
|
|
public void processBuss() {
|
|
//进行业务逻辑处理
|
|
if (max < 0) max = 1000;
|
|
max--;
|
|
String info = String.valueOf(max) + " " + getRoomId();
|
|
try {
|
|
WebSocketServer.sendInfo(info, "1111");
|
|
} catch (IOException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
|
|
}
|