Jump to content

Typing Information Whisper


Recommended Posts

  • Forum Moderator
8 hours ago, VitaminsizFerdi said:

Edit; solved
 

Rules

§2 Topics

 

(2.5) Questions & Answers specific rules

  • Don't modify your thread (or reply to it) to mark it solved, and not explain the solution to the issue.
  • Please use our tag system and vote good/bad answers so everyone can clearly see what matters!

 

Best regards
Raylee

  • Love 1
Link to comment
Share on other sites

  • 5 months later...

Hi..

A suggestion.
Where "writing appears could tell "offline" if the character is not in the game :D

 

----------------------------------------------------------------------------------------------------------------

And error:
shitf + ENTER open message.. not close in your system (no name) ^^ 

spacer.png

 

0802 17:54:41539 :: Traceback (most recent call last):

0802 17:54:41539 ::   File "ui.py", line 1344, in CallEvent

0802 17:54:41540 ::   File "ui.py", line 87, in __call__

0802 17:54:41541 ::   File "ui.py", line 69, in __call__

0802 17:54:41541 ::   File "uiWhisper.py", line 272, in Close

0802 17:54:41541 :: TypeError
0802 17:54:41570 :: : 
0802 17:54:41571 :: bad argument type for built-in operation
0802 17:54:41571 :: 


----------------------------------------------------------------------------------------------------------------

Edit:

Some got confused and then I'll simplify.

in uiwhisper.py (if you already have import time ignore.)

1º search: 

import chr


add after:

import time


2º find and replace
 

def OnScroll(self):
		chat.SetWhisperPosition(self.targetName, self.scrollBar.GetPos())
	def OnScroll(self):
		chat.SetWhisperPosition(self.targetName, self.scrollBar.GetPos())
	if app.ENABLE_WHISPER_RENEWAL:
			def SetTimer(self):
				self.endTime = time.clock() + 0.4
			def OnUpdate(self):
				if self.targetName and self.chatLine:
					if len(self.chatLine.GetText()) > 0 and not whisper.IsSended(self.targetName):
						whisper.Add(self.targetName)
					elif not len(self.chatLine.GetText()) > 0 and whisper.IsSended(self.targetName):
						whisper.Remove(self.targetName)
					if whisper.CheckName(self.targetName):
						self.typing.Show()
						lastTime = max(0, self.endTime - time.clock())
						if 0 == lastTime:
							if len(self.typing.GetText()) - len(b_name) < 3:
								self.typing.SetText(self.typing.GetText() + ".")
							else:
								self.typing.SetText(b_name)	
							self.SetTimer()
					else:
						self.typing.Hide()

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Up. @Mali61 

 

Not close (no name)

spacer.png

 

0802 17:54:41539 :: Traceback (most recent call last):

0802 17:54:41539 ::   File "ui.py", line 1344, in CallEvent

0802 17:54:41540 ::   File "ui.py", line 87, in __call__

0802 17:54:41541 ::   File "ui.py", line 69, in __call__

0802 17:54:41541 ::   File "uiWhisper.py", line 272, in Close

0802 17:54:41541 :: TypeError
0802 17:54:41570 :: : 
0802 17:54:41571 :: bad argument type for built-in operation
0802 17:54:41571 :: 
Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

41 minutes ago, ByLost said:

Up. @Mali61 

 

Not close (no name)

spacer.png

 


0802 17:54:41539 :: Traceback (most recent call last):

0802 17:54:41539 ::   File "ui.py", line 1344, in CallEvent

0802 17:54:41540 ::   File "ui.py", line 87, in __call__

0802 17:54:41541 ::   File "ui.py", line 69, in __call__

0802 17:54:41541 ::   File "uiWhisper.py", line 272, in Close

0802 17:54:41541 :: TypeError
0802 17:54:41570 :: : 
0802 17:54:41571 :: bad argument type for built-in operation
0802 17:54:41571 :: 

 

 

	def Close(self):
		chat.ClearWhisper(self.targetName)

		if app.ENABLE_WHISPER_RENEWAL:
			if self.targetName and whisper.IsSended(self.targetName) and len(self.targetName) > 0:
				whisper.Remove(self.targetName)

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 1 year later...

I have this in input_main:

			/*Info*/
			TPacketGCWhisper pack;
			int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1);
			pack.bHeader = HEADER_GC_WHISPER;
			pack.wSize = static_cast<WORD>(sizeof(TPacketGCWhisper) + len);
			pack.bType = WHISPER_TYPE_SYSTEM;
			strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));

			TEMP_BUFFER buf;
			buf.write(&pack, sizeof(TPacketGCWhisper));
			buf.write(msg, len);
			ch->GetDesc()->Packet(buf.read_peek(), buf.size());

			#else
			TPacketGCWhisper pack;
			pack.bHeader = HEADER_GC_WHISPER;
			pack.bType = WHISPER_TYPE_NOT_EXIST;
			pack.wSize = sizeof(TPacketGCWhisper);
			strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
			ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
			sys_log(0, "WHISPER: no player");
			#endif

How do I insert this part:

//Find
			ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
			sys_log(0, "WHISPER: no player");
		
///Change
#ifdef ENABLE_WHISPER_RENEWAL			
			char buf[CHAT_MAX_LEN + 1];
			strlcpy(buf, data + sizeof(TPacketCGWhisper), MIN(iExtraLen + 1, sizeof(buf)));
			if (!(std::string(buf).find("|?whisper_renewal>|") != std::string::npos || std::string(buf).find("|?whisper_renewal<|") != std::string::npos)) {
				ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
				sys_log(0, "WHISPER: no player");
			}
#else
			ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
			sys_log(0, "WHISPER: no player");
#endif

No matter what I try I get compiler error... 😕

Link to comment
Share on other sites

On 11/3/2021 at 10:34 PM, narcisxb said:

I have this in input_main:

			/*Info*/
			TPacketGCWhisper pack;
			int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1);
			pack.bHeader = HEADER_GC_WHISPER;
			pack.wSize = static_cast<WORD>(sizeof(TPacketGCWhisper) + len);
			pack.bType = WHISPER_TYPE_SYSTEM;
			strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));

			TEMP_BUFFER buf;
			buf.write(&pack, sizeof(TPacketGCWhisper));
			buf.write(msg, len);
			ch->GetDesc()->Packet(buf.read_peek(), buf.size());

			#else
			TPacketGCWhisper pack;
			pack.bHeader = HEADER_GC_WHISPER;
			pack.bType = WHISPER_TYPE_NOT_EXIST;
			pack.wSize = sizeof(TPacketGCWhisper);
			strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
			ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
			sys_log(0, "WHISPER: no player");
			#endif

How do I insert this part:

//Find
			ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
			sys_log(0, "WHISPER: no player");
		
///Change
#ifdef ENABLE_WHISPER_RENEWAL			
			char buf[CHAT_MAX_LEN + 1];
			strlcpy(buf, data + sizeof(TPacketCGWhisper), MIN(iExtraLen + 1, sizeof(buf)));
			if (!(std::string(buf).find("|?whisper_renewal>|") != std::string::npos || std::string(buf).find("|?whisper_renewal<|") != std::string::npos)) {
				ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
				sys_log(0, "WHISPER: no player");
			}
#else
			ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
			sys_log(0, "WHISPER: no player");
#endif

No matter what I try I get compiler error... 😕

Any ideea? Still does not work.

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.