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


C# GameClient.SendMessageNow方法代码示例

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


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

示例1: 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

示例2: Handle

 public override void Handle(GameClient client)
 {
     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,
         });
     }
 }
开发者ID:neoleszcz,项目名称:d3sharp,代码行数:15,代码来源:LogoutComplete.cs

示例3: Handle

        public void Handle(GameClient client)
        {
            client.IsLoggingOut = !client.IsLoggingOut;

            if (client.IsLoggingOut)
            {
                client.SendMessageNow(new LogoutTickTimeMessage()
                {
                    Id = 0x0027,
                    Field0 = false, // true - logout with party?
                    Field1 = 0, // delay 1, make this equal to 0 for instant logout
                    Field2 = 0, // delay 2
                });
            }
        }
开发者ID:Rianon,项目名称:mooege,代码行数:15,代码来源:LogoutContextMessage.cs

示例4: Handle


//.........这里部分代码省略.........
                        });

                        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 = 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:n3rus,项目名称:mooege,代码行数:101,代码来源:SimpleMessage.cs

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