Warnings ServUO Fresh Install (Linux)

fdesu

Member
Feb 25, 2019
15
1
31
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?
 

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,266
211
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
+ 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 = …"
 
  • Like
Reactions: Zavreyon

fdesu

Member
Feb 25, 2019
15
1
31
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:
  • Like
Reactions: Zavreyon

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,266
211
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
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);
                }
            }
 
  • Like
Reactions: Zavreyon

fdesu

Member
Feb 25, 2019
15
1
31
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());
                }
 

fdesu

Member
Feb 25, 2019
15
1
31
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.