Thread: Weird PM logs

Results 1 to 5 of 5
  1. #1 Weird PM logs 
    Registered Member Slatum.'s Avatar
    Join Date
    Apr 2017
    Posts
    125
    Thanks given
    23
    Thanks received
    13
    Rep Power
    16
    So it has come to my attention that my server's PM logs are funky. I was wondering if anyone had an idea on what might be causing this, or if anyone has experienced something similar.

    Before:
    [22/08/2016]-[23:40:56 PM]: [0.0.0.0]: he will be on later today. check forum shoutbox.

    Now:
    [10/12/2016]-[12:30:56 PM]: [0.0.0.0]: 2h a t i s h i s a ))o u n t n a me
    [10/12/2016]-[12:43:47 PM]: [0.0.0.0]: s e
    [10/12/2016]-[12:49:48 PM]: [0.0.0.0]: t e l l h i m t o re n o
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by Slatum. View Post
    So it has come to my attention that my server's PM logs are funky. I was wondering if anyone had an idea on what might be causing this, or if anyone has experienced something similar.

    Before:
    [22/08/2016]-[23:40:56 PM]: [0.0.0.0]: he will be on later today. check forum shoutbox.

    Now:
    [10/12/2016]-[12:30:56 PM]: [0.0.0.0]: 2h a t i s h i s a ))o u n t n a me
    [10/12/2016]-[12:43:47 PM]: [0.0.0.0]: s e
    [10/12/2016]-[12:49:48 PM]: [0.0.0.0]: t e l l h i m t o re n o

    Post the decoding bit?
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member Slatum.'s Avatar
    Join Date
    Apr 2017
    Posts
    125
    Thanks given
    23
    Thanks received
    13
    Rep Power
    16
    Quote Originally Posted by _Patrick_ View Post
    Post the decoding bit?

    What do you mean by the decoding?

    Code:
    	case SEND_PM:
    			long sendMessageToFriendId = c.getInStream().readQWord();
    			byte pmchatText[] = new byte[100];
    			int pmchatTextSize = (byte) (packetSize - 8);
    			c.getInStream().readBytes(pmchatText, pmchatTextSize, 0);
    			c.getPA().writePMLog(Misc.textUnpack(pmchatText, packetSize - 8));
    			if (!c.InDung() && !c.inDungBossRoom()) {
    				for (int i : Config.DUNG_ARM) {
    					for (int j = 0; j < Server.playerHandler.players.length; j++) {
    						if (Server.playerHandler.players[j] != null) {
    							Client c2 = (Client) Server.playerHandler.players[j];
    							if (c.getItems().playerHasItem(i, 1)) {
    								
    								c.logout();
    								return;
    							}
    						}
    					}
    				}
    			}
    			if (Connection.isMuted(c))
    				break;
    			for (int i1 = 0; i1 < c.friends.length; i1++) {
    				if (c.friends[i1] == sendMessageToFriendId) {
    					boolean pmSent = false;
    
    					for (int i2 = 1; i2 < Config.MAX_PLAYERS; i2++) {
    						if (Server.playerHandler.players[i2] != null
    								&& Server.playerHandler.players[i2].isActive
    								&& Misc.playerNameToInt64(Server.playerHandler.players[i2].playerName) == sendMessageToFriendId) {
    							Client o = (Client) Server.playerHandler.players[i2];
    							if (o != null) {
    								if (Server.playerHandler.players[i2].privateChat == 0
    										|| (Server.playerHandler.players[i2].privateChat == 4 && o
    												.getPA()
    												.isInPM(Misc
    														.playerNameToInt64(c.playerName)))) {
    									o.getPA()
    											.sendPM(Misc
    													.playerNameToInt64(c.playerName),
    													c.playerRights, pmchatText,
    													pmchatTextSize);
    									pmSent = true;
    								}
    							}
    							break;
    						}
    					}
    					if (!pmSent) {
    						c.sendMessage("That player is currently offline.");
    						break;
    					}
    				}
    			}
    			break;
    Code:
    public static String textUnpack(byte packedData[], int size) {
    		int idx = 0, highNibble = -1;
    		for (int i = 0; i < size * 2; i++) {
    			int val = packedData[i / 2] >> (4 - 4 * (i % 2)) & 0xf;
    			if (highNibble == -1) {
    				if (val < 13)
    					decodeBuf[idx++] = xlateTable[val];
    				else
    					highNibble = val;
    			} else {
    				decodeBuf[idx++] = xlateTable[((highNibble << 4) + val) - 195];
    				highNibble = -1;
    			}
    		}
    
    		return new String(decodeBuf, 0, idx);
    	}
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by Slatum. View Post
    What do you mean by the decoding?

    Code:
    	case SEND_PM:
    			long sendMessageToFriendId = c.getInStream().readQWord();
    			byte pmchatText[] = new byte[100];
    			int pmchatTextSize = (byte) (packetSize - 8);
    			c.getInStream().readBytes(pmchatText, pmchatTextSize, 0);
    			c.getPA().writePMLog(Misc.textUnpack(pmchatText, packetSize - 8));
    			if (!c.InDung() && !c.inDungBossRoom()) {
    				for (int i : Config.DUNG_ARM) {
    					for (int j = 0; j < Server.playerHandler.players.length; j++) {
    						if (Server.playerHandler.players[j] != null) {
    							Client c2 = (Client) Server.playerHandler.players[j];
    							if (c.getItems().playerHasItem(i, 1)) {
    								
    								c.logout();
    								return;
    							}
    						}
    					}
    				}
    			}
    			if (Connection.isMuted(c))
    				break;
    			for (int i1 = 0; i1 < c.friends.length; i1++) {
    				if (c.friends[i1] == sendMessageToFriendId) {
    					boolean pmSent = false;
    
    					for (int i2 = 1; i2 < Config.MAX_PLAYERS; i2++) {
    						if (Server.playerHandler.players[i2] != null
    								&& Server.playerHandler.players[i2].isActive
    								&& Misc.playerNameToInt64(Server.playerHandler.players[i2].playerName) == sendMessageToFriendId) {
    							Client o = (Client) Server.playerHandler.players[i2];
    							if (o != null) {
    								if (Server.playerHandler.players[i2].privateChat == 0
    										|| (Server.playerHandler.players[i2].privateChat == 4 && o
    												.getPA()
    												.isInPM(Misc
    														.playerNameToInt64(c.playerName)))) {
    									o.getPA()
    											.sendPM(Misc
    													.playerNameToInt64(c.playerName),
    													c.playerRights, pmchatText,
    													pmchatTextSize);
    									pmSent = true;
    								}
    							}
    							break;
    						}
    					}
    					if (!pmSent) {
    						c.sendMessage("That player is currently offline.");
    						break;
    					}
    				}
    			}
    			break;
    Code:
    public static String textUnpack(byte packedData[], int size) {
    		int idx = 0, highNibble = -1;
    		for (int i = 0; i < size * 2; i++) {
    			int val = packedData[i / 2] >> (4 - 4 * (i % 2)) & 0xf;
    			if (highNibble == -1) {
    				if (val < 13)
    					decodeBuf[idx++] = xlateTable[val];
    				else
    					highNibble = val;
    			} else {
    				decodeBuf[idx++] = xlateTable[((highNibble << 4) + val) - 195];
    				highNibble = -1;
    			}
    		}
    
    		return new String(decodeBuf, 0, idx);
    	}
    I don't see any storing in here but debug this part:

    o.getPA().sendPM(Misc.playerNameToInt64(c.playerNa me), c.playerRights, pmchatText, pmchatTextSize);

    Below that add this:
    Code:
    System.out.printf("Username %s V rights %d V message %s V size %d%n", Misc.playerNameToInt64(c.playerName), c.playerRights, pmchatText, pmchatTextSize);
    See what it prints paste it here.
    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Did this happend after a client swap or just happend randomly?
    If it happend with a client swap, you will need to look into the chat configs.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    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. weird PM logs writing?
    By yunaaa in forum Help
    Replies: 8
    Last Post: 07-26-2013, 12:53 PM
  2. [DELTA] Pm Log Help
    By im slickk in forum Help
    Replies: 3
    Last Post: 06-10-2010, 03:30 AM
  3. Deltascape Trade and PM logs, help please!
    By IVI A X W 3 L L in forum Help
    Replies: 2
    Last Post: 07-10-2009, 10:17 AM
  4. Pm logs!!-- creds 80%me 20% nightleaf
    By spooka in forum Tutorials
    Replies: 39
    Last Post: 04-23-2009, 10:22 PM
  5. PM Logs and Filter!
    By AndyJay in forum Tutorials
    Replies: 5
    Last Post: 11-03-2008, 10:40 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •