RunUO 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!

New Main.cs Feature...

Ravenal

Knight
New Main.cs Feature... Core Userfriendly

I wanted to spend the extra time to develop a new main so I did...


What I did is a new feature that I believe might work for other places too... This feature might be neat for those who use Motd versions and people may want to know what version the shard is at or something sooo I developed a XML version easy editable...

Simple Installation...

Add your main.cs into the correct location, if you have already reworked your main.cs to do something then I would advice you to know what your doing.... Otherwise go ahead and override :)...

At the first time you load it it will restart the core because it is creating the Core.xml file which contains some properties such as this...

RunUO Default (Notice NULL) means that RunUO does not have a Stage, if it was RC then that is where it would have gone...

Also notice that if you change the "Shardname" to something else, it will display that RunUO Message underneath it... I would be kind enought if you did not remove this part :) Afterall RunUO deserves some credit for their work...

Also to find these Properties for your shard stuff all you have to do is do...

Core.ReadShardVersion and it will put it in there :D

Notice now, if you Wanted to make your Offical ShardName work well in the ServerList.cs, you need to Change the const to static and it will then Display the shard name if you change it there... Thus will allow you to change the entire shard files or version etc. without having to search and find each script, just incase you decide to change something like your website or something...

WARNING: IF YOU TRY TO CHANGE THE CORE.XML WHILE YOUR SHARD IS RUNNING, THE CHANGES WILL NOT CHANGE UNTIL YOU RESTART....

PHP:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 
- <ShardConfig>
  <ShardProperties ShardName="RunUO" ShardStage="NULL" ShardWebsite="www.runuo.com" ShardVersion="1.0.0, Build 42853" ShowTodayDate="false" /> 
  </ShardConfig>

This is my version

PHP:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ShardConfig>
		<ShardProperties 
		ShardName="Paragonix" 
		ShardStage="Closed Alpha" 
		ShardWebsite="http://paragonix.uniphix.com" 
		ShardVersion="1.0.0a"
		ShowTodayDate="true" />
</ShardConfig>

Heres a Comparaison of my shard's Main and the one that is defaulted...

 

Attachments

  • Main.cs
    15.8 KB · Views: 97

Ravenal

Knight
Any sugesstions or possible features you would like me to fix or add just let me know.

Any bugs on this let me know and I'll fix it asap...

Thanks,

awakenlands
 

Greystar

Wanderer
awakenlands said:
Any sugesstions or possible features you would like me to fix or add just let me know.

Any bugs on this let me know and I'll fix it asap...

Thanks,

awakenlands

All I have to say at this point is nice little mod
 

Greystar

Wanderer
awakenlands said:
Has anyone had issues with this??? And seriously would like to know who has been using this ???


I've been using this and had no problems at this point. If I do I'll let you know.
 

cuy782002

Wanderer
:confused:
ok in english what is this going to change sry for a stupid question but i just have to ask
and were do i put it i looked for the main.cs and didnt come up wif anything

please help a newbie out
 

Phantom

Knight
cuy782002 said:
:confused:
ok in english what is this going to change sry for a stupid question but i just have to ask
and were do i put it i looked for the main.cs and didnt come up wif anything

please help a newbie out

This is a core modification, to use this, you would have to recompile the core. If your a newbie and don't know how to do this, I suggest you don't even attempt it.

awakenlands

You do understand this would have been possible without a core modification right? Although it wouldn't be displayed at the top, but then again I didn't look at where your code is displayed.
 

Ravenal

Knight
Yes Phantom I do realize this, but instead of recompiling the core over and over just to change information in there I allowed a XML file that will be read on the application startup ;)...

I use this same method for my general Shard name from ShardList.cs, MOTD.cs and many other files...

It was simple and easy to make *shurgs*
 
Top