|
You last visited: Today at 21:56
Advertisement
[Question] Plus notice through filter source code ?
Discussion on [Question] Plus notice through filter source code ? within the SRO Private Server forum part of the Silkroad Online category.
04/11/2018, 22:50
|
#1
|
elite*gold: 0
Join Date: May 2008
Posts: 167
Received Thanks: 2
|
[Question] Plus notice through filter source code ?
hi there
i wonder is someone can share with me a correct plus notice script to put inside the filter
i tried to make it manually without any success 
if someone can help ill really appreciate your help 
thanks in advance
|
|
|
04/12/2018, 00:08
|
#2
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,110
Received Thanks: 907
|
Don't ask for script suddenly if you don't want to learn. Also I think plus notice is available in all filters so I guess the filter source you're using contains it!
|
|
|
04/12/2018, 02:50
|
#3
|
elite*gold: 0
Join Date: May 2008
Posts: 167
Received Thanks: 2
|
Quote:
Originally Posted by #HB
Don't ask for script immediately if you don't want to learn. Also I think plus notice is available in all filters so I guess the filter source you're using contains it!
|
Yes its already available and i saw the script in it but its not working
I just need to fix it
Btw im using the superman filter and i think the owner has disabled this function so i asked for a working script or how to activate the existing disabled function cuz i tried and failed
|
|
|
04/12/2018, 22:51
|
#4
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,110
Received Thanks: 907
|
Superman code is working, it just needs a little touch
|
|
|
04/13/2018, 00:33
|
#5
|
elite*gold: 0
Join Date: May 2008
Posts: 167
Received Thanks: 2
|
Quote:
Originally Posted by #HB
Superman code is working, it just needs a little touch
|
can u give me some hints ?
heres the code :
#region Plus Notice system
if (_pck.Opcode == 0xB150 && FilterMain.DB && FilterMain.PlusNotice)
{
try
{
_pck.Lock(); // Lock
_pck.ReadUInt16();
_pck.ReadUInt8();
int slot = _pck.ReadUInt8();
_pck.ReadUInt64();
int plus = _pck.ReadUInt8();
if (plus >= FilterMain.RequiredPlus && plus > 0)
{
try
{
// Get item name
SqlDataReader reader = sqlCon.Return("_GetName", new SqlParameter("@CharName", Program.Plis(this.sql_charname)), new SqlParameter("@Slot", slot));
reader.Read();
// Item name
string ItemName = reader["Name"].ToString();
// Check if name is not null.
if (ItemName != string.Empty && ItemName != null)
{
// New method, notice sender.
sqlCon.exec("INSERT INTO [" + FilterMain.SUP_DB + "].[dbo].[_Notice] (message, added) VALUES('" + Program.Plis(this.sql_charname) + " has increased [" + ItemName + "] to plus (" + plus + ")', '" + DateTime.UtcNow + "')");
}
// Close DB
reader.Close();
}
catch { }
}
}
catch { }
}
#endregion
please ?
|
|
|
04/13/2018, 00:39
|
#6
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,110
Received Thanks: 907
|
First of all: If you're not gonna work on the filter to improve it, then don't try to fix plus notice only because the source totally sucks.
Second: All you have to do is to get items names table and edit the code to send notice using the packet from the program not by inserting into notice table
|
|
|
04/13/2018, 23:52
|
#7
|
elite*gold: 0
Join Date: May 2008
Posts: 167
Received Thanks: 2
|
Quote:
Originally Posted by #HB
First of all: If you're not gonna work on the filter to improve it, then don't try to fix plus notice only because the source totally sucks.
Second: All you have to do is to get items names table and edit the code to send notice using the packet from the program not by inserting into notice table
|
i did that :
#region Plus Notice system
// Notice spam xD
if (_pck.Opcode == 0xB150 && FilterMain.DB && FilterMain.PlusNotice)
{
try
{
_pck.Lock(); // Lock
_pck.ReadUInt16();
_pck.ReadUInt8();
int slot = _pck.ReadUInt8();
_pck.ReadUInt64();
int plus = _pck.ReadUInt8();
if (plus >= FilterMain.RequiredPlus && plus > 0)
{
try
{
// Get item name
SqlDataReader reader = sqlCon.Return("[" + FilterMain.SHA_DB + "].[dbo].[_AddLogItem]", new SqlParameter("@CharName", Program.Plis(this.sql_charname)), new SqlParameter("@Slot", slot));
reader.Read();
// Item name
string Name = reader[("[" + FilterMain.SHA_DB + "].[dbo].[_ItemName]")].ToString();
// Check if name is not null.
if (Name != string.Empty && Name != null)
{
// New method, notice sender.
sqlCon.exec("INSERT INTO [" + FilterMain.SUP_DB + "].[dbo].[_Notice] (message, added) VALUES('" + Program.Plis(this.sql_charname) + " has increased [" + Name + "] to plus (" + plus + ")', '" + DateTime.UtcNow + "')");
}
// Close DB
reader.Close();
and it requires a char id
and when i add 'Program.Plis(this.user_id)' it requires a refitem ID ' 
whats is wrong ?
please help
|
|
|
04/14/2018, 00:16
|
#8
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,110
Received Thanks: 907
|
Read what I've written above again, you didn't change anything
|
|
|
04/14/2018, 00:45
|
#9
|
elite*gold: 0
Join Date: May 2008
Posts: 167
Received Thanks: 2
|
Quote:
Originally Posted by #HB
Read what I've written above again, you didn't change anything
|
yes i didnt changed the notice method but i added the ItemName table as u said
i cant understand where is the problem and what i should change
im a new to C# so its hard for me
please help
if u want 
thanks
Thanks #HB i figured out whats the problem , but i have a datetime convertion issue
can u give some hints ?
P.S 'DateTime.UtcNow' and also 'DateTime.Now' not working and giving a datetime convertion error
any suggestions ?
|
|
|
04/16/2018, 17:39
|
#10
|
elite*gold: 0
Join Date: May 2008
Posts: 167
Received Thanks: 2
|
Edit: i did it with another way
i re-created _Notice table to get date automatically
thanks anyway
|
|
|
04/18/2018, 03:46
|
#11
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,110
Received Thanks: 907
|
You can't work on a filter source code immediately if you're new in C#.
Also, figure out how to make it send the notice as a packet instead of inserting in _Notice table (it's not hard at all and you can find it everywhere if you looked at goofie's code)
|
|
|
04/18/2018, 05:05
|
#12
|
elite*gold: 0
Join Date: May 2008
Posts: 167
Received Thanks: 2
|
Quote:
Originally Posted by #HB
You can't work on a filter source code immediately if you're new in C#.
Also, figure out how to make it send the notice as a packet instead of inserting in _Notice table (it's not hard at all and you can find it everywhere if you looked at goofie's code)
|
i dont prefer to do it through notice packet only cuz i want the plus logs to be stored on a sql table
also i have a sql script which sends a notice which says if the item has an adv. and it's grade on it or not
i think its hard for me to do this through the source code and also it will require a customized SP in sql to work with the commands in the source code
anyway i really appreciate ur help u r a good man
|
|
|
All times are GMT +1. The time now is 21:58.
|
|