[Non-Mini Release] Rewriting Client Notification Handler

09/11/2020 20:59 NorseGodTyr#16
Quote:
Originally Posted by #HB View Post
Hmmm works fine for me.

Your problem is here anyways:
Code:
if (chat = g_notificationhandler.GetKillNotify(uqdata->ObjNameStrID))
{
	swprintf_s(buffer, sizeof(buffer), g_textmanager->GetStringTextByCode(chat)->c_str(), KillerName.c_str());
	g_interface->ShowBlueNotify(buffer);
	sysmsg->Write(UNIQUE_KILL_SYSTEM_COLOR, buffer);
}
You have to be exceeding the buffer size or messing up arguments, ex: [Only registered and activated users can see links. Click Here To Register...]
ok found the problem changed to swprintf

Quote:
Originally Posted by Goosxc View Post
My game stuck after i load monster the unique

also after i killed the unique i got the same error @norsegodtyr
change by

Quote:
if (chat = g_notificationhandler.GetKillNotify(uqdata->ObjNameStrID))
{
swprintf_s(buffer, sizeof(buffer), g_textmanager->GetStringTextByCode(chat)->c_str(), KillerName.c_str());
g_interface->ShowBlueNotify(buffer);
sysmsg->Write(UNIQUE_KILL_SYSTEM_COLOR, buffer);
}
swprintf_s to swprintf
09/12/2020 07:56 irockalone#17
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
any help?
09/12/2020 10:29 #HB#18
Quote:
Originally Posted by NorseGodTyr View Post
swprintf_s to swprintf
Which means your buffer is messed up or it exceeds limit, so its no good to modify it to swprintf.

swprintf_s is limited by the dest buffer size that you specify so if you exceed it, you should be getting that error.

While swprintf just fills the dest buffer with the same size of the source, so it doesn't really care if it exceeds the dest buffer size, AKA if source size is greater than dest size, you'll modify bytes that don't really belong to your dest buffer, which is not safe AT ALL.

That's probably why swprintf is not considered safe.

So, you can try increasing the buffer size.

Quote:
Originally Posted by irockalone View Post
any help?
You seem to miss includes somehow or VC packages.

Quote:
Originally Posted by *Deadly View Post
Is it possible to use some other color like the Pink, Green and Blue notifications on the middle of the screen?
Should be possible, but its not related to this topic. Have a look at resinfo files as well, the color could be there as well.

Quote:
Originally Posted by *Deadly View Post
when I tried to change the hex color of ShowBlueNotify or Pink to something else and build, it started crashing my client the unique appears.
You must've modified something else that isn't really related to it.
09/12/2020 13:31 NorseGodTyr#19
Quote:
Originally Posted by #HB View Post
Which means your buffer is messed up or it exceeds limit, so its no good to modify it to swprintf.

swprintf_s is limited by the dest buffer size that you specify so if you exceed it, you should be getting that error.

While swprintf just fills the dest buffer with the same size of the source, so it doesn't really care if it exceeds the dest buffer size, AKA if source size is greater than dest size, you'll modify bytes that don't really belong to your dest buffer, which is not safe AT ALL.

That's probably why swprintf is not considered safe.

So, you can try increasing the buffer size.
i have try to increase but not work so i changed to swprintf and work fine without any crash/error
09/12/2020 14:32 *Deadly#20
Quote:
Originally Posted by #HB View Post

You must've modified something else that isn't really related to it.

i modified those hex colors

Code:
void CGInterface::ShowBlueNotify(std::wstring msg)
{
	reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x0077B580)(this, &msg);
}
Code:
void CGInterface::ShowBlueNotify(std::wstring* msg)
{
	reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x0077B580)(this, msg);
}
09/12/2020 16:35 irockalone#21
Quote:
Originally Posted by #HB View Post
Which means your buffer is messed up or it exceeds limit, so its no good to modify it to swprintf.

swprintf_s is limited by the dest buffer size that you specify so if you exceed it, you should be getting that error.

While swprintf just fills the dest buffer with the same size of the source, so it doesn't really care if it exceeds the dest buffer size, AKA if source size is greater than dest size, you'll modify bytes that don't really belong to your dest buffer, which is not safe AT ALL.

That's probably why swprintf is not considered safe.

So, you can try increasing the buffer size.



You seem to miss includes somehow or VC packages.



Should be possible, but its not related to this topic. Have a look at resinfo files as well, the color could be there as well.



You must've modified something else that isn't really related to it.

what VC should i use? and can you share link for download?
09/12/2020 16:49 #HB#22
Quote:
Originally Posted by *Deadly View Post
i modified those hex colors

Code:
void CGInterface::ShowBlueNotify(std::wstring msg)
{
	reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x0077B580)(this, &msg);
}
Uhm... These are not colors, these are addresses. Anyways this is out of topic, so please keep this outta here.

Quote:
Originally Posted by irockalone View Post
what VC should i use? and can you share link for download?
Quote:
Originally Posted by #HB View Post
NOTE: Structures found in the files are for VC80 libs, back when strings were 28 bytes. You'll face errors, if you work with any later compiler.
09/12/2020 16:52 irockalone#23
Quote:
Originally Posted by #HB View Post
Uhm... These are not colors, these are addresses. Anyways this is out of topic, so please keep this outta here.
its been 2 hour while i m looking for VC80 SP but there's nothing exists like MS stopped supporting this lol
i would be thankful if you shared a link for this.
09/12/2020 17:35 #HB#24
Quote:
Originally Posted by irockalone View Post
its been 2 hour while i m looking for VC80 SP but there's nothing exists like MS stopped supporting this lol
i would be thankful if you shared a link for this.
VC80 is pretty old yeah, but sadly we have to stick with it, you have 2 options:

No matter what option you choose, you still need to keep up with Joymax allocator, so flo's reconstructed JoymaxAllocator in [Only registered and activated users can see links. Click Here To Register...] would be great to ensure the safety of your std lib.
09/12/2020 19:24 irockalone#25
Quote:
Originally Posted by #HB View Post
VC80 is pretty old yeah, but sadly we have to stick with it, you have 2 options:

No matter what option you choose, you still need to keep up with Joymax allocator, so flo's reconstructed JoymaxAllocator in [Only registered and activated users can see links. Click Here To Register...] would be great to ensure the safety of your std lib.

after including all neccessary directories
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
09/14/2020 22:15 *Deadly#26
Quote:
Originally Posted by #HB View Post
Uhm... These are not colors, these are addresses. Anyways this is out of topic, so please keep this outta here.
Ah, thanks :D I don't actually know c++
11/20/2020 23:49 nevet.S#27
Can it work for taiwan v1.258 files?
11/21/2020 11:11 #HB#28
Quote:
Originally Posted by nevet.S View Post
Can it work for taiwan v1.258 files?
It can, you'll need to adapt with addresses difference, and you'll probably need to add new types and also maybe modify an old type, since there's a big version difference between the files.