PageRenderTime 464ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/mcp/temp/src/minecraft_server/net/minecraft/src/ServerConfigurationManager.java

https://bitbucket.org/vkorolik/twoleanfour-client
Java | 730 lines | 640 code | 79 blank | 11 comment | 72 complexity | e07d3958b3fcd4326ed948c27d3e666e MD5 | raw file
  1. // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3) braces deadcode fieldsfirst
  4. package net.minecraft.src;
  5. import java.io.*;
  6. import java.util.*;
  7. import java.util.logging.Logger;
  8. import net.minecraft.server.MinecraftServer;
  9. // Referenced classes of package net.minecraft.src:
  10. // PlayerManager, PropertyManager, WorldServer, ISaveHandler,
  11. // EntityPlayerMP, ChunkProviderServer, IPlayerFileData, Packet201PlayerInfo,
  12. // NetServerHandler, NetLoginHandler, NetworkManager, ItemInWorldManager,
  13. // EntityTracker, WorldInfo, EntityPlayer, ChunkCoordinates,
  14. // Packet70Bed, Packet9Respawn, World, Teleporter,
  15. // Packet3Chat, Packet4UpdateTime, PlayerUsageSnooper, Packet,
  16. // TileEntity
  17. public class ServerConfigurationManager
  18. {
  19. public static Logger field_925_a = Logger.getLogger("Minecraft");
  20. public List field_924_b;
  21. private MinecraftServer field_923_c;
  22. private PlayerManager field_922_d[];
  23. private int field_9253_e;
  24. private Set field_9252_f;
  25. private Set field_919_g;
  26. private Set field_918_h;
  27. private Set field_22174_i;
  28. private File field_917_i;
  29. private File field_9251_j;
  30. private File field_9250_k;
  31. private File field_22173_m;
  32. private IPlayerFileData field_914_l;
  33. private boolean field_22172_o;
  34. private int field_35482_p;
  35. public ServerConfigurationManager(MinecraftServer p_i194_1_)
  36. {
  37. field_924_b = new ArrayList();
  38. field_9252_f = new HashSet();
  39. field_919_g = new HashSet();
  40. field_918_h = new HashSet();
  41. field_22174_i = new HashSet();
  42. field_35482_p = 0;
  43. field_922_d = new PlayerManager[3];
  44. field_923_c = p_i194_1_;
  45. field_917_i = p_i194_1_.func_6009_a("banned-players.txt");
  46. field_9251_j = p_i194_1_.func_6009_a("banned-ips.txt");
  47. field_9250_k = p_i194_1_.func_6009_a("ops.txt");
  48. field_22173_m = p_i194_1_.func_6009_a("white-list.txt");
  49. int i = p_i194_1_.field_6035_d.func_722_a("view-distance", 10);
  50. field_922_d[0] = new PlayerManager(p_i194_1_, 0, i);
  51. field_922_d[1] = new PlayerManager(p_i194_1_, -1, i);
  52. field_922_d[2] = new PlayerManager(p_i194_1_, 1, i);
  53. field_9253_e = p_i194_1_.field_6035_d.func_722_a("max-players", 20);
  54. field_22172_o = p_i194_1_.field_6035_d.func_724_a("white-list", false);
  55. func_623_e();
  56. func_9245_g();
  57. func_9249_i();
  58. func_22168_m();
  59. func_626_f();
  60. func_9248_h();
  61. func_9239_j();
  62. func_22160_n();
  63. }
  64. public void func_618_a(WorldServer p_618_1_[])
  65. {
  66. field_914_l = p_618_1_[0].func_22075_m().func_22090_d();
  67. }
  68. public void func_28172_a(EntityPlayerMP p_28172_1_)
  69. {
  70. field_922_d[0].func_9213_b(p_28172_1_);
  71. field_922_d[1].func_9213_b(p_28172_1_);
  72. field_922_d[2].func_9213_b(p_28172_1_);
  73. func_28167_a(p_28172_1_.field_4110_as).func_9214_a(p_28172_1_);
  74. WorldServer worldserver = field_923_c.func_28004_a(p_28172_1_.field_4110_as);
  75. worldserver.field_20911_y.func_376_d((int)p_28172_1_.field_322_l >> 4, (int)p_28172_1_.field_320_n >> 4);
  76. }
  77. public int func_640_a()
  78. {
  79. return field_922_d[0].func_542_b();
  80. }
  81. private PlayerManager func_28167_a(int p_28167_1_)
  82. {
  83. if(p_28167_1_ == -1)
  84. {
  85. return field_922_d[1];
  86. }
  87. if(p_28167_1_ == 0)
  88. {
  89. return field_922_d[0];
  90. }
  91. if(p_28167_1_ == 1)
  92. {
  93. return field_922_d[2];
  94. } else
  95. {
  96. return null;
  97. }
  98. }
  99. public void func_28166_b(EntityPlayerMP p_28166_1_)
  100. {
  101. field_914_l.func_725_b(p_28166_1_);
  102. }
  103. public void func_627_a(EntityPlayerMP p_627_1_)
  104. {
  105. func_631_a(new Packet201PlayerInfo(p_627_1_.field_409_aq, true, 1000));
  106. field_924_b.add(p_627_1_);
  107. WorldServer worldserver = field_923_c.func_28004_a(p_627_1_.field_4110_as);
  108. worldserver.field_20911_y.func_376_d((int)p_627_1_.field_322_l >> 4, (int)p_627_1_.field_320_n >> 4);
  109. for(; worldserver.func_481_a(p_627_1_, p_627_1_.field_312_v).size() != 0; p_627_1_.func_86_a(p_627_1_.field_322_l, p_627_1_.field_321_m + 1.0D, p_627_1_.field_320_n)) { }
  110. worldserver.func_526_a(p_627_1_);
  111. func_28167_a(p_627_1_.field_4110_as).func_9214_a(p_627_1_);
  112. func_52018_u();
  113. for(int i = 0; i < field_924_b.size(); i++)
  114. {
  115. EntityPlayerMP entityplayermp = (EntityPlayerMP)field_924_b.get(i);
  116. p_627_1_.field_20908_a.func_39_b(new Packet201PlayerInfo(entityplayermp.field_409_aq, true, entityplayermp.field_35219_i));
  117. }
  118. }
  119. public void func_613_b(EntityPlayerMP p_613_1_)
  120. {
  121. func_28167_a(p_613_1_.field_4110_as).func_543_c(p_613_1_);
  122. }
  123. public void func_616_c(EntityPlayerMP p_616_1_)
  124. {
  125. field_914_l.func_726_a(p_616_1_);
  126. field_923_c.func_28004_a(p_616_1_.field_4110_as).func_22085_d(p_616_1_);
  127. field_924_b.remove(p_616_1_);
  128. func_28167_a(p_616_1_.field_4110_as).func_9213_b(p_616_1_);
  129. func_631_a(new Packet201PlayerInfo(p_616_1_.field_409_aq, false, 9999));
  130. }
  131. public EntityPlayerMP func_619_a(NetLoginHandler p_619_1_, String p_619_2_)
  132. {
  133. if(field_9252_f.contains(p_619_2_.trim().toLowerCase()))
  134. {
  135. p_619_1_.func_34_b("You are banned from this server!");
  136. return null;
  137. }
  138. if(!func_22166_g(p_619_2_))
  139. {
  140. p_619_1_.func_34_b("You are not white-listed on this server!");
  141. return null;
  142. }
  143. String s = p_619_1_.field_8_b.func_755_b().toString();
  144. s = s.substring(s.indexOf("/") + 1);
  145. s = s.substring(0, s.indexOf(":"));
  146. if(field_919_g.contains(s))
  147. {
  148. p_619_1_.func_34_b("Your IP address is banned from this server!");
  149. return null;
  150. }
  151. if(field_924_b.size() >= field_9253_e)
  152. {
  153. p_619_1_.func_34_b("The server is full!");
  154. return null;
  155. }
  156. for(int i = 0; i < field_924_b.size(); i++)
  157. {
  158. EntityPlayerMP entityplayermp = (EntityPlayerMP)field_924_b.get(i);
  159. if(entityplayermp.field_409_aq.equalsIgnoreCase(p_619_2_))
  160. {
  161. entityplayermp.field_20908_a.func_43_c("You logged in from another location");
  162. }
  163. }
  164. return new EntityPlayerMP(field_923_c, field_923_c.func_28004_a(0), p_619_2_, new ItemInWorldManager(field_923_c.func_28004_a(0)));
  165. }
  166. public EntityPlayerMP func_9242_d(EntityPlayerMP p_9242_1_, int p_9242_2_, boolean p_9242_3_)
  167. {
  168. field_923_c.func_28003_b(p_9242_1_.field_4110_as).func_9238_a(p_9242_1_);
  169. field_923_c.func_28003_b(p_9242_1_.field_4110_as).func_610_b(p_9242_1_);
  170. func_28167_a(p_9242_1_.field_4110_as).func_9213_b(p_9242_1_);
  171. field_924_b.remove(p_9242_1_);
  172. field_923_c.func_28004_a(p_9242_1_.field_4110_as).func_22073_e(p_9242_1_);
  173. ChunkCoordinates chunkcoordinates = p_9242_1_.func_25049_H();
  174. p_9242_1_.field_4110_as = p_9242_2_;
  175. EntityPlayerMP entityplayermp = new EntityPlayerMP(field_923_c, field_923_c.func_28004_a(p_9242_1_.field_4110_as), p_9242_1_.field_409_aq, new ItemInWorldManager(field_923_c.func_28004_a(p_9242_1_.field_4110_as)));
  176. if(p_9242_3_)
  177. {
  178. entityplayermp.func_41031_d(p_9242_1_);
  179. }
  180. entityplayermp.field_331_c = p_9242_1_.field_331_c;
  181. entityplayermp.field_20908_a = p_9242_1_.field_20908_a;
  182. WorldServer worldserver = field_923_c.func_28004_a(p_9242_1_.field_4110_as);
  183. entityplayermp.field_425_ad.func_35696_a(p_9242_1_.field_425_ad.func_35697_a());
  184. entityplayermp.field_425_ad.func_35695_b(worldserver.func_22081_n().func_35501_n());
  185. if(chunkcoordinates != null)
  186. {
  187. ChunkCoordinates chunkcoordinates1 = EntityPlayer.func_25051_a(field_923_c.func_28004_a(p_9242_1_.field_4110_as), chunkcoordinates);
  188. if(chunkcoordinates1 != null)
  189. {
  190. entityplayermp.func_107_c((float)chunkcoordinates1.field_22216_a + 0.5F, (float)chunkcoordinates1.field_529_a + 0.1F, (float)chunkcoordinates1.field_528_b + 0.5F, 0.0F, 0.0F);
  191. entityplayermp.func_25050_a(chunkcoordinates);
  192. } else
  193. {
  194. entityplayermp.field_20908_a.func_39_b(new Packet70Bed(0, 0));
  195. }
  196. }
  197. worldserver.field_20911_y.func_376_d((int)entityplayermp.field_322_l >> 4, (int)entityplayermp.field_320_n >> 4);
  198. for(; worldserver.func_481_a(entityplayermp, entityplayermp.field_312_v).size() != 0; entityplayermp.func_86_a(entityplayermp.field_322_l, entityplayermp.field_321_m + 1.0D, entityplayermp.field_320_n)) { }
  199. entityplayermp.field_20908_a.func_39_b(new Packet9Respawn(entityplayermp.field_4110_as, (byte)entityplayermp.field_9093_l.field_804_l, entityplayermp.field_9093_l.func_22081_n().func_46069_q(), entityplayermp.field_9093_l.func_48095_y(), entityplayermp.field_425_ad.func_35697_a()));
  200. entityplayermp.field_20908_a.func_41_a(entityplayermp.field_322_l, entityplayermp.field_321_m, entityplayermp.field_320_n, entityplayermp.field_316_r, entityplayermp.field_315_s);
  201. func_28170_a(entityplayermp, worldserver);
  202. func_28167_a(entityplayermp.field_4110_as).func_9214_a(entityplayermp);
  203. worldserver.func_526_a(entityplayermp);
  204. field_924_b.add(entityplayermp);
  205. entityplayermp.func_20057_k();
  206. entityplayermp.func_22068_s();
  207. return entityplayermp;
  208. }
  209. public void func_28168_f(EntityPlayerMP p_28168_1_, int p_28168_2_)
  210. {
  211. int i = p_28168_1_.field_4110_as;
  212. WorldServer worldserver = field_923_c.func_28004_a(p_28168_1_.field_4110_as);
  213. p_28168_1_.field_4110_as = p_28168_2_;
  214. WorldServer worldserver1 = field_923_c.func_28004_a(p_28168_1_.field_4110_as);
  215. p_28168_1_.field_20908_a.func_39_b(new Packet9Respawn(p_28168_1_.field_4110_as, (byte)p_28168_1_.field_9093_l.field_804_l, worldserver1.func_22081_n().func_46069_q(), worldserver1.func_48095_y(), p_28168_1_.field_425_ad.func_35697_a()));
  216. worldserver.func_22073_e(p_28168_1_);
  217. p_28168_1_.field_304_B = false;
  218. double d = p_28168_1_.field_322_l;
  219. double d1 = p_28168_1_.field_320_n;
  220. double d2 = 8D;
  221. if(p_28168_1_.field_4110_as == -1)
  222. {
  223. d /= d2;
  224. d1 /= d2;
  225. p_28168_1_.func_107_c(d, p_28168_1_.field_321_m, d1, p_28168_1_.field_316_r, p_28168_1_.field_315_s);
  226. if(p_28168_1_.func_120_t())
  227. {
  228. worldserver.func_4074_a(p_28168_1_, false);
  229. }
  230. } else
  231. if(p_28168_1_.field_4110_as == 0)
  232. {
  233. d *= d2;
  234. d1 *= d2;
  235. p_28168_1_.func_107_c(d, p_28168_1_.field_321_m, d1, p_28168_1_.field_316_r, p_28168_1_.field_315_s);
  236. if(p_28168_1_.func_120_t())
  237. {
  238. worldserver.func_4074_a(p_28168_1_, false);
  239. }
  240. } else
  241. {
  242. ChunkCoordinates chunkcoordinates = worldserver1.func_40212_d();
  243. d = chunkcoordinates.field_22216_a;
  244. p_28168_1_.field_321_m = chunkcoordinates.field_529_a;
  245. d1 = chunkcoordinates.field_528_b;
  246. p_28168_1_.func_107_c(d, p_28168_1_.field_321_m, d1, 90F, 0.0F);
  247. if(p_28168_1_.func_120_t())
  248. {
  249. worldserver.func_4074_a(p_28168_1_, false);
  250. }
  251. }
  252. if(i != 1 && p_28168_1_.func_120_t())
  253. {
  254. worldserver1.func_526_a(p_28168_1_);
  255. p_28168_1_.func_107_c(d, p_28168_1_.field_321_m, d1, p_28168_1_.field_316_r, p_28168_1_.field_315_s);
  256. worldserver1.func_4074_a(p_28168_1_, false);
  257. worldserver1.field_20911_y.field_28068_a = true;
  258. (new Teleporter()).func_28115_a(worldserver1, p_28168_1_);
  259. worldserver1.field_20911_y.field_28068_a = false;
  260. }
  261. func_28172_a(p_28168_1_);
  262. p_28168_1_.field_20908_a.func_41_a(p_28168_1_.field_322_l, p_28168_1_.field_321_m, p_28168_1_.field_320_n, p_28168_1_.field_316_r, p_28168_1_.field_315_s);
  263. p_28168_1_.func_28007_a(worldserver1);
  264. p_28168_1_.field_425_ad.func_35694_a(worldserver1);
  265. func_28170_a(p_28168_1_, worldserver1);
  266. func_30008_g(p_28168_1_);
  267. }
  268. public void func_637_b()
  269. {
  270. if(++field_35482_p > 200)
  271. {
  272. field_35482_p = 0;
  273. }
  274. if(field_35482_p < field_924_b.size())
  275. {
  276. EntityPlayerMP entityplayermp = (EntityPlayerMP)field_924_b.get(field_35482_p);
  277. func_631_a(new Packet201PlayerInfo(entityplayermp.field_409_aq, true, entityplayermp.field_35219_i));
  278. }
  279. for(int i = 0; i < field_922_d.length; i++)
  280. {
  281. field_922_d[i].func_538_a();
  282. }
  283. }
  284. public void func_622_a(int p_622_1_, int p_622_2_, int p_622_3_, int p_622_4_)
  285. {
  286. func_28167_a(p_622_4_).func_535_a(p_622_1_, p_622_2_, p_622_3_);
  287. }
  288. public void func_631_a(Packet p_631_1_)
  289. {
  290. for(int i = 0; i < field_924_b.size(); i++)
  291. {
  292. EntityPlayerMP entityplayermp = (EntityPlayerMP)field_924_b.get(i);
  293. entityplayermp.field_20908_a.func_39_b(p_631_1_);
  294. }
  295. }
  296. public void func_28169_a(Packet p_28169_1_, int p_28169_2_)
  297. {
  298. for(int i = 0; i < field_924_b.size(); i++)
  299. {
  300. EntityPlayerMP entityplayermp = (EntityPlayerMP)field_924_b.get(i);
  301. if(entityplayermp.field_4110_as == p_28169_2_)
  302. {
  303. entityplayermp.field_20908_a.func_39_b(p_28169_1_);
  304. }
  305. }
  306. }
  307. public String func_633_c()
  308. {
  309. String s = "";
  310. for(int i = 0; i < field_924_b.size(); i++)
  311. {
  312. if(i > 0)
  313. {
  314. s = (new StringBuilder()).append(s).append(", ").toString();
  315. }
  316. s = (new StringBuilder()).append(s).append(((EntityPlayerMP)field_924_b.get(i)).field_409_aq).toString();
  317. }
  318. return s;
  319. }
  320. public String[] func_40575_d()
  321. {
  322. String as[] = new String[field_924_b.size()];
  323. for(int i = 0; i < field_924_b.size(); i++)
  324. {
  325. as[i] = ((EntityPlayerMP)field_924_b.get(i)).field_409_aq;
  326. }
  327. return as;
  328. }
  329. public void func_22159_a(String p_22159_1_)
  330. {
  331. field_9252_f.add(p_22159_1_.toLowerCase());
  332. func_626_f();
  333. }
  334. public void func_22161_b(String p_22161_1_)
  335. {
  336. field_9252_f.remove(p_22161_1_.toLowerCase());
  337. func_626_f();
  338. }
  339. private void func_623_e()
  340. {
  341. try
  342. {
  343. field_9252_f.clear();
  344. BufferedReader bufferedreader = new BufferedReader(new FileReader(field_917_i));
  345. for(String s = ""; (s = bufferedreader.readLine()) != null;)
  346. {
  347. field_9252_f.add(s.trim().toLowerCase());
  348. }
  349. bufferedreader.close();
  350. }
  351. catch(Exception exception)
  352. {
  353. field_925_a.warning((new StringBuilder()).append("Failed to load ban list: ").append(exception).toString());
  354. }
  355. }
  356. private void func_626_f()
  357. {
  358. try
  359. {
  360. PrintWriter printwriter = new PrintWriter(new FileWriter(field_917_i, false));
  361. String s;
  362. for(Iterator iterator = field_9252_f.iterator(); iterator.hasNext(); printwriter.println(s))
  363. {
  364. s = (String)iterator.next();
  365. }
  366. printwriter.close();
  367. }
  368. catch(Exception exception)
  369. {
  370. field_925_a.warning((new StringBuilder()).append("Failed to save ban list: ").append(exception).toString());
  371. }
  372. }
  373. public Set func_40576_e()
  374. {
  375. return field_9252_f;
  376. }
  377. public Set func_40574_f()
  378. {
  379. return field_919_g;
  380. }
  381. public void func_22162_c(String p_22162_1_)
  382. {
  383. field_919_g.add(p_22162_1_.toLowerCase());
  384. func_9248_h();
  385. }
  386. public void func_22163_d(String p_22163_1_)
  387. {
  388. field_919_g.remove(p_22163_1_.toLowerCase());
  389. func_9248_h();
  390. }
  391. private void func_9245_g()
  392. {
  393. try
  394. {
  395. field_919_g.clear();
  396. BufferedReader bufferedreader = new BufferedReader(new FileReader(field_9251_j));
  397. for(String s = ""; (s = bufferedreader.readLine()) != null;)
  398. {
  399. field_919_g.add(s.trim().toLowerCase());
  400. }
  401. bufferedreader.close();
  402. }
  403. catch(Exception exception)
  404. {
  405. field_925_a.warning((new StringBuilder()).append("Failed to load ip ban list: ").append(exception).toString());
  406. }
  407. }
  408. private void func_9248_h()
  409. {
  410. try
  411. {
  412. PrintWriter printwriter = new PrintWriter(new FileWriter(field_9251_j, false));
  413. String s;
  414. for(Iterator iterator = field_919_g.iterator(); iterator.hasNext(); printwriter.println(s))
  415. {
  416. s = (String)iterator.next();
  417. }
  418. printwriter.close();
  419. }
  420. catch(Exception exception)
  421. {
  422. field_925_a.warning((new StringBuilder()).append("Failed to save ip ban list: ").append(exception).toString());
  423. }
  424. }
  425. public void func_35479_e(String p_35479_1_)
  426. {
  427. field_918_h.add(p_35479_1_.toLowerCase());
  428. func_9239_j();
  429. }
  430. public void func_35478_f(String p_35478_1_)
  431. {
  432. field_918_h.remove(p_35478_1_.toLowerCase());
  433. func_9239_j();
  434. }
  435. private void func_9249_i()
  436. {
  437. try
  438. {
  439. field_918_h.clear();
  440. BufferedReader bufferedreader = new BufferedReader(new FileReader(field_9250_k));
  441. for(String s = ""; (s = bufferedreader.readLine()) != null;)
  442. {
  443. field_918_h.add(s.trim().toLowerCase());
  444. }
  445. bufferedreader.close();
  446. }
  447. catch(Exception exception)
  448. {
  449. field_925_a.warning((new StringBuilder()).append("Failed to load operators list: ").append(exception).toString());
  450. }
  451. }
  452. private void func_9239_j()
  453. {
  454. try
  455. {
  456. PrintWriter printwriter = new PrintWriter(new FileWriter(field_9250_k, false));
  457. String s;
  458. for(Iterator iterator = field_918_h.iterator(); iterator.hasNext(); printwriter.println(s))
  459. {
  460. s = (String)iterator.next();
  461. }
  462. printwriter.close();
  463. }
  464. catch(Exception exception)
  465. {
  466. field_925_a.warning((new StringBuilder()).append("Failed to save operators list: ").append(exception).toString());
  467. }
  468. }
  469. private void func_22168_m()
  470. {
  471. try
  472. {
  473. field_22174_i.clear();
  474. BufferedReader bufferedreader = new BufferedReader(new FileReader(field_22173_m));
  475. for(String s = ""; (s = bufferedreader.readLine()) != null;)
  476. {
  477. field_22174_i.add(s.trim().toLowerCase());
  478. }
  479. bufferedreader.close();
  480. }
  481. catch(Exception exception)
  482. {
  483. field_925_a.warning((new StringBuilder()).append("Failed to load white-list: ").append(exception).toString());
  484. }
  485. }
  486. private void func_22160_n()
  487. {
  488. try
  489. {
  490. PrintWriter printwriter = new PrintWriter(new FileWriter(field_22173_m, false));
  491. String s;
  492. for(Iterator iterator = field_22174_i.iterator(); iterator.hasNext(); printwriter.println(s))
  493. {
  494. s = (String)iterator.next();
  495. }
  496. printwriter.close();
  497. }
  498. catch(Exception exception)
  499. {
  500. field_925_a.warning((new StringBuilder()).append("Failed to save white-list: ").append(exception).toString());
  501. }
  502. }
  503. public boolean func_22166_g(String p_22166_1_)
  504. {
  505. p_22166_1_ = p_22166_1_.trim().toLowerCase();
  506. return !field_22172_o || field_918_h.contains(p_22166_1_) || field_22174_i.contains(p_22166_1_);
  507. }
  508. public boolean func_639_g(String p_639_1_)
  509. {
  510. return field_918_h.contains(p_639_1_.trim().toLowerCase());
  511. }
  512. public EntityPlayerMP func_620_h(String p_620_1_)
  513. {
  514. for(int i = 0; i < field_924_b.size(); i++)
  515. {
  516. EntityPlayerMP entityplayermp = (EntityPlayerMP)field_924_b.get(i);
  517. if(entityplayermp.field_409_aq.equalsIgnoreCase(p_620_1_))
  518. {
  519. return entityplayermp;
  520. }
  521. }
  522. return null;
  523. }
  524. public void func_628_a(String p_628_1_, String p_628_2_)
  525. {
  526. EntityPlayerMP entityplayermp = func_620_h(p_628_1_);
  527. if(entityplayermp != null)
  528. {
  529. entityplayermp.field_20908_a.func_39_b(new Packet3Chat(p_628_2_));
  530. }
  531. }
  532. public void func_12022_a(double p_12022_1_, double p_12022_3_, double p_12022_5_, double p_12022_7_, int p_12022_9_, Packet p_12022_10_)
  533. {
  534. func_28171_a(null, p_12022_1_, p_12022_3_, p_12022_5_, p_12022_7_, p_12022_9_, p_12022_10_);
  535. }
  536. public void func_28171_a(EntityPlayer p_28171_1_, double p_28171_2_, double p_28171_4_, double p_28171_6_,
  537. double p_28171_8_, int p_28171_10_, Packet p_28171_11_)
  538. {
  539. for(int i = 0; i < field_924_b.size(); i++)
  540. {
  541. EntityPlayerMP entityplayermp = (EntityPlayerMP)field_924_b.get(i);
  542. if(entityplayermp == p_28171_1_ || entityplayermp.field_4110_as != p_28171_10_)
  543. {
  544. continue;
  545. }
  546. double d = p_28171_2_ - entityplayermp.field_322_l;
  547. double d1 = p_28171_4_ - entityplayermp.field_321_m;
  548. double d2 = p_28171_6_ - entityplayermp.field_320_n;
  549. if(d * d + d1 * d1 + d2 * d2 < p_28171_8_ * p_28171_8_)
  550. {
  551. entityplayermp.field_20908_a.func_39_b(p_28171_11_);
  552. }
  553. }
  554. }
  555. public void func_630_i(String p_630_1_)
  556. {
  557. Packet3Chat packet3chat = new Packet3Chat(p_630_1_);
  558. for(int i = 0; i < field_924_b.size(); i++)
  559. {
  560. EntityPlayerMP entityplayermp = (EntityPlayerMP)field_924_b.get(i);
  561. if(func_639_g(entityplayermp.field_409_aq))
  562. {
  563. entityplayermp.field_20908_a.func_39_b(packet3chat);
  564. }
  565. }
  566. }
  567. public boolean func_621_a(String p_621_1_, Packet p_621_2_)
  568. {
  569. EntityPlayerMP entityplayermp = func_620_h(p_621_1_);
  570. if(entityplayermp != null)
  571. {
  572. entityplayermp.field_20908_a.func_39_b(p_621_2_);
  573. return true;
  574. } else
  575. {
  576. return false;
  577. }
  578. }
  579. public void func_617_d()
  580. {
  581. for(int i = 0; i < field_924_b.size(); i++)
  582. {
  583. field_914_l.func_726_a((EntityPlayer)field_924_b.get(i));
  584. }
  585. }
  586. public void func_636_a(int i, int j, int k, TileEntity tileentity)
  587. {
  588. }
  589. public void func_22169_k(String p_22169_1_)
  590. {
  591. field_22174_i.add(p_22169_1_);
  592. func_22160_n();
  593. }
  594. public void func_22170_l(String p_22170_1_)
  595. {
  596. field_22174_i.remove(p_22170_1_);
  597. func_22160_n();
  598. }
  599. public Set func_22167_e()
  600. {
  601. return field_22174_i;
  602. }
  603. public void func_22171_f()
  604. {
  605. func_22168_m();
  606. }
  607. public void func_28170_a(EntityPlayerMP p_28170_1_, WorldServer p_28170_2_)
  608. {
  609. p_28170_1_.field_20908_a.func_39_b(new Packet4UpdateTime(p_28170_2_.func_22080_k()));
  610. if(p_28170_2_.func_27068_v())
  611. {
  612. p_28170_1_.field_20908_a.func_39_b(new Packet70Bed(1, 0));
  613. }
  614. }
  615. public void func_30008_g(EntityPlayerMP p_30008_1_)
  616. {
  617. p_30008_1_.func_28017_a(p_30008_1_.field_20053_ao);
  618. p_30008_1_.func_30001_B();
  619. }
  620. public int func_35481_g()
  621. {
  622. return field_924_b.size();
  623. }
  624. public int func_35480_h()
  625. {
  626. return field_9253_e;
  627. }
  628. public String[] func_52019_t()
  629. {
  630. return field_923_c.field_6034_e[0].func_22075_m().func_22090_d().func_52007_g();
  631. }
  632. private void func_52018_u()
  633. {
  634. PlayerUsageSnooper playerusagesnooper = new PlayerUsageSnooper("server");
  635. playerusagesnooper.func_52014_a("version", field_923_c.func_40012_i());
  636. playerusagesnooper.func_52014_a("os_name", System.getProperty("os.name"));
  637. playerusagesnooper.func_52014_a("os_version", System.getProperty("os.version"));
  638. playerusagesnooper.func_52014_a("os_architecture", System.getProperty("os.arch"));
  639. playerusagesnooper.func_52014_a("memory_total", Long.valueOf(Runtime.getRuntime().totalMemory()));
  640. playerusagesnooper.func_52014_a("memory_max", Long.valueOf(Runtime.getRuntime().maxMemory()));
  641. playerusagesnooper.func_52014_a("memory_free", Long.valueOf(Runtime.getRuntime().freeMemory()));
  642. playerusagesnooper.func_52014_a("java_version", System.getProperty("java.version"));
  643. playerusagesnooper.func_52014_a("cpu_cores", Integer.valueOf(Runtime.getRuntime().availableProcessors()));
  644. playerusagesnooper.func_52014_a("players_current", Integer.valueOf(func_35481_g()));
  645. playerusagesnooper.func_52014_a("players_max", Integer.valueOf(func_35480_h()));
  646. playerusagesnooper.func_52014_a("players_seen", Integer.valueOf(func_52019_t().length));
  647. playerusagesnooper.func_52014_a("uses_auth", Boolean.valueOf(field_923_c.field_6027_l));
  648. playerusagesnooper.func_52014_a("server_brand", field_923_c.func_52003_getServerModName());
  649. playerusagesnooper.func_52012_a();
  650. }
  651. }