本文整理汇总了Java中handling.login.LoginServer.putLoginAuth方法的典型用法代码示例。如果您正苦于以下问题:Java LoginServer.putLoginAuth方法的具体用法?Java LoginServer.putLoginAuth怎么用?Java LoginServer.putLoginAuth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类handling.login.LoginServer
的用法示例。
在下文中一共展示了LoginServer.putLoginAuth方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handlePacket
import handling.login.LoginServer; //导入方法依赖的package包/类
public static void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
int charId = slea.readInt();
if (!c.isLoggedIn() || loginFailCount(c) || (!c.login_Auth(charId))) {
c.getSession().write(MaplePacketCreator.enableActions());
return;
}
if ((ChannelServer.getInstance(c.getChannel()) == null) || !WorldConstants.isExists(c.getWorld())) {
c.getSession().close(true);
return;
}
if (c.getIdleTask() != null) {
c.getIdleTask().cancel(true);
}
String ip = c.getSessionIPAddress();
LoginServer.putLoginAuth(charId, ip.substring(ip.indexOf('/') + 1, ip.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, ip);
c.getSession().write(MaplePacketCreator.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charId));
}
示例2: handle
import handling.login.LoginServer; //导入方法依赖的package包/类
@PacketHandler(opcode = RecvPacketOpcode.CHAR_SELECT)
public static void handle(MapleClient c, LittleEndianAccessor lea){
//onCheckCharacterResult
int charId = lea.readInt();
//String charName = lea.readMapleAsciiString(); // You can use it for logging or something.
final String s = c.getSessionIPAddress();
LoginServer.putLoginAuth(charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
//c.getSession().write(CField.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charId));// is c.getChannel() not used anymore?
}
示例3: handle
import handling.login.LoginServer; //导入方法依赖的package包/类
@PacketHandler(opcode = RecvPacketOpcode.AUTH_SECOND_PASSWORD)
public static void handle(MapleClient c, LittleEndianAccessor lea) {
final String password = lea.readMapleAsciiString();
final int charId = lea.readInt();
lea.readByte();
/*if (view) {
c.setChannel(1);
c.setWorld(slea.readInt());
}*/
// || loginFailCount(c)
if (!c.isLoggedIn() || c.getSecondPassword() == null || !c.login_Auth(charId) || ChannelServer.getInstance(c.getChannel()) == null || !WorldOption.isExists(c.getWorld())) {
c.getSession().close();
return;
}
c.updateMacs(lea.readMapleAsciiString());
if (c.CheckSecondPassword(password) && password.length() >= 6 && password.length() <= 16 || c.isGm()) {
if (c.getIdleTask() != null) {
c.getIdleTask().cancel(true);
}
final String s = c.getSessionIPAddress();
LoginServer.putLoginAuth(charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
c.getSession().write(CField.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charId));
} else {
c.getSession().write(LoginPacket.secondPwError((byte) 0x14));
}
}
示例4: handle
import handling.login.LoginServer; //导入方法依赖的package包/类
public static void handle(MapleClient c, LittleEndianAccessor lea) {
final int charId = lea.readInt();
lea.readByte(); // 1?
lea.readByte(); // 1?
final String currentpw = c.getSecondPassword();
if (!c.isLoggedIn() || (currentpw != null && (!currentpw.equals(""))) || !c.login_Auth(charId) || ChannelServer.getInstance(c.getChannel()) == null || !WorldOption.isExists(c.getWorld())) {
System.out.println("The session wants to close");
c.getSession().close();
return;
}
c.updateMacs(lea.readMapleAsciiString());
if (lea.available() != 0) {
final String setpassword = lea.readMapleAsciiString();
if (setpassword.length() >= 6 && setpassword.length() <= 16) {
c.setSecondPassword(setpassword);
c.updateSecondPassword();
} else {
c.getSession().write(LoginPacket.secondPwError((byte) 0x14));
return;
}
}
if (c.getIdleTask() != null) {
c.getIdleTask().cancel(true);
}
final String s = c.getSessionIPAddress();
LoginServer.putLoginAuth(charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
c.getSession().write(CField.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charId));
}
示例5: handle
import handling.login.LoginServer; //导入方法依赖的package包/类
@PacketHandler(opcode = RecvPacketOpcode.CHAR_SELECT)
public static void handle(MapleClient c, LittleEndianAccessor lea){
//onCheckCharacterResult
int charId = lea.readInt();
//String charName = lea.readMapleAsciiString(); // You can use it for logging or something.
final String s = c.getSessionIPAddress();
LoginServer.putLoginAuth(charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
c.getSession().write(CField.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charId));// is c.getChannel() not used anymore?
}
示例6: handlePacket
import handling.login.LoginServer; //导入方法依赖的package包/类
public static void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c, boolean haspic, boolean view) {
slea.readByte();
int charId = slea.readInt();
if (view) {
c.setChannel(1);
c.setWorld(slea.readInt());
}
String currentpw = c.getSecondPassword();
if ((!c.isLoggedIn()) || (loginFailCount(c)) || ((currentpw != null) && ((!currentpw.equals("")) || (haspic))) || (!c.login_Auth(charId)) || (ChannelServer.getInstance(c.getChannel()) == null) || (c.getWorld() != 0)) {
c.getSession().close(true);
return;
}
if (slea.available() != 0L) {
String setpassword = slea.readMapleAsciiString();
if ((setpassword.length() >= 6) && (setpassword.length() <= 16)) {
c.setSecondPassword(setpassword);
c.updateSecondPassword();
} else {
c.getSession().write(LoginPacket.secondPwError((byte) 20));
return;
}
} else if ((GameConstants.GMS) && (haspic)) {
return;
}
if (c.getIdleTask() != null) {
c.getIdleTask().cancel(true);
}
String s = c.getSessionIPAddress();
LoginServer.putLoginAuth(charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
c.getSession().write(MaplePacketCreator.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charId));
}
示例7: Character_WithoutSecondPassword
import handling.login.LoginServer; //导入方法依赖的package包/类
public static void Character_WithoutSecondPassword(final LittleEndianAccessor slea, final MapleClient c, final boolean haspic, final boolean view) {
slea.readByte(); // 1?
slea.readByte(); // 1?
final int charId = slea.readInt();
if (view) {
c.setChannel(1);
c.setWorld(slea.readInt());
}
final String currentpw = c.getSecondPassword();
if (!c.isLoggedIn() || loginFailCount(c) || (currentpw != null && (!currentpw.equals("") || haspic)) || !c.login_Auth(charId) || ChannelServer.getInstance(c.getChannel()) == null || !WorldOption.isExists(c.getWorld())) {
c.getSession().close();
return;
}
c.updateMacs(slea.readMapleAsciiString());
slea.readMapleAsciiString();
if (slea.available() != 0) {
final String setpassword = slea.readMapleAsciiString();
if (setpassword.length() >= 6 && setpassword.length() <= 16) {
c.setSecondPassword(setpassword);
c.updateSecondPassword();
} else {
c.getSession().write(LoginPacket.secondPwError((byte) 0x14));
return;
}
} else if (haspic) {
return;
}
if (c.getIdleTask() != null) {
c.getIdleTask().cancel(true);
}
final String s = c.getSessionIPAddress();
LoginServer.putLoginAuth(charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
c.getSession().write(LoginPacket.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charId));
}
示例8: Character_WithSecondPassword
import handling.login.LoginServer; //导入方法依赖的package包/类
public static void Character_WithSecondPassword(final LittleEndianAccessor slea, final MapleClient c, final boolean view) {
final String password = slea.readMapleAsciiString();
final int charId = slea.readInt();
if (view) {
c.setChannel(1);
c.setWorld(slea.readInt());
}
if (!c.isLoggedIn() || loginFailCount(c) || c.getSecondPassword() == null || !c.login_Auth(charId) || ChannelServer.getInstance(c.getChannel()) == null || !WorldOption.isExists(c.getWorld())) {
c.getSession().close();
return;
}
c.updateMacs(slea.readMapleAsciiString());
if (c.CheckSecondPassword(password) && password.length() >= 6 && password.length() <= 16 || c.isGm()) {
if (c.getIdleTask() != null) {
c.getIdleTask().cancel(true);
}
final String s = c.getSessionIPAddress();
LoginServer.putLoginAuth(charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
c.getSession().write(LoginPacket.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charId));
} else {
c.getSession().write(LoginPacket.secondPwError((byte) 0x14));
}
}
示例9: handle
import handling.login.LoginServer; //导入方法依赖的package包/类
@PacketHandler(opcode = RecvPacketOpcode.CHAR_SELECT_NO_PIC)
public static void handle (MapleClient c, LittleEndianAccessor lea) {
lea.readByte(); // 1?
lea.readByte(); // 1?
final int charid = lea.readInt();
/*if (view) {
c.setChannel(1);
c.setWorld(lea.readInt());
}*/
final String currentpw = c.getSecondPassword();
if (!c.isLoggedIn() || loginFailCount(c) || (currentpw != null && !currentpw.equals("")) || !c.login_Auth(charid) || ChannelServer.getInstance(c.getChannel()) == null || !WorldOption.isExists(c.getWorld())) {
c.getSession().close();
return;
}
//lea.skip(1); //prevents the ArrayIndexArrayOutOfBounds exception. Don't know what it is yet.
c.updateMacs(lea.readMapleAsciiString());
lea.readMapleAsciiString();
if (lea.available() != 0) {
final String setpassword = lea.readMapleAsciiString();
if (setpassword.length() >= 6 && setpassword.length() <= 16) {
c.setSecondPassword(setpassword);
c.updateSecondPassword();
} else {
c.getSession().write(LoginPacket.secondPwError((byte) 0x14));
return;
}
}
if (c.getIdleTask() != null) {
c.getIdleTask().cancel(true);
}
final String s = c.getSessionIPAddress();
LoginServer.putLoginAuth(charid, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
c.getSession().write(CField.getServerIP(c, Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]), charid));
}