|
You last visited: Today at 17:55
Advertisement
Plus Notice With Item Link
Discussion on Plus Notice With Item Link within the SRO PServer Questions & Answers forum part of the SRO Private Server category.
07/27/2025, 01:33
|
#1
|
elite*gold: 0
Join Date: Oct 2014
Posts: 172
Received Thanks: 38
|
Plus Notice With Item Link
#SOLVED
|
|
|
07/28/2025, 11:03
|
#2
|
elite*gold: 0
Join Date: May 2021
Posts: 75
Received Thanks: 12
|
thanks for the explanation and detailed code!
from my analysis of the code, the reason the item link isn't showing up in the Plus notification is: The linkKey format isn't in the correct client-supported format.
string linkKey = $"<{itemName}>"; is invalid.
The element link format officially supported by the client (such as iSRO/vSRO) is:
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
notice the big difference:
a linkKey is a unique key used in the cache (it's not based solely on the item name).
the message contains $item:{linkKey}, which makes the link appear, turn blue, and be clickable.
the correct code is
// Generate a unique key for the item
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
// Generate the message text with the item link
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
// Save the item data in the cache using the key
SharedObjects.ItemLinkInfo[linkKey] = fullItemInfo;
// Send the item link to the player
await session.SendItemLink(linkKey, fullItemInfo);
// Create the notification packet
var globalPacket = SERVER_AGENT_CHAT_UPDATE.of(ChatType.Notice, session.SessionData.Charname, message);
// Send the notification to the same player
await session.SendToClient(globalPacket);
// Send the notification and link to all other players
foreach (var s in SharedObjects.AgentSessions)
{
if (s != null && s != session)
{
await s.SendItemLink(linkKey, fullItemInfo);
await s.SendToClient(globalPacket);
}
}
Console.WriteLine("[Alchemy] Broadcast completed.");
the correct code is
// Generate a unique key for the item
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
// Generate the message text with the item link
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
// Save the item data in the cache using the key
SharedObjects.ItemLinkInfo[linkKey] = fullItemInfo;
// Send the item link to the player
await session.SendItemLink(linkKey, fullItemInfo);
// Create the notification packet
var globalPacket = SERVER_AGENT_CHAT_UPDATE.of(ChatType.Notice, session.SessionData.Charname, message);
// Send the notification to the same player
await session.SendToClient(globalPacket);
// Send the notification and link to all other players
foreach (var s in SharedObjects.AgentSessions)
{
if (s != null && s != session)
{
await s.SendItemLink(linkKey, fullItemInfo);
await s.SendToClient(globalPacket);
}
}
Console.WriteLine("[Alchemy] Broadcast completed.");
the correct code is
// Generate a unique key for the item
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
// Generate the message text with the item link
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
// Save the item data in the cache using the key
SharedObjects.ItemLinkInfo[linkKey] = fullItemInfo;
// Send the item link to the player
await session.SendItemLink(linkKey, fullItemInfo);
// Create the notification packet
var globalPacket = SERVER_AGENT_CHAT_UPDATE.of(ChatType.Notice, session.SessionData.Charname, message);
// Send the notification to the same player
await session.SendToClient(globalPacket);
// Send the notification and link to all other players
foreach (var s in SharedObjects.AgentSessions)
{
if (s != null && s != session)
{
await s.SendItemLink(linkKey, fullItemInfo);
await s.SendToClient(globalPacket);
}
}
Console.WriteLine("[Alchemy] Broadcast completed.");
the correct code is
// Generate a unique key for the item
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
// Generate the message text with the item link
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
// Save the item data in the cache using the key
SharedObjects.ItemLinkInfo[linkKey] = fullItemInfo;
// Send the item link to the player
await session.SendItemLink(linkKey, fullItemInfo);
// Create the notification packet
var globalPacket = SERVER_AGENT_CHAT_UPDATE.of(ChatType.Notice, session.SessionData.Charname, message);
// Send the notification to the same player
await session.SendToClient(globalPacket);
// Send the notification and link to all other players
foreach (var s in SharedObjects.AgentSessions)
{
if (s != null && s != session)
{
await s.SendItemLink(linkKey, fullItemInfo);
await s.SendToClient(globalPacket);
}
}
Console.WriteLine("[Alchemy] Broadcast completed.");
Correct code file dll
if (msg->msgid() == 0x184B)
{
BYTE type;
std::n_string notice;
*msg >> type >> notice;
// Convert the notification to a wide string (for Unicode)
std::wstring wNotice = notice.to_wstring();
// Default color for text in chat
D3DCOLOR color = D3DCOLOR_ARGB(255, 255, 255, 255);
// Customize the color based on the notification type
switch (type)
{
case 1: // Notice
g_pCGInterface->ShowMessage_Notice(wNotice.c_str());
g_pCGInterface->GetSystemMessageView()->WriteMessage(0xff, D3DCOLOR_RGBA(0x68, 0xBB, 0xE3, 255), wNotice.c_str(), 0, 1);
break;
case 2://Warning
g_pCGInterface->ShowMessage_Warning(wNotice.c_str());
g_pCGInterface->GetSystemMessageView()->WriteMessage(0xff, D3DCOLOR_RGBA(0xFF, 0xB2, 0x2E, 255), wNotice.c_str(), 0, 1);
break;
case 3: //Quest
g_pCGInterface->ShowMessage_Quest(wNotice.c_str());
g_pCGInterface->GetSystemMessageView()->WriteMessage(0xff, D3DCOLOR_RGBA(0x2E, 0xFF, 0x2E, 255), wNotice.c_str(), 0, 1);
break;
default:
break;
}
// Always write to the bottom chat window
CIFChatViewer* chatView = (CIFChatViewer*)g_pCGInterface->m_IRM.GetResObj(1, 1);
if (chatView)
{
chatView->WriteToChatW(wNotice.c_str(), color, 1);
}
}
|
|
|
07/28/2025, 17:32
|
#3
|
elite*gold: 0
Join Date: Oct 2014
Posts: 172
Received Thanks: 38
|
Thanks alot sir
Quote:
Originally Posted by romio100
thanks for the explanation and detailed code!
from my analysis of the code, the reason the item link isn't showing up in the Plus notification is: The linkKey format isn't in the correct client-supported format.
string linkKey = $"<{itemName}>"; is invalid.
The element link format officially supported by the client (such as iSRO/vSRO) is:
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
notice the big difference:
a linkKey is a unique key used in the cache (it's not based solely on the item name).
the message contains $item:{linkKey}, which makes the link appear, turn blue, and be clickable.
the correct code is
// Generate a unique key for the item
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
// Generate the message text with the item link
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
// Save the item data in the cache using the key
SharedObjects.ItemLinkInfo[linkKey] = fullItemInfo;
// Send the item link to the player
await session.SendItemLink(linkKey, fullItemInfo);
// Create the notification packet
var globalPacket = SERVER_AGENT_CHAT_UPDATE.of(ChatType.Notice, session.SessionData.Charname, message);
// Send the notification to the same player
await session.SendToClient(globalPacket);
// Send the notification and link to all other players
foreach (var s in SharedObjects.AgentSessions)
{
if (s != null && s != session)
{
await s.SendItemLink(linkKey, fullItemInfo);
await s.SendToClient(globalPacket);
}
}
Console.WriteLine("[Alchemy] Broadcast completed.");
the correct code is
// Generate a unique key for the item
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
// Generate the message text with the item link
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
// Save the item data in the cache using the key
SharedObjects.ItemLinkInfo[linkKey] = fullItemInfo;
// Send the item link to the player
await session.SendItemLink(linkKey, fullItemInfo);
// Create the notification packet
var globalPacket = SERVER_AGENT_CHAT_UPDATE.of(ChatType.Notice, session.SessionData.Charname, message);
// Send the notification to the same player
await session.SendToClient(globalPacket);
// Send the notification and link to all other players
foreach (var s in SharedObjects.AgentSessions)
{
if (s != null && s != session)
{
await s.SendItemLink(linkKey, fullItemInfo);
await s.SendToClient(globalPacket);
}
}
Console.WriteLine("[Alchemy] Broadcast completed.");
the correct code is
// Generate a unique key for the item
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
// Generate the message text with the item link
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
// Save the item data in the cache using the key
SharedObjects.ItemLinkInfo[linkKey] = fullItemInfo;
// Send the item link to the player
await session.SendItemLink(linkKey, fullItemInfo);
// Create the notification packet
var globalPacket = SERVER_AGENT_CHAT_UPDATE.of(ChatType.Notice, session.SessionData.Charname, message);
// Send the notification to the same player
await session.SendToClient(globalPacket);
// Send the notification and link to all other players
foreach (var s in SharedObjects.AgentSessions)
{
if (s != null && s != session)
{
await s.SendItemLink(linkKey, fullItemInfo);
await s.SendToClient(globalPacket);
}
}
Console.WriteLine("[Alchemy] Broadcast completed.");
the correct code is
// Generate a unique key for the item
string linkKey = $"{session.SessionData.Charname}_{DateTime.UtcNow. Ticks}";
// Generate the message text with the item link
string message = $"[{session.SessionData.Charname}] Fuse $item:{linkKey} to Plus[{totalPlus}] {prefix}";
// Save the item data in the cache using the key
SharedObjects.ItemLinkInfo[linkKey] = fullItemInfo;
// Send the item link to the player
await session.SendItemLink(linkKey, fullItemInfo);
// Create the notification packet
var globalPacket = SERVER_AGENT_CHAT_UPDATE.of(ChatType.Notice, session.SessionData.Charname, message);
// Send the notification to the same player
await session.SendToClient(globalPacket);
// Send the notification and link to all other players
foreach (var s in SharedObjects.AgentSessions)
{
if (s != null && s != session)
{
await s.SendItemLink(linkKey, fullItemInfo);
await s.SendToClient(globalPacket);
}
}
Console.WriteLine("[Alchemy] Broadcast completed.");
Correct code file dll
if (msg->msgid() == 0x184B)
{
BYTE type;
std::n_string notice;
*msg >> type >> notice;
// Convert the notification to a wide string (for Unicode)
std::wstring wNotice = notice.to_wstring();
// Default color for text in chat
D3DCOLOR color = D3DCOLOR_ARGB(255, 255, 255, 255);
// Customize the color based on the notification type
switch (type)
{
case 1: // Notice
g_pCGInterface->ShowMessage_Notice(wNotice.c_str());
g_pCGInterface->GetSystemMessageView()->WriteMessage(0xff, D3DCOLOR_RGBA(0x68, 0xBB, 0xE3, 255), wNotice.c_str(), 0, 1);
break;
case 2://Warning
g_pCGInterface->ShowMessage_Warning(wNotice.c_str());
g_pCGInterface->GetSystemMessageView()->WriteMessage(0xff, D3DCOLOR_RGBA(0xFF, 0xB2, 0x2E, 255), wNotice.c_str(), 0, 1);
break;
case 3: //Quest
g_pCGInterface->ShowMessage_Quest(wNotice.c_str());
g_pCGInterface->GetSystemMessageView()->WriteMessage(0xff, D3DCOLOR_RGBA(0x2E, 0xFF, 0x2E, 255), wNotice.c_str(), 0, 1);
break;
default:
break;
}
// Always write to the bottom chat window
CIFChatViewer* chatView = (CIFChatViewer*)g_pCGInterface->m_IRM.GetResObj(1, 1);
if (chatView)
{
chatView->WriteToChatW(wNotice.c_str(), color, 1);
}
}
|
Thanks alot i will try this <3
Have a good day sir.
|
|
|
Similar Threads
|
Share _ItemName + Item Plus Notice & Website
02/16/2019 - SRO PServer Guides & Releases - 16 Replies
Hey epvp :)
Share my _ItemName Table from my website and PlusNotice
12533 items Added with Name
Execute query and add all line from text file (Added in attachment )
|
*Notice*Warning Password stealing site*Notice*
12/28/2009 - World of Warcraft - 0 Replies
Notice is as follows, do not enter this site, if you get a notice in your email like this for gawd sakes dont give anyone your password
Subject:World of Warcraft Account Trade Dispute Notice
When we carry out a routine check when the account, we have evidence to show that your account has been involved in the disputed transactions.
So we have to inform you visit our website(worldofwarcraft*com]fill out some information to facilitate our investigation.
If you can not tie in with our soon...
|
All times are GMT +1. The time now is 17:57.
|
|