Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: settings.ini
- ===================================================================
- --- settings.ini (revision 104)
- +++ settings.ini (working copy)
- @@ -1,7 +1,6 @@
- [Server]
- Port=25565
- -ServerID=-
- -MaxPlayers=10000
- +MaxPlayers=64
- Description=MCServer - Slightly more custom!
- [Worlds]
- @@ -26,6 +25,6 @@
- Types=Chicken,Spider
- [Authentication]
- -Server=www.minecraft.net
- +Server=session.minecraft.net
- Address=/game/checkserver.jsp?user=%USERNAME%&serverId=%SERVERID%
- -Authenticate=0
- +Authenticate=1
- Index: source/cServer.cpp
- ===================================================================
- --- source/cServer.cpp (revision 104)
- +++ source/cServer.cpp (working copy)
- @@ -23,6 +23,8 @@
- #include "cTracer.h"
- #include "cWebAdmin.h"
- +#include "mersenne.h"
- +
- #include "../iniFile/iniFile.h"
- #include "Vector3f.h"
- @@ -196,6 +198,9 @@
- if( IniFile.ReadFile() )
- {
- g_bWaterPhysics = IniFile.GetValueB("Physics", "Water", false );
- +
- + /* Replaced below with 1.0.0 compatible ServerID generation
- +
- std::string ServerID = IniFile.GetValue("Server", "ServerID");
- if( ServerID.empty() )
- {
- @@ -203,7 +208,19 @@
- IniFile.SetValue("Server", "ServerID", ServerID, true );
- IniFile.WriteFile();
- }
- - m_pState->ServerID = ServerID;
- + */
- + m_pState->ServerID = "-";
- + if (IniFile.GetValueB("Authentication", "Authenticate"))
- + {
- + MTRand mtrand1;
- + unsigned int r1 = (mtrand1.randInt()%1147483647) + 1000000000;
- + unsigned int r2 = (mtrand1.randInt()%1147483647) + 1000000000;
- + std::ostringstream sid;
- + sid << std::hex << r1;
- + sid << std::hex << r2;
- + std::string ServerID = sid.str();
- + m_pState->ServerID = ServerID;
- + }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement