Open sourced NatiBot
This commit is contained in:
55
SLBot/bot/NetCom/AlertMessageEventArgs.cs
Normal file
55
SLBot/bot/NetCom/AlertMessageEventArgs.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : AlertMessageEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using System;
|
||||
|
||||
public class AlertMessageEventArgs : EventArgs
|
||||
{
|
||||
private string message;
|
||||
|
||||
public AlertMessageEventArgs(string message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
126
SLBot/bot/NetCom/ChatEventArgs.cs
Normal file
126
SLBot/bot/NetCom/ChatEventArgs.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : ChatEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
|
||||
public class ChatEventArgs : EventArgs
|
||||
{
|
||||
private ChatAudibleLevel audible;
|
||||
private string fromName;
|
||||
private UUID id;
|
||||
private string message;
|
||||
private UUID ownerid;
|
||||
private Vector3 position;
|
||||
private ChatSourceType sourceType;
|
||||
private ChatType type;
|
||||
|
||||
public ChatEventArgs(string message, ChatAudibleLevel audible, ChatType type, ChatSourceType sourceType, string fromName, UUID id, UUID ownerid, Vector3 position)
|
||||
{
|
||||
this.message = message;
|
||||
this.audible = audible;
|
||||
this.type = type;
|
||||
this.sourceType = sourceType;
|
||||
this.fromName = fromName;
|
||||
this.id = id;
|
||||
this.ownerid = ownerid;
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public ChatAudibleLevel Audible
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.audible;
|
||||
}
|
||||
}
|
||||
|
||||
public string FromName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.fromName;
|
||||
}
|
||||
}
|
||||
|
||||
public UUID ID
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
|
||||
public UUID OwnerID
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ownerid;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.position;
|
||||
}
|
||||
}
|
||||
|
||||
public ChatSourceType SourceType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.sourceType;
|
||||
}
|
||||
}
|
||||
|
||||
public ChatType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
76
SLBot/bot/NetCom/ChatSentEventArgs.cs
Normal file
76
SLBot/bot/NetCom/ChatSentEventArgs.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : ChatSentEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
|
||||
public class ChatSentEventArgs : EventArgs
|
||||
{
|
||||
private int channel;
|
||||
private string message;
|
||||
private ChatType type;
|
||||
|
||||
public ChatSentEventArgs(string message, ChatType type, int channel)
|
||||
{
|
||||
this.message = message;
|
||||
this.type = type;
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public int Channel
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.channel;
|
||||
}
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
|
||||
public ChatType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
66
SLBot/bot/NetCom/ClientDisconnectEventArgs.cs
Normal file
66
SLBot/bot/NetCom/ClientDisconnectEventArgs.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : ClientDisconnectEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
|
||||
public class ClientDisconnectEventArgs : EventArgs
|
||||
{
|
||||
private string message;
|
||||
private NetworkManager.DisconnectType type;
|
||||
|
||||
public ClientDisconnectEventArgs(NetworkManager.DisconnectType type, string message)
|
||||
{
|
||||
this.type = type;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
|
||||
public NetworkManager.DisconnectType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
66
SLBot/bot/NetCom/ClientLoginEventArgs.cs
Normal file
66
SLBot/bot/NetCom/ClientLoginEventArgs.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : ClientLoginEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
|
||||
public class ClientLoginEventArgs : EventArgs
|
||||
{
|
||||
private string message;
|
||||
private LoginStatus status;
|
||||
|
||||
public ClientLoginEventArgs(LoginStatus status, string message)
|
||||
{
|
||||
this.status = status;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
|
||||
public LoginStatus Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.status;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
66
SLBot/bot/NetCom/InstantMessageEventArgs.cs
Normal file
66
SLBot/bot/NetCom/InstantMessageEventArgs.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : InstantMEssageEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
|
||||
public class InstantMessageEventArgs : EventArgs
|
||||
{
|
||||
private InstantMessage im;
|
||||
private Simulator sim;
|
||||
|
||||
public InstantMessageEventArgs(InstantMessage im, Simulator sim)
|
||||
{
|
||||
this.im = im;
|
||||
this.sim = sim;
|
||||
}
|
||||
|
||||
public InstantMessage IM
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.im;
|
||||
}
|
||||
}
|
||||
|
||||
public Simulator Sim
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.sim;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
86
SLBot/bot/NetCom/InstantMessageSentEventArgs.cs
Normal file
86
SLBot/bot/NetCom/InstantMessageSentEventArgs.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : InstantMEssageSentEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
|
||||
public class InstantMessageSentEventArgs : EventArgs
|
||||
{
|
||||
private string _message;
|
||||
private UUID _sessionId;
|
||||
private UUID _targetId;
|
||||
private DateTime _timestamp;
|
||||
|
||||
public InstantMessageSentEventArgs(string message, UUID targetId, UUID sessionId, DateTime timestamp)
|
||||
{
|
||||
this._message = message;
|
||||
this._targetId = targetId;
|
||||
this._sessionId = sessionId;
|
||||
this._timestamp = timestamp;
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._message;
|
||||
}
|
||||
}
|
||||
|
||||
public UUID SessionId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._sessionId;
|
||||
}
|
||||
}
|
||||
|
||||
public UUID TargetId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._targetId;
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime Timestamp
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._timestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
55
SLBot/bot/NetCom/MoneyBalanceEventArgs.cs
Normal file
55
SLBot/bot/NetCom/MoneyBalanceEventArgs.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : MoneyBalanceEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using System;
|
||||
|
||||
public class MoneyBalanceEventArgs : EventArgs
|
||||
{
|
||||
private int newAmount;
|
||||
|
||||
public MoneyBalanceEventArgs(int newAmount)
|
||||
{
|
||||
this.newAmount = newAmount;
|
||||
}
|
||||
|
||||
public int NewAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.newAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
578
SLBot/bot/NetCom/NetCommunication.cs
Normal file
578
SLBot/bot/NetCom/NetCommunication.cs
Normal file
@@ -0,0 +1,578 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : NetCommunication.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using bot;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public class NetCommunication
|
||||
{
|
||||
private const string BetaGridLogin = "https://login.aditi.lindenlab.com/cgi-bin/login.cgi";
|
||||
private SecondLifeBot client;
|
||||
private bool loggedIn;
|
||||
private bool loggingIn;
|
||||
private bot.LoginDetails loginDetails;
|
||||
private const string MainGridLogin = "https://login.agni.lindenlab.com/cgi-bin/login.cgi";
|
||||
private ISynchronizeInvoke netcomSync;
|
||||
private bool teleporting;
|
||||
|
||||
public event EventHandler<AlertMessageEventArgs> AlertMessageReceived;
|
||||
|
||||
public event EventHandler<ChatEventArgs> ChatReceived;
|
||||
|
||||
public event EventHandler<ChatSentEventArgs> ChatSent;
|
||||
|
||||
public event EventHandler<ClientDisconnectEventArgs> ClientDisconnected;
|
||||
|
||||
public event EventHandler ClientLoggedOut;
|
||||
|
||||
public event EventHandler<OverrideEventArgs> ClientLoggingIn;
|
||||
|
||||
public event EventHandler<OverrideEventArgs> ClientLoggingOut;
|
||||
|
||||
public event EventHandler<ClientLoginEventArgs> ClientLoginStatus;
|
||||
|
||||
public event EventHandler<InstantMessageEventArgs> InstantMessageReceived;
|
||||
|
||||
public event EventHandler<InstantMessageSentEventArgs> InstantMessageSent;
|
||||
|
||||
public event EventHandler<MoneyBalanceEventArgs> MoneyBalanceUpdated;
|
||||
|
||||
public event EventHandler<TeleportingEventArgs> Teleporting;
|
||||
|
||||
public event EventHandler<TeleportStatusEventArgs> TeleportStatusChanged;
|
||||
|
||||
public NetCommunication(SecondLifeBot client)
|
||||
{
|
||||
this.client = client;
|
||||
this.loginDetails = client.LoginDetails;
|
||||
this.AddClientEvents();
|
||||
this.AddPacketCallbacks();
|
||||
}
|
||||
|
||||
private void AddClientEvents()
|
||||
{
|
||||
//this.client.Self.OnChat += new AgentManager.ChatCallback(this.Self_OnChat);
|
||||
//this.client.Self.OnInstantMessage += new AgentManager.InstantMessageCallback(this.Self_OnInstantMessage);
|
||||
//this.client.Self.OnBalanceUpdated += new AgentManager.BalanceCallback(this.Avatar_OnBalanceUpdated);
|
||||
//this.client.Self.OnTeleport += new AgentManager.TeleportCallback(this.Self_OnTeleport);
|
||||
this.client.Self.TeleportProgress += new EventHandler<TeleportEventArgs>(this.Self_TeleportProgress);
|
||||
this.client.Network.SimConnected += new EventHandler<SimConnectedEventArgs>(this.Network_OnConnected);
|
||||
//this.client.Network.OnConnected += new NetworkManager.ConnectedCallback(this.Network_OnConnected);
|
||||
//this.client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(this.Network_OnDisconnected);
|
||||
this.client.Network.Disconnected += new EventHandler<DisconnectedEventArgs>(this.Network_OnDisconnected);
|
||||
this.client.Network.LoginProgress += new EventHandler<LoginProgressEventArgs>(this.Network_OnLogin);
|
||||
//this.client.Network.OnLogin += new NetworkManager.LoginCallback(this.Network_OnLogin);
|
||||
this.client.Network.LoggedOut += new EventHandler<LoggedOutEventArgs>(this.Network_OnLogoutReply);
|
||||
//this.client.Network.OnLogoutReply += new NetworkManager.LogoutCallback(this.Network_OnLogoutReply);
|
||||
}
|
||||
|
||||
private void AddPacketCallbacks()
|
||||
{
|
||||
this.client.Network.RegisterCallback(PacketType.AlertMessage, this.AlertMessageHandler);
|
||||
}
|
||||
|
||||
private void AlertMessageHandler(object sender, PacketReceivedEventArgs e)
|
||||
{
|
||||
if (e.Packet.Type == PacketType.AlertMessage)
|
||||
{
|
||||
AlertMessagePacket packet2 = (AlertMessagePacket)e.Packet;
|
||||
AlertMessageEventArgs f = new AlertMessageEventArgs(Utils.BytesToString(packet2.AlertData.Message));
|
||||
if (this.netcomSync != null)
|
||||
{
|
||||
this.netcomSync.BeginInvoke(new OnAlertMessageRaise(this.OnAlertMessageReceived), new object[] { f });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnAlertMessageReceived(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Avatar_OnBalanceUpdated(int balance)
|
||||
{
|
||||
MoneyBalanceEventArgs e = new MoneyBalanceEventArgs(balance);
|
||||
if (this.netcomSync != null)
|
||||
{
|
||||
this.netcomSync.BeginInvoke(new OnMoneyBalanceRaise(this.OnMoneyBalanceUpdated), new object[] { e });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnMoneyBalanceUpdated(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void ChatOut(string chat, ChatType type, int channel)
|
||||
{
|
||||
if (this.loggedIn)
|
||||
{
|
||||
this.client.Self.Chat(chat, channel, type);
|
||||
this.OnChatSent(new ChatSentEventArgs(chat, type, channel));
|
||||
}
|
||||
}
|
||||
|
||||
public string generateMAC()
|
||||
{
|
||||
Random random = new Random(15);
|
||||
string str = "";
|
||||
for (int i = 0; i < 0x20; i++)
|
||||
{
|
||||
str = str + this.sm_int_to_hex(random.Next(15));
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public void Login()
|
||||
{
|
||||
this.loggingIn = true;
|
||||
OverrideEventArgs e = new OverrideEventArgs();
|
||||
this.OnClientLoggingIn(e);
|
||||
if (e.Cancel)
|
||||
{
|
||||
this.loggingIn = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
string password;
|
||||
if ((string.IsNullOrEmpty(this.loginDetails.FirstName) || string.IsNullOrEmpty(this.loginDetails.LastName)) || string.IsNullOrEmpty(this.loginDetails.Password))
|
||||
{
|
||||
//CLAUNIA: TRANSLATE ME
|
||||
this.OnClientLoginStatus(new ClientLoginEventArgs(LoginStatus.Failed, "One or more fields are blank."));
|
||||
}
|
||||
string startLocation = string.Empty;
|
||||
if ((this.LoginDetails.StartLocation != "home") && (this.LoginDetails.StartLocation != "last"))
|
||||
{
|
||||
StartLocationParser parser = new StartLocationParser(this.loginDetails.StartLocation.Trim());
|
||||
startLocation = NetworkManager.StartLocation(parser.Sim, parser.X, parser.Y, parser.Z);
|
||||
}
|
||||
else
|
||||
{
|
||||
startLocation = this.LoginDetails.StartLocation;
|
||||
}
|
||||
if (this.loginDetails.IsPasswordMD5)
|
||||
{
|
||||
password = this.loginDetails.Password;
|
||||
}
|
||||
else
|
||||
{
|
||||
password = Utils.MD5(this.loginDetails.Password);
|
||||
}
|
||||
LoginParams loginParams = this.client.Network.DefaultLoginParams(this.loginDetails.FirstName, this.loginDetails.LastName, password, this.loginDetails.UserAgent, this.loginDetails.Author);
|
||||
loginParams.Start = startLocation;
|
||||
if (this.LoginDetails.GridCustomLoginUri == "")
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show(bot.Localization.clResourceManager.getText("NetCom.Updating.Line1") + System.Environment.NewLine +
|
||||
bot.Localization.clResourceManager.getText("NetCom.Updating.Line2") + System.Environment.NewLine +
|
||||
bot.Localization.clResourceManager.getText("NetCom.Updating.Line3"));
|
||||
|
||||
this.client.Settings.LOGIN_SERVER = "https://login.agni.lindenlab.com/cgi-bin/login.cgi";
|
||||
}
|
||||
this.client.Settings.LOGIN_SERVER = this.loginDetails.GridCustomLoginUri;
|
||||
loginParams.URI = this.client.Settings.LOGIN_SERVER;
|
||||
this.client.Network.BeginLogin(loginParams);
|
||||
}
|
||||
}
|
||||
|
||||
public void Logout()
|
||||
{
|
||||
if (!this.loggedIn)
|
||||
{
|
||||
this.OnClientLoggedOut(EventArgs.Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
OverrideEventArgs e = new OverrideEventArgs();
|
||||
this.OnClientLoggingOut(e);
|
||||
if (!e.Cancel)
|
||||
{
|
||||
this.client.Network.Logout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Network_OnConnected(object sender, SimConnectedEventArgs e)
|
||||
{
|
||||
this.client.Self.RequestBalance();
|
||||
this.client.Appearance.SetPreviousAppearance(false);
|
||||
}
|
||||
|
||||
private void Network_OnDisconnected(object sender, DisconnectedEventArgs e)
|
||||
{
|
||||
if (this.loggedIn)
|
||||
{
|
||||
this.loggedIn = false;
|
||||
ClientDisconnectEventArgs f = new ClientDisconnectEventArgs(e.Reason, e.Message);
|
||||
if (this.netcomSync != null)
|
||||
{
|
||||
this.netcomSync.BeginInvoke(new OnClientDisconnectRaise(this.OnClientDisconnected), new object[] { f });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnClientDisconnected(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Network_OnLogin(object sender, LoginProgressEventArgs e)
|
||||
{
|
||||
if (e.Status == LoginStatus.Success)
|
||||
{
|
||||
this.loggedIn = true;
|
||||
}
|
||||
ClientLoginEventArgs f = new ClientLoginEventArgs(e.Status, e.Message);
|
||||
if (this.netcomSync != null)
|
||||
{
|
||||
this.netcomSync.BeginInvoke(new OnClientLoginRaise(this.OnClientLoginStatus), new object[] { f });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnClientLoginStatus(f);
|
||||
}
|
||||
}
|
||||
|
||||
private void Network_OnLogoutReply(object sender, LoggedOutEventArgs e)
|
||||
{
|
||||
this.loggedIn = false;
|
||||
if (this.netcomSync != null)
|
||||
{
|
||||
this.netcomSync.BeginInvoke(new OnClientLogoutRaise(this.OnClientLoggedOut), new object[] { EventArgs.Empty });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnClientLoggedOut(EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnAlertMessageReceived(AlertMessageEventArgs e)
|
||||
{
|
||||
if (this.AlertMessageReceived != null)
|
||||
{
|
||||
this.AlertMessageReceived(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnChatReceived(ChatEventArgs e)
|
||||
{
|
||||
if (this.ChatReceived != null)
|
||||
{
|
||||
this.ChatReceived(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnChatSent(ChatSentEventArgs e)
|
||||
{
|
||||
if (this.ChatSent != null)
|
||||
{
|
||||
this.ChatSent(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnClientDisconnected(ClientDisconnectEventArgs e)
|
||||
{
|
||||
if (this.ClientDisconnected != null)
|
||||
{
|
||||
this.ClientDisconnected(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnClientLoggedOut(EventArgs e)
|
||||
{
|
||||
if (this.ClientLoggedOut != null)
|
||||
{
|
||||
this.ClientLoggedOut(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnClientLoggingIn(OverrideEventArgs e)
|
||||
{
|
||||
if (this.ClientLoggingIn != null)
|
||||
{
|
||||
this.ClientLoggingIn(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnClientLoggingOut(OverrideEventArgs e)
|
||||
{
|
||||
if (this.ClientLoggingOut != null)
|
||||
{
|
||||
this.ClientLoggingOut(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnClientLoginStatus(ClientLoginEventArgs e)
|
||||
{
|
||||
if (this.ClientLoginStatus != null)
|
||||
{
|
||||
this.ClientLoginStatus(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnInstantMessageReceived(InstantMessageEventArgs e)
|
||||
{
|
||||
if (this.InstantMessageReceived != null)
|
||||
{
|
||||
this.InstantMessageReceived(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnInstantMessageSent(InstantMessageSentEventArgs e)
|
||||
{
|
||||
if (this.InstantMessageSent != null)
|
||||
{
|
||||
this.InstantMessageSent(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnMoneyBalanceUpdated(MoneyBalanceEventArgs e)
|
||||
{
|
||||
if (this.MoneyBalanceUpdated != null)
|
||||
{
|
||||
this.MoneyBalanceUpdated(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnTeleporting(TeleportingEventArgs e)
|
||||
{
|
||||
if (this.Teleporting != null)
|
||||
{
|
||||
this.Teleporting(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnTeleportStatusChanged(TeleportEventArgs e)
|
||||
{
|
||||
if (this.TeleportStatusChanged != null)
|
||||
{
|
||||
TeleportStatusEventArgs f = new TeleportStatusEventArgs(e.Message, e.Status, e.Flags);
|
||||
this.TeleportStatusChanged(this, f);
|
||||
}
|
||||
}
|
||||
|
||||
private void Self_OnChat(string message, ChatAudibleLevel audible, ChatType type, ChatSourceType sourceType, string fromName, UUID id, UUID ownerid, Vector3 position)
|
||||
{
|
||||
ChatEventArgs e = new ChatEventArgs(message, audible, type, sourceType, fromName, id, ownerid, position);
|
||||
if (this.netcomSync != null)
|
||||
{
|
||||
this.netcomSync.BeginInvoke(new OnChatRaise(this.OnChatReceived), new object[] { e });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnChatReceived(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void Self_OnInstantMessage(InstantMessage im, Simulator simulator)
|
||||
{
|
||||
InstantMessageEventArgs e = new InstantMessageEventArgs(im, simulator);
|
||||
if (this.netcomSync != null)
|
||||
{
|
||||
this.netcomSync.BeginInvoke(new OnInstantMessageRaise(this.OnInstantMessageReceived), new object[] { e });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnInstantMessageReceived(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void Self_TeleportProgress(object sender, TeleportEventArgs e)
|
||||
{
|
||||
if ((e.Status == TeleportStatus.Finished) || (e.Status == TeleportStatus.Failed))
|
||||
{
|
||||
this.teleporting = false;
|
||||
}
|
||||
|
||||
if (this.netcomSync != null)
|
||||
{
|
||||
this.netcomSync.BeginInvoke(new OnTeleportStatusRaise(this.OnTeleportStatusChanged), new object[] { e });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OnTeleportStatusChanged(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendIMStartTyping(UUID target, UUID session)
|
||||
{
|
||||
if (this.loggedIn)
|
||||
{
|
||||
this.client.Self.InstantMessage(this.loginDetails.FullName, target, "typing", session, InstantMessageDialog.StartTyping, InstantMessageOnline.Online, this.client.Self.SimPosition, this.client.Network.CurrentSim.ID, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendIMStopTyping(UUID target, UUID session)
|
||||
{
|
||||
if (this.loggedIn)
|
||||
{
|
||||
this.client.Self.InstantMessage(this.loginDetails.FullName, target, "typing", session, InstantMessageDialog.StopTyping, InstantMessageOnline.Online, this.client.Self.SimPosition, this.client.Network.CurrentSim.ID, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendInstantMessage(string message, UUID target, UUID session)
|
||||
{
|
||||
if (this.loggedIn)
|
||||
{
|
||||
this.client.Self.InstantMessage(this.loginDetails.FullName, target, message, session, InstantMessageDialog.MessageFromAgent, InstantMessageOnline.Online, this.client.Self.SimPosition, this.client.Network.CurrentSim.ID, null);
|
||||
this.OnInstantMessageSent(new InstantMessageSentEventArgs(message, target, session, DateTime.Now));
|
||||
}
|
||||
}
|
||||
|
||||
private string sm_int_to_hex(int inp)
|
||||
{
|
||||
switch (inp)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
return inp.ToString();
|
||||
|
||||
case 10:
|
||||
return "A";
|
||||
|
||||
case 11:
|
||||
return "B";
|
||||
|
||||
case 12:
|
||||
return "C";
|
||||
|
||||
case 13:
|
||||
return "D";
|
||||
|
||||
case 14:
|
||||
return "E";
|
||||
|
||||
case 15:
|
||||
return "F";
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
public void Teleport(string sim, Vector3 coordinates)
|
||||
{
|
||||
if (this.loggedIn && !this.teleporting)
|
||||
{
|
||||
TeleportingEventArgs e = new TeleportingEventArgs(sim, coordinates);
|
||||
this.OnTeleporting(e);
|
||||
if (!e.Cancel)
|
||||
{
|
||||
this.teleporting = true;
|
||||
this.client.Self.Teleport(sim, coordinates);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SecondLifeBot Client
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.client;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLoggedIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.loggedIn;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLoggingIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.loggingIn;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsTeleporting
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.teleporting;
|
||||
}
|
||||
}
|
||||
|
||||
public bot.LoginDetails LoginDetails
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.loginDetails;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.loginDetails = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ISynchronizeInvoke NetcomSync
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.netcomSync;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.netcomSync = value;
|
||||
}
|
||||
}
|
||||
|
||||
private delegate void OnAlertMessageRaise(AlertMessageEventArgs e);
|
||||
|
||||
private delegate void OnChatRaise(ChatEventArgs e);
|
||||
|
||||
private delegate void OnClientDisconnectRaise(ClientDisconnectEventArgs e);
|
||||
|
||||
private delegate void OnClientLoginRaise(ClientLoginEventArgs e);
|
||||
|
||||
private delegate void OnClientLogoutRaise(EventArgs e);
|
||||
|
||||
private delegate void OnInstantMessageRaise(InstantMessageEventArgs e);
|
||||
|
||||
private delegate void OnMoneyBalanceRaise(MoneyBalanceEventArgs e);
|
||||
|
||||
private delegate void OnTeleportStatusRaise(TeleportEventArgs e);
|
||||
}
|
||||
}
|
||||
|
||||
63
SLBot/bot/NetCom/OverrideEventArgs.cs
Normal file
63
SLBot/bot/NetCom/OverrideEventArgs.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : OverrideEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using System;
|
||||
|
||||
public class OverrideEventArgs : EventArgs
|
||||
{
|
||||
private bool _cancel;
|
||||
|
||||
public OverrideEventArgs()
|
||||
{
|
||||
}
|
||||
|
||||
public OverrideEventArgs(bool cancel)
|
||||
{
|
||||
this._cancel = cancel;
|
||||
}
|
||||
|
||||
public bool Cancel
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._cancel;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._cancel = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
122
SLBot/bot/NetCom/StartLocationParser.cs
Normal file
122
SLBot/bot/NetCom/StartLocationParser.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : StartLocationParser.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using System;
|
||||
|
||||
public class StartLocationParser
|
||||
{
|
||||
private string location;
|
||||
|
||||
public StartLocationParser(string location)
|
||||
{
|
||||
if (location == null)
|
||||
{
|
||||
throw new Exception("Location cannot be null.");
|
||||
}
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
private string GetSim(string location)
|
||||
{
|
||||
if (!location.Contains("/"))
|
||||
{
|
||||
return location;
|
||||
}
|
||||
return location.Split(new char[] { '/' })[0];
|
||||
}
|
||||
|
||||
private int GetX(string location)
|
||||
{
|
||||
int num;
|
||||
if (location.Contains("/") && int.TryParse(location.Split(new char[] { '/' })[1], out num))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
private int GetY(string location)
|
||||
{
|
||||
int num;
|
||||
if (location.Contains("/") && int.TryParse(location.Split(new char[] { '/' })[2], out num))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
private int GetZ(string location)
|
||||
{
|
||||
int num;
|
||||
if (location.Contains("/") && int.TryParse(location.Split(new char[] { '/' })[3], out num))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public string Sim
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetSim(this.location);
|
||||
}
|
||||
}
|
||||
|
||||
public int X
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetX(this.location);
|
||||
}
|
||||
}
|
||||
|
||||
public int Y
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetY(this.location);
|
||||
}
|
||||
}
|
||||
|
||||
public int Z
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetZ(this.location);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
76
SLBot/bot/NetCom/TeleportStatusEventArgs.cs
Normal file
76
SLBot/bot/NetCom/TeleportStatusEventArgs.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : TeleportStatusEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
|
||||
public class TeleportStatusEventArgs : EventArgs
|
||||
{
|
||||
private TeleportFlags flags;
|
||||
private string message;
|
||||
private TeleportStatus status;
|
||||
|
||||
public TeleportStatusEventArgs(string message, TeleportStatus status, TeleportFlags flags)
|
||||
{
|
||||
this.message = message;
|
||||
this.status = status;
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
public TeleportFlags Flags
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.flags;
|
||||
}
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
|
||||
public TeleportStatus Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.status;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
66
SLBot/bot/NetCom/TeleportingEventArgs.cs
Normal file
66
SLBot/bot/NetCom/TeleportingEventArgs.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
/***************************************************************************
|
||||
The Disc Image Chef
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Filename : TeleportingEventArgs.cs
|
||||
Version : 1.0.326
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
Component : NatiBot
|
||||
|
||||
Revision : r326
|
||||
Last change by : Natalia Portillo
|
||||
Date : 2010/01/01
|
||||
|
||||
--[ License ] --------------------------------------------------------------
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (C) 2008-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
namespace bot.NetCom
|
||||
{
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
|
||||
public class TeleportingEventArgs : OverrideEventArgs
|
||||
{
|
||||
private Vector3 _coordinates;
|
||||
private string _sim;
|
||||
|
||||
public TeleportingEventArgs(string sim, Vector3 coordinates)
|
||||
{
|
||||
this._sim = sim;
|
||||
this._coordinates = coordinates;
|
||||
}
|
||||
|
||||
public Vector3 Coordinates
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._coordinates;
|
||||
}
|
||||
}
|
||||
|
||||
public string SimName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._sim;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user