Example #1
0
        public void Parse(Player player, IncomingPacket incomingPacket)
        {
            var useless   = incomingPacket.GetString();
            var machineId = incomingPacket.GetString();

            player.MachineId = machineId;
            player.SendMessage(new SetUniqueIdMessageComposer(machineId));
        }
        public void Invoke(Session _Session, IncomingPacket _Packet)
        {
            string _item    = _Packet.GetString();
            string _tipop   = _Packet.GetString();
            int    _periodo = _Packet.GetInt();
            int    _pre     = _Packet.GetInt();

            _Session.Send(_Session.User.BuyItems(_item, _tipop, _periodo, _pre));
            _Session.Send(_Session.User.GetAvatars());
        }
        public void Invoke(Session _Session, IncomingPacket _Packet)
        {
            string name       = _Packet.GetString();
            string password   = _Packet.GetString();
            int    maxplayers = _Packet.GetInt();
            int    type       = _Packet.GetInt();
            int    Owner      = _Session.User.ID;

            //Channel _cha = Program.ChannelManager.CreateChannel(name, password, 0, 0);
            //_cha.Owner = Owner;
        }
Example #4
0
        public void Invoke(Session _Session, IncomingPacket _Packet)
        {
            string _ctmp = _Packet.GetString();

            string msj_f = HttpUtility.HtmlEncode(_ctmp.Replace("\\\"", "\""));

            StringBuilder sb = new StringBuilder();
            StringWriter  sw = new StringWriter(sb);

            using (JsonWriter writer = new JsonTextWriter(sw))
            {
                writer.Formatting = Formatting.None;
                writer.WriteStartArray();
                writer.WriteValue((int)ServerOpcode.chat);
                writer.WriteValue(msj_f);
                writer.WriteValue(_Session.User.Name);

                if (_Session.User.rank >= 24)
                {
                    writer.WriteValue(ChatType.CHAT_TYPE_GM); //type
                }
                else
                {
                    writer.WriteValue(0); //type
                }
                if (_Session.User.guild > 0)
                {
                    writer.WriteValue(_Session.User.guild_name);
                }

                writer.WriteEndArray();
            }

            _Session.Broadcast(sb.ToString());
        }
        public void Invoke(Session _Session, IncomingPacket _Packet)
        {
            string nname = _Packet.GetString();

            _Session.Send(_Session.User.ChangeName(nname));
            _Session.Send(_Session.User.PlayerInfo());
            _Session.Send(_Session.User.UpdateBoddy());
        }
Example #6
0
        public void Parse(Player player, IncomingPacket IncomingPacket)
        {
            if (player?.Arc4 == null)
            {
                return;
            }

            player.OnAuthentication(IncomingPacket.GetString());
        }
        public void Parse(Player player, IncomingPacket IncomingPacket)
        {
            var cipherPublickey = IncomingPacket.GetString();
            var sharedKey       = HabboEncryptionV2.CalculateDiffieHellmanSharedKey(cipherPublickey);

            if (sharedKey == 0)
            {
                return;
            }

            player.Arc4 = new ARC4(sharedKey.getBytes());
            player.SendMessage(new SecretKeyMessageComposer(HabboEncryptionV2.GetRsaDiffieHellmanPublicKey()));
        }
        public void Invoke(Session _Session, IncomingPacket _Packet)
        {
            int    version  = _Packet.GetInt();
            int    user_id  = _Packet.GetInt();
            string user_key = _Packet.GetString();

            _Session.Send("[" + (int)ServerOpcode.login_profile + "]");
            _Session.User.LoadUser(version, user_id, user_key);
            _Session.Send("[" + (int)ServerOpcode.login_avatars + "]");
            _Session.User.LoadinfoAvatars();
            _Session.Send(_Session.User.PlayerInfo());

            _Session.Send(_Session.User.UpdateBoddy());

            LogConsole.Show(LogType.INFO, "Version: {0} User_id: {1} User_key: {2}", version, user_id, user_key);
        }