public PlayerWhisperEventArgs(HMessage packet)
        {
            _packet = packet;
            Header = _packet.Header;

            int position = 0;
            PlayerIndex = _packet.ReadInt(ref position);
            Message = _packet.ReadString(ref position);
            _packet.ReadInt(ref position);
            Theme = (HTheme)_packet.ReadInt(ref position);
        }
        public PlayerSpeakEventArgs(HMessage packet, HSpeech speech)
        {
            _packet = packet;
            Header = _packet.Header;
            Speech = speech;

            int position = 0;
            PlayerIndex = _packet.ReadInt(ref position);
            Message = _packet.ReadString(ref position);
            _packet.ReadInt(ref position);
            Theme = (HTheme)_packet.ReadInt(ref position);
        }
        public PlayerSendMessageEventArgs(HMessage packet)
        {
            _packet = packet;
            Header = packet.Header;

            int position = 0;
            PlayerID = _packet.ReadInt(ref position);
            Message = _packet.ReadString(ref position);
        }
        public PlayerActionEventArgs(HMessage packet)
        {
            _packet = packet;
            Header = _packet.Header;
            int x, y;
            string z, actionTxt;

            int position = 0;
            PlayerCount = _packet.ReadInt(ref position);
            PlayerIndex = _packet.ReadInt(ref position);
            x = _packet.ReadInt(ref position);
            y = _packet.ReadInt(ref position);
            z = _packet.ReadString(ref position);
            Tile = new HPoint(x, y, z);
            HeadDirection = (HDirection)_packet.ReadInt(ref position);
            BodyDirection = (HDirection)_packet.ReadInt(ref position);
            actionTxt = _packet.ReadString(ref position);
            actionTxt = actionTxt.GetChild("//mv ", '/');
        }
Exemple #5
0
        private void OnPlayerChangeData(HMessage obj)
        {
            try
            {
                #region Some Parsing
                int position = 0;
                obj.ReadInt(ref position);
                obj.ReadString(ref position);
                HGender Gender = SKore.ToGender(obj.ReadString(ref position));
                string Motto = obj.ReadString(ref position);
                #endregion

                var args = new PlayerChangeDataEventArgs(obj);
                foreach (PDU PData in _loadedPlayers.Values)
                {
                    if (PData.PlayerIndex == args.PlayerIndex)
                    {
                        PData.Update(Motto, Gender, args.FigureId);
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }