当前位置: 首页>>代码示例>>C#>>正文


C# GameClient.FlushOutgoingBuffer方法代码示例

本文整理汇总了C#中GameClient.FlushOutgoingBuffer方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.FlushOutgoingBuffer方法的具体用法?C# GameClient.FlushOutgoingBuffer怎么用?C# GameClient.FlushOutgoingBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameClient的用法示例。


在下文中一共展示了GameClient.FlushOutgoingBuffer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendMessage

 public void SendMessage(GameClient client, uint actorID)
 {
     var list = GetMessageList(actorID);
     foreach (var msg in list)
         client.SendMessage(msg);
     client.FlushOutgoingBuffer();
 }
开发者ID:Sanchen,项目名称:mooege,代码行数:7,代码来源:GameAttributeMap.cs

示例2: Handle

        public void Handle(GameClient client)
        {
            if (this.Position != null)
                client.Player.Position = this.Position;

            // looking for gold to pick up
            // TODO: Need to consider items on the ground globally as well (and this doesn't belong here)
            var actorList = client.Player.World.GetActorsInRange(0x00000178, this.Position.X, this.Position.Y, this.Position.Z, 20f);
            foreach (var actor in actorList)
            {
                Item item;
                if (client.Player.GroundItems.TryGetValue(actor.DynamicID, out item) && item.ItemType == ItemType.Gold)
                {
                    client.SendMessage(new FloatingAmountMessage() {
                        Place = new WorldPlace() {
                            Position = this.Position,
                            WorldID = client.Player.World.DynamicID,
                        },
                        Count = item.Count,
                        Field3 = 0x1c,
                    });
                    // NOTE: ANNDataMessage6 is probably "AddToInventory"
                    client.SendMessage(new ANNDataMessage(Opcodes.ANNDataMessage6)
                    {
                        ActorID = actor.DynamicID,
                    });

                    client.Player.Inventory.PickUpGold(actor.DynamicID);

                    client.PacketId += 10 * 2;
                    client.SendMessage(new DWordDataMessage()
                    {
                        Id = 0x89,
                        Field0 = client.PacketId,
                    });

                    client.FlushOutgoingBuffer();

                    client.Player.GroundItems.Remove(actor.DynamicID);
                    // should delete from World also
                }
            }
        }
开发者ID:Sanchen,项目名称:mooege,代码行数:43,代码来源:ACDTranslateNormalMessage.cs

示例3: Handle

        public void Handle(GameClient client)
        {
            if (this.Position != null)
                client.Player.Hero.Position = this.Position;

            // looking for gold to pick up
            var actorList = client.Player.Hero.CurrentWorld.GetActorsInRange(0x00000178, this.Position.X, this.Position.Y, this.Position.Z, 20f);
            foreach (var actor in actorList) 
            {
                Item item;

                if (client.items.TryGetValue(actor.DynamicId, out item) && item.Type == ItemType.Gold) 
                {
                    client.SendMessage(new FloatingAmountMessage() {
                        Field0 = new WorldPlace() {
                            Field0 = this.Position,
                            Field1 = client.Player.Hero.CurrentWorld.WorldID,
                        },
                        Field1 = item.Count,
                        Field3 = 0x1c,
                    });
                    client.SendMessage(new ANNDataMessage()
                    {
                        Id = 0x003C,
                        Field0 = actor.DynamicId,
                    });

                    client.Player.Hero.Inventory.PickUpGold(actor.DynamicId);

                    client.PacketId += 10 * 2;
                    client.SendMessage(new DWordDataMessage()
                    {
                        Id = 0x89,
                        Field0 = client.PacketId,
                    });

                    client.FlushOutgoingBuffer();

                    client.items.Remove(actor.DynamicId);
                    // should delete from World also
                }
            }
        }
开发者ID:BuloZB,项目名称:mooege,代码行数:43,代码来源:ACDTranslateNormalMessage.cs

示例4: Handle

        public override void Handle(GameClient client)
        {
            if (this.Id != 0x000A)
                throw new NotImplementedException();

            // a hackish way to get client.BnetClient in context -- pretends games has only one client in. when we're done with implementing bnet completely, will get this sorted out. /raist
            client.BnetClient = Core.Games.GameManager.AvailableGames[(ulong)this.Field2].Clients.FirstOrDefault();
            if (client.BnetClient != null)
            {
                client.Toon = client.BnetClient.CurrentToon;
                client.BnetClient.InGameClient = client;
            }

            client.SendMessageNow(new VersionsMessage()
            {
                Id = 0x000D,
                SNOPackHash = this.SNOPackHash,
                ProtocolHash = GameMessage.ImplementedProtocolHash,
                Version = "0.3.0.7333",
            });

            client.SendMessage(new ConnectionEstablishedMessage()
            {
                Id = 0x002E,
                Field0 = 0x00000000,
                Field1 = 0x4BB91A16,
                Field2 = this.SNOPackHash,
            });

            client.SendMessage(new GameSetupMessage()
            {
                Id = 0x002F,
                Field0 = 0x00000077,
            });

            client.SendMessage(new SavePointInfoMessage()
            {
                Id = 0x0045,
                snoLevelArea = -1,
            });

            client.SendMessage(new HearthPortalInfoMessage()
            {
                Id = 0x0046,
                snoLevelArea = -1,
                Field1 = -1,
            });

            client.SendMessage(new ActTransitionMessage()
            {
                Id = 0x00A8,
                Field0 = 0x00000000,
                Field1 = true,
            });

            client.GameUniverse.EnterPlayer(client);

            client.FlushOutgoingBuffer();
        }
开发者ID:neoleszcz,项目名称:d3sharp,代码行数:59,代码来源:JoinBNetGameMessage.cs

示例5: Handle

        public void Handle(GameClient client)
        {
            Mooege.Core.GS.Universe.Hero hero = client.Player.Hero;
            switch (this.Id)
            {
                case 0x0030: // Sent with DwordDataMessage(0x0125, Value:0) and SimpleMessage(0x0125)
                    {
                        #region hardcoded1
                        #region HirelingInfo
                        client.SendMessage(new HirelingInfoUpdateMessage()
                        {
                            Id = 0x009D,
                            Field0 = 0x00000001,
                            Field1 = false,
                            Field2 = -1,
                            Field3 = 0x00000000,
                        });

                        client.SendMessage(new HirelingInfoUpdateMessage()
                        {
                            Id = 0x009D,
                            Field0 = 0x00000002,
                            Field1 = false,
                            Field2 = -1,
                            Field3 = 0x00000000,
                        });

                        client.SendMessage(new HirelingInfoUpdateMessage()
                        {
                            Id = 0x009D,
                            Field0 = 0x00000003,
                            Field1 = false,
                            Field2 = -1,
                            Field3 = 0x00000000,
                        });
                        #endregion
                        #region Player Attribute Values

                        GameAttributeMap attributes = new GameAttributeMap();
                        attributes[GameAttribute.Banter_Cooldown, 0xFFFFF] = 0x000007C9;
                        attributes[GameAttribute.Buff_Active, 0x20CBE] = true;
                        attributes[GameAttribute.Buff_Active, 0x33C40] = false;
                        attributes[GameAttribute.Immobolize] = false;
                        attributes[GameAttribute.Untargetable] = false;
                        attributes[GameAttribute.CantStartDisplayedPowers] = false;
                        attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x20CBE] = 0xC1;
                        attributes[GameAttribute.Disabled] = false;
                        attributes[GameAttribute.Hidden] = false;
                        attributes[GameAttribute.Buff_Icon_Count0, 0x33C40] = 0;
                        attributes[GameAttribute.Buff_Icon_End_Tick0, 0x20CBE] = 0x7C9;
                        attributes[GameAttribute.Loading] = false;
                        attributes[GameAttribute.Buff_Icon_End_Tick0, 0x33C40] = 0;
                        attributes[GameAttribute.Invulnerable] = false;
                        attributes[GameAttribute.Buff_Icon_Count0, 0x20CBE] = 1;
                        attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x33C40] = 0;
                        attributes.SendMessage(client, hero.DynamicId);

                        #endregion

                        client.SendMessage(new ACDCollFlagsMessage()
                        {
                            Id = 0x00A6,
                            Field0 = hero.DynamicId,
                            Field1 = 0x00000008,
                        });

                        client.SendMessage(new DWordDataMessage()
                        {
                            Id = 0x0089,
                            Field0 = 0x000000C1,
                        });
                        #endregion
                        client.FlushOutgoingBuffer();
                        #region hardcoded2
                        client.SendMessage(new TrickleMessage()
                        {
                            Id = 0x0042,
                            Field0 = hero.DynamicId,
                            Field1 = client.Player.Hero.ClassSNO,
                            Field2 = new WorldPlace()
                            {
                                Field0 = new Vector3D()
                                {
                                    X = 3143.75f,
                                    Y = 2828.75f,
                                    Z = 59.07559f,
                                },
                                Field1 = client.Player.Hero.WorldId,
                            },
                            Field3 = 0x00000000,
                            Field4 = 0x00026186,
                            Field5 = 1f,
                            Field6 = 0x00000001,
                            Field7 = 0x00000024,
                            Field10 = unchecked((int)0x8DFA5D13),
                            Field12 = 0x0000F063,
                        });

                        client.SendMessage(new DWordDataMessage()
                        {
//.........这里部分代码省略.........
开发者ID:n3rus,项目名称:mooege,代码行数:101,代码来源:SimpleMessage.cs

示例6: Handle


//.........这里部分代码省略.........
                            {
                                Attribute = GameAttribute.Attributes[0x0045], // Invulnerable
                                Int = 0x00000000,
                                Float = 0f,
                            },
                        });

                        client.SendMessage(new AttributeSetValueMessage()
                        {
                            Id = 0x004C,
                            Field0 = 0x789E00E2,
                            Field1 = new NetAttributeKeyValue()
                            {
                                Field0 = 0x00020CBE,
                                Attribute = GameAttribute.Attributes[0x0230], // Buff_Icon_Count0
                                Int = 0x00000001,
                                Float = 0f,
                            },
                        });

                        client.SendMessage(new AttributeSetValueMessage()
                        {
                            Id = 0x004C,
                            Field0 = 0x789E00E2,
                            Field1 = new NetAttributeKeyValue()
                            {
                                Field0 = 0x00033C40,
                                Attribute = GameAttribute.Attributes[0x01BA], // Buff_Icon_Start_Tick0
                                Int = 0x00000000,
                                Float = 0f,
                            },
                        });
                        #endregion

                        client.SendMessage(new ACDCollFlagsMessage()
                        {
                            Id = 0x00A6,
                            Field0 = 0x789E00E2,
                            Field1 = 0x00000008,
                        });

                        client.SendMessage(new DWordDataMessage()
                        {
                            Id = 0x0089,
                            Field0 = 0x000000C1,
                        });
                        #endregion
                        client.FlushOutgoingBuffer();
                        #region hardcoded2
                        client.SendMessage(new TrickleMessage()
                        {
                            Id = 0x0042,
                            Field0 = 0x789E00E2,
                            Field1 = client.BnetClient.CurrentToon.ClassSNO,
                            Field2 = new WorldPlace()
                            {
                                Field0 = new Vector3D()
                                {
                                    Field0 = 3143.75f,
                                    Field1 = 2828.75f,
                                    Field2 = 59.07559f,
                                },
                                Field1 = client.BnetClient.CurrentToon.CurrentWorldID,
                            },
                            Field3 = 0x00000000,
                            Field4 = 0x00026186,
                            Field5 = 1f,
                            Field6 = 0x00000001,
                            Field7 = 0x00000024,
                            Field10 = unchecked((int)0x8DFA5D13),
                            Field12 = 0x0000F063,
                        });

                        client.SendMessage(new DWordDataMessage()
                        {
                            Id = 0x0089,
                            Field0 = 0x000000D1,
                        });
                        #endregion
                        client.FlushOutgoingBuffer();
                    }
                    break;
                case 0x0028: // Logout complete (sent when delay timer expires on client side)
                    if (client.IsLoggingOut)
                    {
                        client.SendMessageNow(new QuitGameMessage()
                        {
                            Id = 0x0003,
                            // Field0 - quit reason?
                            // 0 - logout
                            // 1 - kicked by party leader
                            // 2 - disconnected due to client-server (version?) missmatch
                            Field0 = 0,
                        });
                    }
                    break;
                default:
                    throw new NotImplementedException();
            }
        }
开发者ID:Xtracti0n,项目名称:d3sharp,代码行数:101,代码来源:SimpleMessage.cs


注:本文中的GameClient.FlushOutgoingBuffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。