Vorspire
Knight
[RUO 2.0] Integrated Web-Server
----------
SYSTEM REQUIREMENTS
----------
For Use
For Development
*** Only required for custom WebObjects and/or CoreModules that are supplied in the "Custom" directory with the initial download.
----------
PACKAGE:
----------
namsepace WebServer
namsepace WebServer.HTDOCS
namsepace WebServer.Modules
----------
The time has come, to finally integrate some sort of web-server service into RunUO. One that is easy modded and can deliver the performance and security required to make this all worth-while.
While the current DLL I have wrote is quite powerful in terms of dynamics, I am releasing it here with one simple function;
To provide any shard with a reliable, fast and real-time "Shard Status" service, without the need for writing complicated PHP scripts.
I will have more information to come and possibly many updates, plugins and custom pages to expand this little package into something that allows you to have complete control over your shard from your web-browser.
----------
The Basics
----------
----------
This WebServer comes with (almost) full documentation, with as accurate descriptions as I could manage.
Over 250 comments and annotations to help you develop your own special custom virtual pages.
----------
Hints and Tips
----------
WebObjects:
Virtual WebObjects are WebObjects that can be dynamically called into memory, serve an HttpRequest and transport the requested data back to the HttpResponse, they act exactly as any Web-Page should.
All physical files located in "RunUO.exe/WebServer/HTDOCS/" are also called into memory as Physical WebObjects.
This means that any "web page" that may be requested, can be served with a physical file in the "RunUO.exe/WebServer/HTDOCS/" directory, or by a >>CUSTOM<< WebObject script located in the "RunUO.exe/Scripts/WebServer/" directory.
The VirtualName is responsible for directing the request to the right file and as long as you set the right ContentType, you can use any file extension you wish, or none at all For example: "status.vor" still produces XML data.
The WebObjects were partly inspired by the way the RunUO Gumps system works and uses 3 main methods for inserting data into the body of a custom WebObject;
"AddHTML", "AddText" and "AddByte".
The Status Page can be accessed via; http://<host>/RunUO/status.vor
The Test Image Page can be accessed via; http://<host>/RunUO/test_image.jpg
Core Modules:
These Core Modules are important to the WebServer system, there are currently 6 embedded Core Modules in the program that handle common tasks such as Flood Protection, Garbage Collection, WebObjects Registry and even the actual HttpListener service itself.
Core Modules are basically a 'plug-in' class for the WebServer system, that are loaded before the main Listener and are used to handle special tasks.
Custom Core Modules can be plugged into the WebServer system by adding the relevant scripts to the "RunUO.exe/Scripts/WebServer/Modules/", there is a sample Core Module supplied that is the main set-up to use when creating any custom Core Module.
Core Modules are started in a prioritized order, which you can select in the CoreModuleAttribute arguments.
You can not change the priority of the 6 core WebServer Core Modules.
When using the CoreModuleAttribute, you must always supply the Type argument with the relevant Type of the class you are attaching the attribute to.
For example, if you were to create a custom Core Module named "HelloWorld", the Type argument of the CoreModuleAttribute should also be "HelloWorld".
The Name argument is completely custom and can be anything you wish.
I hope that's enough to get you started.
Please remember that this software is currently in the UNSTABLE-BETA stage and I am not responsible for any damage or data loss as a result of using this system, although I can *almost* guarantee that no damage or data-loss could possibly happen
I will be working on and updating this project quite frequently, however, I can not exactly say when new updates may become available on the RunUO Forums.
I hope you enjoy this package, the next release will yield many new features and more custom Core Modules and advanced custom WebObjects.
Extra Information
----------
SYSTEM REQUIREMENTS
----------
For Use
- Windows User Account with Administrator rights
- Windows XP Home Edition
- Windows XP Professional x64 Edition
- Windows Server 2003
- Windows Service Pack 2
- .NET Framework 2.0
- RunUO 2.0 ***
- Ultima Online SDK 2.X ***
For Development
- Windows XP Home Edition
- Windows XP Professional x64 Edition
- Windows Server 2003
- Windows Service Pack 2
- .NET Framework 2.0
- RunUO 2.0 ***
- Ultima Online SDK 2.X ***
*** Only required for custom WebObjects and/or CoreModules that are supplied in the "Custom" directory with the initial download.
----------
PACKAGE:
----------
namsepace WebServer
namsepace WebServer.HTDOCS
namsepace WebServer.Modules
----------
The time has come, to finally integrate some sort of web-server service into RunUO. One that is easy modded and can deliver the performance and security required to make this all worth-while.
While the current DLL I have wrote is quite powerful in terms of dynamics, I am releasing it here with one simple function;
To provide any shard with a reliable, fast and real-time "Shard Status" service, without the need for writing complicated PHP scripts.
I will have more information to come and possibly many updates, plugins and custom pages to expand this little package into something that allows you to have complete control over your shard from your web-browser.
----------
The Basics
----------
Code:
Thanks for taking interest in this project.
Here are the simple installation instructions for RunUO 2.0+
1)
Copy the entire contents of this package to the local relative directory for RunUO.exe, so that RunUO.exe and WebServer.dll are in the same directory.
2)
Browse to your RunUO "Scripts" directory and create a new directory named "WebServer".
The resulting path should be;
RunUO.exe/Scripts/WebServer/
3)
Browse to the "Custom" directory; "RunUO.exe/WebServer/Custom/" and >>MOVE<< the entire contents, including the script files, to the new "WebServer" folder you just created.
The resulting paths should be;
RunUO.exe/Scripts/WebServer/Modules/
RunUO.exe/Scripts/WebServer/WebObjects/
4)
Remove the trailing dash from the end of these files:
Initializer.cs-
StatusPage.wsobj.cs-
ItemCatalog.wsobj.cs-
Paperdoll.wsobj.cs-
5)
Check Initializer.cs to see if the configuration options are to your liking.
6)
Browse to your RunUO data folder; "RunUO.exe/Data/" and open "Assemblies.cfg".
Add a new line to the list; "WebServer.dll", save and close.
7)
Everything should be ready to go. Boot up your shard and test your WebServer by visitng;
http://localhost/index.html
Alternatively, visit www.whatismyip.com to find out your IP address and do the following:
http://<your_ip_address>/index.html
8)
If that works, then you have successfully set up your WebServer system, congratulations :)
----------
This WebServer comes with (almost) full documentation, with as accurate descriptions as I could manage.
Over 250 comments and annotations to help you develop your own special custom virtual pages.
----------
Hints and Tips
----------
WebObjects:
Virtual WebObjects are WebObjects that can be dynamically called into memory, serve an HttpRequest and transport the requested data back to the HttpResponse, they act exactly as any Web-Page should.
All physical files located in "RunUO.exe/WebServer/HTDOCS/" are also called into memory as Physical WebObjects.
This means that any "web page" that may be requested, can be served with a physical file in the "RunUO.exe/WebServer/HTDOCS/" directory, or by a >>CUSTOM<< WebObject script located in the "RunUO.exe/Scripts/WebServer/" directory.
The VirtualName is responsible for directing the request to the right file and as long as you set the right ContentType, you can use any file extension you wish, or none at all For example: "status.vor" still produces XML data.
The WebObjects were partly inspired by the way the RunUO Gumps system works and uses 3 main methods for inserting data into the body of a custom WebObject;
"AddHTML", "AddText" and "AddByte".
The Status Page can be accessed via; http://<host>/RunUO/status.vor
The Test Image Page can be accessed via; http://<host>/RunUO/test_image.jpg
Code:
************************
************************
[B]ALL WebObjects MUST be assigned to the WebServer.HTDOCS namespace in order to be accessed by the WebServer HttpRequest handling system.
However, you may assign additional names to the namespace, which will represent the URL you use in your browser.
For example, "namespace WebServer.HTDOCS.Public" would be the 'relative' path for the URL "http://<host>/Public/"
Any WebObject class assigned to the custom namespace will be accessed from that same URL appended with the WebObjects' VirtualName, IE; "http://<host>/Public/HelloWorld.obj"[/B]
************************
************************
These Core Modules are important to the WebServer system, there are currently 6 embedded Core Modules in the program that handle common tasks such as Flood Protection, Garbage Collection, WebObjects Registry and even the actual HttpListener service itself.
Core Modules are basically a 'plug-in' class for the WebServer system, that are loaded before the main Listener and are used to handle special tasks.
Custom Core Modules can be plugged into the WebServer system by adding the relevant scripts to the "RunUO.exe/Scripts/WebServer/Modules/", there is a sample Core Module supplied that is the main set-up to use when creating any custom Core Module.
Core Modules are started in a prioritized order, which you can select in the CoreModuleAttribute arguments.
You can not change the priority of the 6 core WebServer Core Modules.
When using the CoreModuleAttribute, you must always supply the Type argument with the relevant Type of the class you are attaching the attribute to.
For example, if you were to create a custom Core Module named "HelloWorld", the Type argument of the CoreModuleAttribute should also be "HelloWorld".
The Name argument is completely custom and can be anything you wish.
Code:
************************
************************
[B]ALL Core Modules should be assigned to the "WebServer.Modules" namepsace to avoid any unwanted ambiguity between WebServer and RunUO assemblies.[/B]
************************
************************
I hope that's enough to get you started.
Please remember that this software is currently in the UNSTABLE-BETA stage and I am not responsible for any damage or data loss as a result of using this system, although I can *almost* guarantee that no damage or data-loss could possibly happen
I will be working on and updating this project quite frequently, however, I can not exactly say when new updates may become available on the RunUO Forums.
I hope you enjoy this package, the next release will yield many new features and more custom Core Modules and advanced custom WebObjects.
WEBSERVER_LITE_README.TXT said:WebServerLite.exe is an application host for the WebServer DLL assembly, which can allow the WebServer to run as a stand-alone application.
If you run WebServerLite.exe, it will not include any of the custom Core Modules or WebObjects from your "RunUO.exe/Scripts/" directory, as it is defaulted to the local "WebServer/Custom/" directory.
WebServer.cfg was specifically created to provide a RunTime configuraton for WebServerLite.exe and will not, in any way, affect the RunUO-WebServer configuration.
To find out how to edit the RunUO-WebServer configuration, please refer to "RUNUO_INSTALL.TXT".
-Vorspire
Extra Information