Esempio n. 1
0
 public void doLogin(Packet1Login packet1login)
 {
     EntityPlayerMP entityplayermp = mcServer.configManager.login(this, packet1login.username,
                                                                  packet1login.password);
     if (entityplayermp != null)
     {
         logger.info(
             (new StringBuilder()).append(getUserAndIPString()).append(" logged in with entity id ").append(
                 entityplayermp.entityId).toString());
         ChunkCoordinates chunkcoordinates = mcServer.worldMngr.func_22078_l();
         var netserverhandler = new NetServerHandler(mcServer, netManager, entityplayermp);
         netserverhandler.sendPacket(new Packet1Login("", "", entityplayermp.entityId,
                                                      mcServer.worldMngr.func_22079_j(),
                                                      (byte) mcServer.worldMngr.worldProvider.worldType));
         netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.posX, chunkcoordinates.posY,
                                                              chunkcoordinates.posZ));
         mcServer.configManager.sendPacketToAllPlayers(
             new Packet3Chat(
                 (new StringBuilder()).append("§e").append(entityplayermp.username).append(" joined the game.").
                     toString()));
         mcServer.configManager.playerLoggedIn(entityplayermp);
         netserverhandler.teleportTo(entityplayermp.posX, entityplayermp.posY, entityplayermp.posZ,
                                     entityplayermp.rotationYaw, entityplayermp.rotationPitch);
         mcServer.networkServer.addPlayer(netserverhandler);
         netserverhandler.sendPacket(new Packet4UpdateTime(mcServer.worldMngr.getWorldTime()));
         entityplayermp.func_20057_k();
     }
     finishedProcessing = true;
 }
Esempio n. 2
0
        public void doLogin(Packet1Login packet1login)
        {
            EntityPlayerMP entityplayermp = mcServer.configManager.login(this, packet1login.username,
                                                                         packet1login.password);

            if (entityplayermp != null)
            {
                logger.info(
                    (new StringBuilder()).append(getUserAndIPString()).append(" logged in with entity id ").append(
                        entityplayermp.entityId).toString());
                ChunkCoordinates chunkcoordinates = mcServer.worldMngr.func_22078_l();
                var netserverhandler = new NetServerHandler(mcServer, netManager, entityplayermp);
                netserverhandler.sendPacket(new Packet1Login("", "", entityplayermp.entityId,
                                                             mcServer.worldMngr.func_22079_j(),
                                                             (byte)mcServer.worldMngr.worldProvider.worldType));
                netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.posX, chunkcoordinates.posY,
                                                                     chunkcoordinates.posZ));
                mcServer.configManager.sendPacketToAllPlayers(
                    new Packet3Chat(
                        (new StringBuilder()).append("§e").append(entityplayermp.username).append(" joined the game.").
                        toString()));
                mcServer.configManager.playerLoggedIn(entityplayermp);
                netserverhandler.teleportTo(entityplayermp.posX, entityplayermp.posY, entityplayermp.posZ,
                                            entityplayermp.rotationYaw, entityplayermp.rotationPitch);
                mcServer.networkServer.addPlayer(netserverhandler);
                netserverhandler.sendPacket(new Packet4UpdateTime(mcServer.worldMngr.getWorldTime()));
                entityplayermp.func_20057_k();
            }
            finishedProcessing = true;
        }
Esempio n. 3
0
 public NetLoginHandler(MinecraftServer minecraftserver, Socket socket, string s)
 {
     finishedProcessing = false;
     loginTimer = 0;
     username = null;
     field_9004_h = null;
     serverId = "";
     mcServer = minecraftserver;
     netManager = new NetworkManager(socket, s, this);
     netManager.chunkDataSendCounter = 0;
 }
Esempio n. 4
0
 public NetLoginHandler(MinecraftServer minecraftserver, Socket socket, string s)
 {
     finishedProcessing = false;
     loginTimer         = 0;
     username           = null;
     field_9004_h       = null;
     serverId           = "";
     mcServer           = minecraftserver;
     netManager         = new NetworkManager(socket, s, this);
     netManager.chunkDataSendCounter = 0;
 }
Esempio n. 5
0
 public void tryLogin()
 {
     if (field_9004_h != null)
     {
         doLogin(field_9004_h);
         field_9004_h = null;
     }
     if (loginTimer++ == 600)
     {
         kickUser("Took too long to log in");
     }
     else
     {
         netManager.processReadPackets();
     }
 }
Esempio n. 6
0
 public override void handleLogin(Packet1Login packet1login)
 {
     username = packet1login.username;
     if (packet1login.protocolVersion != 9)
     {
         if (packet1login.protocolVersion > 9)
         {
             kickUser("Outdated server!");
         }
         else
         {
             kickUser("Outdated client!");
         }
         return;
     }
     if (!mcServer.onlineMode)
     {
         doLogin(packet1login);
     }
     else
     {
         (new ThreadLoginVerifier(this, packet1login)).start();
     }
 }
Esempio n. 7
0
 public static Packet1Login setLoginPacket(NetLoginHandler netloginhandler, Packet1Login packet1login)
 {
     return netloginhandler.field_9004_h = packet1login;
 }
Esempio n. 8
0
 public void tryLogin()
 {
     if (field_9004_h != null)
     {
         doLogin(field_9004_h);
         field_9004_h = null;
     }
     if (loginTimer++ == 600)
     {
         kickUser("Took too long to log in");
     }
     else
     {
         netManager.processReadPackets();
     }
 }
Esempio n. 9
0
 public override void handleLogin(Packet1Login packet1login)
 {
     username = packet1login.username;
     if (packet1login.protocolVersion != 9)
     {
         if (packet1login.protocolVersion > 9)
         {
             kickUser("Outdated server!");
         }
         else
         {
             kickUser("Outdated client!");
         }
         return;
     }
     if (!mcServer.onlineMode)
     {
         doLogin(packet1login);
     }
     else
     {
         (new ThreadLoginVerifier(this, packet1login)).start();
     }
 }
Esempio n. 10
0
 public static Packet1Login setLoginPacket(NetLoginHandler netloginhandler, Packet1Login packet1login)
 {
     return(netloginhandler.field_9004_h = packet1login);
 }
Esempio n. 11
0
        private readonly Packet1Login loginPacket; /* synthetic field */

        #endregion Fields

        #region Constructors

        public ThreadLoginVerifier(NetLoginHandler netloginhandler, Packet1Login packet1login)
        {
            loginHandler = netloginhandler;
            loginPacket = packet1login;
            //
        }
Esempio n. 12
0
        private readonly Packet1Login loginPacket;     /* synthetic field */

        public ThreadLoginVerifier(NetLoginHandler netloginhandler, Packet1Login packet1login)
        {
            loginHandler = netloginhandler;
            loginPacket  = packet1login;
//
        }