Thread: public chat not working

Results 1 to 8 of 8
  1. #1 public chat not working 
    Registered Member haydar25's Avatar
    Join Date
    Jul 2011
    Posts
    325
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    in my public chat when someone types it comes above his head but not in the chatbox
    New server soon; Hybrid-Realm 614
    Reply With Quote  
     

  2. #2  
    Registered Member haydar25's Avatar
    Join Date
    Jul 2011
    Posts
    325
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    okay from my experience i've seen that only when donators talk you can see it in the chatbox
    New server soon; Hybrid-Realm 614
    Reply With Quote  
     

  3. #3  
    Registered Member haydar25's Avatar
    Join Date
    Jul 2011
    Posts
    325
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    someone help me
    New server soon; Hybrid-Realm 614
    Reply With Quote  
     

  4. #4  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    I've encountered something like this before.
    Take a look at:
    Packet 253(clientsided)
    the pushMessage method
    the drawChatArea method

    I expect a problem with playerrights.
    Probably something along the lines of:
    Code:
    if(playerRights == donor)
    if(playerRights == admin){
       //...
    } else ...
    Reply With Quote  
     

  5. #5  
    Registered Member haydar25's Avatar
    Join Date
    Jul 2011
    Posts
    325
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    my pushmessage method:
    Code:
    	public void pushMessage(String s, int i, String s1) {
    		if(i == 0 && dialogID != -1) {
    			aString844 = s;
    			super.clickMode3 = 0;
    		}
    		if(backDialogID == -1)
    			inputTaken = true;
    		for(int j = 499; j > 0; j--) {
    			chatTypes[j] = chatTypes[j - 1];
    			chatNames[j] = chatNames[j - 1];
    			chatMessages[j] = chatMessages[j - 1];
    			chatRights[j] = chatRights[j - 1];
    		}
    		chatTypes[0] = i;
    		chatNames[0] = s1;
    		chatMessages[0] = s;
    		chatRights[0] = rights;
    	}
    my drawchatarea method:
    Code:
    private void drawChatArea() {
    		aRSImageProducer_1166.initDrawingArea();
    		Texture.anIntArray1472 = anIntArray1180;
    		chatArea.drawSprite(0, 0);
    		drawChannelButtons();
    		TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
    		if(messagePromptRaised) {
    			chatTextDrawingArea.drawText(0, aString1121, 60, 259);
    			chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
    		} else if(inputDialogState == 1) {
    			chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
    			chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
    		} else if(inputDialogState == 2) {
    			chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
    			chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
    		} else if(aString844 != null) {
    			chatTextDrawingArea.drawText(0, aString844, 60, 259);
    			chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
    		} else if(backDialogID != -1) {
    			drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
    		} else if(dialogID != -1) {
    			drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
    		} else {
    			int j77 = -3;
    			int j = 0;
    			DrawingArea.setDrawingArea(122, 8, 497, 7);
    			for(int k = 0; k < 500; k++)
    			if(chatMessages[k] != null) {
    				int chatType = chatTypes[k];
    				int yPos = (70 - j77 * 14) + anInt1089 + 5;
    				String s1 = chatNames[k];
    				byte byte0 = 0;
    				if(s1 != null && s1.startsWith("@cr1@")) {
    					s1 = s1.substring(5);
    					byte0 = 1;
    				} else if(s1 != null && s1.startsWith("@cr2@")) {
    					s1 = s1.substring(5);
    					byte0 = 2;
    				} else if(s1 != null && s1.startsWith("@cr3@")) {
    					s1 = s1.substring(5);
    					byte0 = 3;
    				} else if(s1 != null && s1.startsWith("@cr4@")) {
    					s1 = s1.substring(5);
    					byte0 = 4;
    				}
    				if(chatType == 0) {
    					if (chatTypeView == 5 || chatTypeView == 0) {
    					if(yPos > 0 && yPos < 210)
    						textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
    					j++;
    					j77++;
    					}
    				}
    				if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
    					if (chatTypeView == 1 || chatTypeView == 0) {
    						if(yPos > 0 && yPos < 210) {
    							int xPos = 11;
    							if(byte0 == 1) {
    								modIcons[0].drawBackground(xPos + 1, yPos - 12);
    								xPos += 14;
    							} else if(byte0 == 2) {
    								modIcons[1].drawBackground(xPos + 1, yPos - 12);
    								xPos += 14;
    							} else if(byte0 == 3) {
    								donorIcon2.drawSprite(xPos + 1, yPos - 12);
    								xPos += 14;
    							} else if(byte0 == 4) {
    								donorIcon.drawSprite(xPos + 1, yPos - 12);
    								xPos += 14;
    							}
    							textDrawingArea.method385(0, s1 + ":", yPos, xPos);
    							xPos += textDrawingArea.getTextWidth(s1) + 8;
    							textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
    						}
    						j++;
    						j77++;
    					}
    				}
    				if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
    					if (chatTypeView == 2 || chatTypeView == 0) {
    						if(yPos > 0 && yPos < 210) {
    							int k1 = 11;
    							textDrawingArea.method385(0, "From", yPos, k1);
    							k1 += textDrawingArea.getTextWidth("From ");
    							if(byte0 == 1) {
    								modIcons[0].drawBackground(k1, yPos - 12);
    								k1 += 12;
    							} else if(byte0 == 2) {
    								modIcons[1].drawBackground(k1, yPos - 12);
    								k1 += 12;
    							} else if(byte0 == 3) {
    								donorIcon2.drawSprite(k1, yPos - 12);
    								k1 += 12;
    							} else if(byte0 == 4) {
    								donorIcon.drawSprite(k1, yPos - 12);
    								k1 += 12;
    							}
    							textDrawingArea.method385(0, s1 + ":", yPos, k1);
    							k1 += textDrawingArea.getTextWidth(s1) + 8;
    							textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
    						}
    						j++;
    						j77++;
    					}
    				}
    				if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
    					if (chatTypeView == 3 || chatTypeView == 0) {
    						if(yPos > 0 && yPos < 210)
    							textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
    						j++;
    						j77++;
    					}
    				}
    				if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
    					if (chatTypeView == 2 || chatTypeView == 0) {
    						if(yPos > 0 && yPos < 210)
    							textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
    						j++;
    						j77++;
    					}
    				}
    				if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
    					if (chatTypeView == 2 || chatTypeView == 0) {
    						if(yPos > 0 && yPos < 210) {
    							textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
    							textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
    						}
    					j++;
    					j77++;
    					}
    				}
    				if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
    					if (chatTypeView == 3 || chatTypeView == 0) {
    						if(yPos > 0 && yPos < 210)
    							textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
    						j++;
    						j77++;
    					}
    					if(chatType == 11 && (clanChatMode == 0)) {
    						if (chatTypeView == 11) {
    						if(yPos > 0 && yPos < 210)
    							textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
    						j++;
    						j77++;
    					}
    					if(chatType == 12) {
    						if(yPos > 0 && yPos < 110)
    							textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
    							j++;
    						}
    					}
    				}
    				if(chatType == 16) {
    					int j2 = 40;
    					int clanNameWidth = textDrawingArea.getTextWidth(clanname);
    					if(chatTypeView == 11 || chatTypeView == 0) {
    						if(yPos > 3 && yPos < 130)
    							switch(chatRights[k]) {
    								case 1:
    									j2 += clanNameWidth;
    									modIcons[0].drawBackground(j2 - 18, yPos - 12);
    									j2 += 14;
    									break;
    									
    								case 2:
    									j2 += clanNameWidth;
    									modIcons[1].drawBackground(j2 - 18, yPos - 12);
    									j2 += 14;
    									break;
    									
    								case 3:
    									j2 += clanNameWidth;
    									modIcons[1].drawBackground(j2 - 18, yPos - 12);
    									j2 += 14;
    									break;
    				
    								default:
    									j2 += clanNameWidth;
    									break;
    							}
    							textDrawingArea.method385(0, "[", yPos, 8);
    							textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
    							textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
    							
    							textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
    							j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
    							textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
    							j++;
    							j77++;
    						}
    					}
    			}
    			DrawingArea.defaultDrawingAreaSize();
    			anInt1211 = j * 14 + 7 + 5;
    			if(anInt1211 < 111)
    				anInt1211 = 111;
    			drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
    			String s;
    			if(myPlayer != null && myPlayer.name != null)
    				s = myPlayer.name;
    			else
    				s = TextClass.fixName(myUsername);
    			textDrawingArea.method385(0, s + ":", 133, 11);
    			textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
    			DrawingArea.method339(121, 0x807660, 506, 7);
    		}
    		if(menuOpen && menuScreenArea == 2) {
    			drawMenu();
    		}
    		aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
    		aRSImageProducer_1165.initDrawingArea();
    		Texture.anIntArray1472 = anIntArray1182;
    	}
    im not quite sure what the problem is
    New server soon; Hybrid-Realm 614
    Reply With Quote  
     

  6. #6  
    Donator

    Join Date
    Feb 2013
    Posts
    446
    Thanks given
    91
    Thanks received
    87
    Rep Power
    45
    You can try these:

    Code:
    public void pushMessage(String s, int i, String s1) {
    		if(i == 0 && dialogID != -1) {
    			aString844 = s;
    			super.clickMode3 = 0;
    		}
    		if(backDialogID == -1)
    			inputTaken = true;
    		for(int j = 499; j > 0; j--) {
    			chattypes[j] = chattypes[j - 1];
    			chatNames[j] = chatNames[j - 1];
    			chatMessages[j] = chatMessages[j - 1];
    			chatRights[j] = chatRights[j - 1];
    		}
    		chattypes[0] = i;
    		chatNames[0] = s1;
    		chatMessages[0] = s;
    		chatRights[0] = rights;
    	}
    Code:
    private void drawChatArea() {
    		aRSImageProducer_1166.initDrawingArea();
    		Texture.anIntArray1472 = anIntArray1180;
    		chatArea.drawSprite(0, 0);
    		drawChannelButtons();
    		TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
    		if(messagePromptRaised) {
    			chatTextDrawingArea.drawText(0, aString1121, 60, 259);
    			chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
    		} else if(inputDialogState == 1) {
    			chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
    			chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
    		} else if(inputDialogState == 2) {
    			chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
    			chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
    		} else if(aString844 != null) {
    			chatTextDrawingArea.drawText(0, aString844, 60, 259);
    			chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
    		} else if(backDialogID != -1) {
    			drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
    		} else if(dialogID != -1) {
    			drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
    		} else {
    			int j77 = -3;
    			int j = 0;
    			DrawingArea.setDrawingArea(122, 8, 497, 7);
    			for(int k = 0; k < 500; k++)
    			if(chatMessages[k] != null) {
    				int chattype = chattypes[k];
    				int yPos = (70 - j77 * 14) + anInt1089 + 5;
    				String s1 = chatNames[k];
    				byte byte0 = 0;
    				if(s1 != null && s1.startsWith("@cr1@")) {
    					s1 = s1.substring(5);
    					byte0 = 1;
    				} else if(s1 != null && s1.startsWith("@cr2@")) {
    					s1 = s1.substring(5);
    					byte0 = 2;
    				} else if(s1 != null && s1.startsWith("@cr3@")) {
    					s1 = s1.substring(5);
    					byte0 = 3;
    
                    } else if(s1 != null && s1.startsWith("@cr4@")) { // quickchaticon
                    s1 = s1.substring(5);
                    byte0 = 4;
                    }
    
    				if(chattype == 0) {
    					if (chattypeView == 5 || chattypeView == 0) {
    					if(yPos > 0 && yPos < 210)
    						textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
    					j++;
    					j77++;
    					}
    				}
    				if((chattype == 1 || chattype == 2) && (chattype == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
    					if (chattypeView == 1 || chattypeView == 0) {
    						if(yPos > 0 && yPos < 210) {
    							int xPos = 11;
    							if(byte0 == 1) {
    								modIcons[0].drawBackground(xPos + 1, yPos - 12);
    								xPos += 14;
    							} else if(byte0 == 2) {
    								modIcons[1].drawBackground(xPos + 1, yPos - 12);
    								xPos += 14;
    							} else if(byte0 == 3) {
    								modIcons[2].drawBackground(xPos + 1, yPos - 12);
    								xPos += 14;
    							}
    							textDrawingArea.method385(0, s1 + ":", yPos, xPos);
    							xPos += textDrawingArea.getTextWidth(s1) + 8;
    							textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
    						}
    						j++;
    						j77++;
    					}
    				}
    				if((chattype == 3 || chattype == 7) && (splitPrivateChat == 0 || chattypeView == 2) && (chattype == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
    					if (chattypeView == 2 || chattypeView == 0) {
    						if(yPos > 0 && yPos < 210) {
    							int k1 = 11;
    							textDrawingArea.method385(0, "From", yPos, k1);
    							k1 += textDrawingArea.getTextWidth("From ");
    							if(byte0 == 1) {
    								modIcons[0].drawBackground(k1, yPos - 12);
    								k1 += 12;
    							} else if(byte0 == 2) {
    								modIcons[1].drawBackground(k1, yPos - 12);
    								k1 += 12;
    							} else if(byte0 == 3) {
    								modIcons[2].drawBackground(k1, yPos - 12);
    								k1 += 12;
    							}
    							textDrawingArea.method385(0, s1 + ":", yPos, k1);
    							k1 += textDrawingArea.getTextWidth(s1) + 8;
    							textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
    						}
    						j++;
    						j77++;
    					}
    				}
    				if(chattype == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
    					if (chattypeView == 3 || chattypeView == 0) {
    						if(yPos > 0 && yPos < 210)
    							textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
    						j++;
    						j77++;
    					}
    				}
    				if(chattype == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
    					if (chattypeView == 2 || chattypeView == 0) {
    						if(yPos > 0 && yPos < 210)
    							textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
    						j++;
    						j77++;
    					}
    				}
    				if(chattype == 6 && (splitPrivateChat == 0 || chattypeView == 2) && privateChatMode < 2) {
    					if (chattypeView == 2 || chattypeView == 0) {
    						if(yPos > 0 && yPos < 210) {
    							textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
    							textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
    						}
    					j++;
    					j77++;
    					}
    				}
    				if(chattype == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
    					if (chattypeView == 3 || chattypeView == 0) {
    						if(yPos > 0 && yPos < 210)
    							textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
    						j++;
    						j77++;
    					}
    					if(chattype == 11 && (clanChatMode == 0)) {
    						if (chattypeView == 11) {
    						if(yPos > 0 && yPos < 210)
    							textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
    						j++;
    						j77++;
    					}
    					if(chattype == 12) {
    						if(yPos > 0 && yPos < 110)
    							textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
    							j++;
    						}
    					}
    				}
    				if(chattype == 16) {
    					int j2 = 40;
    					int clanNameWidth = textDrawingArea.getTextWidth(clanname);
    					if(chattypeView == 11 || chattypeView == 0) {
    						if(yPos > 3 && yPos < 130)
    							switch(chatRights[k]) {
    								case 1:
    									j2 += clanNameWidth;
    									modIcons[0].drawBackground(j2 - 18, yPos - 12);
    									j2 += 14;
    									break;
    									
    								case 2:
    									j2 += clanNameWidth;
    									modIcons[1].drawBackground(j2 - 18, yPos - 12);
    									j2 += 14;
    									break;
    									
    								case 3:
    									j2 += clanNameWidth;
    									modIcons[1].drawBackground(j2 - 18, yPos - 12);
    									j2 += 14;
    									break;
    				
    								default:
    									j2 += clanNameWidth;
    									break;
    							}
    							textDrawingArea.method385(0, "[", yPos, 8);
    							textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
    							textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
    							
    							textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
    							j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
    							textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
    							j++;
    							j77++;
    						}
    					}
    			}
    			DrawingArea.defaultDrawingAreaSize();
    			anInt1211 = j * 14 + 7 + 5;
    			if(anInt1211 < 111)
    				anInt1211 = 111;
    			drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
    			String s;
    			if(myPlayer != null && myPlayer.name != null)
    				s = myPlayer.name;
    			else
    				s = TextClass.fixName(myUsername);
    			textDrawingArea.method385(0, s + ":", 133, 11);
    			textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
    			DrawingArea.method339(121, 0x807660, 506, 7);
    		}
    		if(menuOpen && menuScreenArea == 2) {
    			drawMenu();
    		}
    		aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
    		aRSImageProducer_1165.initDrawingArea();
    		Texture.anIntArray1472 = anIntArray1182;
    	}

    Reply With Quote  
     

  7. #7  
    Registered Member haydar25's Avatar
    Join Date
    Jul 2011
    Posts
    325
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    didn't work man
    New server soon; Hybrid-Realm 614
    Reply With Quote  
     

  8. #8  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    It wasn't what I expected it would be. I could take a look when I help you with the other issue though.
    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. PI chat not working
    By Heyt in forum Help
    Replies: 4
    Last Post: 09-27-2012, 06:38 AM
  2. [PI] Public Chat not showing
    By vial in forum Help
    Replies: 12
    Last Post: 02-12-2012, 01:58 AM
  3. PI player chat not working 15$
    By Happy Days in forum Help
    Replies: 7
    Last Post: 02-16-2011, 10:52 PM
  4. Replies: 0
    Last Post: 03-04-2010, 03:14 AM
  5. clan chat not working for me
    By devildreams54 in forum Help
    Replies: 5
    Last Post: 07-09-2009, 08:48 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
  •