git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@346 52acb1d6-8a22-11de-b505-999d5b087335
71 lines
2.6 KiB
C#
71 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using libsecondlife;
|
|
using libsecondlife.Packets;
|
|
using System.Collections;
|
|
|
|
namespace AnimationSample
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
SecondLife client;
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
//Create the SecondLife client object
|
|
client = new SecondLife();
|
|
|
|
}
|
|
|
|
private void btnPlay_Click(object sender, EventArgs e)
|
|
{
|
|
//Build an animation packet
|
|
AgentAnimationPacket packet = new AgentAnimationPacket();
|
|
|
|
//create an AgentData block
|
|
AgentAnimationPacket.AgentDataBlock agentdata = new AgentAnimationPacket.AgentDataBlock();
|
|
//Fill in its values
|
|
agentdata.AgentID = client.Avatar.ID;
|
|
agentdata.SessionID = client.Network.SessionID;
|
|
//Add it in the packet
|
|
packet.AgentData = agentdata;
|
|
|
|
//Create an AnimationList block
|
|
AgentAnimationPacket.AnimationListBlock anims = new AgentAnimationPacket.AnimationListBlock();
|
|
//Set the UUID of the animation to avatar_dance1.bvh, a standard animation
|
|
anims.AnimID = new LLUUID("b68a3d7c-de9e-fc87-eec8-543d787e5b0d");
|
|
//Start the animation
|
|
anims.StartAnim = true;
|
|
//Add it to the packet. SInce it's a Variable number block, we have to construct an array.
|
|
packet.AnimationList = new AgentAnimationPacket.AnimationListBlock[] { anims };
|
|
|
|
//Send the packet
|
|
client.Network.SendPacket(packet);
|
|
}
|
|
|
|
private void btnLogin_Click(object sender, EventArgs e)
|
|
{
|
|
//Login information
|
|
Hashtable loginParams = NetworkManager.DefaultLoginValues(txtFirst.Text, txtLast.Text, txtPassword.Text, "00:00:00:00:00:00",
|
|
"last", 1, 12, 12, 12, "Win", "0", "animationsample", "jessemalthus@gmail.com");
|
|
Hashtable loginReply = new Hashtable();
|
|
|
|
// Login
|
|
if (!client.Network.Login(loginParams))
|
|
{
|
|
// Login failed
|
|
MessageBox.Show("We're sorry, but login failed. Error: \n " + client.Network.LoginError);
|
|
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("Login succeded. You're at " + client.Avatar.Position + " on " + client.Network.CurrentSim.Region.Name);
|
|
}
|
|
}
|
|
}
|
|
} |