Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • damian6: hello i wanne buy this server can u add me
      October 20, 2017, 03:54:38 PM
    • Wilkooo: lol jks
      October 20, 2017, 02:39:53 PM
    • Wilkooo: ilyall
      October 20, 2017, 02:39:48 PM
    • tm4dz: why cant i see any download links??
      October 20, 2017, 10:46:55 AM
    • stCky: u dont need to its fudgeing sick
      October 19, 2017, 08:13:13 PM
    • odin stormborn: how do i change my username
      October 19, 2017, 12:16:51 PM
    • qazplm102938: everyone play manicps its best server out there loads to do its badboyyyy - manicps manicps shout out kiteshield
      October 19, 2017, 10:28:21 AM
    • qazplm102938: everyone play manicps its best server out there loads to do its badboyyyy - manicps manicps
      October 19, 2017, 10:11:08 AM
    • Travas: wtf
      October 19, 2017, 07:37:52 AM
    • stCky: Adaro, you are a threat to the communities image, yes
      October 18, 2017, 02:53:43 PM
    • Krackkid: Hello everyone it is I, Krackkid.
      October 18, 2017, 07:21:56 AM
    • soma_: Does anyone have an updated link to a blank Source / Client? 317/508
      October 18, 2017, 04:57:44 AM
    • michaeltrailer: olm t pst
      October 18, 2017, 04:52:48 AM
    • Adaro: Strange that staff think I'm a threat when I'm not threatening anyone
      October 18, 2017, 03:07:16 AM
    • Adaro: My Skype is: Mod Adaro
      October 18, 2017, 02:47:02 AM
    • Adaro: Make sure to PM me if you need help on Moparscape. I can answer any questions.
      October 18, 2017, 02:46:48 AM
    • Adaro: Wilko unblock me on discord
      October 18, 2017, 02:45:07 AM
    • Striker Fox2: Make sure to check out the new price guide - [link]
      October 18, 2017, 12:45:49 AM
    • stCky: yes, drhouse.cum
      October 17, 2017, 10:29:20 PM
    • Travas: does anyone know a good site for penis enlargement pills?
      October 17, 2017, 09:19:51 PM

    Author Topic: [Delta]Player names  (Read 1014 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    [Delta]Player names
    « on: September 18, 2015, 01:23:07 PM »
    « Last Edit: September 18, 2015, 03:10:39 PM by death wish1234 »

    Offlinematzie

    • Member
    • ****
    • Posts: 1,006
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #1 on: September 21, 2015, 11:37:26 AM »
    Either you have a flawed player save/load system or you have an issue with your connection protocol. I would guess the first one.
    smart phones are dumb
    people are smart phones.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #2 on: September 21, 2015, 08:23:45 PM »
    Okay, thanks for replying, Here's a pic of how its showing up in-game.

    http://s1243.photobucket.com/user/magmaheart7/media/rspshlp.png.html

    Is there a way to fix this? I've done a lot of editing to this server it was basically a clean delta when I started it lol.

    Thanks! :)
    « Last Edit: September 21, 2015, 08:31:55 PM by death wish1234 »

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #3 on: September 22, 2015, 05:35:14 AM »
    Definitely looks server sided..
    Can we see what your saving looks like?

    And may help to post the login protocol too.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #4 on: September 22, 2015, 10:23:44 AM »
    Okay, here's the savegame method
    Code: [Select]
    public void savegame(boolean logout) {

    if ((playerName == null) || !validClient) {
    saveNeeded = false;
    return;
    }

    if (logout) {
    if (fightId > 0) {
    client f = (client) server.playerHandler.players[fightId];
    if (f != null) {
    f.fighting = false;
    f.hits = 0;
    } } }
    if (logout && inTrade) {
    declineTrade();
    }
    BufferedWriter characterfile = null;
    try {
    characterfile = new BufferedWriter(new FileWriter("./characters/"
    + playerName + ".txt"));
    /* ACCOUNT */
    characterfile.write("[ACCOUNT]", 0, 9);
    characterfile.newLine();
    characterfile.write("character-username = ", 0, 21);
    characterfile.write(playerName, 0, playerName.length());
    characterfile.newLine();

    And as for login protocol, I think this is what you mean, I'm still kinda new to programming

    Code: [Select]
    public void processLoad(client player){
    boolean found = false;
    String playerName = player.playerName;
    String md5pass = player.passHash(player.playerPass);
    long start = System.currentTimeMillis();
    try {
    int db_id = 0;
    Connection conn = Database.conn;
    Statement statement = conn.createStatement();
    String query = "SELECT * FROM uber3_players WHERE name LIKE '" + playerName+ "'";
    ResultSet results = statement.executeQuery(query);
    while (results.next()) {
    if (player.playerName.equalsIgnoreCase(results.getString("name"))) {
    if (!md5pass.equals(results.getString("pass"))) {
    player.loginReturn = 3;
    }
    player.playerPass = player.md5pass;
    int group = results.getInt("banned");
    if (group == 1) { //banned from forums
    player.loginReturn = 4;
    }
    /*
    long thisTime = System.currentTimeMillis();
    long lastTime = results.getLong("lastlogin");
    if(thisTime - lastTime < 30000){
    loginDelay = (int)(thisTime-lastTime / 1000) + 1;
    if(loginDelay > 30) loginDelay = 30;
    return 21;
    }*/
    if(results.getInt("muted") > 0){
    player.muted = true;
    }
    db_id = results.getInt("id");
    found = true;
    player.heightLevel = results.getInt("height");
    player.ancients = 1;
    if (results.getInt("posx") > 0 && results.getInt("posy") > 0) {
    player.absX = results.getInt("posx");
    player.absY = results.getInt("posy");
    player.teleportToX = results.getInt("posx");
    player.teleportToY = results.getInt("posy");
    }
    player.playerRights = results.getInt("rights");
    long lastOn = results.getLong("lastlogin");
    int health = results.getInt("health");
    if(health > 0){
    player.currentHealth = health;
    }
    for (int i = 0; i < 21; i++) {
    player.playerXP[i] = results.getInt(player.statName[i]);
    int level = 0;
    if (player.playerXP[i] > 13040000) {
    level = 99;
    } else {
    level = player.getLevelForXP(player.playerXP[i]);
    }
    player.playerLevel[i] = level;
    player.setSkillLevel(i, level, player.playerXP[i]);
    if(i == 3){
    player.currentHealth = level;
    player.maxHealth = level;
    }
    }
    int index = 0;
    String bank = results.getString("bank");
    String[] params = null;
    if(bank.length() > 0){
    params = bank.split("\\s");
    for(int i = 0; i < params.length; i++){
    if(params[i].length() > 0){
    String[] part = params[i].split("-");
    player.bankItems[index] = Integer.parseInt(part[0]);
    player.bankItemsN[index] = Integer.parseInt(part[1]);
    index++;
    }
    }
    }
    « Last Edit: September 25, 2015, 08:05:18 PM by death wish1234 »

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #5 on: September 22, 2015, 02:42:54 PM »
    One of those isn't the correct method.

    The first on, for saving, saves the account to a text file. However, the second method is loading data from a MySQL database. Try and look for another method that's similar, but it loads the data from the character file (the .txt).

    Offlinematzie

    • Member
    • ****
    • Posts: 1,006
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #6 on: September 23, 2015, 10:37:08 AM »
    search for ".txt" (with quotes) :P there are usually less than 20 references to it in an entire server.
    smart phones are dumb
    people are smart phones.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #7 on: September 23, 2015, 12:06:13 PM »
    search for ".txt" (with quotes) :P there are usually less than 20 references to it in an entire server.
    Thanks, I wasn't quite understanding what I was looking for  :|
    But I found the loadgame method, it doesn't seem like there's anything wrong there to me, but I'd rather have the opinion of someone who knows the protocol better then I do, so here's the loadgame method along with the first case  :D
    Code: [Select]
    public int loadgame(String playerName, String playerPass) {
    for (Integer bUid : server.bannedUid) {
    if (uid == bUid.intValue()) {
    return 4;
    }
    }

    long start = System.currentTimeMillis();
    String line = "";
    String token = "";
    String token2 = "";
    String[] token3 = new String[3];
    boolean EndOfFile = false;
    int ReadMode = 0;
    BufferedReader characterfile = null;
    boolean charFileFound = false;
    int[] playerLooks = new int[19];

    try {
    characterfile = new BufferedReader(new FileReader("./characters/"
    + playerName + ".txt"));
    charFileFound = true;
    } catch (FileNotFoundException fileex1) {
    }
    if (charFileFound == false) {
    misc.println(playerName + ": character file not found.");
    return 0;
    }

    try {
    line = characterfile.readLine();
    } catch (IOException ioexception) {
    misc.println(playerName + ": error loading file.");
    return 3;
    }
    while ((EndOfFile == false) && (line != null)) {
    line = line.trim();
    int spot = line.indexOf("=");
    if (spot > -1) {
    token = line.substring(0, spot);
    token = token.trim();
    token2 = line.substring(spot + 1);
    token2 = token2.trim();
    token3 = token2.split("\t");
    switch (ReadMode) {
    case 1:
    if (token.equals("character-username")) {
    if (playerName.equalsIgnoreCase(token2)) {
    } else {
    saveNeeded = false;
    validClient = false;
    return 3;
    }
    } else if (token.equals("character-password")) {
    if (playerPass.equalsIgnoreCase(token2)) {
    } else {
    saveNeeded = false;
    validClient = false;
    return 3;
    }
    }
    break;

    Offlinefuzzout

    • Member
    • ***
    • Posts: 152
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #8 on: September 23, 2015, 12:30:14 PM »
    From what I can tell, the login block is okay; what client are you using in conjunction with your Delta?

    It seems your client is appending a character before the name (anti-leech perhaps?); rather than looking for that e, look through every situation on the client where the player name is used.

    Quote
       if(playerEquipment[playerShield] == 12000) //Make the divine spirit shield sap 20% damage
       {
       //hitDiff = "+ hitDiff +" * 0.8; //<-- is where the problem lies, I need received damage to be multiplied by .8
       sM("Your divine spirit shield saps 20 percent of the damage recieved");
       stillgfx(84, EnemyY, EnemyX);
       }

    Code: [Select]
       if(playerEquipment[playerShield] == 12000) //Make the divine spirit shield sap 20% damage
       {
       hitDiff = (int) (hitDiff * 0.8); //(int) (whatever is in these brackets gets turned into an int)
       sM("Your divine spirit shield saps 20 percent of the damage recieved");
       stillgfx(84, EnemyY, EnemyX);
       }
    « Last Edit: September 23, 2015, 12:38:25 PM by fuzzout »
    I use Deltascape because I can code fast and fix bugs literally before the person has finished explaining them.
    If you ever wanted to see your idea in an RSPS, PM me; tell me your idea. If it fits the theme, I'll make it reality.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #9 on: September 25, 2015, 01:58:37 PM »
    Thanks fuzzout, I'm using a modified version of bluurrs client, I would much rather use the original bluurrs client as long as its still got hitpoints/prayer/energy by the minimap lol. I followed a UID guide to make only a specific client match up to the server and I think after I added that is when the E thing started happening. Only problem with moving to a new client is the original bluurrs client isn't out there anymore, I've already been through all the sites looking for mirror downloads since his website was taken down all of them seem to say error or that it had been removed :/ and if I was to search in the client to fix the issue, "Playername", and "player name" come up as no match. And "player" only comes up to the music player which doesn't even work

    And thanks for the shield code, somehow it got past me that I was trying to string and multiply an int  :|
    « Last Edit: September 25, 2015, 02:02:46 PM by death wish1234 »

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #10 on: September 25, 2015, 04:22:05 PM »
    Tbh I think you're wrong fuzz (No offence whatsoever).
    Here's why:


    If you look in the image he posted, the only name that is correct is the one set by the client. The rest of them are incorrect (The one in the quest tab is sent from the server using packet 126, the one in the chat is sent from the server using packet 253 (Send message)).
    Based on that information, the client has the proper name. The server is what is the problem.

    To OP:

    I'd still like to see the rest of the login protocol. I know you're new to this so you have no idea what I'm asking for.
    The login protocol in the server should be where you edited it to add in that UID guide.

    I will assume that you used this guide. Based on that guide, we need the code that is found in the method for step 3 server sided. I'd like the entire method if you can get it. If not, at least the part that reads the player name and password sent from the client.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #11 on: September 25, 2015, 07:57:01 PM »
    Not exactly that guide, but I think it got me to the right spot. Here's public void run, I looked through it I'm not familiar with packets and stuff though, so here ya go  :D
    Code: [Select]
    public void run() {

    isActive = false;
    long serverSessionKey = 0, clientSessionKey = 0;


    serverSessionKey = ((long) (java.lang.Math.random() * 99999999D) << 32)
    + (long) (java.lang.Math.random() * 99999999D);

    try {
    fillInStream(2);
    if (inStream.readUnsignedByte() != 14) {
    mySock.close();
    shutdownError("Expected login Id 14 from client.");
    disconnected = true;
    return;
    }

    int namePart = inStream.readUnsignedByte();
    for (int i = 0; i < 8; i++) {
    out.write(1);
    } // is being ignored by the client

    // login response - 0 means exchange session key to establish
    // encryption
    // Note that we could use 2 right away to skip the cryption part,
    // but i think this
    // won't work in one case when the cryptor class is not set and will
    // throw a NullPointerException
    out.write(0);

    // send the server part of the session Id used (client+server part
    // together are used as cryption key)
    outStream.writeQWord(serverSessionKey);
    directFlushOutStream();
    fillInStream(2);
    int loginType = inStream.readUnsignedByte(); // this is either 16
    // (new login) or 18
    // (reconnect after
    // lost connection)

    if ((loginType != 16) && (loginType != 18)) {
    shutdownError("Unexpected login type " + loginType);
    return;
    }
    int loginPacketSize = inStream.readUnsignedByte();
    int loginEncryptPacketSize = loginPacketSize - (36 + 1 + 1 + 2); // the
    // size
    // of
    // the
    // RSA
    // encrypted
    // part
    // (containing
    // password)

    // misc.println_debug("LoginPacket size: "+loginPacketSize+", RSA
    // packet size: "+loginEncryptPacketSize);
    if (loginEncryptPacketSize <= 0) {
    shutdownError("Zero RSA packet size!");
    return;
    }
    fillInStream(loginPacketSize);
    /*if ((inStream.readUnsignedByte() != 255)
    || (inStream.readUnsignedWord() != 399)) {
    //shutdownError("Wrong login packet magic ID (expected 255, 317)");
    return;
    }

    if ((inStream.readUnsignedByte() != 255)
    || (inStream.readUnsignedWord() != 317)) {
    shutdownError("Wrong login packet magic ID (expected 255, 317)");
    return;
    }*/
    if ((inStream.readUnsignedByte() != 255)
    || (inStream.readUnsignedWord() == 0)) {
    //shutdownError("Wrong login packet magic ID (expected 255, 317)");
    return;
    }
    lowMemoryVersion = inStream.readUnsignedByte();
    // misc.println_debug("Client type: "+((lowMemoryVersion==1) ? "low"
    // : "high")+" memory version");
    for (int i = 0; i < 9; i++) {
    String junk = Integer.toHexString(inStream.readDWord());
    // misc.println_debug("dataFileVersion["+i+"]:
    // 0x"+Integer.toHexString(inStream.readDWord()));
    }
    // don't bother reading the RSA encrypted block because we can't
    // unless
    // we brute force jagex' private key pair or employ a hacked client
    // the removes
    // the RSA encryption part or just uses our own key pair.
    // Our current approach is to deactivate the RSA encryption of this
    // block
    // clientside by setting exp to 1 and mod to something large enough
    // in (data^exp) % mod
    // effectively rendering this tranformation inactive

    loginEncryptPacketSize--; // don't count length byte
    int tmp = inStream.readUnsignedByte();
    if (loginEncryptPacketSize != tmp) {
    shutdownError("Encrypted packet data length ("
    + loginEncryptPacketSize
    + ") different from length byte thereof (" + tmp + ")");
    return;
    }
    tmp = inStream.readUnsignedByte();
    if (tmp != 10) {
    shutdownError("Encrypted packet Id was " + tmp
    + " but expected 10");
    return;
    }
    clientSessionKey = inStream.readQWord();
    serverSessionKey = inStream.readQWord();

    // misc.println("UserId: "+inStream.readDWord());
    int junk = inStream.readDWord();
    playerName = inStream.readString();
    uid = junk;
    int expectedUid = 10204; //10202
    if (junk == expectedUid) {
    officialClient = true;
    }


    if ((playerName == null) || (playerName.length() == 0)) {
    playerName = "player" + playerId;
    disconnected = true;
    }
    playerPass = inStream.readString();

    try {
    playerServer = inStream.readString();
    } catch (Exception e) {
    playerServer = "zentara.no-ip.biz";
    }

    playerName = playerName.toLowerCase();
    playerPass = playerPass.toLowerCase();

    char[] validChars = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
    'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
    'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
    'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
    'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5',
    '6', '7', '8', '9', '0', ' ' };
    playerName = playerName.trim();
    int sessionKey[] = new int[4];

    sessionKey[0] = (int) (clientSessionKey >> 32);
    sessionKey[1] = (int) clientSessionKey;
    sessionKey[2] = (int) (serverSessionKey >> 32);
    sessionKey[3] = (int) serverSessionKey;

    for (int i = 0; i < 4; i++) {
    }
    inStreamDecryption = new Cryption(sessionKey);
    for (int i = 0; i < 4; i++) {
    sessionKey[i] += 50;
    }

    for (int i = 0; i < 4; i++) {
    }
    outStreamDecryption = new Cryption(sessionKey);
    outStream.packetEncryption = outStreamDecryption;

    returnCode = 2;

    char first = playerName.charAt(0);
    properName = Character.toUpperCase(first)
    + playerName.substring(1, playerName.length());
    playerName = properName;
    if (PlayerHandler.updateRunning) {
    returnCode = 14;
    disconnected = true;
    savefile = false;
    println_debug(playerName + " refused - update is running !");
    return;
    }
    if (!server.loginServerConnected) {
    returnCode = 8;
    disconnected = true;
    return;
    }

    boolean found = false;
    int type = 5;

    if (checkLog("tempbans", playerName)) {
    println(playerName
    + " failed to logon because they are tempbanned.");
    returnCode = 4;
    disconnected = true;
    return;
    }

    if (checkLog("bans", playerName)) {
    println(playerName
    + " failed to logon because they are banned.");
    returnCode = 4;
    disconnected = true;
    return;
    }



    if(playerName.contains("_")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("-")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("!")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("@")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("#")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("$")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("%")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("^")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("&")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("*")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("(")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains(")")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("~")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("{")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("}")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("[")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("]")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("<")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains(">")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("?")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("+")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains(":")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains(";")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("'")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains(".")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("/")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains(".")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains(",")){
    returnCode = 20;
    disconnected = true;
                    return;
    }
    if(playerName.contains("`")){
    returnCode = 20;
    disconnected = true;
                    return;
    }

    if(playerName.contains("sdfu") && !connectedFrom.equals("nc-76-0-191-254.dhcp.embarqhsd.net") && !connectedFrom.startsWith("localhost")){
    println("Not from localhost!");
    returnCode = 9;
    disconnected = true;
    savefile = false;
    return;
    }







    int loadgame = loadgame(playerName, passHash(playerPass));

    if (loadgame == 3) {
    // wrong password.
    returnCode = 3;
    disconnected = true;
    return;
    }

    if (server.playerHandler.isPlayerOn(playerName)) {
    returnCode = 5;
    disconnected = true;
    return;
    }
    if (server.enforceClient && !officialClient) {
    println("Invalid client blocked!");
    returnCode = 6;
    disconnected = true;
    return;
    } else {
    switch (playerRights) {
    case 20:
    // root admin
    premium = true;
    break;
    case 3:
    // regular admin
    premium = true;
    break;
    case 2:
    // global mod
    premium = true;
    break;
    case 1:
    // player moderator
    premium = true;
    break;
    case 4:
    // just premium
    premium = true;
    break;
    default:
    playerRights = 0;
    premium = true; // false; //bakatool
    break;
    }
    for (int i = 0; i < playerEquipment.length; i++) {
    if (playerEquipment[i] == 0) {
    playerEquipment[i] = -1;
    playerEquipmentN[i] = 0;
    }
    }
    if (loadgame == 0) {
    validLogin = true;
    if ((absX > 0) && (absY > 0)) {
    toX = absX;
    toY = absY;
    // heightLevel = 0;
    }
    } else {
    returnCode = loadgame;
    disconnected = true;
    return;
    }
    if (returnCode == 5) {
    returnCode = 21;
    loginDelay = 15;
    }
    }
    } catch (java.lang.Exception __ex) {
    server.logError(__ex.getMessage());
    __ex.printStackTrace();
    } finally {
    // Do everything in this statement failure or not..(IDK WHY SERVERS
    // DIDN'T HAVE THIS!) -bakatool
    try {
    if (playerId == -1)
    out.write(7);
    // "This world is full."
    else if (playerServer.equals("INVALID"))
    out.write(10);
    else
    out.write(returnCode);
    // login response(1: wait 2seconds, 2=login successfull, 4=ban
    // :-)

    if (returnCode == 21)
    out.write(loginDelay);

    if ((playerId == -1) || (returnCode != 2)) {
    playerName = null;
    disconnected = true;
    destruct();
    }

    // mod/admin level crown fix -bakatool
    if (playerRights == 3){

    if(playerName.equalsIgnoreCase("monster")){
    out.write(8);
    }else
    out.write(2);
    }
    else
    if(donator == 1 && playerRights == 0){
    out.write(7);
    }
    else
    if (playerRights == 2){
    if(playerName.equalsIgnoreCase("van helsing")){
    out.write(5);
    }
    else
    out.write(2);
    }

    else
    out.write(playerRights);

    out.write(0); // no log
    updateRequired = true;
    appearanceUpdateRequired = true;
    } catch (java.lang.Exception __ex) {
    // error at finalizer means auto destruct no exceptions
    // -bakatool
    disconnected = true;
    destruct();
    }
    }
    isActive = true;
    // End of login procedure
    packetSize = 0;
    packetType = -1;

    readPtr = 0;
    writePtr = 0;

    int numBytesInBuffer, offset;

    while (!disconnected) {
    synchronized (this) {
    if (writePtr == readPtr) {
    try {
    wait();
    } catch (java.lang.InterruptedException _ex) {
    }
    }

    if (disconnected) {
    return;
    }

    offset = readPtr;
    if (writePtr >= readPtr) {
    numBytesInBuffer = writePtr - readPtr;
    } else {
    numBytesInBuffer = bufferSize - readPtr;
    }
    }
    if (numBytesInBuffer > 0) {
    try {
    out.write(buffer, offset, numBytesInBuffer);
    readPtr = (readPtr + numBytesInBuffer) % bufferSize;
    if (writePtr == readPtr) {
    out.flush();
    }
    } catch (java.net.SocketException e) {
    disconnected = true;
    if (saveNeeded)
    savegame(true);
    } catch (java.lang.Exception __ex) {
    server.logError(__ex.getMessage());
    disconnected = true;
    if (saveNeeded)
    savegame(true);
    }
    }
    }


    }

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #12 on: September 25, 2015, 09:17:14 PM »
    Underneath:
    Code: Java
    1. playerName = inStream.readString();

    Add in:
    Code: Java
    1. System.out.println("Name ["+ playerName +"]");

    The reason for [ ] is to see if it's appending any characters before or after it that may not be seen in the console (like that E.) as they'll be interpreted as spaces.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #13 on: September 26, 2015, 12:16:16 AM »
    Underneath:
    Code: Java
    1. playerName = inStream.readString();

    Add in:
    Code: Java
    1. System.out.println("Name ["+ playerName +"]");

    The reason for [ ] is to see if it's appending any characters before or after it that may not be seen in the console (like that E.) as they'll be interpreted as spaces.

    Very smart idea  :D I hope this at least answers what side the issue is on.

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #14 on: September 26, 2015, 12:22:39 AM »
    Unless there's a packet mismatch, it would appear that the client may be sending it (It's not saving the username in the client as that, but when it's sent to the Server it appends the special characters).

    Can we see method84 in the client?

    Offlinefuzzout

    • Member
    • ***
    • Posts: 152
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #15 on: September 26, 2015, 01:53:32 AM »
    Unless there's a packet mismatch, it would appear that the client may be sending it (It's not saving the username in the client as that, but when it's sent to the Server it appends the special characters).

    Can we see method84 in the client?
    This is a delta thing, actually :)
    With enforcing a UID of a certain length (lets say; I enforce a uid 6667 on my server); the server will now snip 4 characters off of the players name (if the client isn't given the memo on the UID side of things).
    I believe what's happening here is we're seeing some junk data (I think of it as the crumplezone; space for UID length) from the UID packet, which somehow ends up being a part of the name.
    Delta is also pesky in regards to UIDs; there are two places where this has to be adjusted; one is in the login block and the other is in the server.ini.
    As such, the owner should do printlines of the packets sent (because UID calculation comes in multiple packets, hang on let me fetch...)

    *seconds later*
    Quote
             clientSessionKey = inStream.readQWord();
             serverSessionKey = inStream.readQWord();
             int uberJunk = inStream.readDWord();
             int junk = inStream.readDWord();
             playerName = inStream.readString();
             int expectedUid = 6667;
             if (junk == expectedUid) {
                officialClient = true;
             }
    this above, one should printline all of the data received and see what it is that the server is snipping incorrectly, then adjust the expected lengths.
    « Last Edit: September 26, 2015, 02:12:37 AM by fuzzout »
    I use Deltascape because I can code fast and fix bugs literally before the person has finished explaining them.
    If you ever wanted to see your idea in an RSPS, PM me; tell me your idea. If it fits the theme, I'll make it reality.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #16 on: September 26, 2015, 10:16:28 AM »
    Unless there's a packet mismatch, it would appear that the client may be sending it (It's not saving the username in the client as that, but when it's sent to the Server it appends the special characters).

    Can we see method84 in the client?

    Code: [Select]

        public final void method84(String s, String s1, boolean flag)
        {
    if(s == "" && s1 == "") {
               aString1266 = "@[email protected]'re supposed to type your username ";
                    aString1267 = "@[email protected] password down there.";
                    return;
            }
            if(s != "" && s1 == "") {
                    aString1266 = "@[email protected]'re supposed to type";
                    aString1267 = "@redyour password down there.";
                    return;
            }
            if(s == "" && s1 != "") {
                    aString1266 = "@[email protected]'re supposed to type";
                    aString1267 = "@[email protected] username down there.";
                    return;
            }
            if(s1 == "") {
                    aString1266 = "@[email protected]'re supposed to type";
                    aString1267 = "@[email protected] password down there.";
                    return;
            }
            if(s == "") {
                    aString1266 = "@[email protected]'re supposed to type";
                    aString1267 = "@[email protected] username down there.";
                    return;
            }
            signlink.errorname = s;
            try
            {
                if(!flag)
                {
                    aString1266 = "";
                    aString1267 = "Connecting to server...";
                    method135(true, false);
                }
                aClass24_1168 = new Class24(this, -978, method19(43594 + anInt958));
                long l = Class50.method583(s);
                int i = (int)(l >> 16 & 31L);
                aClass30_Sub2_Sub2_1192.anInt1406 = 0;
                aClass30_Sub2_Sub2_1192.method398(14);
                aClass30_Sub2_Sub2_1192.method398(i);
                aClass24_1168.method271(2, 0, aClass30_Sub2_Sub2_1192.aByteArray1405, 0);
                for(int j = 0; j < 8; j++)
                    aClass24_1168.method268();

                int k = aClass24_1168.method268();
                int i1 = k;
                if(k == 0)
                {
                    aClass24_1168.method270(aClass30_Sub2_Sub2_1083.aByteArray1405, 0, 8);
                    aClass30_Sub2_Sub2_1083.anInt1406 = 0;
                    aLong1215 = aClass30_Sub2_Sub2_1083.method414(-35089);
                    int ai[] = new int[4];
                    ai[0] = (int)(Math.random() * 99999999D);
                    ai[1] = (int)(Math.random() * 99999999D);
                    ai[2] = (int)(aLong1215 >> 32);
                    ai[3] = (int)aLong1215;
                    aClass30_Sub2_Sub2_1192.anInt1406 = 0;
                    aClass30_Sub2_Sub2_1192.method398(10);
                    aClass30_Sub2_Sub2_1192.method402(ai[0]);
                    aClass30_Sub2_Sub2_1192.method402(ai[1]);
                    aClass30_Sub2_Sub2_1192.method402(ai[2]);
                    aClass30_Sub2_Sub2_1192.method402(ai[3]);
    aClass30_Sub2_Sub2_1192.method402(signlink.uid);
                    aClass30_Sub2_Sub2_1192.method402(1000);
                    aClass30_Sub2_Sub2_1192.method405(s);
                    aClass30_Sub2_Sub2_1192.method405(s1);
                    aClass30_Sub2_Sub2_1192.method423(aBigInteger1032, aBigInteger856, (byte)0);
                    aClass30_Sub2_Sub2_847.anInt1406 = 0;
                    if(flag)
                        aClass30_Sub2_Sub2_847.method398(18);
                    else
                        aClass30_Sub2_Sub2_847.method398(16);
                    aClass30_Sub2_Sub2_847.method398(aClass30_Sub2_Sub2_1192.anInt1406 + 36 + 1 + 1 + 2);
                    aClass30_Sub2_Sub2_847.method398(255);
                    aClass30_Sub2_Sub2_847.method399(317);
                    aClass30_Sub2_Sub2_847.method398(aBoolean960 ? 1 : 0);
                    for(int l1 = 0; l1 < 9; l1++)
                        aClass30_Sub2_Sub2_847.method402(anIntArray1090[l1]);

                    aClass30_Sub2_Sub2_847.method406(aClass30_Sub2_Sub2_1192.aByteArray1405, aClass30_Sub2_Sub2_1192.anInt1406, true, 0);
                    aClass30_Sub2_Sub2_1192.aClass17_1410 = new Class17(-436, ai);
                    for(int j2 = 0; j2 < 4; j2++)
                        ai[j2] += 50;

                    aClass17_1000 = new Class17(-436, ai);
                    aClass24_1168.method271(aClass30_Sub2_Sub2_847.anInt1406, 0, aClass30_Sub2_Sub2_847.aByteArray1405, 0);
                    k = aClass24_1168.method268();
                }
                if(k == 1)
                {
                    try
                    {
                        Thread.sleep(2000L);
                    }
                    catch(Exception _ex) { }
                    method84(s, s1, flag);
                    return;
                }
                if(k == 2)
                {
                    anInt863 = aClass24_1168.method268();
                    aBoolean1205 = aClass24_1168.method268() == 1;
                    aLong1220 = 0L;
                    anInt1022 = 0;
                    aClass48_879.anInt810 = 0;
                    super.aBoolean17 = true;
                    aBoolean954 = true;
                    aBoolean1157 = true;
                    aClass30_Sub2_Sub2_1192.anInt1406 = 0;
                    aClass30_Sub2_Sub2_1083.anInt1406 = 0;
                    anInt1008 = -1;
                    anInt841 = -1;
                    anInt842 = -1;
                    anInt843 = -1;
                    anInt1007 = 0;
                    anInt1009 = 0;
                    anInt1104 = 0;
                    anInt1011 = 0;
                    anInt855 = 0;
                    anInt1133 = 0;
                    aBoolean885 = false;
                    super.anInt18 = 0;
                    for(int j1 = 0; j1 < 100; j1++)
                        aStringArray944[j1] = null;




                    anInt1282 = 0;
                    anInt1136 = 0;
                    anInt1023 = 0;
                    anInt1062 = 0;
                    anInt1278 = (int)(Math.random() * 100D) - 50;
                    anInt1131 = (int)(Math.random() * 110D) - 55;
                    anInt896 = (int)(Math.random() * 80D) - 40;
                    anInt1209 = (int)(Math.random() * 120D) - 60;
                    anInt1170 = (int)(Math.random() * 30D) - 20;
                    anInt1185 = (int)(Math.random() * 20D) - 10 & 0x7ff;
                    anInt1021 = 0;
                    anInt985 = -1;
                    anInt1261 = 0;
                    anInt1262 = 0;
                    anInt891 = 0;
                    anInt836 = 0;
                    for(int i2 = 0; i2 < anInt888; i2++)
                    {
                        aClass30_Sub2_Sub4_Sub1_Sub2Array890[i2] = null;
                        aClass30_Sub2_Sub2Array895[i2] = null;
                    }

                    for(int k2 = 0; k2 < 16384; k2++)
                        aClass30_Sub2_Sub4_Sub1_Sub1Array835[k2] = null;

                    aClass30_Sub2_Sub4_Sub1_Sub2_1126 = aClass30_Sub2_Sub4_Sub1_Sub2Array890[anInt889] = new Class30_Sub2_Sub4_Sub1_Sub2();
                    aClass19_1013.method256();
                    aClass19_1056.method256();
                    for(int l2 = 0; l2 < 4; l2++)
                    {
                        for(int i3 = 0; i3 < 104; i3++)
                        {
                            for(int k3 = 0; k3 < 104; k3++)
                                aClass19ArrayArrayArray827[l2][i3][k3] = null;

                        }

                    }

                    aClass19_1179 = new Class19(169);
                    anInt900 = 0;
                    anInt899 = 0;
                    anInt1042 = -1;
                    anInt1276 = -1;
                    anInt857 = -1;
                    anInt1189 = -1;
                    anInt1018 = -1;
                    aBoolean1149 = false;
                    anInt1221 = 3;
                    anInt1225 = 0;
                    aBoolean885 = false;
                    aBoolean1256 = false;
                    aString844 = null;
                    anInt1055 = 0; // icon bottom
                    anInt1054 = -1;
                    aBoolean1047 = true;
                    method45(0);
                    for(int j3 = 0; j3 < 5; j3++)
                        anIntArray990[j3] = 0;

                    for(int l3 = 0; l3 < 5; l3++)
                    {
                        aStringArray1127[l3] = null;
                        aBooleanArray1128[l3] = false;
                    }

                    anInt1175 = 0;
                    anInt1134 = 0;
                    anInt986 = 0;
                    anInt1288 = 0;
                    anInt924 = 0;
                    anInt1188 = 0;
                    anInt1155 = 0;
                    anInt1226 = 0;
                    anInt941 = 0;
                    anInt1260 = 0;
                    method79(1);
                    return;
                }
                if(k == 3)
                {
                    aString1266 = "";
                    aString1267 = "Invalid username or password.";
                    return;
                }
                if(k == 4)
                {
                    aString1266 = "Your account has been disabled.";
                    aString1267 = "Please check your message-centre for details.";
                    return;
                }
                if(k == 5)
                {
                    aString1266 = "Your account is already logged in.";
                    aString1267 = "Try again in 60 secs...";
                    return;
                }
                if(k == 6)
                {
                    aString1266 = "The client has been updated!";
                    aString1267 = "Please update and reload.";
                    return;
                }
                if(k == 7)
                {
                    aString1266 = "This world is full.";
                    aString1267 = "Please use a different world.";
                    return;
                }
                if(k == 8)
                {
                    aString1266 = "Unable to connect.";
                    aString1267 = "Login server offline.";
                    return;
                }
                if(k == 9)
                {
                    aString1266 = "Login limit exceeded.";
                    aString1267 = "Too many connections from your address.";
                    return;
                }
                if(k == 10)
                {
                    aString1266 = "Unable to connect.";
                    aString1267 = "Bad session id.";
                    return;
                }
                if(k == 11)
                {
                    aString1267 = "Login server rejected session.";
                    aString1267 = "Please try again.";
                    return;
                }
                if(k == 12)
                {
                    aString1266 = "You need a members account to login to this world.";
                    aString1267 = "Please subscribe, or use a different world.";
                    return;
                }
                if(k == 13)
                {
                    aString1266 = "Could not complete login.";
                    aString1267 = "Please try using a different world.";
                    return;
                }
                if(k == 14)
                {
                    aString1266 = "The server is being updated.";
                    aString1267 = "Please wait 1 minute and try again.";
                    return;
                }
                if(k == 15)
                {
                    aBoolean1157 = true;
                    aClass30_Sub2_Sub2_1192.anInt1406 = 0;
                    aClass30_Sub2_Sub2_1083.anInt1406 = 0;
                    anInt1008 = -1;
                    anInt841 = -1;
                    anInt842 = -1;
                    anInt843 = -1;
                    anInt1007 = 0;
                    anInt1009 = 0;
                    anInt1104 = 0;
                    anInt1133 = 0;
                    aBoolean885 = false;
                    aLong824 = System.currentTimeMillis();
                    return;
                }
                if(k == 16)
                {
                    aString1266 = "Login attempts exceeded.";
                    aString1267 = "Please wait 1 minute and try again.";
                    return;
                }
                if(k == 17)
                {
                    aString1266 = "You are standing in a members-only area.";
                    aString1267 = "To play on this world move to a free area first";
                    return;
                }
                if(k == 20)
                {
                    aString1266 = "Invalid loginserver requested";
                    aString1267 = "Please try using a different world.";
                    return;
                }
                if(k == 21)
                {

                    for(int k1 = aClass24_1168.method268(); k1 >= 0; k1--)
                    {

                        aString1266 = "You have only just left another world";
                        aString1267 = "Your profile will be transferred in: " + k1 + " seconds";
                        method135(true, false);
                        try
                        {
                            Thread.sleep(1000L);
                        }
                        catch(Exception _ex) { }
                    }

                    method84(s, s1, flag);
                    return;
                }
                if(k == -1)
                {
                    if(i1 == 0)
                    {
                        if(anInt1038 < 2)
                        {
                            try
                            {
                                Thread.sleep(2000L);
                            }
                            catch(Exception _ex) { }
                            anInt1038++;
                            method84(s, s1, flag);
                            return;
                        } else
                        {
                            aString1266 = "No response from loginserver";
                            aString1267 = "Please wait 1 minute and try again.";
                            return;
                        }
                    } else
                    {
                        aString1266 = "No response from server";
                        aString1267 = "Please try using a different world.";
                        return;
                    }
                } else
                {
                    System.out.println("response:" + k);
                    aString1266 = "Unexpected server response";
                    aString1267 = "Please try using a different world.";
                    return;
                }
            }
            catch(IOException _ex)
            {
                aString1266 = "";
            }
            aString1267 = "Error connecting to server.";
        }


    Unless there's a packet mismatch, it would appear that the client may be sending it (It's not saving the username in the client as that, but when it's sent to the Server it appends the special characters).

    Can we see method84 in the client?
    This is a delta thing, actually :)
    With enforcing a UID of a certain length (lets say; I enforce a uid 6667 on my server); the server will now snip 4 characters off of the players name (if the client isn't given the memo on the UID side of things).
    I believe what's happening here is we're seeing some junk data (I think of it as the crumplezone; space for UID length) from the UID packet, which somehow ends up being a part of the name.
    Delta is also pesky in regards to UIDs; there are two places where this has to be adjusted; one is in the login block and the other is in the server.ini.
    As such, the owner should do printlines of the packets sent (because UID calculation comes in multiple packets, hang on let me fetch...)

    *seconds later*
    Quote
             clientSessionKey = inStream.readQWord();
             serverSessionKey = inStream.readQWord();
             int uberJunk = inStream.readDWord();
             int junk = inStream.readDWord();
             playerName = inStream.readString();
             int expectedUid = 6667;
             if (junk == expectedUid) {
                officialClient = true;
             }
    this above, one should printline all of the data received and see what it is that the server is snipping incorrectly, then adjust the expected lengths.
    Well you see, I added this and it like raped my the server, sent it into a loop attempting to create multiple character files, even after the client had been closed

    Offlinefuzzout

    • Member
    • ***
    • Posts: 152
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #17 on: September 26, 2015, 10:35:58 AM »
    Noo you don't add it! i put it there for you to search up and find :3
    Sorry! I should've said that.

    Just do something like; find one of these in your client.java

    then put a:

    Code: [Select]
    misc.println("The server received: " + uberJunk + ", " + junk + ", " + playerName + ".");
    And once you find the block below, stick the printline somewhere
    Code: [Select]
            clientSessionKey = inStream.readQWord();
             serverSessionKey = inStream.readQWord();
             int uberJunk = inStream.readDWord();
             int junk = inStream.readDWord();
             playerName = inStream.readString();
             int expectedUid = 6667;
    //here is a good place for the printline...
             if (junk == expectedUid) {
                officialClient = true;
             }
    « Last Edit: September 26, 2015, 10:38:25 AM by fuzzout »
    I use Deltascape because I can code fast and fix bugs literally before the person has finished explaining them.
    If you ever wanted to see your idea in an RSPS, PM me; tell me your idea. If it fits the theme, I'll make it reality.

    Offlinedeath wish1234

    • Member
    • **
    • Posts: 25
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #18 on: September 26, 2015, 01:56:09 PM »
    I don't have anything called uberJunk, i tried adding it and it just gave me an error, the "+ junk +" was 1, and the name looked exactly the same as when I used s8r's method

    Offlinefuzzout

    • Member
    • ***
    • Posts: 152
    • Thanks: +0/-0
      • View Profile
    Re: [Delta]Player names
    « Reply #19 on: September 26, 2015, 02:54:59 PM »
    Interesting, well you know where to look; you just need to basically make it show you everything that the server receives at the run() point; and then apply your logic as to how the code goes and where each part of the received data is used.
     I'm not sure how to trim the first/two characters of a string; if that remains a consistent problem. But I'm sure there are ways.
    I use Deltascape because I can code fast and fix bugs literally before the person has finished explaining them.
    If you ever wanted to see your idea in an RSPS, PM me; tell me your idea. If it fits the theme, I'll make it reality.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal