<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://uodemo.uo98.org/index.php?action=history&amp;feed=atom&amp;title=Server_Code</id>
		<title>Server Code - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://uodemo.uo98.org/index.php?action=history&amp;feed=atom&amp;title=Server_Code"/>
		<link rel="alternate" type="text/html" href="https://uodemo.uo98.org/index.php?title=Server_Code&amp;action=history"/>
		<updated>2026-04-28T17:42:08Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0-alpha</generator>

	<entry>
		<id>https://uodemo.uo98.org/index.php?title=Server_Code&amp;diff=145&amp;oldid=prev</id>
		<title>Batlin: /* The runtime engine */</title>
		<link rel="alternate" type="text/html" href="https://uodemo.uo98.org/index.php?title=Server_Code&amp;diff=145&amp;oldid=prev"/>
				<updated>2010-01-21T12:06:21Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;The runtime engine&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 12:06, 21 January 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot; &gt;Line 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The runtime engine executes the scripts, scripts are linked either in the template stable (a file containing all object definitions) or the skill table (a file containing all skill definitions).&amp;#160; Thus the runtime engine is not really an engine on its own but gets called through player interaction and through the time manager in case of events.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The runtime engine executes the scripts, scripts are linked either in the template stable (a file containing all object definitions) or the skill table (a file containing all skill definitions).&amp;#160; Thus the runtime engine is not really an engine on its own but gets called through player interaction and through the time manager in case of events.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A complete list of commands the scripts can use has been published here: [[Command List|Ultima Online Demo Command List]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The event system ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The event system ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Batlin</name></author>	</entry>

	<entry>
		<id>https://uodemo.uo98.org/index.php?title=Server_Code&amp;diff=108&amp;oldid=prev</id>
		<title>Batlin: Protected &quot;Server Code&quot; ([edit=sysop] (indefinite) [move=sysop] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://uodemo.uo98.org/index.php?title=Server_Code&amp;diff=108&amp;oldid=prev"/>
				<updated>2009-08-21T13:19:32Z</updated>
		
		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/index.php?title=Server_Code&quot; title=&quot;Server Code&quot;&gt;Server Code&lt;/a&gt;&amp;quot; ([edit=sysop] (indefinite) [move=sysop] (indefinite))&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:19, 21 August 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Batlin</name></author>	</entry>

	<entry>
		<id>https://uodemo.uo98.org/index.php?title=Server_Code&amp;diff=107&amp;oldid=prev</id>
		<title>Batlin: Created page with '== The core versus The runtime engine. ==  The server side consist of atleast 3 big engines:  1) the communication engine (sending and receiving packets)  2) the time manager  3)...'</title>
		<link rel="alternate" type="text/html" href="https://uodemo.uo98.org/index.php?title=Server_Code&amp;diff=107&amp;oldid=prev"/>
				<updated>2009-08-21T13:19:12Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;== The core versus The runtime engine. ==  The server side consist of atleast 3 big engines:  1) the communication engine (sending and receiving packets)  2) the time manager  3)...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== The core versus The runtime engine. ==&lt;br /&gt;
&lt;br /&gt;
The server side consist of atleast 3 big engines:&lt;br /&gt;
 1) the communication engine (sending and receiving packets)&lt;br /&gt;
 2) the time manager&lt;br /&gt;
 3) the runtime engine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The communication engine ==&lt;br /&gt;
&lt;br /&gt;
Inside the main loop of the server the sequence is always:&lt;br /&gt;
 1) receive packets&lt;br /&gt;
 2) send packets&lt;br /&gt;
 3) handle packets&lt;br /&gt;
 4) execute the time manager&lt;br /&gt;
&lt;br /&gt;
After packets are received they are handled immediately. If a new packet needs to be sent it will be put in a buffer that's send on the next loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The runtime engine ==&lt;br /&gt;
&lt;br /&gt;
The runtime engine executes the scripts, scripts are linked either in the template stable (a file containing all object definitions) or the skill table (a file containing all skill definitions).  Thus the runtime engine is not really an engine on its own but gets called through player interaction and through the time manager in case of events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The event system ==&lt;br /&gt;
&lt;br /&gt;
Inside the [[scripts]] we can find event function definitions. Since scripts are attached (dynamically) to objects those events are attached to the objects too. When an event is triggered then the related event function is executed (operating on the specific object). The events are triggered throughout the server code depending on the event meaning. For example, the &amp;quot;''washit''&amp;quot; (was hit) event is triggered when damage is applied to a mobile and when &amp;quot;''doDamageXXX''&amp;quot; functions are called. Another method of triggering an event is the &amp;quot;''triggerScript''&amp;quot; function which is used in some scripts like the &amp;quot;''dragonai''&amp;quot; script.&lt;br /&gt;
&lt;br /&gt;
Event definitions can preceeded with a number between 0 and 1000. This number is a chance indicator. The following check can be found inside the server code:&lt;br /&gt;
 // EIP=004CE288&lt;br /&gt;
 if(event_chance == 1000)&lt;br /&gt;
 {&lt;br /&gt;
   // add event to the execute list&lt;br /&gt;
 }&lt;br /&gt;
 else if(rand() &amp;amp; 0x3FF &amp;lt; event_chance)&lt;br /&gt;
 {&lt;br /&gt;
   // add event to the execute list&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Event functions must return a number either 0 or 1. When the returned value is 0 then the remaining triggers are not executed. This was found by testing only and has not yet been proved inside the server code!&lt;/div&gt;</summary>
		<author><name>Batlin</name></author>	</entry>

	</feed>