Hi there,

I have a few warning, i tryed to get some information about it.
I didn't get too much, but i would like to know what can i do to fix it?

Thanks in advanced

Regards!

ServUO:
Warnings:
 + Misc/Email.cs:
    CS0618: Line 36: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'
    CS0618: Line 50: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'
 + Services/Monster Stealing/Items/GemOfSalvation.cs:
    CS0472: Line 49: The result of comparing value type `System.DateTime' with null is always `true'
 + Services/Monster Stealing/Items/ManaDraught.cs:
    CS0472: Line 30: The result of comparing value type `System.DateTime' with null is always `true'
    CS0472: Line 70: The result of comparing value type `System.DateTime' with null is always `true'
 + Services/Monster Stealing/Items/SeedOflife.cs:
    CS0472: Line 43: The result of comparing value type `System.DateTime' with null is always `true'
    CS0472: Line 84: The result of comparing value type `System.DateTime' with null is always `true'
 + Services/Town Cryer/TownCryerSystem.cs:
    CS1717: Line 538: Assignment made to same variable; did you mean to assign something else?
 
+ Misc/Email.cs: CS0618: Line 36: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'

The email one you will probably want to just leave alone, unless you can figure out how to use the recommended package.

+ Services/Monster Stealing/Items/GemOfSalvation.cs: CS0472: Line 49: The result of comparing value type `System.DateTime' with null is always `true' + Services/Monster Stealing/Items/ManaDraught.cs: CS0472: Line 30: The result of comparing value type `System.DateTime' with null is always `true' CS0472: Line 70: The result of comparing value type `System.DateTime' with null is always `true' + Services/Monster Stealing/Items/SeedOflife.cs: CS0472: Line 43: The result of comparing value type `System.DateTime' with null is always `true' CS0472: Line 84: The result of comparing value type `System.DateTime' with null is always `true'

DateTime: try this ... change "if (SalvationUsage[pm] != null)" to "if (SalvationUsage[pm] is typeof(DateTime))"

+ Services/Town Cryer/TownCryerSystem.cs: CS1717: Line 538: Assignment made to same variable; did you mean to assign something else?

Town cryer: change "int count = count = …" to "int count = …"
 
The email one you will probably want to just leave alone, unless you can figure out how to use the recommended package.



DateTime: try this ... change "if (SalvationUsage[pm] != null)" to "if (SalvationUsage[pm] is typeof(DateTime))"



Town cryer: change "int count = count = …" to "int count = …"
Hi Lokai,
Thanks for your help.

C#:
Failed with: 1 errors, 0 warnings
Errors:
+ Services/Monster Stealing/Items/GemOfSalvation.cs:
    CS1525: Line 49: Unexpected symbol `)', expecting `(', `.', `[', or `<operator>'

TownCryerSystem.cs Work fine!
 
Last edited:
It's a check that is not really necessary anyway. Try this instead:

C#:
            foreach (PlayerMobile pm in SalvationUsage.Keys)
            {
                if (SalvationUsage[pm] < DateTime.Now + Cooldown)
                {
                    toRemove.Add(pm);
                }
            }
 
It's a check that is not really necessary anyway. Try this instead:

C#:
            foreach (PlayerMobile pm in SalvationUsage.Keys)
            {
                if (SalvationUsage[pm] < DateTime.Now + Cooldown)
                {
                    toRemove.Add(pm);
                }
            }
Work fine, but i have a question.

i have another warning about another check, should i remove too?

SeedOflife.cs:
if (SeedUsageList[by] != null)
                {
                    by.SendLocalizedMessage(1079263,((int)(((SeedUsageList[by] + Cooldown)-DateTime.Now).TotalSeconds)).ToString());
                }
 
You can remove the null check or leave it. The warning is meaningless.
Thanks Lokai, now i'll try with System.Net.Mail.SmtpClient.

Should i put in git the warning solution?, If someone accept the solution.
 
You mean you want to do a pull request for the changes you made?

You can do that if you want.
 
Back