/// <summary> /// Adds a client subscriber to object, which will eventually be notified whenever the object changes state. /// </summary> /// <param name="client">The client to add as a subscriber.</param> /// <param name="remoteObjectId">The client's dynamic ID.</param> public void AddSubscriber(BNetClient client, ulong remoteObjectId) { // Map the subscriber's dynamic ID to to our dynamic ID so we know how to translate later on when the object makes a notify call client.MapLocalObjectID(this.DynamicId, remoteObjectId); this.Subscribers.Add(client); // Since the client wasn't previously subscribed, it should not be aware of the object's state -- let's notify it this.NotifySubscriptionAdded(client); }
public void SetOwner(BNetClient client) { if (client == this.Owner) { Logger.Warn("Tried to set client {0} as owner of channel when it was already the owner", client.Connection.RemoteEndPoint.ToString()); return; } RemoveOwner(RemoveReason.Left); AddMember(client); this.Owner = client; }
/// <summary> /// Removes a given subscriber and unmaps the object's dynamic ID. /// </summary> /// <param name="client">The client to remove.</param> public void RemoveSubscriber(BNetClient client) { if (!this.Subscribers.Contains(client)) { Logger.Warn("Attempted to remove subscriber {0}", client.Connection.RemoteEndPoint.ToString()); return; } // Unmap the object from the client client.UnmapLocalObjectID(this.DynamicId); this.Subscribers.Remove(client); // We don't need to do a notify nor respond to the client with anything since the client will ultimately act // like the object never existed in the first place }
public static string GetGameServerIPForClient(BNetClient client) { if (!NATConfig.Instance.Enabled) // if NAT is not enabled, just return bnetclient's localendpoint address. return client.Connection.LocalEndPoint.Address.ToString(); else { return client.Connection.LocalEndPoint.Address.ToString() == "127.0.0.1" ? client.Connection.LocalEndPoint.ToString() : NATConfig.Instance.PublicIP; // if client is not connected over localhost, send him public-ip. // Known problems: If user enables NAT, LAN-clients (and even local-computer if d3 is configured to use lan-ip) will not able to connect in gs. // That needs a full implementation similar to pvpgn where we currently pretty miss the time for /raist. } }
public Channel(BNetClient client) { this.BnetEntityID = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetLow(this.DynamicId).Build(); var builder = bnet.protocol.channel.ChannelState.CreateBuilder() .SetPrivacyLevel(bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_OPEN) .SetMaxMembers(8) .SetMinMembers(1) .SetMaxInvitations(12); //.SetName("d3sharp test channel"); // NOTE: cap log doesn't set this optional field this.State = builder.Build(); // add the client that requested the creation of channel to channel this.AddMember(client); }
public void ListenForGame(BNetClient client) { // we should actually find server's public-interface and use that. var connectionInfo = bnet.protocol.game_master.ConnectInfo.CreateBuilder().SetToonId(client.CurrentToon.BnetEntityID).SetHost (Net.Game.Config.Instance.BindIP).SetPort(Net.Game.Config.Instance.Port).SetToken(ByteString.CopyFrom(new byte[] {0x07, 0x34, 0x02, 0x60, 0x91, 0x93, 0x76, 0x46, 0x28, 0x84})) .AddAttribute(bnet.protocol.attribute.Attribute.CreateBuilder().SetName("SGameId").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(2014314530).Build())).Build(); var builder = bnet.protocol.game_master.GameFoundNotification.CreateBuilder(); builder.AddConnectInfo(connectionInfo); builder.SetRequestId(this.RequestID); builder.SetGameHandle(this.GameHandle); client.CallMethod(bnet.protocol.game_master.GameFactorySubscriber.Descriptor.FindMethodByName("NotifyGameFound"), builder.Build(), this.DynamicId); }
public void ListenForGame(BNetClient client) { var connectionInfo = bnet.protocol.game_master.ConnectInfo.CreateBuilder().SetToonId(client.CurrentToon.BnetEntityID).SetHost ("127.0.0.1").SetPort(Net.Game.Config.Instance.Port).SetToken(ByteString.CopyFrom(new byte[] {0x07, 0x34, 0x02, 0x60, 0x91, 0x93, 0x76, 0x46, 0x28, 0x84})) .AddAttribute(bnet.protocol.attribute.Attribute.CreateBuilder().SetName("SGameId").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(2014314530).Build())).Build(); var builder = bnet.protocol.game_master.GameFoundNotification.CreateBuilder(); builder.AddConnectInfo(connectionInfo); builder.SetRequestId(this.RequestID); builder.SetGameHandle(this.GameHandle); Logger.Trace("Game spawned: {0}:{1}", connectionInfo.Host, connectionInfo.Port); client.CallMethod(bnet.protocol.game_master.GameFactorySubscriber.Descriptor.FindMethodByName("NotifyGameFound"), builder.Build(), this.ID); }
public Channel(BNetClient client, ulong remoteObjectId) { this.BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetLow(this.DynamicId).Build(); this.D3EntityId = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetIdLow(this.DynamicId).Build(); // This is an object creator, so we have to map the remote object ID client.MapLocalObjectID(this.DynamicId, remoteObjectId); var builder = bnet.protocol.channel.ChannelState.CreateBuilder() .SetPrivacyLevel(bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_OPEN_INVITATION) .SetMaxMembers(8) .SetMinMembers(1) .SetMaxInvitations(12); //.SetName("d3sharp test channel"); // NOTE: cap log doesn't set this optional field this.State = builder.Build(); }
public void AddMember(BNetClient client) { var identity = client.GetIdentity(false, false, true); var member = bnet.protocol.channel.Member.CreateBuilder() .SetIdentity(identity) .SetState(bnet.protocol.channel.MemberState.CreateBuilder() .AddRole(2) .SetPrivileges(0xFBFF) // 64511 .Build()) .Build(); // be carefult when editing the below rpc call, you may broke in game to error!! /raist. var builder = bnet.protocol.channel.AddNotification.CreateBuilder() .SetChannelState(this.State) .SetSelf(member); client.CallMethod(bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyAdd"), builder.Build(), this.DynamicId); this.Members.Add(client, member); }
public void Add(BNetClient client) { var identity = client.GetIdentity(false, false, true); var user = bnet.protocol.channel.Member.CreateBuilder() .SetIdentity(identity) .SetState(bnet.protocol.channel.MemberState.CreateBuilder() .AddRole(2) .SetPrivileges(0xFBFF) // 64511 .Build()) .Build(); this.Members.Add(user); var builder = bnet.protocol.channel.AddNotification.CreateBuilder() .SetChannelState(this.State) .SetSelf(user); // Cap includes the user that was added foreach (var m in this.Members) { builder.AddMember(m); } client.CallMethod(bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyAdd"), builder.Build(), this.DynamicId); }
public void NotifyChannelState(BNetClient client) { var field1 = bnet.protocol.presence.Field.CreateBuilder().SetKey( bnet.protocol.presence.FieldKey.CreateBuilder().SetProgram(16974).SetGroup(3).SetField(3).SetIndex(0) .Build()).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetBoolValue(true).Build()).Build(); var field2 = bnet.protocol.presence.Field.CreateBuilder().SetKey( bnet.protocol.presence.FieldKey.CreateBuilder().SetProgram(16974).SetGroup(3).SetField(10).SetIndex(0) .Build()).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(1315530390868296).Build()).Build(); var field3 = bnet.protocol.presence.Field.CreateBuilder().SetKey( bnet.protocol.presence.FieldKey.CreateBuilder().SetProgram(16974).SetGroup(3).SetField(11).SetIndex(0) .Build()).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue( ByteString.CopyFrom(new byte[] { 0x9, 0x46, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4, 0x11, 0xdd, 0xb4, 0x63, 0xe7, 0x82, 0x44, 0x68, 0x4e })).Build()).Build(); var fieldOperation1 = bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field1).Build(); var fieldOperation2 = bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field2).Build(); var fieldOperation3 = bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field3).Build(); var state = bnet.protocol.presence.ChannelState.CreateBuilder().SetEntityId(this.BnetEntityID).AddFieldOperation( fieldOperation1).AddFieldOperation(fieldOperation2).AddFieldOperation(fieldOperation3).Build(); var channelState = bnet.protocol.channel.ChannelState.CreateBuilder().SetExtension(bnet.protocol.presence.ChannelState.Presence, state); var builder = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder().SetStateChange(channelState); client.CallMethod(bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyUpdateChannelState"), builder.Build(), this.DynamicId); }
public Member GetMember(BNetClient client) { return this.Members[client]; }
public void RemoveOwner(RemoveReason reason) { if (this.Owner != null) { RemoveMember(this.Owner, reason, false); this.Owner = null; } }
public void SetOwner(BNetClient client) { if (client == this.Owner) { Logger.Warn("Tried to set client {0} as owner of channel when it was already the owner", client.Connection.RemoteEndPoint.ToString()); return; } // TODO: Should send state update to current owner instead of removing it RemoveOwner(RemoveReason.Left); this.Owner = client; AddMember(client); }
public Channel(BNetClient client, ulong remoteObjectId) { this.BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetLow(this.DynamicId).Build(); this.D3EntityId = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetIdLow(this.DynamicId).Build(); this.PrivacyLevel = bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_OPEN_INVITATION; this.MinMembers = 1; this.MaxMembers = 8; this.MaxInvitations = 12; // This is an object creator, so we have to map the remote object ID client.MapLocalObjectID(this.DynamicId, remoteObjectId); // The client can't be set as the owner (or added as a member) here because the server must first make a response // to the client before using a mapped ID (presuming that this was called from a service). // We'll just let the caller do that for us. }
public static Channel CreateNewChannel(BNetClient client, ulong remoteObjectId) { var channel = new Channel(client, remoteObjectId); Channels.Add(channel.DynamicId, channel); return channel; }
public void AddMember(BNetClient client) { if (HasUser(client)) { Logger.Warn("Attempted to add client {0} to channel when it was already a member of the channel", client.Connection.RemoteEndPoint.ToString()); return; } var identity = client.GetIdentity(false, false, true); var member = bnet.protocol.channel.Member.CreateBuilder() .SetIdentity(identity) .SetState(bnet.protocol.channel.MemberState.CreateBuilder() .AddRole(2) .SetPrivileges(0xFBFF) // 64511 .Build()) .Build(); // Be careful when editing the below RPC call, you may break in-game to error!! /raist var message = bnet.protocol.channel.AddNotification.CreateBuilder() .SetChannelState(this.State) .SetSelf(member) .AddMember(member) .Build(); // This needs to be here so that the foreach below will also send to the client that was just added this.Members.Add(client, member); var method = bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyAdd"); foreach (var pair in this.Members) { client.CallMethod(method, message, this.DynamicId); } client.CurrentChannel = this; }
public void RemoveUser(BNetClient client) { //// send notification remove to client itself. //var identity = client.GetIdentity(false, false, true); //var builder = bnet.protocol.channel.RemoveNotification.CreateBuilder() // .SetMemberId(identity.ToonId); //this.Members.Remove(client); //client.CallMethod(bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyRemove"), builder.Build(), this.DynamicId); //// notify all subscribers. //this.NotifySubscribers(); }
public void OnMessage(JoinBNetGameMessage msg) { if (msg.Id != 0x000A) throw new NotImplementedException(); // a hackish way to get bnetclient in context -- pretends games has only one client in. when we're done with implementing bnet completely, will get this sorted out. /raist this.BnetClient = Core.Games.GameManager.AvailableGames[(ulong)msg.Field2].Clients.FirstOrDefault(); if (this.BnetClient != null) this.BnetClient.InGameClient = this; SendMessage(new VersionsMessage() { Id = 0x000D, SNOPackHash = msg.SNOPackHash, ProtocolHash = GameMessage.ImplementedProtocolHash, Version = "0.3.0.7333", }); FlushOutgoingBuffer(); SendMessage(new ConnectionEstablishedMessage() { Id = 0x002E, Field0 = 0x00000000, Field1 = 0x4BB91A16, Field2 = msg.SNOPackHash, }); SendMessage(new GameSetupMessage() { Id = 0x002F, Field0 = 0x00000077, }); SendMessage(new SavePointInfoMessage() { Id = 0x0045, snoLevelArea = -1, }); SendMessage(new HearthPortalInfoMessage() { Id = 0x0046, snoLevelArea = -1, Field1 = -1, }); SendMessage(new ActTransitionMessage() { Id = 0x00A8, Field0 = 0x00000000, Field1 = true, }); #region NewPlayer SendMessage(new NewPlayerMessage() { Id = 0x0031, Field0 = 0x00000000, //Party frame (0x00000000 hide, 0x00000001 show) Field1 = "", //Owner name? ToonName = this.BnetClient.CurrentToon.Name, Field3 = 0x00000002, //party frame class Field4 = 0x00000004, //party frame level snoActorPortrait = BnetClient.CurrentToon.ClassSNO, //party frame portrait Field6 = 0x00000001, #region HeroStateData Field7 = new HeroStateData() { Field0 = 0x00000000, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = BnetClient.CurrentToon.Gender, Field4 = new PlayerSavedData() { #region HotBarButtonData Field0 = new HotbarButtonData[9] { new HotbarButtonData() { m_snoPower = 0x000176C4, m_gbidItem = -1, }, new HotbarButtonData() { m_snoPower = 0x00007780, m_gbidItem = -1, }, new HotbarButtonData() { m_snoPower = -1, m_gbidItem = -1, }, new HotbarButtonData() { m_snoPower = 0x00007780, m_gbidItem = -1, }, new HotbarButtonData() { m_snoPower = 0x000216FA, m_gbidItem = -1, }, new HotbarButtonData() { m_snoPower = -1, m_gbidItem = -1, }, new HotbarButtonData() { m_snoPower = -1, m_gbidItem = -1, }, new HotbarButtonData() { m_snoPower = -1, m_gbidItem = -1, }, new HotbarButtonData() { m_snoPower = -1, m_gbidItem = 0x622256D4, }, }, #endregion #region SkillKeyMapping Field1 = new SkillKeyMapping[15] { new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, new SkillKeyMapping() { Power = -1, Field1 = -1, Field2 = 0x00000000, }, }, #endregion Field2 = 0x00000000, Field3 = 0x00000001, #region HirelingSavedData Field4 = new HirelingSavedData() { Field0 = new HirelingInfo[4] { new HirelingInfo() { Field0 = 0x00000000, Field1 = -1, Field2 = 0x00000000, Field3 = 0x00000000, Field4 = false, Field5 = -1, Field6 = -1, Field7 = -1, Field8 = -1, }, new HirelingInfo() { Field0 = 0x00000000, Field1 = -1, Field2 = 0x00000000, Field3 = 0x00000000, Field4 = false, Field5 = -1, Field6 = -1, Field7 = -1, Field8 = -1, }, new HirelingInfo() { Field0 = 0x00000000, Field1 = -1, Field2 = 0x00000000, Field3 = 0x00000000, Field4 = false, Field5 = -1, Field6 = -1, Field7 = -1, Field8 = -1, }, new HirelingInfo() { Field0 = 0x00000000, Field1 = -1, Field2 = 0x00000000, Field3 = 0x00000000, Field4 = false, Field5 = -1, Field6 = -1, Field7 = -1, Field8 = -1, }, }, Field1 = 0x00000000, Field2 = 0x00000000, }, #endregion Field5 = 0x00000000, #region LearnedLore Field6 = new LearnedLore() { Field0 = 0x00000000, m_snoLoreLearned = new int[256] { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }, }, #endregion #region snoActiveSkills snoActiveSkills = new int[6] { 0x000176C4, 0x000216FA, -1, -1, -1, -1, }, #endregion #region snoTraits snoTraits = new int[3] { -1, -1, -1, }, #endregion #region SavePointData Field9 = new SavePointData() { snoWorld = -1, Field1 = -1, }, #endregion #region SeenTutorials m_SeenTutorials = new int[64] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, #endregion }, Field5 = 0x00000000, #region PlayerQuestRewardHistoryEntry tQuestRewardHistory = new PlayerQuestRewardHistoryEntry[0] { }, #endregion }, #endregion Field8 = false, //announce party join Field9 = 0x00000001, Field10 = 0x789E00E2, }); #endregion GameWorld.ReadAndSendMap(); Console.WriteLine("Positioning character at " + GameWorld.posx + " " + GameWorld.posy + " " + GameWorld.posz); #region ACDEnterKnown 0x789E00E2 PlayerId?? SendMessage(new ACDEnterKnownMessage() { Id = 0x003B, Field0 = 0x789E00E2, Field1 = BnetClient.CurrentToon.ClassSNO, //Player model? Field2 = 0x00000009, Field3 = 0x00000000, Field4 = new WorldLocationMessageData() { Field0 = 1.43f, Field1 = new PRTransform() { Field0 = new Quaternion() { Field0 = 0.05940768f, Field1 = new Vector3D() { Field0 = 0f, Field1 = 0f, Field2 = 0.9982339f, }, }, Field1 = new Vector3D() { Field0 = GameWorld.posx, Field1 = GameWorld.posy, Field2 = GameWorld.posz, }, }, Field2 = GameWorld.WorldID, }, Field5 = null, Field6 = new GBHandle() { Field0 = 0x00000007, Field1 = BnetClient.CurrentToon.ClassID, }, Field7 = -1, Field8 = -1, Field9 = 0x00000000, Field10 = 0x00, }); SendMessage(new ACDCollFlagsMessage() { Id = 0x00A6, Field0 = 0x789E00E2, Field1 = 0x00000000, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x01F8], // SkillKit Int = BnetClient.CurrentToon.SkillKit, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x00033C40, Attribute = GameAttribute.Attributes[0x01CC], // Buff_Active Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x00007545, Attribute = GameAttribute.Attributes[0x0041], // Skill Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x00007545, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x00000226, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 0.5f, }, new NetAttributeKeyValue() { Field0 = 0x00000226, Attribute = GameAttribute.Attributes[0x003C], // Resistance Int = 0x00000000, Float = 0.5f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00D7], // Immobolize Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00D6], // Untargetable Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000076B7, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000076B7, Attribute = GameAttribute.Attributes[0x0041], // Skill Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000006DF, Attribute = GameAttribute.Attributes[0x0041], // Skill Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x0000CE11, Attribute = GameAttribute.Attributes[0x01CC], // Buff_Active Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x01D2], // CantStartDisplayedPowers Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000216FA, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000176C4, Attribute = GameAttribute.Attributes[0x0041], // Skill Int = 0x00000001, Float = 0f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Field0 = 0x000216FA, Attribute = GameAttribute.Attributes[0x0041], // Skill Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000176C4, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000006DF, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000000DE, Attribute = GameAttribute.Attributes[0x003C], // Resistance Int = 0x00000000, Float = 0.5f, }, new NetAttributeKeyValue() { Field0 = 0x000000DE, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 0.5f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00C8], // Get_Hit_Recovery Int = 0x00000000, Float = 6f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00C7], // Get_Hit_Recovery_Per_Level Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00C6], // Get_Hit_Recovery_Base Int = 0x00000000, Float = 5f, }, new NetAttributeKeyValue() { Field0 = 0x00007780, Attribute = GameAttribute.Attributes[0x0041], // Skill Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00C5], // Get_Hit_Max Int = 0x00000000, Float = 60f, }, new NetAttributeKeyValue() { Field0 = 0x00007780, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00C4], // Get_Hit_Max_Per_Level Int = 0x00000000, Float = 10f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00C3], // Get_Hit_Max_Base Int = 0x00000000, Float = 50f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000001, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 3.051758E-05f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Field0 = 0x00000002, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000003, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000004, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000005, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000006, Attribute = GameAttribute.Attributes[0x003E], // Resistance_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00BE], // Dodge_Rating_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x02BA], // IsTrialActor Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000FFFFF, Attribute = GameAttribute.Attributes[0x01B9], // Buff_Visual_Effect Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x00A8], // Crit_Percent_Cap Int = 0x3F400000, Float = 0f, }, new NetAttributeKeyValue() { Field0 = BnetClient.CurrentToon.ResourceID, Attribute = GameAttribute.Attributes[0x005E], // Resource_Cur Int = 0x43480000, Float = 0f, }, new NetAttributeKeyValue() { Field0 = BnetClient.CurrentToon.ResourceID, Attribute = GameAttribute.Attributes[0x005F], // Resource_Max Int = 0x00000000, Float = 200f, }, new NetAttributeKeyValue() { Field0 = BnetClient.CurrentToon.ResourceID, Attribute = GameAttribute.Attributes[0x0061], // Resource_Max_Total Int = 0x43480000, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x009D], // Damage_Weapon_Min_Total_All Int = 0x00000000, Float = 2f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0099], // Damage_Weapon_Delta_Total_All Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Field0 = BnetClient.CurrentToon.ResourceID, Attribute = GameAttribute.Attributes[0x0068], // Resource_Regen_Total Int = 0x00000000, Float = 3.051758E-05f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Field0 = BnetClient.CurrentToon.ResourceID, Attribute = GameAttribute.Attributes[0x006B], // Resource_Effective_Max Int = 0x00000000, Float = 200f, }, new NetAttributeKeyValue() { Field0 = 0x000FFFFF, Attribute = GameAttribute.Attributes[0x0092], // Damage_Min_Subtotal Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x000FFFFF, Attribute = GameAttribute.Attributes[0x0091], // Damage_Min_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x000FFFFF, Attribute = GameAttribute.Attributes[0x0190], // Damage_Weapon_Min_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x018F], // Attacks_Per_Second_Item_CurrentHand Int = 0x00000000, Float = 1.199219f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0189], // Attacks_Per_Second_Item_Total_MainHand Int = 0x00000000, Float = 1.199219f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0089], // Attacks_Per_Second_Total Int = 0x00000000, Float = 1.199219f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0087], // Attacks_Per_Second Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0187], // Attacks_Per_Second_Item_MainHand Int = 0x00000000, Float = 1.199219f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0086], // Attacks_Per_Second_Item_Total Int = 0x00000000, Float = 1.199219f, }, new NetAttributeKeyValue() { Field0 = 0x00033C40, Attribute = GameAttribute.Attributes[0x01BE], // Buff_Icon_End_Tick0 Int = 0x000003FB, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0084], // Attacks_Per_Second_Item_Subtotal Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0082], // Attacks_Per_Second_Item Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00033C40, Attribute = GameAttribute.Attributes[0x01BA], // Buff_Icon_Start_Tick0 Int = 0x00000077, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0081], // Hit_Chance Int = 0x00000000, Float = 1f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x007F], // Casting_Speed_Total Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x007D], // Casting_Speed Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x007B], // Movement_Scalar_Total Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Field0 = 0x0002EC66, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000000, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0079], // Movement_Scalar_Capped_Total Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0078], // Movement_Scalar_Subtotal Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0076], // Strafing_Rate_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0075], // Sprinting_Rate_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0074], // Running_Rate_Total Int = 0x00000000, Float = 0.3598633f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x018B], // Damage_Weapon_Min_Total_MainHand Int = 0x00000000, Float = 2f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0073], // Walking_Rate_Total Int = 0x00000000, Float = 0.2797852f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x018D], // Damage_Weapon_Delta_Total_MainHand Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Field0 = 0x00000001, Attribute = GameAttribute.Attributes[0x008E], // Damage_Delta_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000002, Attribute = GameAttribute.Attributes[0x008E], // Damage_Delta_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000003, Attribute = GameAttribute.Attributes[0x008E], // Damage_Delta_Total Int = 0x00000000, Float = 3.051758E-05f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Field0 = 0x00000004, Attribute = GameAttribute.Attributes[0x008E], // Damage_Delta_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000005, Attribute = GameAttribute.Attributes[0x008E], // Damage_Delta_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000006, Attribute = GameAttribute.Attributes[0x008E], // Damage_Delta_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x008E], // Damage_Delta_Total Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0070], // Running_Rate Int = 0x00000000, Float = 0.3598633f, }, new NetAttributeKeyValue() { Field0 = 0x00000001, Attribute = GameAttribute.Attributes[0x0190], // Damage_Weapon_Min_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000002, Attribute = GameAttribute.Attributes[0x0190], // Damage_Weapon_Min_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000003, Attribute = GameAttribute.Attributes[0x0190], // Damage_Weapon_Min_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000004, Attribute = GameAttribute.Attributes[0x0190], // Damage_Weapon_Min_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000005, Attribute = GameAttribute.Attributes[0x0190], // Damage_Weapon_Min_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000006, Attribute = GameAttribute.Attributes[0x0190], // Damage_Weapon_Min_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0190], // Damage_Weapon_Min_Total_CurrentHand Int = 0x00000000, Float = 2f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x006F], // Walking_Rate Int = 0x00000000, Float = 0.2797852f, }, new NetAttributeKeyValue() { Field0 = 0x00000001, Attribute = GameAttribute.Attributes[0x0091], // Damage_Min_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000002, Attribute = GameAttribute.Attributes[0x0091], // Damage_Min_Total Int = 0x00000000, Float = 3.051758E-05f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Field0 = 0x00000003, Attribute = GameAttribute.Attributes[0x0091], // Damage_Min_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000004, Attribute = GameAttribute.Attributes[0x0091], // Damage_Min_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000005, Attribute = GameAttribute.Attributes[0x0091], // Damage_Min_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000006, Attribute = GameAttribute.Attributes[0x0091], // Damage_Min_Total Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000001, Attribute = GameAttribute.Attributes[0x0191], // Damage_Weapon_Delta_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000002, Attribute = GameAttribute.Attributes[0x0191], // Damage_Weapon_Delta_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000003, Attribute = GameAttribute.Attributes[0x0191], // Damage_Weapon_Delta_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000004, Attribute = GameAttribute.Attributes[0x0191], // Damage_Weapon_Delta_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000005, Attribute = GameAttribute.Attributes[0x0191], // Damage_Weapon_Delta_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000006, Attribute = GameAttribute.Attributes[0x0191], // Damage_Weapon_Delta_Total_CurrentHand Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0091], // Damage_Min_Total Int = 0x00000000, Float = 2f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0191], // Damage_Weapon_Delta_Total_CurrentHand Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x006E], // Movement_Scalar Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Field0 = 0x00000001, Attribute = GameAttribute.Attributes[0x0092], // Damage_Min_Subtotal Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000002, Attribute = GameAttribute.Attributes[0x0092], // Damage_Min_Subtotal Int = 0x00000000, Float = 3.051758E-05f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Field0 = 0x00000003, Attribute = GameAttribute.Attributes[0x0092], // Damage_Min_Subtotal Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000004, Attribute = GameAttribute.Attributes[0x0092], // Damage_Min_Subtotal Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000005, Attribute = GameAttribute.Attributes[0x0092], // Damage_Min_Subtotal Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000006, Attribute = GameAttribute.Attributes[0x0092], // Damage_Min_Subtotal Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0092], // Damage_Min_Subtotal Int = 0x00000000, Float = 2f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0094], // Damage_Weapon_Delta Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0095], // Damage_Weapon_Delta_SubTotal Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0096], // Damage_Weapon_Max Int = 0x00000000, Float = 3f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0097], // Damage_Weapon_Max_Total Int = 0x00000000, Float = 3f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x0098], // Damage_Weapon_Delta_Total Int = 0x00000000, Float = 1f, }, new NetAttributeKeyValue() { Field0 = 0x0000CE11, Attribute = GameAttribute.Attributes[0x027B], // Trait Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x009B], // Damage_Weapon_Min Int = 0x00000000, Float = 2f, }, new NetAttributeKeyValue() { Field0 = 0x00000000, Attribute = GameAttribute.Attributes[0x009C], // Damage_Weapon_Min_Total Int = 0x00000000, Float = 2f, }, new NetAttributeKeyValue() { Field0 = 0x0000CE11, Attribute = GameAttribute.Attributes[0x0041], // Skill Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x0000CE11, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000001, Float = 0f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[15] { new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x005C], // Resource_Type_Primary Int = BnetClient.CurrentToon.ResourceID, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0056], // Hitpoints_Max_Total Int = 0x00000000, Float = 76f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0054], // Hitpoints_Max Int = 0x00000000, Float = 40f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0051], // Hitpoints_Total_From_Level Int = 0x00000000, Float = 3.051758E-05f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0050], // Hitpoints_Total_From_Vitality Int = 0x00000000, Float = 36f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x004F], // Hitpoints_Factor_Vitality Int = 0x00000000, Float = 4f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x004E], // Hitpoints_Factor_Level Int = 0x00000000, Float = 4f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x004D], // Hitpoints_Cur Int = 0x00000000, Float = 76f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x024C], // Disabled Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0046], // Loading Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0045], // Invulnerable Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0043], // TeamID Int = 0x00000002, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000FFFFF, Attribute = GameAttribute.Attributes[0x0042], // Skill_Total Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x000FFFFF, Attribute = GameAttribute.Attributes[0x0041], // Skill Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Field0 = 0x0000CE11, Attribute = GameAttribute.Attributes[0x0230], // Buff_Icon_Count0 Int = 0x00000001, Float = 0f, }, }, }); SendMessage(new AttributesSetValuesMessage() { Id = 0x004D, Field0 = 0x789E00E2, atKeyVals = new NetAttributeKeyValue[14] { new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x012C], // Hidden Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0027], // Level_Cap Int = 0x0000000D, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0026], // Level Int = BnetClient.CurrentToon.Level, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0022], // Experience_Next Int = 0x000004B0, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0021], // Experience_Granted Int = 0x000003E8, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0020], // Armor_Total Int = 0x00000000, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x000C], // Defense Int = 0x00000000, Float = 10f, }, new NetAttributeKeyValue() { Field0 = 0x00033C40, Attribute = GameAttribute.Attributes[0x0230], // Buff_Icon_Count0 Int = 0x00000001, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x000B], // Vitality Int = 0x00000000, Float = 9f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x000A], // Precision Int = 0x00000000, Float = 11f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0009], // Attack Int = 0x00000000, Float = 10f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0008], // Shared_Stash_Slots Int = 0x0000000E, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0007], // Backpack_Slots Int = 0x0000003C, Float = 0f, }, new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x0103], // General_Cooldown Int = 0x00000000, Float = 0f, }, }, }); SendMessage(new ACDGroupMessage() { Id = 0x00B8, Field0 = 0x789E00E2, Field1 = -1, Field2 = -1, }); SendMessage(new ANNDataMessage() { Id = 0x003E, Field0 = 0x789E00E2, }); SendMessage(new ACDTranslateFacingMessage() { Id = 0x0070, Field0 = 0x789E00E2, Field1 = 3.022712f, Field2 = false, }); SendMessage(new PlayerEnterKnownMessage() { Id = 0x003D, Field0 = 0x00000000, Field1 = 0x789E00E2, }); SendMessage(new VisualInventoryMessage() { Id = 0x004E, Field0 = 0x789E00E2, Field1 = new VisualEquipment() { Field0 = new VisualItem[8] { new VisualItem() //Head { Field0 = BnetClient.CurrentToon.Equipment.VisualItemList[0].Gbid, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = -1, }, new VisualItem() //Chest { Field0 = BnetClient.CurrentToon.Equipment.VisualItemList[1].Gbid, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = -1, }, new VisualItem() //Feet { Field0 = BnetClient.CurrentToon.Equipment.VisualItemList[2].Gbid, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = -1, }, new VisualItem() //Hands { Field0 = BnetClient.CurrentToon.Equipment.VisualItemList[3].Gbid, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = -1, }, new VisualItem() //Main hand { Field0 = BnetClient.CurrentToon.Equipment.VisualItemList[4].Gbid, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = -1, }, new VisualItem() //Offhand { Field0 = BnetClient.CurrentToon.Equipment.VisualItemList[5].Gbid, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = -1, }, new VisualItem() //Shoulders { Field0 = BnetClient.CurrentToon.Equipment.VisualItemList[6].Gbid, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = -1, }, new VisualItem() //Legs { Field0 = BnetClient.CurrentToon.Equipment.VisualItemList[7].Gbid, Field1 = 0x00000000, Field2 = 0x00000000, Field3 = -1, }, }, }, }); SendMessage(new PlayerActorSetInitialMessage() { Id = 0x0039, Field0 = 0x789E00E2, Field1 = 0x00000000, }); SendMessage(new SNONameDataMessage() { Id = 0x00D3, Field0 = new SNOName() { Field0 = 0x00000001, Field1 = BnetClient.CurrentToon.ClassSNO, }, }); #endregion FlushOutgoingBuffer(); SendMessage(new DWordDataMessage() // TICK { Id = 0x0089, Field0 = 0x00000077, }); FlushOutgoingBuffer(); SendMessage(new AttributeSetValueMessage() { Id = 0x004C, Field0 = 0x789E00E2, Field1 = new NetAttributeKeyValue() { Attribute = GameAttribute.Attributes[0x005B], // Hitpoints_Healed_Target Int = 0x00000000, Float = 76f, }, }); SendMessage(new DWordDataMessage() // TICK { Id = 0x0089, Field0 = 0x0000007D, }); FlushOutgoingBuffer(); }
public static Channel CreateNewChannel(BNetClient client) { var channel = new Channel(client); Channels.Add(channel.DynamicId, channel); return channel; }
public void AddSubscriber(BNetClient client, ulong remoteObjectId) { client.MapLocalObjectID(this.LocalObjectId, remoteObjectId); this.Subscribers.Add(client); this.NotifySubscriber(client); }
public virtual void NotifySubscriber(BNetClient client) { }
public void AddMember(BNetClient client) { if (HasUser(client)) { Logger.Warn("Attempted to add client {0} to channel when it was already a member of the channel", client.Connection.RemoteEndPoint.ToString()); return; } var identity = client.GetIdentity(false, false, true); var addedMember = bnet.protocol.channel.Member.CreateBuilder() .SetIdentity(identity) .SetState(bnet.protocol.channel.MemberState.CreateBuilder() .AddRole(2) .SetPrivileges(0xFBFF) // 64511 .Build()) .Build(); // This needs to be here so that the foreach below will also send to the client that was just added this.Members.Add(client, addedMember); var method = bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyAdd"); foreach (var pair in this.Members) { var message = bnet.protocol.channel.AddNotification.CreateBuilder() .SetChannelState(this.State) // Here we have to set the self property for each call on each client // TODO: This may not be necessary here (this field is optional); check the caps .SetSelf(pair.Value) .AddMember(addedMember) .Build(); pair.Key.CallMethod(method, message, this.DynamicId); } client.CurrentChannel = this; }
public void AddMember(BNetClient client) { if (HasUser(client)) { Logger.Warn("Attempted to add client {0} to channel when it was already a member of the channel", client.Connection.RemoteEndPoint.ToString()); return; } var identity = client.GetIdentity(false, false, true); bool isOwner = client == this.Owner; var addedMember = new Member(identity, (isOwner) ? Member.Privilege.UnkCreator : Member.Privilege.UnkMember); if (this.Members.Count > 0) { addedMember.AddRoles( (isOwner) ? Member.Role.PartyLeader : Member.Role.PartyMember, Member.Role.ChannelMember); } else { addedMember.AddRole((isOwner) ? Member.Role.ChannelCreator : Member.Role.ChannelMember); } // This needs to be here so that the foreach below will also send to the client that was just added this.Members.Add(client, addedMember); // Cache the built state and member var channelState = this.State; var bnetMember = addedMember.BnetMember; var method = bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyAdd"); foreach (var pair in this.Members) { var message = bnet.protocol.channel.AddNotification.CreateBuilder() .SetChannelState(channelState) // Set the Self property for each call on each client // TODO: This may not be necessary here (this field is optional); check the caps .SetSelf(pair.Value.BnetMember) .AddMember(bnetMember) .Build(); //Logger.Warn("NotifyAdd:\n{0}", message.ToString()); pair.Key.CallMethod(method, message, this.DynamicId); } client.CurrentChannel = this; }
public void RemoveMember(BNetClient client, RemoveReason reason) { RemoveMember(client, reason, false); }
public bool HasUser(BNetClient client) { return this.Members.Any(pair => pair.Key == client); }
public void RemoveMember(BNetClient client, RemoveReason reason) { if (client.CurrentToon == null) { Logger.Warn("Could not remove toon-less client {0}", client.Connection.RemoteEndPoint.ToString()); return; } else if (!HasUser(client)) { Logger.Warn("Attempted to remove non-member client {0} from channel", client.Connection.RemoteEndPoint.ToString()); return; } else if (client.CurrentChannel != this) { Logger.Warn("Client {0} is being removed from a channel that is not its current one..", client.Connection.RemoteEndPoint.ToString()); } var memberId = this.Members[client].Identity.ToonId; var message = bnet.protocol.channel.RemoveNotification.CreateBuilder() .SetMemberId(memberId) .SetReason((uint)reason) .Build(); //Logger.Debug("NotifyRemove message:\n{0}", message.ToString()); var method = bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyRemove"); foreach (var pair in this.Members) //.Where(m => m.Value.Identity != client.Identity(false, false, true)) { pair.Key.CallMethod(method, message, this.DynamicId); } this.Members.Remove(client); client.CurrentChannel = null; }
/*public void Close() { RemoveAllUsers(); } public void RemoveAllUsers() { // Need a way to iterate clients on the server to send a NotifyRemove // and then call RemoveUser on them this.Members.Clear(); }*/ public void RemoveUser(BNetClient client) { var identity = client.GetIdentity(false, false, true); var builder = bnet.protocol.channel.RemoveNotification.CreateBuilder() .SetMemberId(identity.ToonId); this.Members.RemoveAll(m => identity == m.Identity); client.CurrentChannel = null; client.CallMethod(bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyRemove"), builder.Build(), this.DynamicId); }
/// <summary> /// Notifies a specific subscriber about the object's present state. /// This methods should be actually implemented by deriving object classes. /// </summary> /// <param name="client">The subscriber.</param> protected virtual void NotifySubscriptionAdded(BNetClient client) { }
public bool HasUser(BNetClient client) { return this.Members.Any(m => m.Identity == client.GetIdentity(false, false, true)); }