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


C# ServerMessage.AppendInt32WithBreak方法代码示例

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


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

示例1: Handle

        public void Handle(GameClient Session, ClientMessage Event)
        {
            ServerMessage Message = new ServerMessage(950u);
            int StreamCount = 0;
            foreach (DataRow dRow in Session.GetHabbo().Class12_0.DataTable_12.Rows)
            {
                StreamCount = StreamCount + 1;
            }
            DataTable dataTable_ = Session.GetHabbo().Class12_0.DataTable_12;
            foreach (DataRow dataRow in dataTable_.Rows)
            {
                int type = (int)dataRow["type"];
                if (type == 1)
                {
                    DataRow[] DataRow_ = Session.GetHabbo().Class12_0.DataTable_8.Select("id = " + (uint)dataRow["userid"]);
                    uint userid = (uint)dataRow["userid"];
                    string username = (string)DataRow_[0]["username"];
                    string gender = (string)dataRow["gender"].ToString().ToLower();
                    string look = (string)dataRow["look"];
                    int time = (int)((GoldTree.GetUnixTimestamp() - (double)dataRow["time"]) / 60);
                    string data = (string)dataRow["data"];

                    Message.AppendInt32(StreamCount);
                    Message.AppendUInt(1u);
                    Message.AppendInt32(type);
                    Message.AppendStringWithBreak(userid.ToString());
                    Message.AppendStringWithBreak(username);
                    Message.AppendStringWithBreak(gender);
                    Message.AppendStringWithBreak("http://127.0.0.1/retro/r63/c_images/friendstream/index.gif?figure=" + look + ".gif");
                    Message.AppendInt32WithBreak(time);
                    Message.AppendInt32WithBreak(type + 1);

                    uint RoomID;
                    RoomData RoomData;
                    if (uint.TryParse(data, out RoomID))
                        RoomData = GoldTree.GetGame().GetRoomManager().method_12(RoomID);
                    else
                        RoomData = GoldTree.GetGame().GetRoomManager().method_12(0);

                    if (RoomData != null)
                    {
                        Message.AppendStringWithBreak(RoomData.Id.ToString()); //data
                        Message.AppendStringWithBreak(RoomData.Name); //extra data
                    }
                    else
                    {
                        Message.AppendStringWithBreak("");
                        Message.AppendStringWithBreak("Room deleted");
                    }
                }
            }
            Session.SendMessage(Message);
        }
开发者ID:GoldTreeTheBest,项目名称:Gold-Tree-Emulator,代码行数:53,代码来源:GetEventStreamComposer.cs

示例2: Handle

		public void Handle(GameClient session, ClientMessage message)
		{
            ServerMessage response = new ServerMessage(950u);

            session.GetHabbo().GetUserDataFactory().UpdateFriendStream();

            int streamCount = session.GetHabbo().GetUserDataFactory().GetFriendStream().Rows.Count;

            DataTable dataTable_ = session.GetHabbo().GetUserDataFactory().GetFriendStream();

            foreach (DataRow row in dataTable_.Rows)
            {
                int type = (int)row["type"];

                if (type == 1)
                {
                    DataRow[] tmpRow = session.GetHabbo().GetUserDataFactory().GetFriends().Select("id = " + (uint)row["userid"]);

                    uint userid = (uint)row["userid"];
                    string username = (string)tmpRow[0]["username"];

                    string gender = (string)row["gender"].ToString().ToLower();
                    string look = (string)row["look"];

                    int time = (int)((GoldTree.GetUnixTimestamp() - (double)row["time"]) / 60);

                    string data = (string)row["data"];

                    response.AppendInt32(streamCount);

                    response.AppendUInt(1u);

                    response.AppendInt32(type);

                    response.AppendStringWithBreak(userid.ToString());
                    response.AppendStringWithBreak(username);

                    response.AppendStringWithBreak(gender);
                    response.AppendStringWithBreak("http://127.0.0.1/retro/r63/c_images/friendstream/index.gif?figure=" + look + ".gif");

                    response.AppendInt32WithBreak(time);

                    response.AppendInt32WithBreak(type + 1);

                    uint roomId;

                    RoomData RoomData;

                    if (uint.TryParse(data, out roomId))
                        RoomData = GoldTree.GetGame().GetRoomManager().method_12(roomId);
                    else
                        RoomData = GoldTree.GetGame().GetRoomManager().method_12(0);

                    if (RoomData != null)
                    {
                        response.AppendStringWithBreak(RoomData.Id.ToString()); //data
                        response.AppendStringWithBreak(RoomData.Name); //extra data
                    }
                    else
                    {
                        response.AppendStringWithBreak("");
                        response.AppendStringWithBreak("Room deleted");
                    }
                }
            }

            session.SendMessage(response);
		}
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:68,代码来源:GetEventStreamComposer.cs


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