Thread: [592] Receive Private Message Issue

Results 1 to 10 of 10
  1. #1 [592] Receive Private Message Issue 
    ♫ Musical Project ♫

    Natalie's Avatar
    Join Date
    Dec 2015
    Posts
    136
    Thanks given
    69
    Thanks received
    40
    Discord
    View profile
    Rep Power
    99
    Hello, I was wondering If I can have some help solving this issue I'm having with receiving messages from players.

    If the player has an admin icon, it works fine. But if you don't have any icons, it doesn't work at all.




    Edit:

    Here's the fix if anyone using 592 Matrix:

    Search this line in PacketDecoder Class:
    Code:
                         Class241.method1545((byte) 70, -1, string_163_, string_169_, null, 0, string, 3);
    Replace with:
    Code:
                            Class241.method1545((byte) 115, -1, string_163_, string_169_, null, 0, string, 7);

    Spoiler for Help Question:
    Here's the packet:

    Code:
    			if (Class161.INCOMING_PACKET == Class93.aClass13_1221) {
    				boolean bool = Class78.packetStream.readUnsignedByte(255) == 1;
    				String string = Class78.packetStream.readString((byte) -40);
    				String string_163_ = string;
    				if (bool)
    					string_163_ = Class78.packetStream.readString((byte) -40);
    				long l = (long) Class78.packetStream.readUnsignedShort((byte) 120);
    				long l_164_ = (long) Class78.packetStream.read24BitInteger((byte) 29);
    				int i_165_ = Class78.packetStream.readUnsignedByte(255);
    				long l_166_ = (l << 32) + l_164_;
    				boolean bool_167_ = false;
    				while_1_: do {
    					for (int i_168_ = 0; (i_168_ ^ 0xffffffff) > -101; i_168_++) {
    						if (l_166_ == Class246_Sub1_Sub16.aLongArray6694[i_168_]) {
    							bool_167_ = true;
    							break while_1_;
    						}
    					}
    					if (i_165_ <= 1) {
    						if (Class59.aBool820 && !Class_u.aBool4703 || Class168.aBool2395)
    							bool_167_ = true;
    						else if (Class129.method881(string_163_, false))
    							bool_167_ = true;
    					}
    				} while (false);
    				if (!bool_167_ && Class37.anInt551 == 0) {
    					Class246_Sub1_Sub16.aLongArray6694[Class230.anInt3160] = l_166_;
    					Class230.anInt3160 = (1 + Class230.anInt3160) % 100;
    					String string_169_ = (Class59_Sub3_Sub1.method2443(Class140.method940(false, Class78.packetStream), (byte) 111));
    					if (i_165_ == 2)
    						Class241.method1545((byte) 115, -1, "<img=1>" + string_163_, string_169_, null, 0, "<img=1>" + string, 7);
    					else if (i_165_ == 1)
    						Class241.method1545((byte) 82, -1, "<img=0>" + string_163_, string_169_, null, 0, "<img=0>" + string, 7);
    					else
    						Class241.method1545((byte) 70, -1, string_163_, string_169_, null, 0, string, 3);
    				}
    				Class161.INCOMING_PACKET = null;
    				return true;
    			}
    And heres the server packet:

    Code:
    	public void receivePrivateMessage(String name, String display, int rights, ChatMessage message) {
    		OutputStream stream = new OutputStream();
    		stream.writePacketVarByte(player, 46);
    		stream.writeByte(name.equals(display) ? 0 : 1);
    		stream.writeString(display);
    		if (!name.equals(display))
    			stream.writeString(name);
    		int hash = player.getFriendsIgnores().getNextIgnoredMessageCount();
    		int firstHashPart = hash >> 32;
    		stream.writeShort(firstHashPart);
    		stream.write24BitInteger(hash - (firstHashPart << 32));
    		stream.writeByte(rights);
    		Huffman.sendEncryptMessage(stream, message.getMessage(player.isFilteringProfanity()));
    		stream.endPacketVarByte();
    		player.write(stream);
    	}


    Thanks
    Reply With Quote  
     

  2. #2  
    Registered Member
    Akimbo Azure's Avatar
    Join Date
    May 2014
    Posts
    238
    Thanks given
    297
    Thanks received
    107
    Discord
    View profile
    Rep Power
    457
    Does it throw an error?
    Reply With Quote  
     

  3. #3  
    ♫ Musical Project ♫

    Natalie's Avatar
    Join Date
    Dec 2015
    Posts
    136
    Thanks given
    69
    Thanks received
    40
    Discord
    View profile
    Rep Power
    99
    Quote Originally Posted by Akimbo Azure View Post
    Does it throw an error?
    It's not, it's very odd case.

    Though here's another example picture.
    Reply With Quote  
     

  4. #4  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,734
    Thanks given
    699
    Thanks received
    688
    Discord
    View profile
    Rep Power
    512
    You should debug to see where it stops in the client. My guess is that this boolean is true;

    Code:
    bool_167_
    since 2 of the 3 conditions to set it true are locked behind a check that the rights are <= 1 (P-MOD / normal player):

    Code:
    if (i_165_ <= 1) {
    With that in mind, the problem would be here:

    Code:
    if (Class59.aBool820 && !Class_u.aBool4703 || Class168.aBool2395)
        bool_167_ = true;
    else if (Class129.method881(string_163_, false))
        bool_167_ = true;
    The 2nd if statement is for ignore list, so it should not matter (though you should still debug to make sure). The reason your message is ignored would be because of the 1st if statement. I'm not sure what these checks are hoewever.

    EDIT; After looking further, all 3 variables used in the 1st if statement are assigned during the startup packet sent after world/lobby login. This is what it looks like on 718 matrix:

    Code:
    public final void sendLoginDetails(Player player) {
    		OutputStream stream = new OutputStream();
    		stream.writePacketVarByte(null, 2);
    		stream.writeByte(player.getRights());
    		stream.writeByte(0);
    		stream.writeByte(0); // 3rd
    		stream.writeByte(0); // 4th
    		stream.writeByte(1);
    		stream.writeByte(0); // 6th
    		stream.writeShort(player.getIndex());
    		stream.writeByte(1);
    		stream.write24BitInteger(0);
    		stream.writeByte(1); //is member world
    		stream.writeString(player.getDisplayName());
    		stream.endPacketVarByte();
    		session.write(stream);
    	}
    In my client they would respectively correspond to the 3rd, 4th, and 6th bytes which should all be 0s. You can debug to see if the ones that you send at login are different.
    Project thread
    Reply With Quote  
     

  5. #5  
    ♫ Musical Project ♫

    Natalie's Avatar
    Join Date
    Dec 2015
    Posts
    136
    Thanks given
    69
    Thanks received
    40
    Discord
    View profile
    Rep Power
    99
    Quote Originally Posted by clem585 View Post
    You should debug to see where it stops in the client. My guess is that this boolean is true;

    Code:
    bool_167_
    since 2 of the 3 conditions to set it true are locked behind a check that the rights are <= 1 (P-MOD / normal player):

    Code:
    if (i_165_ <= 1) {
    With that in mind, the problem would be here:

    Code:
    if (Class59.aBool820 && !Class_u.aBool4703 || Class168.aBool2395)
        bool_167_ = true;
    else if (Class129.method881(string_163_, false))
        bool_167_ = true;
    The 2nd if statement is for ignore list, so it should not matter (though you should still debug to make sure). The reason your message is ignored would be because of the 1st if statement. I'm not sure what these checks are hoewever.
    I did remove the entire if checks in that, and it still occurred.
    Reply With Quote  
     

  6. #6  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Age
    29
    Posts
    2,580
    Thanks given
    193
    Thanks received
    779
    Discord
    View profile
    Rep Power
    1383
    anInt551 corresponds to if they are in tut island. pretty sure those 3 booleans clem is talking about are quickchat related.

    What do you have for player.getFriendsIgnores().getNextIgnoredMessageCo unt(). That is what you are sending as the hash but it just refers to the id in the chatbox to avoid dups. Stock matrix just sends random values for it.

    Id try replacing

    Code:
    		int hash = player.getFriendsIgnores().getNextIgnoredMessageCount();
    		int firstHashPart = hash >> 32;
    		stream.writeShort(firstHashPart);
    		stream.write24BitInteger(hash - (firstHashPart << 32));
    with

    Code:
    		for (int i = 0; i < 5; i++)
    			stream.writeByte(Utils.getRandom(255));
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  7. Thankful users:


  8. #7  
    🔥 Arigon - Redefining The Limits

    Ashpire's Avatar
    Join Date
    Mar 2012
    Age
    25
    Posts
    2,675
    Thanks given
    883
    Thanks received
    1,785
    Discord
    View profile
    Rep Power
    1720
    Quote Originally Posted by Advocatus View Post
    anInt551 corresponds to if they are in tut island. pretty sure those 3 booleans clem is talking about are quickchat related.

    What do you have for player.getFriendsIgnores().getNextIgnoredMessageCo unt(). That is what you are sending as the hash but it just refers to the id in the chatbox to avoid dups. Stock matrix just sends random values for it.

    Id try replacing

    Code:
    		int hash = player.getFriendsIgnores().getNextIgnoredMessageCount();
    		int firstHashPart = hash >> 32;
    		stream.writeShort(firstHashPart);
    		stream.write24BitInteger(hash - (firstHashPart << 32));
    with

    Code:
    		for (int i = 0; i < 5; i++)
    			stream.writeByte(Utils.getRandom(255));
    Most likely, that's how we handle ours as well

    Code:
        @Override
        protected boolean encode(PlayerSession player) {
            builder.writeByte(0);
            builder.writeString(username);
    
            for (int i = 0; i < 5; i++) {
                builder.writeByte(RandomUtils.random(255));
            }
    
            builder.writeByte(rank);
    
            String msg = StringUtils.fixMessage(message.getMessage());
            Huffman.sendEncryptMessage(builder, msg);
            return true;
        }


    Reply With Quote  
     

  9. #8  
    ♫ Musical Project ♫

    Natalie's Avatar
    Join Date
    Dec 2015
    Posts
    136
    Thanks given
    69
    Thanks received
    40
    Discord
    View profile
    Rep Power
    99
    Quote Originally Posted by Advocatus View Post
    anInt551 corresponds to if they are in tut island. pretty sure those 3 booleans clem is talking about are quickchat related.

    What do you have for player.getFriendsIgnores().getNextIgnoredMessageCo unt(). That is what you are sending as the hash but it just refers to the id in the chatbox to avoid dups. Stock matrix just sends random values for it.

    Id try replacing

    Code:
    		int hash = player.getFriendsIgnores().getNextIgnoredMessageCount();
    		int firstHashPart = hash >> 32;
    		stream.writeShort(firstHashPart);
    		stream.write24BitInteger(hash - (firstHashPart << 32));
    with

    Code:
    		for (int i = 0; i < 5; i++)
    			stream.writeByte(Utils.getRandom(255));
    I've tried that as well. Didn't work.
    Reply With Quote  
     

  10. #9  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Age
    29
    Posts
    2,580
    Thanks given
    193
    Thanks received
    779
    Discord
    View profile
    Rep Power
    1383
    Id personally recommend then adding some debugging to see if the message is even passed to method1545. If it makes it to that method then you know it is getting added to chat at least and there may be something further down the line. If it isnt, then you know the issue is higher up with the checks in the method.
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  11. Thankful users:


  12. #10  
    ♫ Musical Project ♫

    Natalie's Avatar
    Join Date
    Dec 2015
    Posts
    136
    Thanks given
    69
    Thanks received
    40
    Discord
    View profile
    Rep Power
    99
    Here's the fix if anyone using 592 Matrix:

    Search this line in PacketDecoder Class:
    Code:
                         Class241.method1545((byte) 70, -1, string_163_, string_169_, null, 0, string, 3);
    Replace with:
    Code:
                            Class241.method1545((byte) 115, -1, string_163_, string_169_, null, 0, string, 7);
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [HELP] [REP++] [PI] Private messaging issue
    By xx k03d xx in forum Help
    Replies: 6
    Last Post: 02-11-2013, 02:42 AM
  2. Receive Private Message
    By PrataKosong in forum Help
    Replies: 4
    Last Post: 02-05-2012, 07:46 PM
  3. 614 Not receiving private messages
    By zzzfishstick in forum Help
    Replies: 0
    Last Post: 01-15-2012, 12:22 AM
  4. Private Message issue?
    By dark4448 in forum Help
    Replies: 2
    Last Post: 10-30-2010, 08:38 PM
  5. Replies: 0
    Last Post: 07-31-2010, 08:46 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •