The rest of the refactor
This commit is contained in:
2
dist/classes/ClientCommands.d.ts
vendored
2
dist/classes/ClientCommands.d.ts
vendored
@@ -10,11 +10,13 @@ import { CommunicationsCommands } from './commands/CommunicationsCommands';
|
||||
import { AgentCommands } from './commands/AgentCommands';
|
||||
import { GroupCommands } from './commands/GroupCommands';
|
||||
import { InventoryCommands } from './commands/InventoryCommands';
|
||||
import { ParcelCommands } from './commands/ParcelCommands';
|
||||
export declare class ClientCommands {
|
||||
network: NetworkCommands;
|
||||
asset: AssetCommands;
|
||||
teleport: TeleportCommands;
|
||||
region: RegionCommands;
|
||||
parcel: ParcelCommands;
|
||||
grid: GridCommands;
|
||||
comms: CommunicationsCommands;
|
||||
agent: AgentCommands;
|
||||
|
||||
2
dist/classes/ClientCommands.js
vendored
2
dist/classes/ClientCommands.js
vendored
@@ -9,12 +9,14 @@ const CommunicationsCommands_1 = require("./commands/CommunicationsCommands");
|
||||
const AgentCommands_1 = require("./commands/AgentCommands");
|
||||
const GroupCommands_1 = require("./commands/GroupCommands");
|
||||
const InventoryCommands_1 = require("./commands/InventoryCommands");
|
||||
const ParcelCommands_1 = require("./commands/ParcelCommands");
|
||||
class ClientCommands {
|
||||
constructor(region, agent, bot) {
|
||||
this.network = new NetworkCommands_1.NetworkCommands(region, agent, bot);
|
||||
this.asset = new AssetCommands_1.AssetCommands(region, agent, bot);
|
||||
this.teleport = new TeleportCommands_1.TeleportCommands(region, agent, bot);
|
||||
this.region = new RegionCommands_1.RegionCommands(region, agent, bot);
|
||||
this.parcel = new ParcelCommands_1.ParcelCommands(region, agent, bot);
|
||||
this.grid = new GridCommands_1.GridCommands(region, agent, bot);
|
||||
this.comms = new CommunicationsCommands_1.CommunicationsCommands(region, agent, bot);
|
||||
this.agent = new AgentCommands_1.AgentCommands(region, agent, bot);
|
||||
|
||||
2
dist/classes/ClientCommands.js.map
vendored
2
dist/classes/ClientCommands.js.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"ClientCommands.js","sourceRoot":"","sources":["../../lib/classes/ClientCommands.ts"],"names":[],"mappings":";;AAGA,gEAA2D;AAC3D,4DAAuD;AACvD,kEAA6D;AAC7D,8DAAyD;AACzD,0DAAqD;AACrD,8EAAyE;AACzE,4DAAuD;AACvD,4DAAuD;AACvD,oEAA+D;AAE/D;IAYI,YAAY,MAAc,EAAE,KAAY,EAAE,GAAQ;QAE9C,IAAI,CAAC,OAAO,GAAG,IAAI,iCAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACvD,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,mCAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,GAAG,IAAI,+BAAc,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,GAAG,IAAI,2BAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,+CAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC5D,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,qCAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/D,CAAC;CACJ;AAxBD,wCAwBC"}
|
||||
{"version":3,"file":"ClientCommands.js","sourceRoot":"","sources":["../../lib/classes/ClientCommands.ts"],"names":[],"mappings":";;AAGA,gEAA2D;AAC3D,4DAAuD;AACvD,kEAA6D;AAC7D,8DAAyD;AACzD,0DAAqD;AACrD,8EAAyE;AACzE,4DAAuD;AACvD,4DAAuD;AACvD,oEAA+D;AAC/D,8DAAyD;AAEzD;IAaI,YAAY,MAAc,EAAE,KAAY,EAAE,GAAQ;QAE9C,IAAI,CAAC,OAAO,GAAG,IAAI,iCAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACvD,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,mCAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,GAAG,IAAI,+BAAc,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,GAAG,IAAI,+BAAc,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,GAAG,IAAI,2BAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,+CAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC5D,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,qCAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/D,CAAC;CACJ;AA1BD,wCA0BC"}
|
||||
@@ -1,16 +1,15 @@
|
||||
import {LureEvent} from '../events/LureEvent';
|
||||
import {ChatEvent} from '../events/ChatEvent';
|
||||
import {TeleportEvent} from '../events/TeleportEvent';
|
||||
import {Subject} from 'rxjs/Subject';
|
||||
import {InstantMessageEvent} from '../events/InstantMessageEvent';
|
||||
import {GroupInviteEvent} from '../events/GroupInviteEvent';
|
||||
import {FriendRequestEvent} from '../events/FriendRequestEvent';
|
||||
import {DisconnectEvent} from '../events/DisconnectEvent';
|
||||
import {GroupChatEvent} from '../events/GroupChatEvent';
|
||||
import {GroupChatSessionJoinEvent} from '../events/GroupChatSessionJoinEvent';
|
||||
import {GroupChatSessionAgentListEvent} from '../events/GroupChatSessionAgentListEvent';
|
||||
import {InventoryOfferedEvent} from '../events/InventoryOfferedEvent';
|
||||
import {FriendResponseEvent} from '../events/FriendshipResponseEvent';
|
||||
import {
|
||||
ChatEvent,
|
||||
DisconnectEvent,
|
||||
FriendRequestEvent, FriendResponseEvent, GroupChatEvent, GroupChatSessionAgentListEvent, GroupChatSessionJoinEvent,
|
||||
GroupInviteEvent,
|
||||
InstantMessageEvent,
|
||||
InventoryOfferedEvent,
|
||||
LureEvent,
|
||||
TeleportEvent
|
||||
} from '..';
|
||||
|
||||
|
||||
export class ClientEvents
|
||||
{
|
||||
|
||||
@@ -5,19 +5,20 @@ import {Message} from '../enums/Message';
|
||||
import {ChatFromSimulatorMessage} from './messages/ChatFromSimulator';
|
||||
import {ImprovedInstantMessageMessage} from './messages/ImprovedInstantMessage';
|
||||
import {Utils} from './Utils';
|
||||
import {ChatEvent} from '../events/ChatEvent';
|
||||
import {InstantMessageDialog} from '../enums/InstantMessageDialog';
|
||||
import {LureEvent} from '../events/LureEvent';
|
||||
import {AlertMessageMessage} from './messages/AlertMessage';
|
||||
import {ClientEvents} from './ClientEvents';
|
||||
import {InstantMessageEvent} from '../events/InstantMessageEvent';
|
||||
import {ChatSourceType} from '../enums/ChatSourceType';
|
||||
import {InstantMessageEventFlags} from '../enums/InstantMessageEventFlags';
|
||||
import {GroupInviteEvent} from '../events/GroupInviteEvent';
|
||||
import {GroupChatEvent} from '../events/GroupChatEvent';
|
||||
import {FriendRequestEvent} from '../events/FriendRequestEvent';
|
||||
import {InventoryOfferedEvent} from '../events/InventoryOfferedEvent';
|
||||
import {FriendResponseEvent} from '../events/FriendshipResponseEvent';
|
||||
import {
|
||||
ChatEvent,
|
||||
ChatSourceType,
|
||||
FriendRequestEvent,
|
||||
FriendResponseEvent,
|
||||
GroupChatEvent,
|
||||
GroupInviteEvent,
|
||||
InstantMessageEvent,
|
||||
InstantMessageEventFlags,
|
||||
InventoryOfferedEvent, LureEvent
|
||||
} from '..';
|
||||
|
||||
export class Comms
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {MapInfoReply} from '../../events/MapInfoReply';
|
||||
import {Packet} from '../Packet';
|
||||
import * as Long from 'long';
|
||||
import {MapItemReplyMessage} from '../messages/MapItemReply';
|
||||
@@ -8,7 +7,6 @@ import {MapBlockRequestMessage} from '../messages/MapBlockRequest';
|
||||
import {UUID} from '../UUID';
|
||||
import {MapItemRequestMessage} from '../messages/MapItemRequest';
|
||||
import {Utils} from '../Utils';
|
||||
import {PacketFlags} from '../../enums/PacketFlags';
|
||||
import {GridItemType} from '../../enums/GridItemType';
|
||||
import {CommandsBase} from './CommandsBase';
|
||||
import {AvatarPickerRequestMessage} from '../messages/AvatarPickerRequest';
|
||||
@@ -16,17 +14,15 @@ import {AvatarPickerReplyMessage} from '../messages/AvatarPickerReply';
|
||||
import {FilterResponse} from '../../enums/FilterResponse';
|
||||
import {MapNameRequestMessage} from '../messages/MapNameRequest';
|
||||
import {GridLayerType} from '../../enums/GridLayerType';
|
||||
import {RegionInfoReply} from '../../events/RegionInfoReply';
|
||||
import {MapInfoRangeReply} from '../../events/MapInfoRangeReply';
|
||||
import {MapBlock} from '../MapBlock';
|
||||
import {MapInfoRangeReplyEvent, MapInfoReplyEvent, PacketFlags, RegionInfoReplyEvent} from '../..';
|
||||
export class GridCommands extends CommandsBase
|
||||
{
|
||||
getRegionByName(regionName: string)
|
||||
{
|
||||
return new Promise<RegionInfoReply>((resolve, reject) =>
|
||||
return new Promise<RegionInfoReplyEvent>((resolve, reject) =>
|
||||
{
|
||||
const circuit = this.currentRegion.circuit;
|
||||
const response = new MapInfoReply();
|
||||
const msg: MapNameRequestMessage = new MapNameRequestMessage();
|
||||
msg.AgentData = {
|
||||
AgentID: this.agent.agentID,
|
||||
@@ -64,17 +60,18 @@ export class GridCommands extends CommandsBase
|
||||
const name = Utils.BufferToStringSimple(region.Name);
|
||||
if (name.trim().toLowerCase() === regionName.trim().toLowerCase() && !(region.X === 0 && region.Y === 0))
|
||||
{
|
||||
const reply = new RegionInfoReply();
|
||||
reply.access = region.Access;
|
||||
reply.X = region.X;
|
||||
reply.Y = region.Y;
|
||||
reply.name = name;
|
||||
reply.regionFlags = region.RegionFlags;
|
||||
reply.waterHeight = region.WaterHeight;
|
||||
reply.agents = region.Agents;
|
||||
reply.mapImageID = region.MapImageID;
|
||||
|
||||
reply.handle = Utils.RegionCoordinatesToHandle(region.X * 256, region.Y * 256);
|
||||
const reply = new class implements RegionInfoReplyEvent
|
||||
{
|
||||
X = region.X;
|
||||
Y = region.Y;
|
||||
name = name;
|
||||
access = region.Access;
|
||||
regionFlags = region.RegionFlags;
|
||||
waterHeight = region.WaterHeight;
|
||||
agents = region.Agents;
|
||||
mapImageID = region.MapImageID;
|
||||
handle = Utils.RegionCoordinatesToHandle(region.X * 256, region.Y * 256)
|
||||
};
|
||||
resolve(reply);
|
||||
}
|
||||
});
|
||||
@@ -84,12 +81,12 @@ export class GridCommands extends CommandsBase
|
||||
});
|
||||
});
|
||||
}
|
||||
getRegionMapInfo(gridX: number, gridY: number): Promise<MapInfoReply>
|
||||
getRegionMapInfo(gridX: number, gridY: number): Promise<MapInfoReplyEvent>
|
||||
{
|
||||
return new Promise<MapInfoReply>((resolve, reject) =>
|
||||
return new Promise<MapInfoReplyEvent>((resolve, reject) =>
|
||||
{
|
||||
const circuit = this.currentRegion.circuit;
|
||||
const response = new MapInfoReply();
|
||||
const response = new MapInfoReplyEvent();
|
||||
const msg: MapBlockRequestMessage = new MapBlockRequestMessage();
|
||||
msg.AgentData = {
|
||||
AgentID: this.agent.agentID,
|
||||
@@ -198,12 +195,12 @@ export class GridCommands extends CommandsBase
|
||||
});
|
||||
}
|
||||
|
||||
getRegionMapInfoRange(minX: number, minY: number, maxX: number, maxY: number): Promise<MapInfoRangeReply>
|
||||
getRegionMapInfoRange(minX: number, minY: number, maxX: number, maxY: number): Promise<MapInfoRangeReplyEvent>
|
||||
{
|
||||
return new Promise<MapInfoRangeReply>((resolve, reject) =>
|
||||
return new Promise<MapInfoRangeReplyEvent>((resolve, reject) =>
|
||||
{
|
||||
const circuit = this.currentRegion.circuit;
|
||||
const response = new MapInfoRangeReply();
|
||||
const response = new MapInfoRangeReplyEvent();
|
||||
const msg: MapBlockRequestMessage = new MapBlockRequestMessage();
|
||||
msg.AgentData = {
|
||||
AgentID: this.agent.agentID,
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
import {CommandsBase} from './CommandsBase';
|
||||
import {Region} from '../Region';
|
||||
import {LureEvent} from '../../events/LureEvent';
|
||||
import {TeleportEventType} from '../../enums/TeleportEventType';
|
||||
import {TeleportEvent} from '../../events/TeleportEvent';
|
||||
import {PacketFlags} from '../../enums/PacketFlags';
|
||||
import {TeleportLureRequestMessage} from '../messages/TeleportLureRequest';
|
||||
import {TeleportFlags} from '../../enums/TeleportFlags';
|
||||
import {Vector3} from '../Vector3';
|
||||
import {RegionInfoReply} from '../../events/RegionInfoReply';
|
||||
import {TeleportLocationRequestMessage} from '../messages/TeleportLocationRequest';
|
||||
import * as Long from 'long';
|
||||
import {LureEvent, PacketFlags, RegionInfoReplyEvent, TeleportEvent, TeleportFlags} from '../..';
|
||||
|
||||
export class TeleportCommands extends CommandsBase
|
||||
{
|
||||
@@ -131,7 +127,7 @@ export class TeleportCommands extends CommandsBase
|
||||
{
|
||||
return new Promise<TeleportEvent>((resolve, reject) =>
|
||||
{
|
||||
this.bot.clientCommands.grid.getRegionByName(regionName).then((region: RegionInfoReply) =>
|
||||
this.bot.clientCommands.grid.getRegionByName(regionName).then((region: RegionInfoReplyEvent) =>
|
||||
{
|
||||
this.teleportToHandle(region.handle, position, lookAt).then((event: TeleportEvent) =>
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {ChatAudibleLevel} from '../enums/ChatAudible';
|
||||
import {ChatType} from '../enums/ChatType';
|
||||
import {ChatSourceType} from '../enums/ChatSourceType';
|
||||
import {Vector3} from '../classes/Vector3';
|
||||
import {ChatSourceType, UUID, Vector3} from '..';
|
||||
|
||||
export class ChatEvent
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {UUID} from '..';
|
||||
|
||||
export class FriendRequestEvent
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {UUID} from '..';
|
||||
|
||||
export class GroupChatEvent
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {UUID} from '..';
|
||||
|
||||
export class GroupChatSessionAgentListEvent
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {UUID} from '..';
|
||||
|
||||
export class GroupChatSessionJoinEvent
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {UUID} from '..';
|
||||
|
||||
export class GroupInviteEvent
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {ChatSourceType} from '../enums/ChatSourceType';
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {InstantMessageEventFlags} from '../enums/InstantMessageEventFlags';
|
||||
import {ChatSourceType, InstantMessageEventFlags, UUID} from '..';
|
||||
|
||||
export class InstantMessageEvent
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {ChatSourceType} from '../enums/ChatSourceType';
|
||||
import {AssetType} from '../enums/AssetType';
|
||||
import {AssetType, ChatSourceType, UUID} from '..';
|
||||
|
||||
export class InventoryOfferedEvent
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {UUID} from '../classes/UUID';
|
||||
import {Vector3} from '../classes/Vector3';
|
||||
import {UUID, Vector3} from '..';
|
||||
|
||||
export class LureEvent
|
||||
{
|
||||
|
||||
50
lib/index.ts
50
lib/index.ts
@@ -17,12 +17,28 @@ import {Vector3} from './classes/Vector3';
|
||||
import {ChatEvent} from './events/ChatEvent';
|
||||
import {GroupInviteEvent} from './events/GroupInviteEvent';
|
||||
import {FriendRequestEvent} from './events/FriendRequestEvent';
|
||||
import {FriendResponseEvent} from './events/FriendResponseEvent';
|
||||
import {LureEvent} from './events/LureEvent';
|
||||
import {TeleportEvent} from './events/TeleportEvent';
|
||||
import {DisconnectEvent} from './events/DisconnectEvent';
|
||||
import {GroupChatEvent} from './events/GroupChatEvent';
|
||||
import {GroupChatSessionJoinEvent} from './events/GroupChatSessionJoinEvent';
|
||||
import {GroupChatSessionAgentListEvent} from './events/GroupChatSessionAgentListEvent';
|
||||
import {RegionInfoReplyEvent} from './events/RegionInfoReplyEvent';
|
||||
import {MapInfoReplyEvent} from './events/MapInfoReplyEvent';
|
||||
import {MapInfoRangeReplyEvent} from './events/MapInfoRangeReplyEvent';
|
||||
import {InventoryOfferedEvent} from './events/InventoryOfferedEvent';
|
||||
import {AgentFlags} from './enums/AgentFlags';
|
||||
import {ControlFlags} from './enums/ControlFlags';
|
||||
import {InventoryItemFlags} from './enums/InventoryItemFlags';
|
||||
import {LoginFlags} from './enums/LoginFlags';
|
||||
import {MessageFlags} from './enums/MessageFlags';
|
||||
import {PacketFlags} from './enums/PacketFlags';
|
||||
import {RegionProtocolFlags} from './enums/RegionProtocolFlags';
|
||||
import {SoundFlags} from './enums/SoundFlags';
|
||||
import {TeleportFlags} from './enums/TeleportFlags';
|
||||
import {CompressedFlags} from './enums/CompressedFlags';
|
||||
import {DecodeFlags} from './enums/DecodeFlags';
|
||||
|
||||
export {
|
||||
Bot,
|
||||
@@ -31,19 +47,39 @@ export {
|
||||
HTTPAssets,
|
||||
ClientEvents,
|
||||
BVH,
|
||||
InstantMessageEvent,
|
||||
InstantMessageEventFlags,
|
||||
ChatSourceType,
|
||||
BotOptionFlags,
|
||||
UUID,
|
||||
Vector3,
|
||||
|
||||
// Flags
|
||||
AgentFlags,
|
||||
CompressedFlags,
|
||||
ControlFlags,
|
||||
DecodeFlags,
|
||||
InstantMessageEventFlags,
|
||||
InventoryItemFlags,
|
||||
LoginFlags,
|
||||
MessageFlags,
|
||||
PacketFlags,
|
||||
RegionProtocolFlags,
|
||||
SoundFlags,
|
||||
TeleportFlags,
|
||||
|
||||
// Events
|
||||
ChatEvent,
|
||||
GroupInviteEvent,
|
||||
FriendRequestEvent,
|
||||
LureEvent,
|
||||
TeleportEvent,
|
||||
DisconnectEvent,
|
||||
FriendRequestEvent,
|
||||
FriendResponseEvent,
|
||||
GroupChatEvent,
|
||||
GroupChatSessionAgentListEvent,
|
||||
GroupChatSessionJoinEvent,
|
||||
GroupChatSessionAgentListEvent
|
||||
GroupInviteEvent,
|
||||
InstantMessageEvent,
|
||||
InventoryOfferedEvent,
|
||||
LureEvent,
|
||||
MapInfoRangeReplyEvent,
|
||||
MapInfoReplyEvent,
|
||||
RegionInfoReplyEvent,
|
||||
TeleportEvent
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user