public override void run() { var hashmap = new HashMap(); do { if (!field_985_b.field_973_b) { break; } try { Socket socket = NetworkListenThread.func_713_a(field_985_b).accept(); if (socket != null) { InetAddress inetaddress = socket.getInetAddress(); if (hashmap.containsKey(inetaddress) && !"127.0.0.1".Equals(inetaddress.getHostAddress()) && java.lang.System.currentTimeMillis() - ((Long) hashmap.get(inetaddress)).longValue() < 5000L) { hashmap.put(inetaddress, Long.valueOf(java.lang.System.currentTimeMillis())); socket.close(); } else { hashmap.put(inetaddress, Long.valueOf(java.lang.System.currentTimeMillis())); var netloginhandler = new NetLoginHandler(mcServer, socket, (new StringBuilder()).append( "Connection #").append( NetworkListenThread.func_712_b (field_985_b)).toString()); NetworkListenThread.func_716_a(field_985_b, netloginhandler); } } } catch (IOException ioexception) { ioexception.printStackTrace(); } } while (true); }
public void addRecipe(ItemStack itemstack, object[] aobj) { string s = ""; int i = 0; int j = 0; int k = 0; if (aobj[i] is string[]) { var ask = (string[]) aobj[i++]; for (int l = 0; l < ask.Length; l++) { string s2 = ask[l]; k++; j = s2.Length; s = (new StringBuilder()).append(s).append(s2).toString(); } } else { while (aobj[i] is string) { var s1 = (string) aobj[i++]; k++; j = s1.Length; s = (new StringBuilder()).append(s).append(s1).toString(); } } var hashmap = new HashMap(); for (; i < aobj.Length; i += 2) { var character = (Character) aobj[i]; ItemStack itemstack1 = null; if (aobj[i + 1] is Item) { itemstack1 = new ItemStack((Item) aobj[i + 1]); } else if (aobj[i + 1] is Block) { itemstack1 = new ItemStack((Block) aobj[i + 1], 1, -1); } else if (aobj[i + 1] is ItemStack) { itemstack1 = (ItemStack) aobj[i + 1]; } hashmap.put(character, itemstack1); } var aitemstack = new ItemStack[j*k]; for (int i1 = 0; i1 < j*k; i1++) { char c = s[i1]; if (hashmap.containsKey(Character.valueOf(c))) { aitemstack[i1] = ((ItemStack) hashmap.get(Character.valueOf(c))).copy(); } else { aitemstack[i1] = null; } } recipes.add(new ShapedRecipes(j, k, aitemstack, itemstack)); }
// // Type inference // private bool hasUnfixedTypeVariables(TypeInfo type, HashMap<TypeInfo, TypeVariableInfo> typeVariableInfos) { var tv = typeVariableInfos.get(type); if (tv != null) { return tv.fixedType == null; } else if (type.IsArray) { return hasUnfixedTypeVariables(type.ElementType, typeVariableInfos); } else if (!type.IsClosed) { foreach (var t in type.GenericArguments) { if (hasUnfixedTypeVariables(t, typeVariableInfos)) { return true; } } } return false; }