当前位置: 首页>>代码示例>>Java>>正文


Java Packet253ServerAuthData类代码示例

本文整理汇总了Java中net.minecraft.network.packet.Packet253ServerAuthData的典型用法代码示例。如果您正苦于以下问题:Java Packet253ServerAuthData类的具体用法?Java Packet253ServerAuthData怎么用?Java Packet253ServerAuthData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Packet253ServerAuthData类属于net.minecraft.network.packet包,在下文中一共展示了Packet253ServerAuthData类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_72500_a

import net.minecraft.network.packet.Packet253ServerAuthData; //导入依赖的package包/类
public void func_72500_a(Packet2ClientProtocol p_72500_1_) {
   if(this.field_72543_h != null) {
      this.func_72527_a("Quit repeating yourself!");
   } else {
      this.field_72543_h = p_72500_1_.func_73454_f();
      if(!this.field_72543_h.equals(StringUtils.func_76338_a(this.field_72543_h))) {
         this.func_72527_a("Invalid username!");
      } else {
         PublicKey var2 = this.field_72534_f.func_71250_E().getPublic();
         if(p_72500_1_.func_73453_d() != 78) {
            if(p_72500_1_.func_73453_d() > 78) {
               this.func_72527_a("Outdated server!");
            } else {
               this.func_72527_a("Outdated client!");
            }

         } else {
            this.field_72541_j = this.field_72534_f.func_71266_T()?Long.toString(field_72537_e.nextLong(), 16):"-";
            this.field_72536_d = new byte[4];
            field_72537_e.nextBytes(this.field_72536_d);
            this.field_72538_b.func_74429_a(new Packet253ServerAuthData(this.field_72541_j, var2, this.field_72536_d));
         }
      }
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:26,代码来源:NetLoginHandler.java

示例2: handleServerAuthData

import net.minecraft.network.packet.Packet253ServerAuthData; //导入依赖的package包/类
public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData)
{
    String s = par1Packet253ServerAuthData.getServerId().trim();
    PublicKey publickey = par1Packet253ServerAuthData.getPublicKey();
    SecretKey secretkey = CryptManager.createNewSharedKey();

    if (!"-".equals(s))
    {
        String s1 = (new BigInteger(CryptManager.getServerIdHash(s, publickey, secretkey))).toString(16);
        String s2 = this.sendSessionRequest(this.mc.getSession().getUsername(), this.mc.getSession().getSessionID(), s1);

        if (!"ok".equalsIgnoreCase(s2))
        {
            this.netManager.networkShutdown("disconnect.loginFailedInfo", new Object[] {s2});
            return;
        }
    }

    this.addToSendQueue(new Packet252SharedKey(secretkey, publickey, par1Packet253ServerAuthData.getVerifyToken()));
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:21,代码来源:NetClientHandler.java

示例3: func_72470_a

import net.minecraft.network.packet.Packet253ServerAuthData; //导入依赖的package包/类
public void func_72470_a(Packet253ServerAuthData p_72470_1_) {
   String var2 = p_72470_1_.func_73377_d().trim();
   PublicKey var3 = p_72470_1_.func_73376_f();
   SecretKey var4 = CryptManager.func_75890_a();
   if(!"-".equals(var2)) {
      String var5 = (new BigInteger(CryptManager.func_75895_a(var2, var3, var4))).toString(16);
      String var6 = this.func_72550_a(this.field_72563_h.func_110432_I().func_111285_a(), this.field_72563_h.func_110432_I().func_111286_b(), var5);
      if(!"ok".equalsIgnoreCase(var6)) {
         this.field_72555_g.func_74424_a("disconnect.loginFailedInfo", new Object[]{var6});
         return;
      }
   }

   this.func_72552_c(new Packet252SharedKey(var4, var3, p_72470_1_.func_73378_g()));
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:16,代码来源:NetClientHandler.java

示例4: handleClientProtocol

import net.minecraft.network.packet.Packet253ServerAuthData; //导入依赖的package包/类
public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol)
{
    if (this.clientUsername != null)
    {
        this.raiseErrorAndDisconnect("Quit repeating yourself!");
    }
    else
    {
        this.clientUsername = par1Packet2ClientProtocol.getUsername();

        if (!this.clientUsername.equals(StringUtils.stripControlCodes(this.clientUsername)))
        {
            this.raiseErrorAndDisconnect("Invalid username!");
        }
        else
        {
            PublicKey publickey = this.mcServer.getKeyPair().getPublic();

            if (par1Packet2ClientProtocol.getProtocolVersion() != 78)
            {
                if (par1Packet2ClientProtocol.getProtocolVersion() > 78)
                {
                    this.raiseErrorAndDisconnect("Outdated server!");
                }
                else
                {
                    this.raiseErrorAndDisconnect("Outdated client!");
                }
            }
            else
            {
                this.loginServerId = this.mcServer.isServerInOnlineMode() ? Long.toString(rand.nextLong(), 16) : "-";
                this.verifyToken = new byte[4];
                rand.nextBytes(this.verifyToken);
                this.myTCPConnection.addToSendQueue(new Packet253ServerAuthData(this.loginServerId, publickey, this.verifyToken));
            }
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:40,代码来源:NetLoginHandler.java

示例5: handleServerAuthData

import net.minecraft.network.packet.Packet253ServerAuthData; //导入依赖的package包/类
@Override
public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData)
{
	nch.handleServerAuthData(par1Packet253ServerAuthData);
	
}
 
开发者ID:xurei,项目名称:forge_world_downloader,代码行数:7,代码来源:WDLNetClientHandler.java

示例6: func_72470_a

import net.minecraft.network.packet.Packet253ServerAuthData; //导入依赖的package包/类
public void func_72470_a(Packet253ServerAuthData p_72470_1_) {
   this.func_72509_a(p_72470_1_);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:NetHandler.java


注:本文中的net.minecraft.network.packet.Packet253ServerAuthData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。