|
44 | 44 | import java.util.stream.Collectors; |
45 | 45 |
|
46 | 46 | import static cn.jsmod2.core.FileSystem.*; |
47 | | -import static cn.jsmod2.core.utils.Utils.getFullBytes; |
48 | | -import static cn.jsmod2.core.utils.Utils.getLen; |
| 47 | +import static cn.jsmod2.core.utils.Utils.*; |
49 | 48 |
|
50 | 49 | /** |
51 | 50 | * jsmod2 cn.jsmod2.server class |
@@ -204,30 +203,34 @@ public void startWatch(Class<?> main,String[] args) { |
204 | 203 | Utils.TryCatch(()-> { |
205 | 204 | this.log.multiInfo(this.getClass(),main.getSimpleName() + "::start::" + main.getName(),"",""); |
206 | 205 | this.executeEmerald(args, true); |
207 | | - this.start(); |
| 206 | + this.start(args); |
208 | 207 | this.successTime(); |
209 | 208 | }); |
210 | 209 | } |
211 | | - public void start(){ |
| 210 | + public void start(String[] args){ |
212 | 211 | if(useUDP) { |
213 | 212 | this.pool.execute(new ListenerThread()); |
214 | 213 | }else{ |
215 | 214 | this.pool.execute(new ListenerThreadTCP()); |
216 | 215 | } |
217 | | - String log = logListener("yyyy-MM-dd HH.mm.ss",this::getMax,SMOD2_LOG_FILE); |
218 | | - if(log != null) { |
219 | | - this.pool.execute(new LogListener(log, Integer.parseInt(serverProp.getProperty(SMOD2_LOG_INTERVAL,"2000")),"yyyy-MM-dd HH.mm.ss",this::getMax,SMOD2_LOG_FILE)); |
| 216 | + if(!contains(args,"-lr")) { |
| 217 | + String log = logListener("yyyy-MM-dd HH.mm.ss", this::getMax, SMOD2_LOG_FILE); |
| 218 | + if (log != null) { |
| 219 | + this.pool.execute(new LogListener(log, Integer.parseInt(serverProp.getProperty(SMOD2_LOG_INTERVAL, "2000")), "yyyy-MM-dd HH.mm.ss", this::getMax, SMOD2_LOG_FILE)); |
| 220 | + } |
220 | 221 | } |
221 | | - String log1 = logListener("yyyy-MM-dd_HH_mm",(format, x1, x2) -> getMultiSCPMax(format,x1,x2,"MA"), Register.CONSOLE_LOG); |
222 | | - if(log1 != null){ |
223 | | - this.pool.execute(new LogListener(log1,Integer.parseInt(serverProp.getProperty(SMOD2_LOG_INTERVAL,"2000")),"yyyy-MM-dd_HH_mm",(format, x1, x2) -> getMultiSCPMax(format,x1,x2,"MA"),Register.CONSOLE_LOG)); |
224 | | - this.pool.execute(new LogListener(log1,Integer.parseInt(serverProp.getProperty(SMOD2_LOG_INTERVAL,"2000")),"yyyy-MM-dd_HH_mm",(format, x1, x2) -> getMultiSCPMax(format,x1,x2,"SCP"),Register.CONSOLE_LOG)); |
| 222 | + if(!contains(args,"-lm")) { |
| 223 | + String log1 = logListener("yyyy-MM-dd_HH_mm", (format, x1, x2) -> getMultiSCPMax(format, x1, x2, "MA"), Register.CONSOLE_LOG); |
| 224 | + if (log1 != null) { |
| 225 | + this.pool.execute(new LogListener(log1, Integer.parseInt(serverProp.getProperty(SMOD2_LOG_INTERVAL, "2000")), "yyyy-MM-dd_HH_mm", (format, x1, x2) -> getMultiSCPMax(format, x1, x2, "MA"), Register.CONSOLE_LOG)); |
| 226 | + this.pool.execute(new LogListener(log1, Integer.parseInt(serverProp.getProperty(SMOD2_LOG_INTERVAL, "2000")), "yyyy-MM-dd_HH_mm", (format, x1, x2) -> getMultiSCPMax(format, x1, x2, "SCP"), Register.CONSOLE_LOG)); |
| 227 | + } |
225 | 228 | } |
226 | 229 |
|
227 | | - |
228 | | - |
229 | | - if(Boolean.parseBoolean(serverProp.getProperty(GITHUB))) { |
230 | | - this.pool.execute(new GithubConnectThread()); |
| 230 | + if(!contains(args,"-github")) { |
| 231 | + if (Boolean.parseBoolean(serverProp.getProperty(GITHUB))) { |
| 232 | + this.pool.execute(new GithubConnectThread()); |
| 233 | + } |
231 | 234 | } |
232 | 235 | //this.pool.execute(new ServerThread()); |
233 | 236 |
|
|
0 commit comments