Пример #1
0
        private void onChanged(long sessionid, byte index, byte field, Octets data, Octets dataremoved)
        {
            bool __o_flags__;

            __o_flags__ = __flags__.get(index);
            __flags__.set(index);
            ViewChangedType _t_  = __o_flags__ ? ViewChangedType.REPLACE : ViewChangedType.NEW;
            OctetsStream    _os_ = OctetsStream.wrap(data);

            switch (index)
            {
            case 0:
            {
                __nickname _s_ = _t_ == ViewChangedType.REPLACE ? nickname : (nickname = new __nickname());
                switch (field)
                {
                case 0:
                {
                    _s_.nickname = _os_.unmarshal_string();
                    break;
                }
                }
                __type__ = _t_;
                break;
            }

            case 1:
            {
                __position _s_ = _t_ == ViewChangedType.REPLACE ? position : (position = new __position());
                switch (field)
                {
                case 0:
                {
                    _os_.unmarshal(_s_.position);
                    break;
                }
                }
                __type__ = _t_;
                break;
            }

            case 2:
            {
                __hp _s_ = _t_ == ViewChangedType.REPLACE ? hp : (hp = new __hp());
                switch (field)
                {
                case 0:
                {
                    _s_.hp = _os_.unmarshal_int();
                    break;
                }
                }
                __type__ = _t_;
                break;
            }

            default:
                throw new Exception("view \"" + this + "\" mismatch bind index = \"" + index + "\"");
            }
        }
Пример #2
0
        private void onChanged(long sessionid, byte index, Octets data)
        {
            bool __o_flags__;

            __o_flags__ = __flags__.get(index);
            __flags__.set(index);
            ViewChangedType _t_  = __o_flags__ ? ViewChangedType.REPLACE : ViewChangedType.NEW;
            OctetsStream    _os_ = OctetsStream.wrap(data);

            switch (index)
            {
            case 0:
            {
                __nickname _n_ = new __nickname();
                _n_.unmarshal(_os_);
                nickname = _n_;
                onViewChanged(sessionid, "nickname", _n_, _t_);
                break;
            }

            case 1:
            {
                __position _n_ = new __position();
                _n_.unmarshal(_os_);
                position = _n_;
                onViewChanged(sessionid, "position", _n_, _t_);
                break;
            }

            case 2:
            {
                __hp _n_ = new __hp();
                _n_.unmarshal(_os_);
                hp = _n_;
                onViewChanged(sessionid, "hp", _n_, _t_);
                break;
            }

            default:
                throw new Exception("view \"" + this + "\" lost var index = \"" + index + "\"");
            }
        }