Guest User

Untitled

a guest
Jul 12th, 2016
207
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. #####################################################
  3. #Benjojo's minecraft server v0.00000001             #
  4. #####################################################
  5. # I know that this code is like looking at a car    #
  6. # crash but its the horrible prototype code.        #
  7. #                                                   #
  8. # No Licence is here, Feel free to mention me if    #
  9. # feel like it, i know that licences dont get       #
  10. # followed so I will not bother.                    #
  11. #                                                   #
  12. # Data captures are from the stock MCMP server.     #
  13. #####################################################
  14. */
  15.  
  16. char peer1_0[] = {
  17. 0x00, 0x07, 0x48, 0x41, 0x53, 0x48, 0x48, 0x41,
  18. 0x53, 0x48, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  19. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  20. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  21. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  22. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  23. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  24. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  25. 0x20, 0x20, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d,
  26. 0x65, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x79, 0x20,
  27. 0x4d, 0x69, 0x6e, 0x65, 0x63, 0x72, 0x61, 0x66,
  28. 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
  29. 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  30. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  31. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  32. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  33. 0x20, 0x20, 0x00 };
  34. char peer1_1[] = {
  35. 0x02, 0x03, 0x01, 0xb3, 0x1f, 0x8b, 0x08, 0x00,
  36. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0xdb,
  37. 0x8b, 0x6e, 0x82, 0x30, 0x00, 0x05, 0xd0, 0x42,
  38. 0xdd, 0x07, 0xcc, 0xff, 0xff, 0xd8, 0xf1, 0x52,
  39. 0xd0, 0x49, 0x65, 0xad, 0x08, 0xc3, 0x73, 0x96,
  40. 0x74, 0xc6, 0x71, 0x5b, 0x46, 0x1c, 0xc9, 0x6d,
  41. 0x58, 0xa8, 0x42, 0x88, 0xc0, 0x5b, 0x7c, 0x75,
  42. 0xe4, 0x01, 0x00, 0x00, 0x60, 0xcf, 0xbe, 0x3b,
  43. 0xf9, 0xf1, 0xd0, 0xc9, 0x9e, 0xe0, 0xd3, 0xf3,
  44. 0xfd, 0xf5, 0xb7, 0x63, 0x09, 0x00, 0x00, 0xc0,
  45. 0xca, 0xf4, 0xff, 0x7f, 0xde, 0xff, 0xdb, 0xa5,
  46. 0xed, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xfe, 0x95,
  47. 0xf6, 0xf7, 0xad, 0xf3, 0x00, 0x00, 0x00, 0xc0,
  48. 0xfa, 0xb6, 0xee, 0xff, 0xf6, 0x0f, 0x00, 0x00,
  49. 0x00, 0x60, 0xff, 0xb6, 0xee, 0xff, 0xf6, 0x0f,
  50. 0x00, 0x00, 0x00, 0x5a, 0xda, 0x51, 0xa9, 0xaa,
  51. 0x74, 0x82, 0x7a, 0xe3, 0xfc, 0xce, 0x6d, 0xdd,
  52. 0xff, 0xfd, 0x85, 0x00, 0x00, 0x7c, 0xb4, 0x1a,
  53. 0xae, 0x4a, 0x3f, 0x14, 0xb1, 0x6a, 0xc9, 0x67,
  54. 0xe7, 0xfb, 0xfe, 0x9d, 0x9d, 0x6f, 0x54, 0x25,
  55. 0xe1, 0x57, 0xe4, 0x43, 0x61, 0xfe, 0x5c, 0x98,
  56. 0x2f, 0x8b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0xb5,
  77. 0xfe, 0x0f, 0x00, 0x00, 0x87, 0x71, 0xea, 0xe5,
  78. 0xe7, 0x27, 0xa3, 0x7c, 0x46, 0xbe, 0xf0, 0xfa,
  79. 0xb3, 0x6f, 0x7d, 0xaf, 0xbe, 0xeb, 0xff, 0xbf,
  80. 0xcd, 0xf6, 0xff, 0x30, 0x3c, 0x08, 0x90, 0x96,
  81. 0x38, 0x60, 0xc9, 0x33, 0x5f, 0xa9, 0xf9, 0xbb,
  82. 0xa7, 0x0b, 0x9e, 0xad, 0x9f, 0x88, 0x3f, 0x5d,
  83. 0x00, 0x00, 0x00, 0x00, 0x8e, 0x68, 0x79, 0x17,
  84. 0x5e, 0xe3, 0x48, 0x00, 0x00, 0x00, 0xe0, 0x1d,
  85. 0xf4, 0x7f, 0x00, 0x00, 0x00, 0x38, 0x3e, 0xad,
  86. 0x1e, 0x00, 0x00, 0x00, 0x8e, 0x6f, 0xf9, 0x7f,
  87. 0xd3, 0xeb, 0xff, 0x00, 0x00, 0x00, 0x70, 0x7c,
  88. 0xfa, 0x3f, 0x00, 0x00, 0xe5, 0x7e, 0x00, 0xe2,
  89. 0x4e, 0xa9, 0x6a, 0x04, 0x00, 0x01, 0x00, 0x00,
  90. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  91. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  92. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  93. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  94. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  95. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  96. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  97. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  98. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  99. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  100. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  101. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  102. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  103. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  104. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  105. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  106. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  107. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  108. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  109. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  110. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  111. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  112. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  113. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  114. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  115. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  116. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  117. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  118. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  119. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  120. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  121. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  122. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  123. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  124. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  125. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  126. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  127. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  128. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  129. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  130. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  131. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  132. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  133. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  134. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  135. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  136. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  137. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  138. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  139. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  140. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  141. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  142. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  143. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  144. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  145. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  146. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  147. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  148. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  149. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  150. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  151. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  152. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  153. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  154. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  155. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  156. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  157. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  158. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  159. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  160. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  161. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  162. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  163. 0x00, 0x00, 0x00, 0x00, 0x64, 0x04, 0x00, 0x40,
  164. 0x00, 0x10, 0x00, 0x40, 0x07, 0xff, 0x4d, 0x75,
  165. 0x6c, 0x74, 0x69, 0x4b, 0x69, 0x6c, 0x6c, 0x20,
  166. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  167. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  168. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  169. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  170. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  171. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  172. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x03, 0x70,
  173. 0x01, 0xf0, 0x03, 0x70, 0x00, 0x00, 0x07, 0x01,
  174. 0x62, 0x65, 0x6e, 0x6a, 0x6f, 0x6a, 0x6f, 0x20,
  175. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  176. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  177. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  178. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  179. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  180. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  181. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  182. 0x03, 0x70, 0x01, 0x33, 0x03, 0x70, 0x00, 0x00,
  183. 0x01, 0x01, 0x06, 0x00, 0x33, 0x00, 0x0a, 0x00,
  184. 0x18, 0x02, 0x01, 0x0d, 0xff, 0x4d, 0x75, 0x6c,
  185. 0x74, 0x69, 0x4b, 0x69, 0x6c, 0x6c, 0x20, 0x6a,
  186. 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x68,
  187. 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x20,
  188. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  189. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  190. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  191. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  192. 0x20, 0x20, 0x20, 0x20, 0x20 };
  193.  
  194. char hb[] = {
  195. 0x01 };
  196.  
  197. #include <Ethernet.h>
  198.  
  199. byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
  200. byte ip[] = { 192, 168, 0, 133 };
  201.  
  202. Server server(25565);
  203.  
  204. void setup()
  205. {
  206.   Ethernet.begin(mac, ip);
  207.   server.begin();
  208.   Serial.begin(9600);
  209. }
  210.  
  211. void loop()
  212. {
  213.   Client client = server.available();
  214.   if (client) {
  215.     boolean clientisgood = false;
  216.     boolean clientisgood2 = false;
  217.     boolean shutoff = false;    
  218.     int test = 0;
  219.     int run = 0;
  220.     int t = 0;
  221.     while (client.connected()) {
  222.     if (client.available()) {
  223.             char c = client.read();
  224.             Serial.print(c, HEX);
  225.  
  226.             if (shutoff == false){
  227.                 t = t + 1;
  228.                 if (c == peer1_0[0]) {
  229.                   test = test + 1;
  230.                   Serial.print("\nT1 done\n");
  231.                 }
  232.                
  233.                 if (test == 1){
  234.                   if (c == peer1_0[1]) {
  235.                   test = test + 1;
  236.                   Serial.print("\nT2 done\n");
  237.                   }
  238.                 }
  239.                 if (test == 2){
  240.                   if (t == 130){
  241.                     Serial.print("\nT3 done\n");
  242.  
  243.                        for (int i=0; i <= sizeof(peer1_0); i++){
  244.                          client.print(peer1_0[i]);
  245.                          delay(5);
  246.                        }
  247.                        delay(100);
  248.                        Serial.print("\nSent server Info\n");
  249.                        Serial.print("\nSending Level Info\n");
  250.                        for (int i=0; i <= sizeof(peer1_1); i++){
  251.                          client.print(peer1_1[i]);
  252.                          delay(5);
  253.                        }        
  254.                        Serial.print("\nSent Level Info\n");
  255.                        Serial.print("\nZing\n");
  256.                        shutoff = true;
  257.                        client.print(hb[0]); // Send a HB, For some reason THIS HAS TO HAPPEN
  258.                        }
  259.                    
  260.                   }
  261.             }
  262.             }
  263.        
  264.          if (clientisgood == true) {
  265.           client.print(hb[0]);
  266.           delay(100);
  267.          }
  268.     }
  269.  }
  270. }
RAW Paste Data