• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Sessions.Session类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mango.Communication.Sessions.Session的典型用法代码示例。如果您正苦于以下问题:C# Session类的具体用法?C# Session怎么用?C# Session使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Session类属于Mango.Communication.Sessions命名空间,在下文中一共展示了Session类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            /*
             * ItemCount Int32
             * UserId Int32
             * Score Int32
             * Position Int32
             * Username String
             * Figure String
             * Gender String
             * Int32(1)
             * Int32(1)
             */

            //TODO: USE DISTRIBUTOR TO JUST GET USER FROM CACHE.
            int userid = message.NextInt32();

            HabboController user = new HabboController(userid);

            var response = new Message(2048);
            response.WriteInt32(1); // User Count
            response.WriteInt32(userid);
            response.WriteInt32(0); // TODO: Make column for  SCORE
            response.WriteInt32(1); // TODO: Make a void that filters the scores and sets the rank.
            response.WriteString(user.username);
            response.WriteString(user.figure);
            response.WriteString(user.gender);
            response.WriteInt32(1);
            response.WriteInt32(1);
            session.SendPacket(response);
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:31,代码来源:Games.cs


示例2: Purchase

        /// <summary>
        /// Handels the purchase for an object from the catalog.
        /// </summary>
        public void Purchase(Session session, Message message)
        {
            // Get pageId from Client.
            int pageId = message.NextInt32();

            // Get itemId from Client.
            int itemId = message.NextInt32();

            // Create a instance of CatalogItemController using the purchased item Id.
            CatalogItemController purchasedItem = new CatalogItemController(itemId);

            // Simple check.
            if (purchasedItem.pageId != pageId) // If Page id do not match
                return;

            // Remove credits based on Item cost.
            session.Habbo.credits -= purchasedItem.credits;

            message = new Message(11); // Change to CreditUpdate id.

            // Updates users credits.
            message.WriteString("" + session.Habbo.credits + ".0");

            session.SendPacket(message);

            session.Habbo.SaveOrUpdate(session.Habbo);
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:30,代码来源:Catalog.cs


示例3: ParsePacket

 public void ParsePacket(Session session, Message message)
 {
     var response = new Message(544);
     response.WriteString("Team Rev|");
     response.WriteString("");
     session.SendPacket(response);
 }
开发者ID:habb0,项目名称:RevEmu,代码行数:7,代码来源:Alert.cs


示例4: ParsePacket

        /// <summary>
        /// Handles Packet, for current user, and message event.
        /// </summary>
        /// <param name="gameclient">User of Packet</param>
        /// <param name="Message">Message for User</param>
        public void ParsePacket(Session session, Message message)
        {
            var Response = new Message(2121);
            session.SendPacket(Response);

            Response = new Message(294);
            Response.WriteString("model_f"); // Room Model
            Response.WriteInt32(1); // id ?
            session.SendPacket(Response);

            Response = new Message(3248);
            Response.WriteString("floor");
            Response.WriteInt32(0);
            session.SendPacket(Response);

            Response = new Message(3248);
            Response.WriteString("landscape");
            Response.WriteString("0.0");
            session.SendPacket(Response);

            Response = new Message(3323);
            Response.WriteInt32(4);
            session.SendPacket(Response);

            Response = new Message(3840);
            session.SendPacket(Response);

            Response = new Message(1794);
            Response.WriteInt32(0);
            session.SendPacket(Response);

            Response = new Message(369);
            Response.WriteInt32(142641);
            session.SendPacket(Response);
        }
开发者ID:ZakAmirz,项目名称:RevEmu,代码行数:40,代码来源:RoomLoading.cs


示例5: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            var Response = new Message(2888);
            Response.WriteInt32(3);
            session.SendPacket(Response);

            Response = new Message(1401);
            Response.WriteInt32(3);
            Response.WriteString("1344031458870");
            Response.WriteString("http://habbo.hs.llnwd.net/basejump/693/BaseJump.swf");
            Response.WriteString("best");
            Response.WriteString("showAll");
            Response.WriteInt32(60);
            Response.WriteInt32(10);
            Response.WriteInt32(0);
            Response.WriteInt32(4);
            Response.WriteString("accessToken");
            Response.WriteString(session.Habbo.username + "-" + session.Habbo.figure);
            Response.WriteString("gameServerHost");
            Response.WriteString("ff-am.habbo.com");
            Response.WriteString("gameServerPort");
            Response.WriteString("30000");
            Response.WriteString("socketPolicyPort");
            Response.WriteString("30843");
            session.SendPacket(Response);
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:26,代码来源:JoinQueue.cs


示例6: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            string releaseBuild = message.NextString();
            Application.Application.Logging.WriteLine(string.Format("Client release: {0}", releaseBuild), Logging.Status.Debug);
            Console.Title += string.Format(" | Invoked on Revision: {0}, Loading Packets...", releaseBuild);

            session.ReleaseBuild = releaseBuild;
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:8,代码来源:ClientRelease.cs


示例7: ParsePacket

 /// <summary>
 /// Handles Packet, for current user, and message event.
 /// </summary>
 /// <param name="Session">User of Packet</param>
 /// <param name="Message">Message for User</param>
 public void ParsePacket(Session session, Message message)
 {
     var Response = new Message(3298);
     Response.WriteInt32(session.Habbo.id);
     Response.WriteString(message.NextString());
     Response.WriteInt32(0);
     Response.WriteInt32(0);
     Response.WriteInt32(-1);
     session.SendPacket(Response);
 }
开发者ID:habb0,项目名称:RevEmu,代码行数:15,代码来源:ShoutOnHotel.cs


示例8: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            string sso = message.NextString();
            //Application.Logging.WriteLine(string.Format("SSO Ticket: {0}", sso));

            var loadMyHabbo = new HabboDistributor().GetHabbo(sso);

            session.Habbo = loadMyHabbo;

            var response = new Message(SendHeaders.InitHotelView);
            session.SendPacket(response);
        }
开发者ID:ZakAmirz,项目名称:RevEmu,代码行数:12,代码来源:Authentication.cs


示例9: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            int id = message.NextInt32();
            var flashbase = message.NextString();
            var variables = message.NextString();

            //Console.WriteLine("Flashbase {0}, Variables {1} loaded.", flashbase, variables);

            /*Application.Application.Logging.WriteLine(string.Format("ID {0}", id));
            Application.Application.Logging.WriteLine(string.Format("Flashbase {0}", flashbase));
            Application.Application.Logging.WriteLine(string.Format("Variables {0}", variables));*/
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:12,代码来源:ClientSettings.cs


示例10: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            int FriendId = message.NextInt32();

            string theMessage = message.NextString();

            Console.WriteLine(FriendId);
            var Response = new Message(2582);
            Response.WriteInt32(FriendId);
            Response.WriteString(theMessage);
            Response.WriteString(string.Empty);
            session.SendPacket(Response);
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:13,代码来源:SendMessage.cs


示例11: ParsePacket

 public void ParsePacket(Session session, Message Message)
 {
     var Response = new Message(SendHeaders.InitClubStatus);
     Response.WriteString(Message.NextString());
     Response.WriteInt32(10);
     Response.WriteInt32(0);
     Response.WriteInt32(0);
     Response.WriteInt32(0);
     Response.WriteInt32(1);
     Response.WriteBool(false);
     Response.WriteBool(true);
     Response.WriteInt32(0);
     Response.WriteInt32(0);
     Response.WriteInt32(0);
     session.SendPacket(Response);
 }
开发者ID:habb0,项目名称:RevEmu,代码行数:16,代码来源:InitClub.cs


示例12: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            /*
             * [LOG][CLIENT] > 2574: [0][0][0]D[10][0][0][0][1][0][0]^^[0]8b12104s05013s05014s05015b629b628442e26e378b9f8f18818bbaa
             * [LOG][CLIENT] > 3163: [0][0][0][6][12][[0][0][0][0]
             */

            var Response = new Message(2574);
            Response.WriteInt32(1);
            Response.WriteInt32(24158);
            Response.WriteString("b12104s05013s05014s05015b629b628442e26e378b9f8f18818bbaa");
            session.SendPacket(Response);

            Response = new Message(3163);
            Response.WriteInt32(0);
            session.SendPacket(Response);
        }
开发者ID:ZakAmirz,项目名称:RevEmu,代码行数:17,代码来源:InfoLoading.cs


示例13: ParsePacket

 public void ParsePacket(Session session, Message message)
 {
     var Uinfo = new Message(3744);
     Uinfo.WriteInt32(session.Habbo.id); // id perhaps
     Uinfo.WriteString(session.Habbo.username); // names
     Uinfo.WriteInt32(4); // registered minutes ago
     Uinfo.WriteInt32(8); // last login minutes ago
     Uinfo.WriteBool(true); // is online, NO doubt
     Uinfo.WriteInt32(1); // cfhs
     Uinfo.WriteInt32(2); // abusive cfhs
     Uinfo.WriteInt32(3); // cautions
     Uinfo.WriteInt32(4); // bans
     Uinfo.WriteString("3"); // purchase shit?
     Uinfo.WriteInt32(3); // no idea yet
     Uinfo.WriteInt32(5); // amount banned accounts lol
     Uinfo.WriteString("666"); // some shit above banned accounts
     session.SendPacket(Uinfo);
 }
开发者ID:habb0,项目名称:RevEmu,代码行数:18,代码来源:UserInfo.cs


示例14: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            message = new Message(619);

            message.WriteInt32(0);
            message.WriteInt32(1);
            int id = message.NextInt32(); // UserId?
            Console.WriteLine(id);

            //var result = new HabboSqlData(id);

               // message.WriteString(result.username);
            message.WriteBool(false);
            //message.WriteString(result.motto);
            message.WriteInt32(0);
            message.WriteInt32(1);
            message.WriteInt32(0);
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:18,代码来源:SearchFriend.cs


示例15: Execute

        public static void Execute(Session session, Message message)
        {
            if (!Messages.ContainsKey((uint) message.HeaderId))
            {
                Application.Logging.WriteLine(string.Format("Not found: {0}", message.HeaderId), Logging.Status.Warning);
                return;
            }

            var handler = Messages[(uint)message.HeaderId] as IPacketEvent;

            if (handler != null)
            {
                Application.Logging.WriteLine(string.Format("Invoked: {0} -> {1}", handler.EventId, GetName(handler.EventId),
                                              Logging.Status.Invoker));

                DelHandle delHandle = handler.ParsePacket;

                delHandle.Invoke(session, message);
            }
        }
开发者ID:ZakAmirz,项目名称:RevEmu,代码行数:20,代码来源:MessageHandler.cs


示例16: ParsePacket

        /// <summary>
        /// Handles Packet, for current user, and message event.
        /// </summary>
        /// <param name="gameclient">User of Packet</param>
        /// <param name="Message">Message for User</param>
        public void ParsePacket(Session session, Message message)
        {
            var Response = new Message(2348);
            session.SendPacket(Response);

            Response = new Message(1399);
            Response.WriteString("model_f"); // Room Model
            Response.WriteInt32(1); // id ?
            session.SendPacket(Response);

            Response = new Message(2771);
            Response.WriteString("wallpaper"); // Wallpaper
            Response.WriteString("110"); // Height / Width
            session.SendPacket(Response);

            Response = new Message(2771);
            Response.WriteString("floor"); // Floor
            Response.WriteString("110"); // Height / Width
            session.SendPacket(Response);

            Response = new Message(3998);
            Response.WriteInt32(4);
            session.SendPacket(Response);

            Response = new Message(3083);
            Response.WriteInt32(2);
            Response.WriteBool(false);
            session.SendPacket(Response);

            Response = new Message(831);
            session.SendPacket(Response);

            Response = new Message(2771);
            Response.WriteString("landscape"); // Landscape
            Response.WriteString("10.0"); // Height / Width
            session.SendPacket(Response);

            Response = new Message(2101);
            Response.WriteString("-1");
            session.SendPacket(Response);
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:46,代码来源:EnterRoomEvent.cs


示例17: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            var response = new Message(1263);
            response.WriteInt32(326494);
            response.WriteString("[µ] Train Station [µ] NYC [µ]");
            response.WriteInt32(55701607);
            response.WriteString("b22234s9723416fe55795537635b44781e732427990d");
            response.WriteInt32(14);
            response.WriteInt32(1);
            response.WriteInt32(0);
            response.WriteInt32(1);
            response.WriteString("JakeSS");
            response.WriteString(
                "hr-3163-61.hd-3091-6.ch-255-64.lg-3023-110.sh-3068-64-64.ha-1022-110.ea-3226-110.fa-1205-110.ca-3176-93-93.cc-3075-110.cp-3204");
            response.WriteString("Mar 17, 2012");

            response.WriteInt32(0);
            response.WriteInt32(0);
            response.WriteString(string.Empty);
            session.SendPacket(response);
        }
开发者ID:ZakAmirz,项目名称:RevEmu,代码行数:21,代码来源:GroupMembers.cs


示例18: Walk

        public void Walk(Session session, Message Response)
        {
            int X = Response.NextInt32();
            int Y = Response.NextInt32();

            session.habboRoomObject.GoalX = X;
            session.habboRoomObject.GoalY = Y;

            WalkThread walkthread = new WalkThread(session, new Pathfinder(this.map, session.habboRoomObject));

            Thread thread = new Thread(new ThreadStart(walkthread.run));

            // Send Packet here
            /*Response = new Message(1887);
            Response.WriteInt32(1);
            Response.WriteInt32(session.Habbo.Getid);
            Response.WriteInt32(X);
            Response.WriteInt32(Y);
            Response.WriteString("0.0");
            Response.WriteInt32(0);
            Response.WriteInt32(0);
            Response.WriteString("/mv " + X + "," + Y + ",0.0//");
            session.SendPacket(Response);*/
        }
开发者ID:habb0,项目名称:RevEmu,代码行数:24,代码来源:RoomModelSql.cs


示例19: ParsePacket

 public void ParsePacket(Session session, Message Message)
 {
     //Message Response = new Message();
 }
开发者ID:ZakAmirz,项目名称:RevEmu,代码行数:4,代码来源:Inventory.cs


示例20: ParsePacket

        public void ParsePacket(Session session, Message message)
        {
            // This is totally wrong, needs to be redone

            int targetId = message.NextInt32();
        }
开发者ID:ZakAmirz,项目名称:RevEmu,代码行数:6,代码来源:AcceptFriendRequest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.ImageListViewItem类代码示例发布时间:2022-05-26
下一篇:
C# Windows.SystemWindow类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap