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


C# ServerMessage.AppendRawDouble方法代码示例

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


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

示例1: Compose

        public static ServerMessage Compose(Vector3 Source, Vector3 Target, uint RollerId, uint ActorId, uint ItemId)
        {
            bool ItemMode = ItemId > 0;

            ServerMessage Message = new ServerMessage(OpcodesOut.ROLLER_EVENT);
            Message.AppendInt32(Source.X);
            Message.AppendInt32(Source.Y);
            Message.AppendInt32(Target.X);
            Message.AppendInt32(Target.Y);
            Message.AppendBoolean(ItemMode);

            if (ItemMode)
            {
                Message.AppendUInt32(ItemId);
            }
            else
            {
                Message.AppendUInt32(RollerId);
                Message.AppendInt32(2);
                Message.AppendUInt32(ActorId);
            }

            Message.AppendRawDouble(Source.Z);
            Message.AppendRawDouble(Target.Z);

            if (ItemMode)
            {
                Message.AppendUInt32(RollerId);
            }

            return Message;
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:32,代码来源:RollerEventComposer.cs

示例2: Compose

        public static ServerMessage Compose(List<RoomActor> Actors)
        {
            ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_USER_STATUS_LIST);
            Message.AppendInt32(Actors.Count);

            foreach (RoomActor Actor in Actors)
            {
                // a|rBPCRB0.0JJ//
                Message.AppendUInt32(Actor.Id);
                Message.AppendInt32(Actor.Position.X);
                Message.AppendInt32(Actor.Position.Y);
                Message.AppendRawDouble(Actor.Position.Z);
                Message.AppendInt32(Actor.HeadRotation);
                Message.AppendInt32(Actor.BodyRotation);
                Message.AppendRawString("/");

                foreach (KeyValuePair<string, string> Status in Actor.UserStatusses)
                {
                    Message.AppendRawString(Status.Key + ' ' + Status.Value + '/');
                }

                Message.AppendStringWithBreak("/");
            }

            return Message;
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:26,代码来源:RoomUserStatusListComposer.cs

示例3: Compose

        public static ServerMessage Compose(List<RoomActor> Actors)
        {
            ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_USER_LIST);
            Message.AppendInt32(Actors.Count);

            foreach (RoomActor Actor in Actors)
            {
                bool IsBot = (Actor.Type == RoomActorType.AiBot);
                Bot BotData = (IsBot ? (Bot)Actor.ReferenceObject : null);
                bool IsPet = (BotData != null && BotData.IsPet);

                if (IsBot && !IsPet)
                {
                    Message.AppendInt32(-1);
                }
                else
                {
                    Message.AppendUInt32(Actor.ReferenceId);
                }

                Message.AppendStringWithBreak(Actor.Name);
                Message.AppendStringWithBreak(Actor.Motto);
                Message.AppendStringWithBreak(Actor.Figure);
                Message.AppendUInt32(Actor.Id);
                Message.AppendInt32(Actor.Position.X);
                Message.AppendInt32(Actor.Position.Y);
                Message.AppendRawDouble(Actor.Position.Z);

                Message.AppendInt32(Actor.Type == RoomActorType.UserCharacter ? 2 : 4); // 2 for user, 4 for bot
                Message.AppendInt32(Actor.Type == RoomActorType.UserCharacter ? 1 : (((Bot)Actor.ReferenceObject).BehaviorType == "pet" ? 2 : 3)); // 1 for user, 2 for pet, 3 for other bot

                if (!IsBot)
                {
                    Message.AppendStringWithBreak(((CharacterInfo)Actor.ReferenceObject).Gender == CharacterGender.Male ? "m" : "f");
                    Message.AppendInt32(-1); // Unknown
                    Message.AppendInt32(-1); // Group ID
                    Message.AppendInt32(-1); // Unknown (sometimes -1, sometimes 1)
                    Message.AppendStringWithBreak(string.Empty);
                    Message.AppendInt32(((CharacterInfo)Actor.ReferenceObject).Score);
                }
                else if (IsPet)
                {
                    Message.AppendInt32(500);
                }
            }

            return Message;
        }
开发者ID:habb0,项目名称:Snowlight,代码行数:48,代码来源:RoomUserObjectListComposer.cs

示例4: SerializeFloorItem

        public static void SerializeFloorItem(ServerMessage Message, Item Item)
        {
            uint SecondaryId = 0;

            if (Item.Definition.Behavior == ItemBehavior.MusicDisk)
            {
                uint.TryParse(Item.DisplayFlags, out SecondaryId);
            }

            Message.AppendUInt32(Item.Id);
            Message.AppendUInt32(Item.Definition.SpriteId);
            Message.AppendInt32(Item.RoomPosition.X);
            Message.AppendInt32(Item.RoomPosition.Y);
            Message.AppendInt32(Item.RoomRotation);
            Message.AppendRawDouble(Item.RoomPosition.Z);
            Message.AppendUInt32(SecondaryId);
            Message.AppendStringWithBreak(Item.DisplayFlags);
            Message.AppendInt32(Item.PendingExpiration ? (int)((double)(Math.Ceiling(Item.ExpireTimeLeft / 60))) + 1 : 0); // Rental expire
            Message.AppendBoolean(Item.Definition.Usable); // Since RELEASE63-33578-33561 => "Use" button
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:20,代码来源:RoomItemComposer.cs

示例5: Compose

        public static ServerMessage Compose(List<RoomActor> Actors)
        {
            ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_USER_LIST);
            Message.AppendInt32(Actors.Count);

            foreach (RoomActor Actor in Actors)
            {
                bool IsBot = (Actor.Type == RoomActorType.AiBot);
                Bot BotData = (IsBot ? (Bot)Actor.ReferenceObject : null);
                bool IsPet = (BotData != null && BotData.IsPet);

                if (IsBot && !IsPet)
                {
                    Message.AppendInt32(-1);
                }
                else
                {
                    Message.AppendUInt32(Actor.ReferenceId);
                }

                Message.AppendStringWithBreak(Actor.Name);

                if (Actor != null)
                {
                    if (!IsBot && !IsPet)
                    {
                        string figure_update = "";
                        string motto = "";
                        using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
                        {
                            Session Session = SessionManager.GetSessionByCharacterId(Actor.ReferenceId);
                            DataRow Row1 = MySqlClient.ExecuteQueryRow("SELECT * FROM groups_details WHERE id = '" + Actor.GroupId + "'");
                            DataRow Row2 = MySqlClient.ExecuteQueryRow("SELECT * FROM characters WHERE id = '" + Actor.ReferenceId + "'");
                            DataRow Row3 = MySqlClient.ExecuteQueryRow("SELECT * FROM jobranks WHERE jobid = '" + Actor.GroupId + "' AND rankid = '" + Row2["jobrank"] + "'");
                            int room_id = (int)Row1["roomid"];
                            string jobname = (string)Row1["name"] + " " + (string)Row3["name"];
                            string jobfig = (string)Row3["figure_data_" + Actor.Gender.ToString()];
                            if (Actor.Jailed == 1)
                            {
                                Actor.UpdateWorking(MySqlClient, 0);
                                figure_update = FigToUniFig(Actor.Figure) + "ch-220-94.lg-280-94.sh-290-62";
                                motto = "[JAILED] " + Actor.Motto;
                            }
                            else if (Actor.Dead == 1)
                            {
                                Actor.UpdateWorking(MySqlClient, 0);
                                figure_update = Actor.Figure;
                                motto = "[DEAD] " + Actor.Motto;
                            }
                            else if (Actor.Working == 1)
                            {
                                if (room_id == Actor.CurrentRoomId || room_id == 0)
                                {
                                    if (jobfig == "")
                                    {
                                        figure_update = Actor.Figure;
                                    }
                                    else
                                    {
                                        figure_update = FigToUniFig(Actor.Figure) + jobfig;
                                    }
                                    motto = "[WORKING] " + jobname;
                                }
                                else
                                {
                                    Actor.UpdateWorking(MySqlClient, 0);
                                }
                            }
                            else
                            {
                                figure_update = Actor.Figure;
                                motto = Actor.Motto;
                                Actor.UpdateWorking(MySqlClient, 0);
                            }
                            Message.AppendStringWithBreak(motto);
                            Message.AppendStringWithBreak(figure_update);
                        }
                    }
                    else
                    {
                        Message.AppendStringWithBreak(Actor.Motto);
                        Message.AppendStringWithBreak(Actor.Figure);
                    }
                }
                Message.AppendUInt32(Actor.Id);
                Message.AppendInt32(Actor.Position.X);
                Message.AppendInt32(Actor.Position.Y);
                Message.AppendRawDouble(Actor.Position.Z);

                Message.AppendInt32(Actor.Type == RoomActorType.UserCharacter ? 2 : 4); // 2 for user, 4 for bot
                Message.AppendInt32(Actor.Type == RoomActorType.UserCharacter ? 1 : (((Bot)Actor.ReferenceObject).BehaviorType == "pet" ? 2 : 3)); // 1 for user, 2 for pet, 3 for other bot

                if (!IsBot)
                {
                    int groupid;
                    using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
                    {
                        DataRow GroupExtraData = MySqlClient.ExecuteQueryRow("SELECT groupid FROM characters WHERE id = ' " + Actor.ReferenceId + "'");
                        groupid = ((int)GroupExtraData["groupid"]);
                    }
//.........这里部分代码省略.........
开发者ID:DaimOwns,项目名称:ProRP,代码行数:101,代码来源:RoomUserObjectListComposer.cs


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