本文整理汇总了C#中OpenSim类的典型用法代码示例。如果您正苦于以下问题:C# OpenSim类的具体用法?C# OpenSim怎么用?C# OpenSim使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OpenSim类属于命名空间,在下文中一共展示了OpenSim类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public void Initialize(OpenSim.Framework.IOpenSimBase openSim)
{
m_log.Info("[AURORADATA]: Setting up the data service");
OpenSimBase = openSim;
Aurora.Services.DataService.LocalDataService service = new Aurora.Services.DataService.LocalDataService();
service.Initialise(openSim.ConfigSource);
}
示例2: RegionStatsHandler
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public RegionStatsHandler(OpenSim.Framework.RegionInfo region_info)
{
regionInfo = region_info;
osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret);
osXStatsURI = Util.SHA1Hash(regionInfo.osSecret);
}
示例3: AddRegion
public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
{
m_log.Error("[SCENEIMPORT]: Add Region: ");
m_scenes.Add(scene);
m_scene = scene;
// scene.EventManager.OnClientConnect += new EventManager.OnClientConnectCoreDelegate(HandleOnClientConnect);
}
示例4: client_OnChatFromClient
void client_OnChatFromClient(object sender, OpenSim.Framework.OSChatMessage e)
{
if (e.Message != "")
{
switch (e.Message.Split(' ')[0])
{
case "fog":
if (e.Sender is RexClientViewBase)
{
((RexClientViewBase)e.Sender).SendRexFog(0, 50, 50, 50, 50);
}
break;
case "water":
if (e.Sender is RexClientViewBase)
{
if (e.Message.Split(' ').Length > 1)
{
((RexClientViewBase)e.Sender).SendRexWaterHeight(Convert.ToSingle(e.Message.Split(' ')[1]));
}
else
{
((RexClientViewBase)e.Sender).SendRexWaterHeight(50);
}
}
break;
case "postp":
if (e.Sender is RexClientViewBase)
{
if (e.Message.Split(' ').Length > 2)
{
bool toggle = Convert.ToBoolean(e.Message.Split(' ')[2]);
int id = Convert.ToInt32(e.Message.Split(' ')[1]);
((RexClientViewBase)e.Sender).SendRexPostProcess(id, toggle);
}
}
break;
case "wind":
if (e.Sender is RexClientViewBase)
{
((RexClientViewBase)e.Sender).SendRexToggleWindSound(!this.windToggle);
windToggle = !windToggle;
//((RexClientView)e.Sender).SendRexScriptCommand("hud", "ShowInventoryMessage(\"wind ="+windToggle.ToString()+" \")", "");
}
break;
default:
//Test code. Not to any relese.
//e.Sender.SendAlertMessage("Hello there");
//if (e.Sender is RexClientView)
//{
// ((RexClientView)e.Sender).SendRexScriptCommand("hud", "ShowInventoryMessage(\"Test\")", "");
//}
break;
}
}
}
示例5: WindConfig
public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
{
if (windConfig != null)
{
if (windConfig.Contains("strength"))
{
m_strength = windConfig.GetFloat("strength", 1.0F);
}
}
}
示例6: SerializeGroupToBytes
public byte[] SerializeGroupToBytes(OpenSim.Region.Framework.Scenes.SceneObjectGroup group, SerializationFlags flags)
{
Serialization.SceneObjectGroupSnapshot snap = Serialization.SceneObjectGroupSnapshot.FromSceneObjectGroup(group, flags);
using (MemoryStream ms = new MemoryStream())
{
ProtoBuf.Serializer.Serialize<Serialization.SceneObjectGroupSnapshot>(ms, snap);
return ms.ToArray();
}
}
示例7: SerializeObjectToBytes
public byte[] SerializeObjectToBytes(OpenSim.Region.Framework.Scenes.CoalescedObject csog, SerializationFlags flags)
{
Serialization.CoalescedObjectSnapshot snap = Serialization.CoalescedObjectSnapshot.FromCoalescedObject(csog, flags);
using (MemoryStream ms = new MemoryStream())
{
ProtoBuf.Serializer.Serialize<Serialization.CoalescedObjectSnapshot>(ms, snap);
return ms.ToArray();
}
}
示例8: FromItemPermissionBlock
internal static ItemPermissionBlockSnapshot FromItemPermissionBlock(OpenSim.Framework.ItemPermissionBlock itemPermissionBlock)
{
return new ItemPermissionBlockSnapshot
{
BasePermissions = itemPermissionBlock.BasePermissions,
NextPermissions = itemPermissionBlock.NextPermissions,
EveryonePermissions = itemPermissionBlock.EveryOnePermissions,
GroupPermissions = itemPermissionBlock.GroupPermissions,
CurrentPermissions = itemPermissionBlock.CurrentPermissions
};
}
示例9: SerializeGroupToInventoryBytes
/// <summary>
/// Serializes a group into a byte array suitable for storage and retrieval from inventory
/// </summary>
/// <param name="group"></param>
/// <returns></returns>
public byte[] SerializeGroupToInventoryBytes(OpenSim.Region.Framework.Scenes.SceneObjectGroup group, SerializationFlags flags)
{
Serialization.SceneObjectGroupSnapshot snap = Serialization.SceneObjectGroupSnapshot.FromSceneObjectGroup(group, flags);
using (MemoryStream ms = new MemoryStream())
{
ms.Write(GROUP_HEADER, 0, GROUP_HEADER.Length);
snap.SerializeToStream(ms);
return ms.ToArray();
}
}
示例10: HandleAgentUpdate
private void HandleAgentUpdate(OpenSim.Framework.IClientAPI remoteClient, OpenSim.Framework.AgentUpdateArgs agentData)
{
if (m_maxHeight != 0)
{
ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId);
if (sp.AbsolutePosition.Z > m_maxHeight)
{
Vector3 newPos = sp.AbsolutePosition;
newPos.Z = m_maxHeight;
sp.Teleport(newPos);
}
}
}
示例11: link
public override void link(OpenSim.Region.PhysicsModules.SharedBase.PhysicsActor obj)
{
BSPrimLinkable parent = obj as BSPrimLinkable;
if (parent != null)
{
BSPhysObject parentBefore = Linkset.LinksetRoot; // DEBUG
int childrenBefore = Linkset.NumberOfChildren; // DEBUG
Linkset = parent.Linkset.AddMeToLinkset(this);
DetailLog("{0},BSPrimLinkable.link,call,parentBefore={1}, childrenBefore=={2}, parentAfter={3}, childrenAfter={4}",
LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren);
}
return;
}
示例12: WindConfig
public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
{
if (windConfig != null)
{
// Uses strength value if avg_strength not specified
m_avgStrength = windConfig.GetFloat("strength", 5.0F);
m_avgStrength = windConfig.GetFloat("avg_strength", 5.0F);
m_avgDirection = windConfig.GetFloat("avg_direction", 0.0F);
m_varStrength = windConfig.GetFloat("var_strength", 5.0F);
m_varDirection = windConfig.GetFloat("var_direction", 30.0F);
m_rateChange = windConfig.GetFloat("rate_change", 1.0F);
LogSettings();
}
}
示例13: CreateObjectCmd
public CreateObjectCmd(PhysxPrim parent, string primName, OpenSim.Framework.PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position,
OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation, OpenMetaverse.Vector3 velocity, OpenMetaverse.Vector3 angularVelocity,
float lod, PhysicsScene.AddPrimShapeFlags flags, Material material, byte[] serializedPhysicsProperties, byte[] serializedPhysicsShapes,
ulong interpolateTime)
{
_parent = parent;
_primName = primName;
_pbs = pbs;
_position = position;
_size = size;
_rotation = rotation;
_velocity = velocity;
_angularVelocity = angularVelocity;
_lod = lod;
_flags = flags;
_material = material;
_serializedPhysicsProperties = serializedPhysicsProperties;
_serializedPhysicsShapes = serializedPhysicsShapes;
_interpolateTime = interpolateTime;
}
示例14: FromKeyframeAnimation
public static KeyframeAnimationSnapshot FromKeyframeAnimation(OpenSim.Framework.KeyframeAnimation keyframeAnimation)
{
if (keyframeAnimation == null)
return null;
return new KeyframeAnimationSnapshot()
{
CurrentAnimationPosition = keyframeAnimation.CurrentAnimationPosition,
CurrentMode = (int)keyframeAnimation.CurrentMode,
CurrentCommand = (int)keyframeAnimation.CurrentCommand,
InitialPosition = keyframeAnimation.InitialPosition,
InitialRotation = keyframeAnimation.InitialRotation,
PingPongForwardMotion = keyframeAnimation.PingPongForwardMotion,
PositionList = keyframeAnimation.PositionList,
RotationList = keyframeAnimation.RotationList,
TimeLastTick = keyframeAnimation.TimeLastTick,
TimeElapsed = keyframeAnimation.TimeElapsed,
TimeList = keyframeAnimation.TimeList
};
}
示例15: SetUpLindenLoginData
LindenLoginData SetUpLindenLoginData(OpenSim.Grid.UserServer.Modules.RexLogin.Avatar avatar, string account,
string welcomeMessage, UUID sessionID)
{
LindenLoginData response = new LindenLoginData();
response.AgentID = avatar.ID;
response.BuddyList = LindenLoginHelper.GetBuddyList(avatar.ID);
LindenLoginHelper.SetClassifiedCategories(ref response);
response.FirstName = avatar.GetAttribute(AvatarAttributes.FIRST_NAME).AsString() + " " + avatar.GetAttribute(AvatarAttributes.LAST_NAME).AsString();
avatar.Attributes[AvatarAttributes.FIRST_NAME] = OSD.FromString(response.FirstName);
response.HomeLookAt = avatar.GetAttribute(AvatarAttributes.HOME_LOOKAT).AsVector3();
response.HomePosition = avatar.GetAttribute(AvatarAttributes.HOME_POSITION).AsVector3();
response.HomeRegionX = avatar.GetAttribute(AvatarAttributes.HOME_REGION_X).AsUInteger();
response.HomeRegionY = avatar.GetAttribute(AvatarAttributes.HOME_REGION_Y).AsUInteger();
response.LastName = "<" + account + ">";
avatar.Attributes[AvatarAttributes.LAST_NAME] = OSD.FromString(response.LastName);
response.Login = true;
response.Message = welcomeMessage;
response.SessionID = sessionID;
response.SecureSessionID = UUID.Random();
return response;
}