Advertisement
Guest User

Untitled

a guest
Dec 25th, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. Index: settings.ini
  2. ===================================================================
  3. --- settings.ini (revision 104)
  4. +++ settings.ini (working copy)
  5. @@ -1,7 +1,6 @@
  6. [Server]
  7. Port=25565
  8. -ServerID=-
  9. -MaxPlayers=10000
  10. +MaxPlayers=64
  11. Description=MCServer - Slightly more custom!
  12.  
  13. [Worlds]
  14. @@ -26,6 +25,6 @@
  15. Types=Chicken,Spider
  16.  
  17. [Authentication]
  18. -Server=www.minecraft.net
  19. +Server=session.minecraft.net
  20. Address=/game/checkserver.jsp?user=%USERNAME%&serverId=%SERVERID%
  21. -Authenticate=0
  22. +Authenticate=1
  23. Index: source/cServer.cpp
  24. ===================================================================
  25. --- source/cServer.cpp (revision 104)
  26. +++ source/cServer.cpp (working copy)
  27. @@ -23,6 +23,8 @@
  28. #include "cTracer.h"
  29. #include "cWebAdmin.h"
  30.  
  31. +#include "mersenne.h"
  32. +
  33. #include "../iniFile/iniFile.h"
  34. #include "Vector3f.h"
  35.  
  36. @@ -196,6 +198,9 @@
  37. if( IniFile.ReadFile() )
  38. {
  39. g_bWaterPhysics = IniFile.GetValueB("Physics", "Water", false );
  40. +
  41. + /* Replaced below with 1.0.0 compatible ServerID generation
  42. +
  43. std::string ServerID = IniFile.GetValue("Server", "ServerID");
  44. if( ServerID.empty() )
  45. {
  46. @@ -203,7 +208,19 @@
  47. IniFile.SetValue("Server", "ServerID", ServerID, true );
  48. IniFile.WriteFile();
  49. }
  50. - m_pState->ServerID = ServerID;
  51. + */
  52. + m_pState->ServerID = "-";
  53. + if (IniFile.GetValueB("Authentication", "Authenticate"))
  54. + {
  55. + MTRand mtrand1;
  56. + unsigned int r1 = (mtrand1.randInt()%1147483647) + 1000000000;
  57. + unsigned int r2 = (mtrand1.randInt()%1147483647) + 1000000000;
  58. + std::ostringstream sid;
  59. + sid << std::hex << r1;
  60. + sid << std::hex << r2;
  61. + std::string ServerID = sid.str();
  62. + m_pState->ServerID = ServerID;
  63. + }
  64. }
  65. return true;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement