Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. package com.inferno.net.login;
  2.  
  3. import java.nio.channels.Channel;
  4.  
  5. import com.inferno.net.packet.Packet;
  6. import com.inferno.net.security.IsaacRandom;
  7.  
  8. import io.netty.channel.ChannelHandlerContext;
  9.  
  10. /**
  11. * The {@link Packet} implementation that contains data used for the final
  12. * portion of the login protocol.
  13. *
  14. * @author lare96 <http://github.org/lare96>
  15. */
  16. public final class LoginDetailsMessage {
  17.  
  18. /**
  19. * The context to which this player is going through.
  20. */
  21. private final ChannelHandlerContext context;
  22.  
  23. /**
  24. * The username of the player.
  25. */
  26. private final String username;
  27.  
  28. /**
  29. * The password of the player.
  30. */
  31. private final String password;
  32.  
  33. /**
  34. * The player's host address
  35. */
  36. private final String host;
  37.  
  38. /**
  39. * The player's client version.
  40. */
  41. private final int clientVersion;
  42.  
  43. /**
  44. * The player's client uid.
  45. */
  46. private final int uid;
  47.  
  48. /**
  49. * The encrypting isaac
  50. */
  51. private final IsaacRandom encryptor;
  52.  
  53. /**
  54. * The decrypting isaac
  55. */
  56. private final IsaacRandom decryptor;
  57.  
  58. /**
  59. * Creates a new {@link LoginDetailsMessage}.
  60. *
  61. * @param ctx
  62. * the {@link ChannelHandlerContext} that holds our
  63. * {@link Channel} instance.
  64. * @param username
  65. * the username of the player.
  66. * @param password
  67. * the password of the player.
  68. * @param encryptor
  69. * the encryptor for encrypting messages.
  70. * @param decryptor
  71. * the decryptor for decrypting messages.
  72. */
  73. public LoginDetailsMessage(ChannelHandlerContext context, String username, String password, String host, int clientVersion, int uid,
  74. IsaacRandom encryptor, IsaacRandom decryptor) {
  75. this.context = context;
  76. this.username = username;
  77. this.password = password;
  78. this.host = host;
  79. this.clientVersion = clientVersion;
  80. this.uid = uid;
  81. this.encryptor = encryptor;
  82. this.decryptor = decryptor;
  83. }
  84.  
  85.  
  86. public ChannelHandlerContext getContext() {
  87. return context;
  88. }
  89.  
  90. public String getUsername() {
  91. return username;
  92. }
  93.  
  94. public String getPassword() {
  95. return password;
  96. }
  97.  
  98. public String getHost() {
  99. return host;
  100. }
  101.  
  102. public int getClientVersion() {
  103. return clientVersion;
  104. }
  105.  
  106. public int getUid() {
  107. return uid;
  108. }
  109.  
  110. public IsaacRandom getEncryptor() {
  111. return encryptor;
  112. }
  113.  
  114. public IsaacRandom getDecryptor() {
  115. return decryptor;
  116. }
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement