/// <summary>
        /// Reads an array of values from a <see cref="BitStream"/>.
        /// </summary>
        /// <param name="bs">The <see cref="BitStream"/> to read from.</param>
        /// <param name="count">The number of values to read.</param>
        /// <returns>The array of read values.</returns>
        public static int[] ReadInts(this BitStream bs, int count)
        {
            var ret = new int[count];

            for (var i = 0; i < count; i++)
            {
                ret[i] = bs.ReadInt();
            }
            return(ret);
        }
 /// <summary>
 /// Reads a 32-bit signed integer.
 /// </summary>
 /// <param name="name">Unused by the <see cref="BinaryValueReader"/>.</param>
 /// <returns>Value read from the reader.</returns>
 public int ReadInt(string name)
 {
     return(_reader.ReadInt());
 }
 void RecvSetStatPoints(IIPSocket conn, BitStream r)
 {
     var statPoints = r.ReadInt();
     UserInfo.StatPoints = statPoints;
 }
 void RecvSetExp(IIPSocket conn, BitStream r)
 {
     var exp = r.ReadInt();
     UserInfo.Exp = exp;
 }
 void RecvSetCash(IIPSocket conn, BitStream r)
 {
     var cash = r.ReadInt();
     UserInfo.Cash = cash;
 }
        void RecvNotifyExpCash(IIPSocket conn, BitStream r)
        {
            var exp = r.ReadInt();
            var cash = r.ReadInt();

            var param = new string[] {exp.ToString(),cash.ToString()};
            var message = GameMessageCollection.CurrentLanguage.GetMessage(GameMessage.CombatRecieveReward, param);

            GameplayScreen.InfoBox.Add(message);
        }
        void RecvCharDamage(IIPSocket conn, BitStream r)
        {
            var mapCharIndex = r.ReadMapEntityIndex();
            var damage = r.ReadInt();

            var chr = _objGrabber.GetDynamicEntity<Character>(mapCharIndex);
            if (chr == null)
                return;

            GameplayScreen.DamageTextPool.Create(damage, chr, GetTime());
        }
示例#8
0
        void RecvNotifyExpCash(IIPSocket conn, BitStream r)
        {
            var exp = r.ReadInt();
            var cash = r.ReadInt();

            var msg = string.Format("Got {0} exp and {1} cash", exp, cash);
            GameplayScreen.InfoBox.Add(msg);
        }