UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

[SVN] [Copern] code cleaning: scrolls of transc/105PS

Status
Not open for further replies.
[SVN] [Copern] code cleaning: scrolls of transc/105PS

situation at the moment: Our code quality sucks, but generally it's not really really bad.

in this report: in Scripts/Engines/CannedEvil/ChampionSpawn.cs I fixed the type of scrolls the protector should have, but in doing this I poorly written the part //Justice Reward 2 times, for 105PSes and Fel SoTs.
That IS horribile.

The risk I am going (and you are going too) to run is:
[2009-12-11 17:17:50] <@ASayre-> if you commit that to the svn I will hunt you down and attack you with a rusty spoon :p
and being it already in the SVN... *gosh* :-P

Note: no one bashed me for this specific one, it's an initiative of mine. That quoted phrase was about ToTs before the cleanup... but better taking it as a general rule.
 

Copern

Sorceror
Re: code cleaning: scrolls of transc/105PS

I'll work on this as I find the time. I'll be consolidating Scroll of Transcendence, Scroll of Alacrity, Stat Scrolls, and Power Scrolls into a base class (SpecialScroll?) which should cut down on some of the redundancy. Working serialization with current scrolls will be a given.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] code cleaning: scrolls of transc/105PS

Quick note: Noticed a bug for Scrolls of Transcendence while working on this. If you were under that skill's cap, but the skill's current amount plus the scrolls added skill was greater than the skill's cap, it would set the skill value of the scroll to the skill's cap minus your current skill.

So let's say you had 99.5 tactics with a skill cap of 100 and were at your total skill cap (say 700 skill points). If you used a 1.0 skill scroll of trans in tactics, it would fail to be used, give you the error message, and the skill value of it would be set to 0.5. It would only show up if you [props it and not clicked it though since the name props aren't invalidated on use. I've included a fix for this bug. Unfortunately there's nothing I can do for current scrolls affected by it. No patch yet atm.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] code cleaning: scrolls of transc/105PS

And here we are. Consolidated most of the code in the scrolls to a base class. Got rid of as much redundancy as I could though there's a still may be a couple small things. Tried the make the logic as straightforward as possible and easier to read I think (especially in the Use methods of the scrolls) while still maintaining the same functionality. Though I fixed the bug in current SVN that I mentioned earlier. Serialization should work properly. Hopefully I didn't miss anything, sleepy at the moment.
 

Attachments

  • specialscrollcleanup.patch
    62.5 KB · Views: 10
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

Since an issue with Bedlam champ not dropping Transcendence scrolls has come about (Located Here). Here is a simple fix to get it working properly. Based off of SVN 491 and the files contained in this thread.
 

Attachments

  • MalasChampScrollFix.diff
    6.2 KB · Views: 4
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

Callandor2k;687709 said:
Since an issue with Bedlam champ not dropping Transcendence scrolls has come about (Located Here). Here is a simple fix to get it working properly. Based off of SVN 491 and the files contained in this thread.

That's good.

I'd like to ask, anyway, if you can post 1 patch doing the whole thing, and to avoid "patch for a patch".

This because, even if I double and triple-check, when things are ready I look for the last patch uploaded, not counting 1 patch will make my job easier :)
 

Copern

Sorceror
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

Combined my cleanup with Callandor's fix.
 

Attachments

  • scrollcleanup+malaschampscroll.patch
    62.6 KB · Views: 6
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

I went to test it and started soloing a Coon in Fel carrying a protector.

As I got the message "You have been rewarded with a scroll of power!" I got the message the server has crashed.
note: that was the first scroll I got.

... what logs say about?
 

Athena

Account Terminated
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

osd_daedalus;690591 said:
I went to test it and started soloing a Coon in Fel carrying a protector.

As I got the message "You have been rewarded with a scroll of power!" I got the message the server has crashed.
note: that was the first scroll I got.

... what logs say about?

There's no crash log as it locked up and didn't crash.
 
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

Seer Athena;690597 said:
There's no crash log as it locked up and didn't crash.

that's true, since I didn't had "Connection Lost". But I had the The server has crashed message.
 

Athena

Account Terminated
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

I've just done a few champion spawns and got SoT's without the server freezing. Can you post exactly where you were and what you were using skill/spell wise so we can try to pin point the problem.
 
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

Seer Athena;690609 said:
I've just done a few champion spawns and got SoT's without the server freezing. Can you post exactly where you were and what you were using skill/spell wise so we can try to pin point the problem.

The last thing I did was wither. There weren't summons casted by me in that moment.
I was in Fel Coon exactly on the left side of the champion area (if you consider the altar as center, I was on the left immediately after the water).

Near to the same position there was a hidden character in animal form (bake kitsune) protecting me, being knight of justice.
 

Athena

Account Terminated
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

Ok, I managed to crash the server, it happens when the SoT or a power scroll goes to a protector and yourself, here's the crash log, it doesn't crash if you don't have a protector:


Exception:
System.MissingMethodException: Method not found: 'Default constructor not found...ctor() of Server.Items.PowerScroll'.
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000]
at System.Activator.CreateInstance (System.Type type) [0x00000]
at Server.Engines.CannedEvil.ChampionSpawn.GiveScrollTo (Server.Mobile killer, Server.Items.SpecialScroll scroll) [0x00000]
at Server.Engines.CannedEvil.ChampionSpawn.OnSlice () [0x00000]
at Server.Engines.CannedEvil.SliceTimer.OnTick () [0x00000]
at Server.Timer.Slice () [0x00000]
at Server.Core.Main (System.String[] args) [0x00000]


Setting this back to development.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] [Copern] code cleaning: scrolls of transc/105PS

*smacks head* Whoops... Calling a reflection method to attempt to create an instance of something with no parameters doesn't exactly work too well when there's no constructor for such a case. Can't believe I didn't notice that. :rolleyes:

Thanks for picking that up and posting the log. Will have a patch shortly.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] [Copern] code cleaning: scrolls of transc/105PS

And here we go.
 

Attachments

  • specialscrollcleanup2.patch
    63.3 KB · Views: 4
Re: [TESTING-TC] [Copern] code cleaning: scrolls of transc/105PS

Pont, Allex and me just did a Bedlam champ and we got no SoT. Instead, we got blood as champ artifact :p

Of course, 1 champ says nothing. We have to do it at least other 2-3 times.
 
Status
Not open for further replies.
Top