diff --git a/OGS.sql b/OGS.sql deleted file mode 100644 index 5efaf97ef4..0000000000 --- a/OGS.sql +++ /dev/null @@ -1,134 +0,0 @@ --- phpMyAdmin SQL Dump --- version 2.6.3-pl1 --- http://www.phpmyadmin.net --- --- Host: 127.0.0.1 --- Generation Time: Feb 16, 2007 at 09:54 PM --- Server version: 4.0.23 --- PHP Version: 4.4.0 --- --- Database: `OGS` --- - --- -------------------------------------------------------- - --- --- Table structure for table `Grid_settings` --- - -DROP TABLE IF EXISTS `Grid_settings`; -CREATE TABLE IF NOT EXISTS `Grid_settings` ( - `Setting` text NOT NULL, - `value` text NOT NULL -) TYPE=MyISAM; - --- --- Dumping data for table `Grid_settings` --- - -INSERT INTO `Grid_settings` (`Setting`, `value`) VALUES ('highest_LLUUID', '51AEFF430000000000000000000002fd'); - --- -------------------------------------------------------- - --- --- Table structure for table `foreign_profiles` --- - -DROP TABLE IF EXISTS `foreign_profiles`; -CREATE TABLE IF NOT EXISTS `foreign_profiles` ( - `userprofile_LLUUID` varchar(32) NOT NULL default '', - `foreigngrid` text NOT NULL, - `profile_firstname` text NOT NULL, - `profile_lastname` text NOT NULL, - `profile_passwdmd5` text NOT NULL, - `homesim_ip` text NOT NULL, - `homesim_port` int(11) NOT NULL default '0', - `homeasset_url` text NOT NULL, - `homeuser_url` text NOT NULL, - `look_at` text NOT NULL, - `region_handle` text NOT NULL, - `position` text NOT NULL, - PRIMARY KEY (`userprofile_LLUUID`) -) TYPE=MyISAM; - --- --- Dumping data for table `foreign_profiles` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `local_user_profiles` --- - -DROP TABLE IF EXISTS `local_user_profiles`; -CREATE TABLE IF NOT EXISTS `local_user_profiles` ( - `userprofile_LLUUID` varchar(32) NOT NULL default '', - `profile_firstname` text NOT NULL, - `profile_lastname` text NOT NULL, - `profile_passwdmd5` text NOT NULL, - `homesim_ip` text NOT NULL, - `homesim_port` int(11) NOT NULL default '0', - `homeasset_url` text NOT NULL, - `look_at` text NOT NULL, - `region_handle` text NOT NULL, - `position` text NOT NULL, - PRIMARY KEY (`userprofile_LLUUID`) -) TYPE=MyISAM; - --- --- Dumping data for table `local_user_profiles` --- - -INSERT INTO `local_user_profiles` (`userprofile_LLUUID`, `profile_firstname`, `profile_lastname`, `profile_passwdmd5`, `homesim_ip`, `homesim_port`, `homeasset_url`, `look_at`, `region_handle`, `position`) VALUES ('51AEFF43000000000000000000000100', 'Test', 'User', '$1$098f6bcd4621d373cade4e832627b4f6', '127.0.0.1', 1000, 'http://dummyassetserver.net/', 'r-0.57343, r-0.819255,r0', 'r255232,254976', 'r41.6589, r100.8374, r22.5072'); - --- -------------------------------------------------------- - --- --- Table structure for table `region_profiles` --- - -DROP TABLE IF EXISTS `region_profiles`; -CREATE TABLE IF NOT EXISTS `region_profiles` ( - `RegionID` varchar(32) NOT NULL default '', - `Name` text NOT NULL, - `GridLocX` bigint(20) NOT NULL default '0', - `GridLocY` bigint(20) NOT NULL default '0', - `region_handle` text NOT NULL, - `ip_addr` text NOT NULL, - `port` text NOT NULL, - PRIMARY KEY (`RegionID`) -) TYPE=MyISAM; - --- --- Dumping data for table `region_profiles` --- - -INSERT INTO `region_profiles` (`RegionID`, `Name`, `GridLocX`, `GridLocY`, `region_handle`, `ip_addr`, `port`) VALUES ('51AEFF43000000000000000000000200', 'Test sandbox', 997, 996, 'r255232,254976', '127.0.0.1', '1000'); - --- -------------------------------------------------------- - --- --- Table structure for table `sessions` --- - -DROP TABLE IF EXISTS `sessions`; -CREATE TABLE IF NOT EXISTS `sessions` ( - `session_id` varchar(32) NOT NULL default '', - `secure_session_id` text NOT NULL, - `agent_id` text NOT NULL, - `session_start` datetime NOT NULL default '0000-00-00 00:00:00', - `session_end` datetime NOT NULL default '0000-00-00 00:00:00', - `session_active` tinyint(4) NOT NULL default '0', - `current_location` text NOT NULL, - `remote_ip` text NOT NULL, - `circuit_code` int(11) NOT NULL default '0', - PRIMARY KEY (`session_id`) -) TYPE=MyISAM; - --- --- Dumping data for table `sessions` --- - -INSERT INTO `sessions` (`session_id`, `secure_session_id`, `agent_id`, `session_start`, `session_end`, `session_active`, `current_location`, `remote_ip`, `circuit_code`) VALUES ('51AEFF430000000000000000000002fc', '51AEFF430000000000000000000002fd', '51AEFF43000000000000000000000100', '2007-02-16 21:13:19', '0000-00-00 00:00:00', 1, 'r255232,254976', '81.174.255.70', 0); diff --git a/README b/README deleted file mode 100644 index f2942952d0..0000000000 --- a/README +++ /dev/null @@ -1,22 +0,0 @@ -Some basic instructions on how to use OpenSim/OGS for hackers and geeks -------------------------------------------------- - -1.First, either get in touch with a grid owner or install the OGS server components on your own server. -2.Ask the grid owner to send you keys over a secure channel (encrypted email, paper mail, phone, encrypted IM/IRC). If you and the grid owner are not concerned about security (YOU SHOULD BE!!!) then this exchange can be done over any communications channel. -3.Edit src/Config.cs to reflect your changes or if the grid owner has provided you with a template/custom database, drop opensim.yap into bin/ -4.If you edited src/Config.cs then run "nant build" at the root directory -5.With mono on Linux/BSD cd into bin/ and run "mono OpenSim.exe", On win32 just run OpenSim.exe -5.Login to the grid with a standard viewer and find your sim (note that at certain times the SVN version does not allow logins) - -Some basic instructions on how to use OpenSim/OGS for the laymen -------------------------------------------------- - -1.Ensure you either have mono or the .NET framework runtime installed -2.Find a grid owner -3.Ask the grid owner to send you connection instructions -4.Either install the grid owner's opensim.yap by placing it into the same directory as OpenSim.exe or follow their instructions -5.On Linux/BSD, go to a command prompt and type: -cd /path/to/where/you/downloaded/ -cd bin/ -mono OpenSim.exe -6.Login to the grid in the normal way diff --git a/bin/Axiom.MathLib.dll b/bin/Axiom.MathLib.dll deleted file mode 100644 index 21ce3a8b18..0000000000 Binary files a/bin/Axiom.MathLib.dll and /dev/null differ diff --git a/bin/Db4objects.Db4o.dll b/bin/Db4objects.Db4o.dll deleted file mode 100755 index be976a108c..0000000000 Binary files a/bin/Db4objects.Db4o.dll and /dev/null differ diff --git a/bin/avatar-template.dat b/bin/avatar-template.dat deleted file mode 100644 index 286b75d79b..0000000000 Binary files a/bin/avatar-template.dat and /dev/null differ diff --git a/bin/libsecondlife.dll b/bin/libsecondlife.dll deleted file mode 100755 index 89d692a324..0000000000 Binary files a/bin/libsecondlife.dll and /dev/null differ diff --git a/bin/log4net.dll b/bin/log4net.dll deleted file mode 100644 index ffc57e1125..0000000000 Binary files a/bin/log4net.dll and /dev/null differ diff --git a/caffeine.sh b/caffeine.sh deleted file mode 100644 index 6387fffe0b..0000000000 --- a/caffeine.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# WILL NOT BUILD WITHOUT THIS FILE, VERY IMPORTANT! - -kill -9 `/var/run/brain/pituaritygland/melatonin` -/usr/sbin/service norephrine start -rm -rf /brain/receptors/adenosine/* - -# Caused a conflict with taste.buds, removed for now -# drink /var/drinks/coffee - -# We use this instead, enables implementation of the WINGS (Will Interefere with Need for General Sleep) protocol -drink /var/drinks/redbull diff --git a/genvers.sh b/genvers.sh deleted file mode 100755 index 3da91d7ec6..0000000000 --- a/genvers.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -MAJOR=0 -MINOR=1 -BUILD=`date +%s` -REVISION=`svnversion | sed s/:// | sed s/M//` -REALREVISION=`svnversion` -cat src/VersionInfo.cs.template | sed s/@@VERSION/"$MAJOR.$MINOR, Build $BUILD, Revision $REALREVISION"/g >src/VersionInfo.cs -echo -n $MAJOR.$MINOR.*.$REVISION >VERSION diff --git a/ogs/assetserver/assets/00000000000000005005000000000005/data b/ogs/assetserver/assets/00000000000000005005000000000005/data deleted file mode 100644 index e6840e2139..0000000000 Binary files a/ogs/assetserver/assets/00000000000000005005000000000005/data and /dev/null differ diff --git a/ogs/assetserver/assets/00000000000000007007000000000006/data b/ogs/assetserver/assets/00000000000000007007000000000006/data deleted file mode 100644 index 5ad1fd0f43..0000000000 Binary files a/ogs/assetserver/assets/00000000000000007007000000000006/data and /dev/null differ diff --git a/ogs/assetserver/assets/00000000000000007009000000000008/data b/ogs/assetserver/assets/00000000000000007009000000000008/data deleted file mode 100644 index cd2fd94422..0000000000 Binary files a/ogs/assetserver/assets/00000000000000007009000000000008/data and /dev/null differ diff --git a/ogs/assetserver/assets/66c41e3938f9f75a024e585989bfab73/data b/ogs/assetserver/assets/66c41e3938f9f75a024e585989bfab73/data deleted file mode 100644 index 920c7758c4..0000000000 --- a/ogs/assetserver/assets/66c41e3938f9f75a024e585989bfab73/data +++ /dev/null @@ -1,105 +0,0 @@ -LLWearable version 22 -Female Shape and Outfit 3 Shape -Created by system from avatar's appearance. - permissions 0 - { - base_mask 00082000 - owner_mask 00082000 - group_mask 00082000 - everyone_mask 00082000 - next_owner_mask 00082000 - creator_id 3d924400-038e-6ad9-920b-cfbb9b40585c - owner_id 542ffb8e-8932-49b9-8664-58f53e442797 - last_owner_id 3d924400-038e-6ad9-920b-cfbb9b40585c - group_id 00000000-0000-0000-0000-000000000000 - } - sale_info 0 - { - sale_type not - sale_price 0 - } -type 0 -parameters 82 -1 .21 -2 -.5 -4 -.11 -5 -.1 -6 -.3 -7 -.4 -8 -.5 -10 .7 -11 .34 -12 -.5 -13 0 -14 .04 -15 .58 -17 .56 -18 -.26 -19 -.73 -20 -.34 -21 -.01 -22 1 -23 -.5 -24 -.63 -25 .44 -27 .05 -33 -.24 -34 -.7 -35 -.16 -36 -.2 -37 -.98 -38 -.5 -80 0 -105 .07 -155 -.22 -157 0 -185 -1 -193 .86 -196 -.74 -505 .65 -506 .12 -507 -1.5 -515 0 -517 .16 -518 .8 -629 0 -637 0 -646 .4 -647 1 -649 .36 -650 .85 -652 .49 -653 -1 -656 0 -659 .65 -662 .5 -663 0 -664 0 -665 0 -675 -.15 -676 .26 -678 .28 -682 .27 -683 -.19 -684 -.09 -685 0 -690 .45 -692 .4 -693 -0 -753 -.5 -756 -.08 -758 .24 -759 .6 -760 .11 -764 -.38 -765 -.3 -769 .42 -773 .51 -795 .16 -796 .11 -799 .36 -841 0 -842 -.82 -879 0 -880 0 -textures 0 diff --git a/ogs/assetserver/assets/e0ee49b5a4184df8d3c9a65361fe7f49/data b/ogs/assetserver/assets/e0ee49b5a4184df8d3c9a65361fe7f49/data deleted file mode 100644 index 95cc683422..0000000000 --- a/ogs/assetserver/assets/e0ee49b5a4184df8d3c9a65361fe7f49/data +++ /dev/null @@ -1,52 +0,0 @@ -LLWearable version 22 -Sexy - Female Skin - - permissions 0 - { - base_mask 00086000 - owner_mask 00086000 - group_mask 00000000 - everyone_mask 00000000 - next_owner_mask 00086000 - creator_id 3b659a92-dbf0-4301-8fdc-208d78f00d77 - owner_id 3d924400-038e-6ad9-920b-cfbb9b40585c - last_owner_id 101358d5-469d-4b24-9b85-4dc3c05e635d - group_id 00000000-0000-0000-0000-000000000000 - } - sale_info 0 - { - sale_type not - sale_price 10 - } -type 1 -parameters 26 -108 0 -110 0 -111 0 -116 0 -117 1 -150 0 -162 0 -163 0 -165 0 -700 .01 -701 .5 -702 .26 -703 0 -704 0 -705 .5 -706 .6 -707 0 -708 0 -709 0 -710 0 -711 .5 -712 0 -713 .7 -714 0 -715 0 -775 0 -textures 3 -0 f9261672-5058-9ef8-c0c4-48f43a0b16d4 -5 b6ba53be-b5bf-9a1f-2e19-21daf998429c -6 703f6e24-a1fb-1980-acaf-6ab8a99a5bd5 diff --git a/ogs/assetserver/assetserver_config.inc.php b/ogs/assetserver/assetserver_config.inc.php deleted file mode 100644 index b2199f3ef9..0000000000 --- a/ogs/assetserver/assetserver_config.inc.php +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/ogs/assetserver/index.php b/ogs/assetserver/index.php deleted file mode 100644 index ee20229a58..0000000000 --- a/ogs/assetserver/index.php +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/ogs/common/database.inc.php.tmpl b/ogs/common/database.inc.php.tmpl deleted file mode 100644 index 42ac5ca43e..0000000000 --- a/ogs/common/database.inc.php.tmpl +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/ogs/common/grid_config.inc.php b/ogs/common/grid_config.inc.php deleted file mode 100644 index 0bc6a5eae8..0000000000 --- a/ogs/common/grid_config.inc.php +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/ogs/common/util.inc.php b/ogs/common/util.inc.php deleted file mode 100644 index b931205a29..0000000000 --- a/ogs/common/util.inc.php +++ /dev/null @@ -1,42 +0,0 @@ -\n"); - foreach($data as $name => $value) { - echo(" <$name>$value\n"); - } - echo("\n"); -} - -function rand_uuid() -{ - return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', - mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), - mt_rand( 0, 0x0fff ) | 0x4000, - mt_rand( 0, 0x3fff ) | 0x8000, - mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); -} -?> diff --git a/ogs/common/xmlrpc.inc.php b/ogs/common/xmlrpc.inc.php deleted file mode 100644 index 03c1ee7fdd..0000000000 --- a/ogs/common/xmlrpc.inc.php +++ /dev/null @@ -1,828 +0,0 @@ - htmlspecialchars) - Site: http://scripts.incutio.com/xmlrpc/ - Manual: http://scripts.incutio.com/xmlrpc/manual.php - Made available under the Artistic License: http://www.opensource.org/licenses/artistic-license.php -*/ - - -class IXR_Value { - var $data; - var $type; - function IXR_Value ($data, $type = false) { - $this->data = $data; - if (!$type) { - $type = $this->calculateType(); - } - $this->type = $type; - if ($type == 'struct') { - /* Turn all the values in the array in to new IXR_Value objects */ - foreach ($this->data as $key => $value) { - $this->data[$key] = new IXR_Value($value); - } - } - if ($type == 'array') { - for ($i = 0, $j = count($this->data); $i < $j; $i++) { - $this->data[$i] = new IXR_Value($this->data[$i]); - } - } - } - function calculateType() { - if ($this->data === true || $this->data === false) { - return 'boolean'; - } - if (is_integer($this->data)) { - return 'i4'; - } - if (is_double($this->data)) { - return 'double'; - } - // Deal with IXR object types base64 and date - if (is_object($this->data) && is_a($this->data, 'IXR_Date')) { - return 'date'; - } - if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) { - return 'base64'; - } - if (is_object($this->data)) { - return 'object'; - } - if (!is_array($this->data)) { - return 'string'; - } - /* We have an array - is it an array or a struct ? */ - if ($this->isStruct($this->data)) { - return 'struct'; - } else { - return 'array'; - } - } - function getXml() { - /* Return XML for this value */ - switch ($this->type) { - case 'boolean': - return ''.(($this->data) ? '1' : '0').''; - break; - case 'i4': - return ''.$this->data.''; - break; - case 'double': - return ''.$this->data.''; - break; - case 'string': - return ''.htmlspecialchars($this->data).''; - break; - case 'array': - $return = ''.""; - foreach ($this->data as $item) { - $return .= ' '.$item->getXml().""; - } - $return .= ''; - return $return; - break; - case 'struct': - $return = ''.""; - foreach ($this->data as $name => $value) { - $return .= "$name"; - $return .= $value->getXml().""; - } - $return .= ''; - return $return; - break; - case 'date': - case 'base64': - return $this->data->getXml(); - break; - case 'object': - return $this->data->getXml(); - break; - } - return false; - } - function isStruct($array) { - /* Nasty function to check if an array is a struct or not */ - $expected = 0; - foreach ($array as $key => $value) { - if ((string)$key != (string)$expected) { - return true; - } - $expected++; - } - return false; - } -} - - -class IXR_Message { - var $message; - var $messageType; // methodCall / methodResponse / fault - var $faultCode; - var $faultString; - var $methodName; - var $params; - // Current variable stacks - var $_arraystructs = array(); // The stack used to keep track of the current array/struct - var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array - var $_currentStructName = array(); // A stack as well - var $_param; - var $_value; - var $_currentTag; - var $_currentTagContents; - // The XML parser - var $_parser; - function IXR_Message ($message) { - $this->message = $message; - } - function parse() { - // first remove the XML declaration - $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message); - if (trim($this->message) == '') { - return false; - } - $this->_parser = xml_parser_create(); - // Set XML parser to take the case of tags in to account - xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false); - // Set XML parser callback functions - xml_set_object($this->_parser, $this); - xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); - xml_set_character_data_handler($this->_parser, 'cdata'); - if (!xml_parse($this->_parser, $this->message)) { - /* die(sprintf('XML error: %s at line %d', - xml_error_string(xml_get_error_code($this->_parser)), - xml_get_current_line_number($this->_parser))); */ - return false; - } - xml_parser_free($this->_parser); - // Grab the error messages, if any - if ($this->messageType == 'fault') { - $this->faultCode = $this->params[0]['faultCode']; - $this->faultString = $this->params[0]['faultString']; - } - return true; - } - function tag_open($parser, $tag, $attr) { - $this->currentTag = $tag; - switch($tag) { - case 'methodCall': - case 'methodResponse': - case 'fault': - $this->messageType = $tag; - break; - /* Deal with stacks of arrays and structs */ - case 'data': // data is to all intents and puposes more interesting than array - $this->_arraystructstypes[] = 'array'; - $this->_arraystructs[] = array(); - break; - case 'struct': - $this->_arraystructstypes[] = 'struct'; - $this->_arraystructs[] = array(); - break; - } - } - function cdata($parser, $cdata) { - $this->_currentTagContents .= $cdata; - } - function tag_close($parser, $tag) { - $valueFlag = false; - switch($tag) { - case 'int': - case 'i4': - $value = (int)trim($this->_currentTagContents); - $this->_currentTagContents = ''; - $valueFlag = true; - break; - case 'double': - $value = (double)trim($this->_currentTagContents); - $this->_currentTagContents = ''; - $valueFlag = true; - break; - case 'string': - $value = (string)trim($this->_currentTagContents); - $this->_currentTagContents = ''; - $valueFlag = true; - break; - case 'dateTime.iso8601': - $value = new IXR_Date(trim($this->_currentTagContents)); - // $value = $iso->getTimestamp(); - $this->_currentTagContents = ''; - $valueFlag = true; - break; - case 'value': - // "If no type is indicated, the type is string." - if (trim($this->_currentTagContents) != '') { - $value = (string)$this->_currentTagContents; - $this->_currentTagContents = ''; - $valueFlag = true; - } - break; - case 'boolean': - $value = (boolean)trim($this->_currentTagContents); - $this->_currentTagContents = ''; - $valueFlag = true; - break; - case 'base64': - $value = base64_decode($this->_currentTagContents); - $this->_currentTagContents = ''; - $valueFlag = true; - break; - /* Deal with stacks of arrays and structs */ - case 'data': - case 'struct': - $value = array_pop($this->_arraystructs); - array_pop($this->_arraystructstypes); - $valueFlag = true; - break; - case 'member': - array_pop($this->_currentStructName); - break; - case 'name': - $this->_currentStructName[] = trim($this->_currentTagContents); - $this->_currentTagContents = ''; - break; - case 'methodName': - $this->methodName = trim($this->_currentTagContents); - $this->_currentTagContents = ''; - break; - } - if ($valueFlag) { - /* - if (!is_array($value) && !is_object($value)) { - $value = trim($value); - } - */ - if (count($this->_arraystructs) > 0) { - // Add value to struct or array - if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') { - // Add to struct - $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value; - } else { - // Add to array - $this->_arraystructs[count($this->_arraystructs)-1][] = $value; - } - } else { - // Just add as a paramater - $this->params[] = $value; - } - } - } -} - - -class IXR_Server { - var $data; - var $callbacks = array(); - var $message; - var $capabilities; - function IXR_Server($callbacks = false, $data = false) { - $this->setCapabilities(); - if ($callbacks) { - $this->callbacks = $callbacks; - } - $this->setCallbacks(); - $this->serve($data); - } - function serve($data = false) { - if (!$data) { - global $HTTP_RAW_POST_DATA; - if (!$HTTP_RAW_POST_DATA) { - die('XML-RPC server accepts POST requests only.'); - } - $data = $HTTP_RAW_POST_DATA; - } - $this->message = new IXR_Message($data); - if (!$this->message->parse()) { - $this->error(-32700, 'parse error. not well formed'); - } - if ($this->message->messageType != 'methodCall') { - $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall'); - } - $result = $this->call($this->message->methodName, $this->message->params); - // Is the result an error? - if (is_a($result, 'IXR_Error')) { - $this->error($result); - } - // Encode the result - $r = new IXR_Value($result); - $resultxml = $r->getXml(); - // Create the XML - $xml = <<$resultxml -EOD; - // Send it - $this->output($xml); - } - function call($methodname, $args) { - if (!$this->hasMethod($methodname)) { - return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.'); - } - $method = $this->callbacks[$methodname]; - // Perform the callback and send the response - if (count($args) == 1) { - // If only one paramater just send that instead of the whole array - $args = $args[0]; - } - // Are we dealing with a function or a method? - if (substr($method, 0, 5) == 'this:') { - // It's a class method - check it exists - $method = substr($method, 5); - if (!method_exists($this, $method)) { - return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.'); - } - // Call the method - $result = $this->$method($args); - } else { - // It's a function - does it exist? - if (!function_exists($method)) { - return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.'); - } - // Call the function - $result = $method($args); - } - return $result; - } - - function error($error, $message = false) { - // Accepts either an error object or an error code and message - if ($message && !is_object($error)) { - $error = new IXR_Error($error, $message); - } - $this->output($error->getXml()); - } - function output($xml) { - $xml = ''."".$xml; - $length = strlen($xml); - header('Connection: close'); - header('Content-Length: '.$length); - header('Content-Type: text/xml'); - header('Date: '.date('r')); - echo $xml; - exit; - } - function hasMethod($method) { - return in_array($method, array_keys($this->callbacks)); - } - function setCapabilities() { - // Initialises capabilities array - $this->capabilities = array( - 'xmlrpc' => array( - 'specUrl' => 'http://www.xmlrpc.com/spec', - 'specVersion' => 1 - ), - 'faults_interop' => array( - 'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php', - 'specVersion' => 20010516 - ), - 'system.multicall' => array( - 'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208', - 'specVersion' => 1 - ), - ); - } - function getCapabilities($args) { - return $this->capabilities; - } - function setCallbacks() { - $this->callbacks['system.getCapabilities'] = 'this:getCapabilities'; - $this->callbacks['system.listMethods'] = 'this:listMethods'; - $this->callbacks['system.multicall'] = 'this:multiCall'; - } - function listMethods($args) { - // Returns a list of methods - uses array_reverse to ensure user defined - // methods are listed before server defined methods - return array_reverse(array_keys($this->callbacks)); - } - function multiCall($methodcalls) { - // See http://www.xmlrpc.com/discuss/msgReader$1208 - $return = array(); - foreach ($methodcalls as $call) { - $method = $call['methodName']; - $params = $call['params']; - if ($method == 'system.multicall') { - $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden'); - } else { - $result = $this->call($method, $params); - } - if (is_a($result, 'IXR_Error')) { - $return[] = array( - 'faultCode' => $result->code, - 'faultString' => $result->message - ); - } else { - $return[] = array($result); - } - } - return $return; - } -} - -class IXR_Request { - var $method; - var $args; - var $xml; - function IXR_Request($method, $args) { - $this->method = $method; - $this->args = $args; - $this->xml = << - -{$this->method} - - -EOD; - foreach ($this->args as $arg) { - $this->xml .= ''; - $v = new IXR_Value($arg); - $this->xml .= $v->getXml(); - $this->xml .= ""; - } - $this->xml .= ''; - } - function getLength() { - return strlen($this->xml); - } - function getXml() { - return $this->xml; - } -} - - -class IXR_Client { - var $server; - var $port; - var $path; - var $useragent; - var $response; - var $message = false; - var $debug = false; - // Storage place for an error message - var $error = false; - function IXR_Client($server, $path = false, $port = 80) { - if (!$path) { - // Assume we have been given a URL instead - $bits = parse_url($server); - $this->server = $bits['host']; - $this->port = isset($bits['port']) ? $bits['port'] : 80; - $this->path = isset($bits['path']) ? $bits['path'] : '/'; - // Make absolutely sure we have a path - if (!$this->path) { - $this->path = '/'; - } - } else { - $this->server = $server; - $this->path = $path; - $this->port = $port; - } - $this->useragent = 'The Incutio XML-RPC PHP Library'; - } - function query() { - $args = func_get_args(); - $method = array_shift($args); - $request = new IXR_Request($method, $args); - $length = $request->getLength(); - $xml = $request->getXml(); - $r = "\r\n"; - $request = "POST {$this->path} HTTP/1.0$r"; - $request .= "Host: {$this->server}$r"; - $request .= "Content-Type: text/xml$r"; - $request .= "User-Agent: {$this->useragent}$r"; - $request .= "Content-length: {$length}$r$r"; - $request .= $xml; - // Now send the request - if ($this->debug) { - echo '
'.htmlspecialchars($request)."\n
\n\n"; - } - $fp = @fsockopen($this->server, $this->port); - if (!$fp) { - $this->error = new IXR_Error(-32300, 'transport error - could not open socket'); - return false; - } - fputs($fp, $request); - $contents = ''; - $gotFirstLine = false; - $gettingHeaders = true; - while (!feof($fp)) { - $line = fgets($fp, 4096); - if (!$gotFirstLine) { - // Check line for '200' - if (strstr($line, '200') === false) { - $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200'); - return false; - } - $gotFirstLine = true; - } - if (trim($line) == '') { - $gettingHeaders = false; - } - if (!$gettingHeaders) { - $contents .= trim($line)."\n"; - } - } - if ($this->debug) { - echo '
'.htmlspecialchars($contents)."\n
\n\n"; - } - // Now parse what we've got back - $this->message = new IXR_Message($contents); - if (!$this->message->parse()) { - // XML error - $this->error = new IXR_Error(-32700, 'parse error. not well formed'); - return false; - } - // Is the message a fault? - if ($this->message->messageType == 'fault') { - $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString); - return false; - } - // Message must be OK - return true; - } - function getResponse() { - // methodResponses can only have one param - return that - return $this->message->params[0]; - } - function isError() { - return (is_object($this->error)); - } - function getErrorCode() { - return $this->error->code; - } - function getErrorMessage() { - return $this->error->message; - } -} - - -class IXR_Error { - var $code; - var $message; - function IXR_Error($code, $message) { - $this->code = $code; - $this->message = $message; - } - function getXml() { - $xml = << - - - - - faultCode - {$this->code} - - - faultString - {$this->message} - - - - - - -EOD; - return $xml; - } -} - - -class IXR_Date { - var $year; - var $month; - var $day; - var $hour; - var $minute; - var $second; - function IXR_Date($time) { - // $time can be a PHP timestamp or an ISO one - if (is_numeric($time)) { - $this->parseTimestamp($time); - } else { - $this->parseIso($time); - } - } - function parseTimestamp($timestamp) { - $this->year = date('Y', $timestamp); - $this->month = date('Y', $timestamp); - $this->day = date('Y', $timestamp); - $this->hour = date('H', $timestamp); - $this->minute = date('i', $timestamp); - $this->second = date('s', $timestamp); - } - function parseIso($iso) { - $this->year = substr($iso, 0, 4); - $this->month = substr($iso, 4, 2); - $this->day = substr($iso, 6, 2); - $this->hour = substr($iso, 9, 2); - $this->minute = substr($iso, 12, 2); - $this->second = substr($iso, 15, 2); - } - function getIso() { - return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second; - } - function getXml() { - return ''.$this->getIso().''; - } - function getTimestamp() { - return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year); - } -} - -class LLBlock { - var $data; - var $xml; - - function LLBlock($data) { - $this->data = $data; - } - - function getXml() { - if(count($this->data)>0) { - $this->xml=""; - foreach($this->data as $name => $value) { - $this->xml=$this->xml."".$name."".$value.""; - } - $this->xml=$this->xml.""; - return $this->xml; - } - } -} - -class IXR_Base64 { - var $data; - function IXR_Base64($data) { - $this->data = $data; - } - function getXml() { - return ''.base64_encode($this->data).''; - } -} - - -class IXR_IntrospectionServer extends IXR_Server { - var $signatures; - var $help; - function IXR_IntrospectionServer() { - $this->setCallbacks(); - $this->setCapabilities(); - $this->capabilities['introspection'] = array( - 'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html', - 'specVersion' => 1 - ); - $this->addCallback( - 'system.methodSignature', - 'this:methodSignature', - array('array', 'string'), - 'Returns an array describing the return type and required parameters of a method' - ); - $this->addCallback( - 'system.getCapabilities', - 'this:getCapabilities', - array('struct'), - 'Returns a struct describing the XML-RPC specifications supported by this server' - ); - $this->addCallback( - 'system.listMethods', - 'this:listMethods', - array('array'), - 'Returns an array of available methods on this server' - ); - $this->addCallback( - 'system.methodHelp', - 'this:methodHelp', - array('string', 'string'), - 'Returns a documentation string for the specified method' - ); - } - function addCallback($method, $callback, $args, $help) { - $this->callbacks[$method] = $callback; - $this->signatures[$method] = $args; - $this->help[$method] = $help; - } - function call($methodname, $args) { - // Make sure it's in an array - if ($args && !is_array($args)) { - $args = array($args); - } - // Over-rides default call method, adds signature check - if (!$this->hasMethod($methodname)) { - return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.'); - } - $method = $this->callbacks[$methodname]; - $signature = $this->signatures[$methodname]; - $returnType = array_shift($signature); - // Check the number of arguments - if (count($args) != count($signature)) { - // print 'Num of args: '.count($args).' Num in signature: '.count($signature); - return new IXR_Error(-32602, 'server error. wrong number of method parameters'); - } - // Check the argument types - $ok = true; - $argsbackup = $args; - for ($i = 0, $j = count($args); $i < $j; $i++) { - $arg = array_shift($args); - $type = array_shift($signature); - switch ($type) { - case 'int': - case 'i4': - if (is_array($arg) || !is_int($arg)) { - $ok = false; - } - break; - case 'base64': - case 'string': - if (!is_string($arg)) { - $ok = false; - } - break; - case 'boolean': - if ($arg !== false && $arg !== true) { - $ok = false; - } - break; - case 'float': - case 'double': - if (!is_float($arg)) { - $ok = false; - } - break; - case 'date': - case 'dateTime.iso8601': - if (!is_a($arg, 'IXR_Date')) { - $ok = false; - } - break; - } - if (!$ok) { - return new IXR_Error(-32602, 'server error. invalid method parameters'); - } - } - // It passed the test - run the "real" method call - return parent::call($methodname, $argsbackup); - } - function methodSignature($method) { - if (!$this->hasMethod($method)) { - return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.'); - } - // We should be returning an array of types - $types = $this->signatures[$method]; - $return = array(); - foreach ($types as $type) { - switch ($type) { - case 'string': - $return[] = 'string'; - break; - case 'int': - case 'i4': - $return[] = 42; - break; - case 'double': - $return[] = 3.1415; - break; - case 'dateTime.iso8601': - $return[] = new IXR_Date(time()); - break; - case 'boolean': - $return[] = true; - break; - case 'base64': - $return[] = new IXR_Base64('base64'); - break; - case 'array': - $return[] = array('array'); - break; - case 'struct': - $return[] = array('struct' => 'struct'); - break; - } - } - return $return; - } - function methodHelp($method) { - return $this->help[$method]; - } -} - - -class IXR_ClientMulticall extends IXR_Client { - var $calls = array(); - function IXR_ClientMulticall($server, $path = false, $port = 80) { - parent::IXR_Client($server, $path, $port); - $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)'; - } - function addCall() { - $args = func_get_args(); - $methodName = array_shift($args); - $struct = array( - 'methodName' => $methodName, - 'params' => $args - ); - $this->calls[] = $struct; - } - function query() { - // Prepare multicall, then call the parent::query() method - return parent::query('system.multicall', $this->calls); - } -} - -?> diff --git a/ogs/gridserver/gridserver_config.inc.php b/ogs/gridserver/gridserver_config.inc.php deleted file mode 100644 index 98ebed360e..0000000000 --- a/ogs/gridserver/gridserver_config.inc.php +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/ogs/gridserver/index.php b/ogs/gridserver/index.php deleted file mode 100644 index f7754c687b..0000000000 --- a/ogs/gridserver/index.php +++ /dev/null @@ -1,176 +0,0 @@ - 'I can play the bad key trick too you know', - 'login' => 'false' - ); - } - - // if we get to here, the key is valid, give that login server what it wants! - - $link = mysql_connect($dbhost,$dbuser,$dbpasswd) - OR die("Unable to connect to database"); - - mysql_select_db($dbname) - or die("Unable to select database"); - - $region_handle = $args['region_handle']; - $query = "SELECT * FROM region_profiles WHERE region_handle='$region_handle'"; - $result = mysql_query($query); - - return mysql_fetch_assoc($result); -} - -function get_session_info($args) { - global $dbhost,$dbuser,$dbpasswd,$dbname; - global $sim_sendkey, $sim_recvkey; - - // authkey, session-id, agent-id - - // First see who's talking to us, if key is invalid then send an invalid one back and nothing more - if($args[0]!=$sim_recvkey) { - return Array( - 'authkey' => "I can play the bad key trick too you know" - ); - } - - $link = mysql_connect($dbhost,$dbuser,$dbpasswd) - OR die("Unable to connect to database"); - - mysql_select_db($dbname) - or die("Unable to select database"); - - $session_id = $args[1]; - $agent_id = $args[2]; - - $query = "SELECT * FROM sessions WHERE session_id = '$session_id' AND agent_id='$agent_id' AND session_active=1"; - $result = mysql_query($query); - if(mysql_num_rows($result)>0) { - $info=mysql_fetch_assoc($result); - $circuit_code = $info['circuit_code']; - $secure_session_id=$info['secure_session_id']; - - $query = "SELECT * FROM local_user_profiles WHERE userprofile_LLUUID='$agent_id'"; - $result=mysql_query($query); - $userinfo=mysql_fetch_assoc($result); - $firstname=$userinfo['profile_firstname']; - $lastname=$userinfo['profile_lastname']; - $agent_id=$userinfo['userprofile_LLUUID']; - return Array( - 'authkey' => $sim_sendkey, - 'circuit_code' => $circuit_code, - 'agent_id' => $agent_id, - 'session_id' => $session_id, - 'secure_session_id' => $secure_session_id, - 'firstname' => $firstname, - 'lastname' => $lastname - ); - } -} - -function check_loggedin($args) { - global $dbhost,$dbuser,$dbpasswd,$dbname; - global $userserver_sendkey, $userserver_recvkey; - - // First see who's talking to us, if key is invalid then send an invalid one back and nothing more - if($args['authkey']!=$userserver_recvkey) { - return Array( - 'authkey' => "I can play the bad key trick too you know" - ); - } - - // if we get to here, the key is valid, give that login server what it wants! - - $link = mysql_connect($dbhost,$dbuser,$dbpasswd) - OR die("Unable to connect to database"); - - mysql_select_db($dbname) - or die("Unable to select database"); - - $userprofile_LLUUID = $args['userprofile_LLUUID']; - $query = "SELECT * FROM sessions WHERE agent_id='$userprofile_LLUUID' AND session_active=1"; - $result = mysql_query($query); - - if(mysql_num_rows($result)>1) { - return Array( - 'authkey' => $userserver_sendkey, - 'logged_in' => 1 - ); - } else { - return Array( - 'authkey' => $userserver_sendkey, - 'logged_in' => 0 - ); - } -} - -function create_session($args) { - global $dbhost,$dbuser,$dbpasswd,$dbname; - global $userserver_sendkey, $userserver_recvkey; - - // First see who's talking to us, if key is invalid then send an invalid one back and nothing more - if($args['authkey']!=$userserver_recvkey) { - return Array( - 'authkey' => "I can play the bad key trick too you know" - ); - } - - // if we get to here, the key is valid, give that login server what it wants! - - $link = mysql_connect($dbhost,$dbuser,$dbpasswd) - OR die("Unable to connect to database"); - - mysql_select_db($dbname) - or die("Unable to select database"); - - // yes, secure_sessionid should be different, i know... - $query = "SELECT value FROM Grid_settings WHERE setting='highest_LLUUID'"; - $result = mysql_query($query); - $row = mysql_fetch_array($result); - $highest_LLUUID = $row['value']; - $newsession_id=inc_lluuid($highest_LLUUID); - $secure_session_id=inc_lluuid($newsession_id); - - $query="UPDATE Grid_settings SET value='$secure_session_id' WHERE setting='highest_LLUUID' LIMIT 1"; - $result=mysql_query($query); - - $userprofile_LLUUID=$args['userprofile_LLUUID']; - $current_location=$args['current_location']; - $remote_ip=$args['remote_ip']; - $query="INSERT INTO sessions(session_id,secure_session_id,agent_id,session_start,session_active,current_location,remote_ip) VALUES('$newsession_id','$secure_session_id','$userprofile_LLUUID',NOW(),1,'$current_location','$remote_ip')"; - $result=mysql_query($query); - if(!isset($result)) { - die(); - } - return Array( - 'authkey' => $userserver_sendkey, - 'session_id' => $newsession_id, - 'secure_session_id' => $secure_session_id - ); -} - -$server=new IXR_Server( - Array( - 'check_session_loggedin' => 'check_loggedin', - 'create_session' => 'create_session', - 'get_sim_info' => 'get_sim_info', - 'get_session_info' => 'get_session_info' - ) -); - -?> \ No newline at end of file diff --git a/ogs/gridserver/usersessions/.htaccess b/ogs/gridserver/usersessions/.htaccess deleted file mode 100644 index 3b76a74ec4..0000000000 --- a/ogs/gridserver/usersessions/.htaccess +++ /dev/null @@ -1,5 +0,0 @@ -Options +FollowSymlinks - -RewriteEngine on -RewriteOptions MaxRedirects=1 -RewriteRule .* index.php [L] diff --git a/ogs/gridserver/usersessions/index.php b/ogs/gridserver/usersessions/index.php deleted file mode 100644 index e7a3817c35..0000000000 --- a/ogs/gridserver/usersessions/index.php +++ /dev/null @@ -1,85 +0,0 @@ -0) { - $info=mysql_fetch_assoc($result); - $circuit_code = $info['circuit_code']; - if($circuit_code == 0) $circuit_code=$params['4']; - $secure_session_id=$info['secure_session_id']; - $session_id=$info['session_id']; - - $query = "SELECT * FROM local_user_profiles WHERE userprofile_LLUUID='$agent_id'"; - $result=mysql_query($query); - $userinfo=mysql_fetch_assoc($result); - $firstname=$userinfo['profile_firstname']; - $lastname=$userinfo['profile_lastname']; - $agent_id=$userinfo['userprofile_LLUUID']; - $exists=1; -} else { - $exists=0; -} - -// if only 3 params, assume we are sending an XML response -if(count($params)==3) { - output_xml_block("usersession",Array( - 'authkey' => $sim_sendkey, - 'circuit_code' => $circuit_code, - 'agent_id' => $agent_id, - 'session_id' => $session_id, - 'secure_session_id' => $secure_session_id, - 'firstname' => $firstname, - 'lastname' => $lastname - )); -} - -switch($cmd) { - case 'exists': - echo $exists; - break; - case 'delete': - $query = "UPDATE sessions SET session_active=0, session_end=NOW() WHERE agent_id='$agent_id' LIMIT 1"; - $deleteresult = mysql_query($query); - break; -} -?> diff --git a/ogs/login/index.php b/ogs/login/index.php deleted file mode 100644 index 4f53c11e46..0000000000 --- a/ogs/login/index.php +++ /dev/null @@ -1,170 +0,0 @@ -0) { - $profiledata = mysql_fetch_assoc($profile_lookup_result); - - // if we get here, the username/password is valid, but still need to check there's not an already existing session - $client = new IXR_Client($gridserver_url); - if (!$client->query('check_session_loggedin', Array('userprofile_LLUUID' => $profiledata['userprofile_LLUUID'], 'authkey' => $gridserver_sendkey, 'server_type' => 'login'))) { // if this doesn't work, grid server is down - that's bad - return Array ( - 'reason' => 'key', - 'message' => "Could not connect to grid server. Please try again later or contact the grid owner ". $grid_owner, - 'login' => "false" - ); - } - - $response=$client->getResponse(); - if($response['authkey'] != $gridserver_recvkey) { // if this doesn't match up, it's a fake grid server - return Array ( - 'reason' => 'key', - 'message' => "Could not connect to grid server due to possible security issues. It is possible that the grid has been compromised. Please contact the grid owner " . $grid_owner . " and report this issue", - 'login' => "false" - ); - } - - - if($response['logged_in'] == 1) { // if the user is already logged in, tell them - return Array ( - 'reason' => 'presence', - 'message' => "You appear to already be logged into this grid, if your client has recently crashed then please try again later", - 'login' => "false" - ); - } - - // now we start a new session on the grid - $remote_ip=$_SERVER['REMOTE_ADDR']; - $region_handle=$profiledata['region_handle']; - $client->query('create_session',Array('userprofile_LLUUID' => $profiledata['userprofile_LLUUID'], 'authkey' => $gridserver_sendkey, 'remote_ip' => $remote_ip, 'current_location' => $region_handle)); - $response = $client->getResponse(); - $session_id = $response['session_id']; - $secure_session_id = $response['secure_session_id']; - - // ask the grid server what the IP address and port of the sim we want to connect to is - $client->query('get_sim_info', Array('region_handle' => $region_handle, 'authkey' => $gridserver_sendkey) ); - $siminfo = $client->getResponse(); - - // send the final response! - $position=$profiledata['position']; - $look_at=$profiledata['look_at']; - - $LocX=intval($siminfo['GridLocX'])*256; - $LocY=intval($siminfo['GridLocY'])*256; - $home="{'region_handle':'$region_handle', 'position':'$position', 'look_at':'$look_at'}"; - - $globaltextures = new LLBlock( - Array( - 'sun_texture_id' => "cce0f112-878f-4586-a2e2-a8f104bba271", - 'cloud_texture_id' => "fc4b9f0b-d008-45c6-96a4-01dd947ac621", - 'moon_texture_id' => "d07f6eed-b96a-47cd-b51d-400ad4a1c428" - )); - - $login_flags = new LLBlock( - Array( - 'stipend_since_login' => "N", - 'ever_logged_in' => "Y", - 'gendered' => "Y", - 'daylight_savings' => "N" - )); - $ui_config = new LLBlock( - Array( - 'allow_first_life' => "Y" - )); - $inventory_skeleton = new LLBlock(Array( - Array( - 'name' => 'My inventory', - 'parent_id' => '00000000-0000-0000-0000-000000000000', - 'version' => 4, - 'type_default' => 8, - 'folder_id' => 'f798e114-c10f-409b-a90d-a11577ff1de8' - ), - Array( - 'name' => 'Textures', - 'parent_id' => 'f798e114-c10f-409b-a90d-a11577ff1de8', - 'version' => 1, - 'type_default' => 0, - 'folder_id' => 'fc8b4059-30bb-43a8-a042-46f5b431ad82' - ))); - $inventory_root = new LLBlock( - Array( - 'folder_id' => "f798e114-c10f-409b-a90d-a11577ff1de8" - )); - $initial_outfit = new LLBlock( - Array( - 'folder_name' => "Nightclub Female", - 'gender' => "female" - )); - return Array ( - 'message' => "Welcome to OGS!", - 'session_id' => format_lluuid($session_id), - 'sim_port' => intval($siminfo['port']), - 'agent_access' => "M", - 'start_location' => "last", - 'global-textures' => $globaltextures, - 'seconds_since_epoch' => time(), - 'first_name' => $profiledata['profile_firstname'], - 'circuit_code' => 50633318, - 'login_flags' => $login_flags, - 'seed_capability' => '', - 'home' => $home, - 'secure_session_id' => format_lluuid($secure_session_id), - 'last_name' => $profiledata['profile_lastname'], - 'ui-config' => $ui_config, - 'region_x' => $LocX, - 'inventory_skeleton' => $inventory_skeleton, - 'sim_ip' => $siminfo['ip_addr'], - 'region_y' => $LocY, - 'inventory-root' => $inventory_root, - 'login' => "true", - 'look_at' => $look_at, - 'agent_id' => format_lluuid($profiledata['userprofile_LLUUID']), - 'initial-outfit' => $initial_outfit - ); - - - } else { - // this is the default invalid username/password error - return Array ( - 'reason' => 'key', - 'message' => "You have entered an invalid name/password combination or are using an incompatible client. Please check with the grid owner " .$grid_owner . " if you are sure your login details are accurate.", - 'login' => "false", - ); - } - -} - -$server=new IXR_Server(array('login_to_simulator' => 'login')); -?> diff --git a/ogs/login/login_config.inc.php b/ogs/login/login_config.inc.php deleted file mode 100644 index 4cce696522..0000000000 --- a/ogs/login/login_config.inc.php +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/opensim.build b/opensim.build deleted file mode 100644 index 2fdf1cb51d..0000000000 --- a/opensim.build +++ /dev/null @@ -1,63 +0,0 @@ - - - First nant buildfile for OpenSim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/opensim.mdp b/opensim.mdp deleted file mode 100644 index f41280ff4f..0000000000 --- a/opensim.mdp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/opensim.mds b/opensim.mds deleted file mode 100644 index 7587db3192..0000000000 --- a/opensim.mds +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Config.cs b/src/Config.cs deleted file mode 100644 index 9bb92962d0..0000000000 --- a/src/Config.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ - -* Copyright (c) , -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using Db4objects.Db4o; -using libsecondlife; -using OpenSim.world; - -namespace OpenSim -{ - /// - /// This class handles connection to the underlying database used for configuration of the region. - /// Region content is also stored by this class. The main entry point is InitConfig() which attempts to locate - /// opensim.yap in the current working directory. If opensim.yap can not be found, default settings are loaded from - /// what is hardcoded here and then saved into opensim.yap for future startups. - /// - public class SimConfig - { - public string RegionName; - - public uint RegionLocX; - public uint RegionLocY; - public ulong RegionHandle; - - public int IPListenPort; - public string IPListenAddr; - - public bool sandbox = true; - public string AssetURL = String.Empty; - public string AssetSendKey = String.Empty; - - public string GridURL = String.Empty; - public string GridSendKey = String.Empty; - - private IObjectContainer db; - - public void LoadDefaults() - { - string tempstring; - OpenSim_Main.localcons.WriteLine("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); - - this.RegionName = OpenSim_Main.localcons.CmdPrompt("Name [OpenSim test]: ", "OpenSim test"); - this.RegionLocX = (uint)Convert.ToInt32(OpenSim_Main.localcons.CmdPrompt("Grid Location X [997]: ", "997")); - this.RegionLocY = (uint)Convert.ToInt32(OpenSim_Main.localcons.CmdPrompt("Grid Location Y [996]: ", "996")); - this.IPListenPort = Convert.ToInt32(OpenSim_Main.localcons.CmdPrompt("UDP port for client connections [9000]: ", "9000")); - this.IPListenAddr = OpenSim_Main.localcons.CmdPrompt("IP Address to listen on for client connections [127.0.0.1]: ", "127.0.0.1"); - - tempstring = OpenSim_Main.localcons.CmdPrompt("Run in sandbox or grid mode? [sandbox]: ", "sandbox", "sandbox", "grid"); - this.sandbox = tempstring.Equals("sandbox"); - - if (!this.sandbox) - { - this.AssetURL = OpenSim_Main.localcons.CmdPrompt("Asset server URL: "); - this.AssetSendKey = OpenSim_Main.localcons.CmdPrompt("Asset server key: "); - this.GridURL = OpenSim_Main.localcons.CmdPrompt("Grid server URL: "); - this.GridSendKey = OpenSim_Main.localcons.CmdPrompt("Grid server key: "); - } - this.RegionHandle = Helpers.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); - } - - public void InitConfig() - { - try - { - db = Db4oFactory.OpenFile("opensim.yap"); - IObjectSet result = db.Get(typeof(SimConfig)); - if (result.Count == 1) - { - OpenSim_Main.localcons.WriteLine("Config.cs:InitConfig() - Found a SimConfig object in the local database, loading"); - foreach (SimConfig cfg in result) - { - this.sandbox = cfg.sandbox; - this.RegionName = cfg.RegionName; - this.RegionLocX = cfg.RegionLocX; - this.RegionLocY = cfg.RegionLocY; - this.RegionHandle = Helpers.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); - this.IPListenPort = cfg.IPListenPort; - this.IPListenAddr = cfg.IPListenAddr; - this.AssetURL = cfg.AssetURL; - this.AssetSendKey = cfg.AssetSendKey; - this.GridURL = cfg.GridURL; - this.GridSendKey = cfg.GridSendKey; - } - } - else - { - OpenSim_Main.localcons.WriteLine("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); - LoadDefaults(); - OpenSim_Main.localcons.WriteLine("Writing out default settings to local database"); - db.Set(this); - } - } - catch (Exception e) - { - db.Close(); - OpenSim_Main.localcons.WriteLine("Config.cs:InitConfig() - Exception occured"); - OpenSim_Main.localcons.WriteLine(e.ToString()); - } - OpenSim_Main.localcons.WriteLine("Sim settings loaded:"); - OpenSim_Main.localcons.WriteLine("Name: " + this.RegionName); - OpenSim_Main.localcons.WriteLine("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); - OpenSim_Main.localcons.WriteLine("Region Handle: " + this.RegionHandle.ToString()); - OpenSim_Main.localcons.WriteLine("Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort); - OpenSim_Main.localcons.WriteLine("Sandbox Mode? " + this.sandbox.ToString()); - OpenSim_Main.localcons.WriteLine("Asset URL: " + this.AssetURL); - OpenSim_Main.localcons.WriteLine("Asset key: " + this.AssetSendKey); - OpenSim_Main.localcons.WriteLine("Grid URL: " + this.GridURL); - OpenSim_Main.localcons.WriteLine("Grid key: " + this.GridSendKey); - } - - public World LoadWorld() - { - OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Loading world...."); - World blank = new World(); - OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB"); - IObjectSet world_result = db.Get(new float[65536]); - if (world_result.Count > 0) - { - OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading"); - blank.LandMap = (float[])world_result.Next(); - } - else - { - OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one"); - HeightmapGenHills hills = new HeightmapGenHills(); - blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); - - OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database"); - db.Set(blank.LandMap); - db.Commit(); - } - return blank; - } - - public void LoadFromGrid() - { - OpenSim_Main.localcons.WriteLine("Config.cs:LoadFromGrid() - dummy function, DOING ABSOLUTELY NOTHING AT ALL!!!"); - // TODO: Make this crap work - } - - public void Shutdown() - { - db.Close(); - } - } -} diff --git a/src/Main.cs b/src/Main.cs deleted file mode 100644 index f3fa6097af..0000000000 --- a/src/Main.cs +++ /dev/null @@ -1,159 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ - - -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Text; -using System.IO; -using System.Threading; -using System.Net; -using System.Net.Sockets; -using System.Collections; -using System.Collections.Generic; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.world; - -namespace OpenSim -{ - /// - /// Description of MainForm. - /// - public class OpenSim_Main - { - public static DateTime startuptime; - public static OpenSim_Main sim; - public static SimConfig cfg; - public static World local_world; - public static ServerConsole localcons; - private static Thread MainListener; - public static Socket Server; - private static IPEndPoint ServerIncoming; - private static byte[] RecvBuffer = new byte[4096]; - private byte[] ZeroBuffer = new byte[8192]; - private static IPEndPoint ipeSender; - private static EndPoint epSender; - private static AsyncCallback ReceivedData; - public Dictionary ClientThreads = new Dictionary(); - - [STAThread] - public static void Main( string[] args ) - { - Console.WriteLine("OpenSim " + VersionInfo.Version + "\n"); - Console.WriteLine("Starting...\n"); - sim = new OpenSim_Main(); - sim.Startup(); - while(true) { - localcons.MainConsolePrompt(); - } - } - - private OpenSim_Main() { - } - - public static void Shutdown() { - localcons.WriteLine("Main.cs:Shutdown() - Closing all threads"); - localcons.WriteLine("Main.cs:Shutdown() - Killing listener thread"); - MainListener.Abort(); - localcons.WriteLine("Main.cs:Shutdown() - Killing clients"); - // IMPLEMENT THIS - localcons.WriteLine("Main.cs:Shutdown() - Closing console and terminating"); - localcons.Close(); - Environment.Exit(0); - } - - private void Startup() { - startuptime=DateTime.Now; - localcons=new ServerConsole(ServerConsole.ConsoleType.Local,"",0); - // We check our local database first, then the grid for config options - localcons.WriteLine("Main.cs:Startup() - Loading configuration"); - cfg = new SimConfig(); - cfg.InitConfig(); - localcons.WriteLine("Main.cs:Startup() - Contacting gridserver"); - cfg.LoadFromGrid(); - - localcons.WriteLine("Main.cs:Startup() - We are " + cfg.RegionName + " at " + cfg.RegionLocX.ToString() + "," + cfg.RegionLocY.ToString()); - localcons.WriteLine("Initialising world"); - local_world = cfg.LoadWorld(); - - localcons.WriteLine("Main.cs:Startup() - Starting up main world loop"); - local_world.InitLoop(); - - localcons.WriteLine("Main.cs:Startup() - Starting up messaging system"); - MainListener = new Thread(new ThreadStart(MainServerListener)); - MainListener.Start(); - - Thread.Sleep(500); // give other threads a chance to catch up - string[] noparams = new string[1]; - noparams[0]=""; - localcons.WriteLine("\nOpenSim ready\nType help for list of commands"); - } - - private void OnReceivedData(IAsyncResult result) { - ipeSender = new IPEndPoint(IPAddress.Any, 0); - epSender = (EndPoint)ipeSender; - Packet packet = null; - int numBytes = Server.EndReceiveFrom(result, ref epSender); - int packetEnd = numBytes - 1; - packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); - - // This is either a new client or a packet to send to an old one - if(ClientThreads.ContainsKey(epSender)) { - ClientThreads[epSender].InPacket(packet); - } else if( packet.Type == PacketType.UseCircuitCode ) { // new client - OpenSimClient newuser = new OpenSimClient(epSender,(UseCircuitCodePacket)packet); - ClientThreads.Add(epSender, newuser); - } else { // invalid client - Console.Error.WriteLine("Main.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString()); - } - Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - } - - private void MainServerListener() { - localcons.WriteLine("Main.cs:MainServerListener() - New thread started"); - localcons.WriteLine("Main.cs:MainServerListener() - Opening UDP socket on " + cfg.IPListenAddr + ":" + cfg.IPListenPort); - - ServerIncoming = new IPEndPoint(IPAddress.Any, cfg.IPListenPort); - Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - Server.Bind(ServerIncoming); - - localcons.WriteLine("Main.cs:MainServerListener() - UDP socket bound, getting ready to listen"); - - ipeSender = new IPEndPoint(IPAddress.Any, 0); - epSender = (EndPoint) ipeSender; - ReceivedData = new AsyncCallback(this.OnReceivedData); - Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - - localcons.WriteLine("Main.cs:MainServerListener() - Listening..."); - while(true) { - Thread.Sleep(100); - local_world.DoStuff(); - } - } - } -} diff --git a/src/OpenSimClient.cs b/src/OpenSimClient.cs deleted file mode 100644 index 497df000c8..0000000000 --- a/src/OpenSimClient.cs +++ /dev/null @@ -1,510 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Collections; -using System.Collections.Generic; -using libsecondlife; -using libsecondlife.Packets; -using System.Net; -using System.Net.Sockets; -using System.IO; -using System.Threading; -using System.Timers; - -namespace OpenSim -{ - /// - /// Handles new client connections - /// Constructor takes a single Packet and authenticates everything - /// - public class OpenSimClient - { - - public LLUUID AgentID; - public LLUUID SessionID; - public uint CircuitCode; - public world.Avatar ClientAvatar; - private UseCircuitCodePacket cirpack; - private Thread ClientThread; - public EndPoint userEP; - private BlockingQueue PacketQueue; - private BlockingQueue AssetRequests; - private Dictionary PendingAcks = new Dictionary(); - private Dictionary NeedAck = new Dictionary(); - private System.Timers.Timer AckTimer; - private uint Sequence = 0; - private object SequenceLock = new object(); - private const int MAX_APPENDED_ACKS = 10; - private const int RESEND_TIMEOUT = 4000; - private const int MAX_SEQUENCE = 0xFFFFFF; - //private Queue Inbox; - - public void ack_pack(Packet Pack) - { - //libsecondlife.Packets.PacketAckPacket ack_it = new PacketAckPacket(); - //ack_it.Packets = new PacketAckPacket.PacketsBlock[1]; - //ack_it.Packets[0] = new PacketAckPacket.PacketsBlock(); - //ack_it.Packets[0].ID = Pack.Header.ID; - //ack_it.Header.Reliable = false; - - //OutPacket(ack_it); - - if (Pack.Header.Reliable) - { - lock (PendingAcks) - { - uint sequence = (uint)Pack.Header.Sequence; - if (!PendingAcks.ContainsKey(sequence)) { PendingAcks[sequence] = sequence; } - } - } - } - - public void AssetLoader() - { - if (OpenSim_Main.cfg.sandbox == false) - { - WebResponse AssetResponse; - byte[] idata; - - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:AssetLoader() - Starting new thread"); - TransferRequestPacket reqPacket = AssetRequests.Dequeue(); - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:AssetLoader() - Got a request, processing it"); - LLUUID AssetID = new LLUUID(reqPacket.TransferInfo.Params, 0); - - try - { - WebRequest AssetLoad = WebRequest.Create(OpenSim_Main.cfg.AssetURL + "getasset/" + OpenSim_Main.cfg.AssetSendKey + "/" + AssetID + "/data"); - AssetResponse = AssetLoad.GetResponse(); - idata = new byte[(int)AssetResponse.ContentLength]; - BinaryReader br = new BinaryReader(AssetResponse.GetResponseStream()); - idata = br.ReadBytes((int)AssetResponse.ContentLength); - br.Close(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - return; - } - - TransferInfoPacket Transfer = new TransferInfoPacket(); - Transfer.TransferInfo.ChannelType = 2; - Transfer.TransferInfo.Status = 0; - Transfer.TransferInfo.TargetType = 0; - Transfer.TransferInfo.Params = reqPacket.TransferInfo.Params; - Transfer.TransferInfo.Size = (int)AssetResponse.ContentLength; - Transfer.TransferInfo.TransferID = reqPacket.TransferInfo.TransferID; - - OutPacket(Transfer); - - TransferPacketPacket TransferPacket = new TransferPacketPacket(); - TransferPacket.TransferData.Packet = 0; - TransferPacket.TransferData.ChannelType = 2; - TransferPacket.TransferData.TransferID = reqPacket.TransferInfo.TransferID; - - if (AssetResponse.ContentLength > 1000) - { - byte[] chunk = new byte[1000]; - Array.Copy(idata, chunk, 1000); - TransferPacket.TransferData.Data = chunk; - TransferPacket.TransferData.Status = 0; - OutPacket(TransferPacket); - - TransferPacket = new TransferPacketPacket(); - TransferPacket.TransferData.Packet = 1; - TransferPacket.TransferData.ChannelType = 2; - TransferPacket.TransferData.TransferID = reqPacket.TransferInfo.TransferID; - byte[] chunk1 = new byte[(idata.Length - 1000)]; - Array.Copy(idata, 1000, chunk1, 0, chunk1.Length); - TransferPacket.TransferData.Data = chunk1; - TransferPacket.TransferData.Status = 1; - OutPacket(TransferPacket); - } - else - { - TransferPacket.TransferData.Status = 1; - TransferPacket.TransferData.Data = idata; - OutPacket(TransferPacket); - } - AssetResponse.Close(); - } - } - - public void Logout() - { - // TODO - kill any AssetLoaders - ClientThread.Abort(); - } - - public void ProcessInPacket(Packet Pack) - { - ack_pack(Pack); - switch (Pack.Type) - { - case PacketType.CompleteAgentMovement: - ClientAvatar.CompleteMovement(OpenSim_Main.local_world); - ClientAvatar.SendInitialPosition(); - break; - case PacketType.RegionHandshakeReply: - OpenSim_Main.local_world.SendLayerData(this); - break; - case PacketType.AgentWearablesRequest: - ClientAvatar.SendInitialAppearance(); - break; - case PacketType.TransferRequest: - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request"); - // We put transfer requests into a big queue and then spawn a thread for each new one - TransferRequestPacket transfer = (TransferRequestPacket)Pack; - AssetRequests.Enqueue(transfer); - Thread AssetLoaderThread = new Thread(new ThreadStart(AssetLoader)); - AssetLoaderThread.Start(); - break; - case PacketType.LogoutRequest: - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request"); - lock (OpenSim_Main.local_world.Entities) - { - OpenSim_Main.local_world.Entities.Remove(this.AgentID); - } - - if (OpenSim_Main.cfg.sandbox == false) - { - WebRequest DeleteSession = WebRequest.Create(OpenSim_Main.cfg.GridURL + "/usersessions/" + OpenSim_Main.cfg.GridSendKey + "/" + this.AgentID.ToString() + this.CircuitCode.ToString() + "/delete"); - WebResponse GridResponse = DeleteSession.GetResponse(); - StreamReader sr = new StreamReader(GridResponse.GetResponseStream()); - String grTest = sr.ReadLine(); - sr.Close(); - GridResponse.Close(); - OpenSim_Main.localcons.WriteLine("DEBUG: " + grTest); - } - this.ClientThread.Abort(); - break; - case PacketType.AgentUpdate: - ClientAvatar.HandleAgentUpdate((AgentUpdatePacket)Pack); - break; - case PacketType.ChatFromViewer: - ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; - if (Helpers.FieldToString(inchatpack.ChatData.Message) == "") break; - - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); - reply.ChatData.Audible = 1; - reply.ChatData.Message = inchatpack.ChatData.Message; - reply.ChatData.ChatType = 1; - reply.ChatData.SourceType = 1; - reply.ChatData.Position = this.ClientAvatar.position; - reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0"); - reply.ChatData.OwnerID = this.AgentID; - reply.ChatData.SourceID = this.AgentID; - - - - foreach (OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) - { - client.OutPacket(reply); - } - break; - } - } - - private void ResendUnacked() - { - int now = Environment.TickCount; - - lock (NeedAck) - { - foreach (Packet packet in NeedAck.Values) - { - if (now - packet.TickCount > RESEND_TIMEOUT) - { - - packet.Header.Resent = true; - OutPacket(packet); - } - } - } - } - - private void SendAcks() - { - lock (PendingAcks) - { - if (PendingAcks.Count > 0) - { - if (PendingAcks.Count > 250) - { - return; - } - - - - int i = 0; - PacketAckPacket acks = new PacketAckPacket(); - acks.Packets = new PacketAckPacket.PacketsBlock[PendingAcks.Count]; - - foreach (uint ack in PendingAcks.Values) - { - acks.Packets[i] = new PacketAckPacket.PacketsBlock(); - acks.Packets[i].ID = ack; - i++; - } - - acks.Header.Reliable = false; - OutPacket(acks); - - PendingAcks.Clear(); - } - } - } - - private void AckTimer_Elapsed(object sender, ElapsedEventArgs ea) - { - SendAcks(); - ResendUnacked(); - } - - public void ProcessOutPacket(Packet Pack) - { - - // Keep track of when this packet was sent out - Pack.TickCount = Environment.TickCount; - - if (!Pack.Header.Resent) - { - // Set the sequence number - lock (SequenceLock) - { - if (Sequence >= MAX_SEQUENCE) - Sequence = 1; - else - Sequence++; - Pack.Header.Sequence = Sequence; - } - - if (Pack.Header.Reliable) //DIRTY HACK - { - lock (NeedAck) - { - if (!NeedAck.ContainsKey(Pack.Header.Sequence)) - { - NeedAck.Add(Pack.Header.Sequence, Pack); - } - else - { - // Client.Log("Attempted to add a duplicate sequence number (" + - // packet.Header.Sequence + ") to the NeedAck dictionary for packet type " + - // packet.Type.ToString(), Helpers.LogLevel.Warning); - } - } - - // Don't append ACKs to resent packets, in case that's what was causing the - // delivery to fail - if (!Pack.Header.Resent) - { - // Append any ACKs that need to be sent out to this packet - lock (PendingAcks) - { - if (PendingAcks.Count > 0 && PendingAcks.Count < MAX_APPENDED_ACKS && - Pack.Type != PacketType.PacketAck && - Pack.Type != PacketType.LogoutRequest) - { - Pack.Header.AckList = new uint[PendingAcks.Count]; - int i = 0; - - foreach (uint ack in PendingAcks.Values) - { - Pack.Header.AckList[i] = ack; - i++; - } - - PendingAcks.Clear(); - Pack.Header.AppendedAcks = true; - } - } - } - } - } - - - byte[] ZeroOutBuffer = new byte[4096]; - byte[] sendbuffer; - sendbuffer = Pack.ToBytes(); - - try - { - if (Pack.Header.Zerocoded) - { - int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); - OpenSim_Main.Server.SendTo(ZeroOutBuffer, packetsize, SocketFlags.None, userEP); - } - else - { - OpenSim_Main.Server.SendTo(sendbuffer, sendbuffer.Length, SocketFlags.None, userEP); - } - } - catch (Exception) - { - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread"); - ClientThread.Abort(); - } - - } - - public void InPacket(Packet NewPack) - { - // Handle appended ACKs - if (NewPack.Header.AppendedAcks) - { - lock (NeedAck) - { - foreach (uint ack in NewPack.Header.AckList) - { - OpenSim_Main.localcons.WriteLine("Got appended ack: " + ack); - NeedAck.Remove(ack); - } - } - } - - // Handle PacketAck packets - if (NewPack.Type == PacketType.PacketAck) - { - PacketAckPacket ackPacket = (PacketAckPacket)NewPack; - - lock (NeedAck) - { - foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets) - { - NeedAck.Remove(block.ID); - } - } - } - else if ((NewPack.Type == PacketType.StartPingCheck)) - { - //reply to pingcheck - libsecondlife.Packets.StartPingCheckPacket startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack; - libsecondlife.Packets.CompletePingCheckPacket endPing = new CompletePingCheckPacket(); - endPing.PingID.PingID = startPing.PingID.PingID; - OutPacket(endPing); - } - else - { - QueItem item = new QueItem(); - item.Packet = NewPack; - item.Incoming = true; - this.PacketQueue.Enqueue(item); - } - - } - - public void OutPacket(Packet NewPack) - { - QueItem item = new QueItem(); - item.Packet = NewPack; - item.Incoming = false; - this.PacketQueue.Enqueue(item); - } - - public OpenSimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack) - { - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request"); - cirpack = initialcirpack; - userEP = remoteEP; - PacketQueue = new BlockingQueue(); - AssetRequests = new BlockingQueue(); - AckTimer = new System.Timers.Timer(500); - AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); - AckTimer.Start(); - - ClientThread = new Thread(new ThreadStart(AuthUser)); - ClientThread.IsBackground = true; - ClientThread.Start(); - } - - private void ClientLoop() - { - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:ClientLoop() - Entered loop"); - while (true) - { - QueItem nextPacket = PacketQueue.Dequeue(); - if (nextPacket.Incoming) - { - //is a incoming packet - ProcessInPacket(nextPacket.Packet); - } - else - { - //is a out going packet - ProcessOutPacket(nextPacket.Packet); - } - } - } - - private void InitNewClient() - { - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); - OpenSim_Main.local_world.AddViewerAgent(this); - world.Entity tempent = OpenSim_Main.local_world.Entities[this.AgentID]; - this.ClientAvatar = (world.Avatar)tempent; - } - - private void AuthUser() - { - if (OpenSim_Main.cfg.sandbox == false) - { - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:AuthUser() - Authenticating new user request with grid"); - WebRequest CheckSession = WebRequest.Create(OpenSim_Main.cfg.GridURL + "/usersessions/" + OpenSim_Main.cfg.GridSendKey + "/" + cirpack.CircuitCode.ID.ToString() + "/" + cirpack.CircuitCode.Code.ToString() + "/exists"); - OpenSim_Main.localcons.WriteLine(OpenSim_Main.cfg.GridURL); - WebResponse GridResponse = CheckSession.GetResponse(); - StreamReader sr = new StreamReader(GridResponse.GetResponseStream()); - String grTest = sr.ReadLine(); - sr.Close(); - GridResponse.Close(); - if (String.IsNullOrEmpty(grTest) || grTest.Equals("1")) - { // YAY! Valid login - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString()); - this.AgentID = cirpack.CircuitCode.ID; - this.SessionID = cirpack.CircuitCode.SessionID; - this.CircuitCode = cirpack.CircuitCode.Code; - InitNewClient(); - ClientLoop(); - } - else - { // Invalid - OpenSim_Main.localcons.WriteLine("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString()); - ClientThread.Abort(); - } - } - else - { - this.AgentID = cirpack.CircuitCode.ID; - this.SessionID = cirpack.CircuitCode.SessionID; - this.CircuitCode = cirpack.CircuitCode.Code; - InitNewClient(); - ClientLoop(); - } - } - } - -} diff --git a/src/Second-server.csproj b/src/Second-server.csproj deleted file mode 100644 index 8d55e06e04..0000000000 --- a/src/Second-server.csproj +++ /dev/null @@ -1,65 +0,0 @@ - - - Exe - OpenSim - OpenSim - Debug - AnyCPU - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E} - OpenSim.OpenSim_Main - - - ..\bin\ - False - DEBUG;TRACE - True - Full - True - - - ..\bin\ - True - TRACE - False - None - False - - - - False - ..\bin\Axiom.MathLib.dll - - - - False - ..\bin\libsecondlife.dll - - - False - ..\bin\log4net.dll - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Second-server.sln b/src/Second-server.sln deleted file mode 100644 index 86fc54c313..0000000000 --- a/src/Second-server.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second-server", "Second-server.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|.NET 1.1 = Debug|.NET 1.1 - Debug|Any CPU = Debug|Any CPU - Release|.NET 1.1 = Release|.NET 1.1 - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|.NET 1.1.ActiveCfg = Debug|Any CPU - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|.NET 1.1.Build.0 = Debug|Any CPU - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|.NET 1.1.ActiveCfg = Release|Any CPU - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|.NET 1.1.Build.0 = Release|.NET 1.1 - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ServerConsole.cs b/src/ServerConsole.cs deleted file mode 100644 index 21a465d88b..0000000000 --- a/src/ServerConsole.cs +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ - -* Copyright (c) , -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Threading; -using System.IO; -using System.Net; -using libsecondlife; -using libsecondlife.Packets; - -namespace OpenSim -{ - public class ServerConsole { - private ConsoleType ConsType; - StreamWriter Log; - - public enum ConsoleType { - Local, // Use stdio - TCP, // Use TCP/telnet - SimChat // Use in-world chat (for gods) - } - - - // STUPID HACK ALERT!!!! STUPID HACK ALERT!!!!! - // constype - the type of console to use (see enum ConsoleType) - // sparam - depending on the console type: - // TCP - the IP to bind to (127.0.0.1 if blank) - // Local - param ignored - // SimChat - the AgentID of this sim's admin - // and for the iparam: - // TCP - the port to bind to - // Local - param ignored - // SimChat - the chat channel to accept commands from - public ServerConsole(ConsoleType constype, string sparam, int iparam) { - ConsType = constype; - switch(constype) { - case ConsoleType.Local: - Console.WriteLine("ServerConsole.cs - creating new local console"); - Console.WriteLine("Logs will be saved to current directory in opensim-console.log"); - Log=File.AppendText("opensim-console.log"); - Log.WriteLine("========================================================================"); - Log.WriteLine("OpenSim " + VersionInfo.Version + " Started at " + DateTime.Now.ToString()); - break; - case ConsoleType.TCP: - break; - case ConsoleType.SimChat: - break; - - default: - Console.WriteLine("ServerConsole.cs - what are you smoking? that isn't a valid console type!"); - break; - } - } - - public void Close() { - Log.WriteLine("OpenSim shutdown at " + DateTime.Now.ToString()); - Log.Close(); - } - - // You know what ReadLine() and WriteLine() do, right? And Read() and Write()? Right, you do actually know C#, right? Are you actually a programmer? Do you know english? Do you find my sense of humour in comments irritating? Good, glad you're still here - public void WriteLine(string Line) { - Log.WriteLine(Line); - Console.WriteLine(Line); - return; - } - - public string ReadLine() { - string TempStr=Console.ReadLine(); - Log.WriteLine(TempStr); - return TempStr; - } - - public int Read() { - int TempInt= Console.Read(); - Log.Write((char)TempInt); - return TempInt; - } - - public void Write(string Line) { - Console.Write(Line); - Log.Write(Line); - return; - } - - // Displays a command prompt and waits for the user to enter a string, then returns that string - public string CmdPrompt(string prompt) { - this.Write(prompt); - return this.ReadLine(); - } - - // Displays a command prompt and returns a default value if the user simply presses enter - public string CmdPrompt(string prompt, string defaultresponse) { - string temp=CmdPrompt(prompt); - if(temp=="") { - return defaultresponse; - } else { - return temp; - } - } - - // Displays a command prompt and returns a default value, user may only enter 1 of 2 options - public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB) { - bool itisdone=false; - string temp=CmdPrompt(prompt,defaultresponse); - while(itisdone==false) { - if((temp==OptionA) || (temp==OptionB)) { - itisdone=true; - } else { - this.WriteLine("Valid options are " + OptionA + " or " + OptionB); - temp=CmdPrompt(prompt,defaultresponse); - } - } - return temp; - } - - // Runs a command with a number of parameters - public Object RunCmd(string Cmd, string[] cmdparams) { - switch(Cmd) { - case "help": - this.WriteLine("show users - show info about connected users"); - this.WriteLine("shutdown - disconnect all clients and shutdown"); - break; - - case "show": - ShowCommands(cmdparams[0]); - break; - - case "shutdown": - OpenSim_Main.Shutdown(); - break; - } - return null; - } - - // Shows data about something - public void ShowCommands(string ShowWhat) { - switch(ShowWhat) { - case "uptime": - this.WriteLine("OpenSim has been running since " + OpenSim_Main.startuptime.ToString()); - this.WriteLine("That is " + (DateTime.Now-OpenSim_Main.startuptime).ToString()); - break; - case "users": - OpenSim.world.Avatar TempAv; - this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP")); - foreach (libsecondlife.LLUUID UUID in OpenSim_Main.local_world.Entities.Keys) { - TempAv=(OpenSim.world.Avatar)OpenSim_Main.local_world.Entities[UUID]; - this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}",TempAv.firstname, TempAv.lastname,UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); - } - break; - } - } - - // Displays a prompt to the user and then runs the command they entered - public void MainConsolePrompt() { - string[] tempstrarray; - string tempstr = this.CmdPrompt("OpenSim-" + OpenSim_Main.cfg.RegionHandle.ToString() + " # "); - tempstrarray = tempstr.Split(' '); - string cmd=tempstrarray[0]; - Array.Reverse(tempstrarray); - Array.Resize(ref tempstrarray,tempstrarray.Length-1); - Array.Reverse(tempstrarray); - string[] cmdparams=(string[])tempstrarray; - RunCmd(cmd,cmdparams); - } - } - -} diff --git a/src/Util.cs b/src/Util.cs deleted file mode 100644 index 3b89b25886..0000000000 --- a/src/Util.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ - -* Copyright (c) , -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Collections.Generic; -using System.Threading; -using libsecondlife; -using libsecondlife.Packets; - -namespace OpenSim -{ - /// - /// - public class QueItem { - public QueItem() - { - } - - public Packet Packet; - public bool Incoming; - } - - - public class BlockingQueue< T > { - private Queue< T > _queue = new Queue< T >(); - private object _queueSync = new object(); - - public void Enqueue(T value) - { - lock(_queueSync) - { - _queue.Enqueue(value); - Monitor.Pulse(_queueSync); - } - } - - public T Dequeue() - { - lock(_queueSync) - { - if( _queue.Count < 1) - Monitor.Wait(_queueSync); - - return _queue.Dequeue(); - } - } - } - -} diff --git a/src/VersionInfo.cs b/src/VersionInfo.cs deleted file mode 100644 index 14581eeeb9..0000000000 --- a/src/VersionInfo.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; - -namespace OpenSim -{ - /// - /// - public class VersionInfo - { - public static string Version = "0.0.1-unofficial"; - } -} diff --git a/src/VersionInfo.cs.template b/src/VersionInfo.cs.template deleted file mode 100644 index e4e1b95ae3..0000000000 --- a/src/VersionInfo.cs.template +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright (c) OpenSim project, http://osgrid.org/ -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; - -namespace OpenSim -{ - /// - /// - public class VersionInfo - { - public static string Version = "@@VERSION"; - } -} diff --git a/src/types/Mesh.cs b/src/types/Mesh.cs deleted file mode 100644 index 3e00c9130b..0000000000 --- a/src/types/Mesh.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.types -{ - // TODO: This will need some performance tuning no doubt. - public class Mesh - { - public List mesh; - - public Mesh() - { - mesh = new List(); - } - - public void AddTri(Triangle tri) - { - mesh.Add(tri); - } - - public static Mesh operator +(Mesh a, Mesh b) - { - a.mesh.AddRange(b.mesh); - return a; - } - } -} diff --git a/src/types/Triangle.cs b/src/types/Triangle.cs deleted file mode 100644 index 8dfea6e762..0000000000 --- a/src/types/Triangle.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Axiom.MathLib; - -namespace OpenSim.types -{ - public class Triangle - { - Vector3 a; - Vector3 b; - Vector3 c; - - public Triangle() - { - a = new Vector3(); - b = new Vector3(); - c = new Vector3(); - } - - public Triangle(Vector3 A, Vector3 B, Vector3 C) - { - a = A; - b = B; - c = C; - } - } -} diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs deleted file mode 100644 index 9d8d7d2322..0000000000 --- a/src/world/Avatar.cs +++ /dev/null @@ -1,256 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; -using Axiom.MathLib; - -namespace OpenSim.world -{ - public class Avatar : Entity - { - public string firstname; - public string lastname; - public OpenSimClient ControllingClient; - public LLVector3 oldvel; - public LLVector3 oldpos; - public uint CurrentKeyMask; - public bool walking; - - private libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; - - public Avatar(OpenSimClient TheClient) { - OpenSim_Main.localcons.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); - ControllingClient=TheClient; - SetupTemplate("avatar-template.dat"); - - position = new LLVector3(100.0f,100.0f,60.0f); - } - - public override void update() { - lock(this) { - base.update(); - - oldvel=this.velocity; - oldpos=this.position; - if((this.CurrentKeyMask & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_POS) != 0) { - Vector3 tmpVelocity = this.rotation * new Vector3(1.0f,0.0f,0.0f); - tmpVelocity.Normalize(); tmpVelocity = tmpVelocity * 0.5f; - this.velocity.X = tmpVelocity.x; - this.velocity.Y = tmpVelocity.y; - this.velocity.Z = tmpVelocity.z; - this.walking=true; - } else { - this.velocity.X=0; - this.velocity.Y=0; - this.velocity.Z=0; - this.walking=false; - } - } - } - - private void SetupTemplate(string name) - { - - int i = 0; - FileInfo fInfo = new FileInfo(name); - long numBytes = fInfo.Length; - FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); - BinaryReader br = new BinaryReader(fStream); - byte [] data1 = br.ReadBytes((int)numBytes); - br.Close(); - fStream.Close(); - - libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); - - System.Text.Encoding enc = System.Text.Encoding.ASCII; - libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); - pos.X = 100f; - objdata.ID = this.localid; - objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); - libsecondlife.LLVector3 pos2 = new LLVector3(100f,100f,23f); - //objdata.FullID=user.AgentID; - byte[] pb = pos.GetBytes(); - Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length); - - AvatarTemplate = objdata; - - } - - public void CompleteMovement(World RegionInfo) { - OpenSim_Main.localcons.WriteLine("Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet"); - AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); - mov.AgentData.SessionID = this.ControllingClient.SessionID; - mov.AgentData.AgentID = this.ControllingClient.AgentID; - mov.Data.RegionHandle = OpenSim_Main.cfg.RegionHandle; - // TODO - dynamicalise this stuff - mov.Data.Timestamp = 1172750370; - mov.Data.Position = new LLVector3((float)this.position.X, (float)this.position.Y, (float)this.position.Z); - mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0); - - OpenSim_Main.localcons.WriteLine("Sending AgentMovementComplete packet"); - ControllingClient.OutPacket(mov); - } - - public void SendInitialPosition() { - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - - - //send a objectupdate packet with information about the clients avatar - ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); - objupdate.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; - objupdate.RegionData.TimeDilation = 64096; - objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; - - objupdate.ObjectData[0] = AvatarTemplate; - //give this avatar object a local id and assign the user a name - objupdate.ObjectData[0].ID = this.localid; - //User_info.name="Test"+this.local_numer+" User"; - objupdate.ObjectData[0].FullID = ControllingClient.AgentID; - objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0"); - - libsecondlife.LLVector3 pos2 = new LLVector3((float)this.position.X, (float)this.position.Y, (float)this.position.Z); - - byte[] pb = pos2.GetBytes(); - - Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); - OpenSim_Main.local_world._localNumber++; - this.ControllingClient.OutPacket(objupdate); - } - - public override ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock() { - byte[] bytes = new byte[60]; - int i=0; - ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); - - dat.TextureEntry = AvatarTemplate.TextureEntry; - libsecondlife.LLVector3 pos2 = new LLVector3(this.position.X, this.position.Y, this.position.Z); - - uint ID = this.localid; - bytes[i++] = (byte)(ID % 256); - bytes[i++] = (byte)((ID >> 8) % 256); - bytes[i++] = (byte)((ID >> 16) % 256); - bytes[i++] = (byte)((ID >> 24) % 256); - bytes[i++] = 0; - bytes[i++] = 1; - i += 14; - bytes[i++] = 128; - bytes[i++] = 63; - - byte[] pb = pos2.GetBytes(); - Array.Copy(pb, 0, bytes, i, pb.Length); - i += 12; - - - ushort ac = 32767; - bytes[i++] = (byte)((ushort)(((this.velocity.X/128f)+1)*32767) % 256 ); - bytes[i++] = (byte)(((ushort)(((this.velocity.X/128f)+1)*32767) >> 8) % 256); - bytes[i++] = (byte)((ushort)(((this.velocity.Y/128f)+1)*32767) % 256); - bytes[i++] = (byte)(((ushort)(((this.velocity.Y/128f)+1)*32767) >> 8) % 256); - bytes[i++] = (byte)((ushort)(((this.velocity.Z/128f)+1)*32767) % 256); - bytes[i++] = (byte)(((ushort)(((this.velocity.Z/128f)+1)*32767) >> 8) % 256); - - - - - //accel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - //rot - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - //rotation vel - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - bytes[i++] = (byte)(ac % 256); - bytes[i++] = (byte)((ac >> 8) % 256); - - dat.Data=bytes; - return(dat); - - } - - public void SendInitialAppearance() { - AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); - aw.AgentData.AgentID = this.ControllingClient.AgentID; - aw.AgentData.SerialNum = 0; - aw.AgentData.SessionID = ControllingClient.SessionID; - - aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; - AgentWearablesUpdatePacket.WearableDataBlock awb = new AgentWearablesUpdatePacket.WearableDataBlock(); - awb.WearableType = (byte)0; - awb.AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); - awb.ItemID = LLUUID.Random(); - aw.WearableData[0] = awb; - - for(int i=1; i<13; i++) { - awb = new AgentWearablesUpdatePacket.WearableDataBlock(); - awb.WearableType = (byte)i; - awb.AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); - awb.ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); - aw.WearableData[i] = awb; - } - - ControllingClient.OutPacket(aw); - } - - public void SendRegionHandshake(World RegionInfo) { - OpenSim_Main.localcons.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - RegionHandshakePacket handshake = new RegionHandshakePacket(); - - OpenSim_Main.localcons.WriteLine("Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details"); - handshake.RegionInfo.BillableFactor = 0; - handshake.RegionInfo.IsEstateManager = false; - handshake.RegionInfo.TerrainHeightRange00 = 60; - handshake.RegionInfo.TerrainHeightRange01 = 60; - handshake.RegionInfo.TerrainHeightRange10 = 60; - handshake.RegionInfo.TerrainHeightRange11 = 60; - handshake.RegionInfo.TerrainStartHeight00 = 10; - handshake.RegionInfo.TerrainStartHeight01 = 10; - handshake.RegionInfo.TerrainStartHeight10 = 10; - handshake.RegionInfo.TerrainStartHeight11 = 10; - handshake.RegionInfo.SimAccess = 13; - handshake.RegionInfo.WaterHeight = 20.0f; - handshake.RegionInfo.RegionFlags = 72458694; // TODO: WTF sirs? Use an enum! - handshake.RegionInfo.SimName = _enc.GetBytes(OpenSim_Main.cfg.RegionName + "\0"); - handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000"); - handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); - handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); - handshake.RegionInfo.TerrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); - handshake.RegionInfo.TerrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); - handshake.RegionInfo.TerrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000"); - handshake.RegionInfo.TerrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000"); - handshake.RegionInfo.TerrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000"); - handshake.RegionInfo.TerrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000"); - handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37"); - - OpenSim_Main.localcons.WriteLine("Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet"); - this.ControllingClient.OutPacket(handshake); - } - - public void HandleAgentUpdate(AgentUpdatePacket update) { - lock(this) { - this.CurrentKeyMask = update.AgentData.ControlFlags; - this.rotation = new Quaternion(update.AgentData.BodyRotation.W, update.AgentData.BodyRotation.X, update.AgentData.BodyRotation.Y, update.AgentData.BodyRotation.Z); - this.needupdate = true; - } - } - - } -} diff --git a/src/world/Entity.cs b/src/world/Entity.cs deleted file mode 100644 index 7880a4675b..0000000000 --- a/src/world/Entity.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Axiom.MathLib; -using libsecondlife; -using OpenSim.types; -using libsecondlife.Packets; - -namespace OpenSim.world -{ - public class Entity - { - protected libsecondlife.LLUUID uuid; - protected uint localid; - public LLVector3 position; - public LLVector3 velocity; - protected Quaternion rotation; - protected string name; - protected List children; - public bool needupdate; - - public Entity() - { - uuid = new libsecondlife.LLUUID(); - localid = 8880000 + (OpenSim_Main.local_world._localNumber++); // FIXME - race condition! - position = new LLVector3(); - velocity = new LLVector3(); - rotation = new Quaternion(); - name = "(basic entity)"; - children = new List(); - } - - public virtual void update() { - // Do any per-frame updates needed that are applicable to every type of entity - foreach (Entity child in children) - { - if(child.needupdate) - child.update(); - } - this.needupdate=false; - } - - public virtual ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock() { - return null; - } - - - public virtual string getName() - { - return name; - } - - public virtual Mesh getMesh() - { - Mesh mesh = new Mesh(); - - foreach (Entity child in children) - { - mesh += child.getMesh(); - } - - return mesh; - } - } -} diff --git a/src/world/HeightmapGenHills.cs b/src/world/HeightmapGenHills.cs deleted file mode 100644 index 12af005b0e..0000000000 --- a/src/world/HeightmapGenHills.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; - -namespace libsecondlife -{ - public class HeightmapGenHills - { - private Random Rand = new Random(); - private int NumHills; - private float HillMin; - private float HillMax; - private bool Island; - private float[] heightmap; - - public float[] GenerateHeightmap(int numHills, float hillMin, float hillMax, bool island) - { - NumHills = numHills; - HillMin = hillMin; - HillMax = hillMax; - Island = island; - - heightmap = new float[256 * 256]; - - for (int i = 0; i < numHills; i++) - { - AddHill(); - } - - Normalize(); - - return heightmap; - } - - private void AddHill() - { - float x, y; - float radius = RandomRange(HillMin, HillMax); - - if (Island) - { - // Which direction from the center of the map the hill is placed - float theta = RandomRange(0, 6.28f); - - // How far from the center of the map to place the hill. The radius - // is subtracted from the range to prevent any part of the hill from - // reaching the edge of the map - float distance = RandomRange(radius / 2.0f, 128.0f - radius); - - x = 128.0f + (float)Math.Cos(theta) * distance; - y = 128.0f + (float)Math.Sin(theta) * distance; - } - else - { - x = RandomRange(-radius, 256.0f + radius); - y = RandomRange(-radius, 256.0f + radius); - } - - float radiusSq = radius * radius; - float distSq; - float height; - - int xMin = (int)(x - radius) - 1; - int xMax = (int)(x + radius) + 1; - if (xMin < 0) xMin = 0; - if (xMax > 255) xMax = 255; - - int yMin = (int)(y - radius) - 1; - int yMax = (int)(y + radius) + 1; - if (yMin < 0) yMin = 0; - if (yMax > 255) yMax = 255; - - // Loop through each affected cell and determine the height at that point - for (int v = yMin; v <= yMax; ++v) - { - float fv = (float)v; - - for (int h = xMin; h <= xMax; ++h) - { - float fh = (float)h; - - // Determine how far from the center of this hill this point is - distSq = (x - fh) * (x - fh) + (y - fv) * (y - fv); - height = radiusSq - distSq; - - // Don't add negative hill values - if (height > 0.0f) heightmap[h + v * 256] += height; - } - } - } - - private void Normalize() - { - float min = heightmap[0]; - float max = heightmap[0]; - - for (int x = 0; x < 256; x++) - { - for (int y = 0; y < 256; y++) - { - if (heightmap[x + y * 256] < min) min = heightmap[x + y * 256]; - if (heightmap[x + y * 256] > max) max = heightmap[x + y * 256]; - } - } - - // Avoid a rare divide by zero - if (min != max) - { - for (int x = 0; x < 256; x++) - { - for (int y = 0; y < 256; y++) - { - heightmap[x + y * 256] = ((heightmap[x + y * 256] - min) / (max - min)) * (HillMax - HillMin); - } - } - } - } - - private float RandomRange(float min, float max) - { - return (float)Rand.NextDouble() * (max - min) + min; - } - } -} diff --git a/src/world/PhysicsEngine.cs b/src/world/PhysicsEngine.cs deleted file mode 100644 index b237f5e133..0000000000 --- a/src/world/PhysicsEngine.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Threading; -using libsecondlife; -using libsecondlife.Packets; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.world -{ - public class PhysicsEngine - { - - public PhysicsEngine() { - } - - public void Startup() { - OpenSim_Main.localcons.WriteLine("PhysicsEngine.cs:Startup() - DOING NOTHING, DUMMY FUNCTION!"); - } - - public void DoStuff(World simworld) { - foreach (libsecondlife.LLUUID UUID in simworld.Entities.Keys) - { - simworld.Entities[UUID].position += simworld.Entities[UUID].velocity; - simworld.Entities[UUID].position.Z = simworld.LandMap[(int)simworld.Entities[UUID].position.Y * 256 + (int)simworld.Entities[UUID].position.X]+1; - if(simworld.Entities[UUID].position.X<0) simworld.Entities[UUID].position.X=0; - if(simworld.Entities[UUID].position.Y<0) simworld.Entities[UUID].position.Y=0; - if(simworld.Entities[UUID].position.X>255) simworld.Entities[UUID].position.X=255; - if(simworld.Entities[UUID].position.Y>255) simworld.Entities[UUID].position.Y=255; - } - } - } -} diff --git a/src/world/Primitive.cs b/src/world/Primitive.cs deleted file mode 100644 index 143fa55a33..0000000000 --- a/src/world/Primitive.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.types; - -namespace OpenSim.world -{ - public class Primitive : Entity - { - protected float mesh_cutbegin; - protected float mesh_cutend; - - public Primitive() - { - mesh_cutbegin = 0.0f; - mesh_cutend = 1.0f; - } - - public override Mesh getMesh() - { - Mesh mesh = new Mesh(); - Triangle tri = new Triangle( - new Axiom.MathLib.Vector3(0.0f, 1.0f, 1.0f), - new Axiom.MathLib.Vector3(1.0f, 0.0f, 1.0f), - new Axiom.MathLib.Vector3(1.0f, 1.0f, 0.0f)); - - mesh.AddTri(tri); - mesh += base.getMesh(); - - return mesh; - } - } -} diff --git a/src/world/ScriptEngine.cs b/src/world/ScriptEngine.cs deleted file mode 100644 index f20a08ec1b..0000000000 --- a/src/world/ScriptEngine.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.world -{ - public class ScriptEngine - { - public ScriptEngine(World env) - { - } - - public void LoadScript() - { - - } - } -} diff --git a/src/world/SurfacePatch.cs b/src/world/SurfacePatch.cs deleted file mode 100644 index 71e4116d11..0000000000 --- a/src/world/SurfacePatch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.world -{ - public class SurfacePatch - { - public float[] HeightMap; - - public SurfacePatch() { - HeightMap = new float[16*16]; - - int xinc; - int yinc; - for(xinc=0; xinc<16; xinc++) for(yinc=0; yinc<16; yinc++) { - HeightMap[xinc+(yinc*16)]=100.0f; - } - - } - } -} diff --git a/src/world/World.cs b/src/world/World.cs deleted file mode 100644 index 158ddc2a1c..0000000000 --- a/src/world/World.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Threading; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace OpenSim.world -{ - public class World - { - public Dictionary Entities; - public float[] LandMap; - public ScriptEngine Scripts; - public uint _localNumber = 0; - public PhysicsEngine physics; - - private libsecondlife.TerrainManager TerrainManager; - private Random Rand = new Random(); - - public World() - { - OpenSim_Main.localcons.WriteLine("World.cs - creating new entitities instance"); - Entities = new Dictionary(); - - OpenSim_Main.localcons.WriteLine("World.cs - creating LandMap"); - TerrainManager = new TerrainManager(new SecondLife()); - } - - public void InitLoop() - { - OpenSim_Main.localcons.WriteLine("World.cs:StartLoop() - Initialising physics"); - this.physics = new PhysicsEngine(); - physics.Startup(); - } - - public void DoStuff() - { - lock (this) - { - physics.DoStuff(this); - this.Update(); - } - } - - public void Update() - { - foreach (libsecondlife.LLUUID UUID in Entities.Keys) - { - if (Entities[UUID].needupdate) - { - Entities[UUID].update(); - - if (Entities[UUID] is Avatar) - { - Avatar avatar = (Avatar)Entities[UUID]; - if ((avatar.oldpos != avatar.position) || (avatar.oldvel != avatar.velocity) || avatar.walking) - { - ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = Entities[UUID].CreateTerseBlock(); - foreach (OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) - { - ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; // FIXME - terse.RegionData.TimeDilation = 0; - terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; - terse.ObjectData[0] = terseBlock; - client.OutPacket(terse); - } - } - } - } - } - } - - public void SendLayerData(OpenSimClient RemoteClient) - { - int[] patches = new int[4]; - - for (int y = 0; y < 16; y++) - { - for (int x = 0; x < 16; x = x + 4) - { - patches[0] = x + 0 + y * 16; - patches[1] = x + 1 + y * 16; - patches[2] = x + 2 + y * 16; - patches[3] = x + 3 + y * 16; - - Packet layerpack = TerrainManager.CreateLandPacket(LandMap, patches); - RemoteClient.OutPacket(layerpack); - } - } - } - - public void AddViewerAgent(OpenSimClient AgentClient) - { - OpenSim_Main.localcons.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); - Avatar NewAvatar = new Avatar(AgentClient); - OpenSim_Main.localcons.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); - this.Entities.Add(AgentClient.AgentID, NewAvatar); - OpenSim_Main.localcons.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); - NewAvatar.SendRegionHandshake(this); - this.Update(); // will work for now, but needs to be optimised so we don't update everything in the sim for each new user - } - - public bool Backup() - { - /* TODO: Save the current world entities state. */ - - return false; - } - } -} diff --git a/src/world/scripting/IScript.cs b/src/world/scripting/IScript.cs deleted file mode 100644 index 550594d343..0000000000 --- a/src/world/scripting/IScript.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.world.scripting -{ - public interface IScriptHost { - bool Register(IScript iscript); - } - public interface IScript - { - string Name{get;set;} - IScriptHost Host{get;set;} - void Show(); - } -}