예제 #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;
 }
예제 #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;
        }
예제 #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;
 }
예제 #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;
 }
예제 #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();
     }
 }
예제 #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();
     }
 }
예제 #7
0
 public static Packet1Login setLoginPacket(NetLoginHandler netloginhandler, Packet1Login packet1login)
 {
     return netloginhandler.field_9004_h = packet1login;
 }
예제 #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();
     }
 }
예제 #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();
     }
 }
예제 #10
0
 public static Packet1Login setLoginPacket(NetLoginHandler netloginhandler, Packet1Login packet1login)
 {
     return(netloginhandler.field_9004_h = packet1login);
 }
예제 #11
0
        private readonly Packet1Login loginPacket; /* synthetic field */

        #endregion Fields

        #region Constructors

        public ThreadLoginVerifier(NetLoginHandler netloginhandler, Packet1Login packet1login)
        {
            loginHandler = netloginhandler;
            loginPacket = packet1login;
            //
        }
예제 #12
0
        private readonly Packet1Login loginPacket;     /* synthetic field */

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