Example #1
0
 public override void addToStream(Bundle stream, object v)
 {
     stream.writeUint32((UInt32)((List <object>)v).Count);
     for (int i = 0; i < ((List <object>)v).Count; i++)
     {
         ((KBEDATATYPE_BASE)vtype).addToStream(stream, ((List <object>)v)[i]);
     }
 }
Example #2
0
 public void addToStreamEx(Bundle stream, PLAYRE_DATA v)
 {
     stream.writeUnicode(v.playerName);
     stream.writeUint64(v.playerDBID);
     stream.writeUint32(v.playerGold);
     stream.writeUint8(v.isOnLine);
     stream.writeEntitycall(v.entity);
 }
Example #3
0
 public override void addToStream(Bundle stream, object v)
 {
     stream.writeUint32(4);
     stream.writeFloat(((Vector4)v).x);
     stream.writeFloat(((Vector4)v).y);
     stream.writeFloat(((Vector4)v).z);
     stream.writeFloat(((Vector4)v).w);
 }
Example #4
0
 public override void addToStream(Bundle stream, object v)
 {
     stream.writeUint32((UInt32)((List<object>)v).Count);
     for(int i=0; i<((List<object>)v).Count; i++)
     {
         ((KBEDATATYPE_BASE)type).addToStream(stream, ((List<object>)v)[i]);
     }
 }
Example #5
0
 public void addToStreamEx(Bundle stream, FRIENDS_LIST v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         stream.writeUint64(v[i]);
     }
     ;
 }
 public void addToStreamEx(Bundle stream, PROP_LIST v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         stream.writeUnicode(v[i]);
     }
     ;
 }
Example #7
0
 public void addToStreamEx(Bundle stream, OPEN_PACK_RUL v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         stream.writeUint64(v[i]);
     }
     ;
 }
 public void addToStreamEx(Bundle stream, List <CITY_SELL_GOODS_INFO> v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         itemType.addToStreamEx(stream, v[i]);
     }
     ;
 }
Example #9
0
 public void addToStreamEx(Bundle stream, PlayerList v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         stream.writeEntitycall(v[i]);
     }
     ;
 }
Example #10
0
 public void addToStreamEx(Bundle stream, ENTITYID_LIST v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         stream.writeInt32(v[i]);
     }
     ;
 }
Example #11
0
 public void addToStreamEx(Bundle stream, List <List <Int64> > v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         itemType.addToStreamEx(stream, v[i]);
     }
     ;
 }
Example #12
0
 public void addToStreamEx(Bundle stream, ENTITY_FORBID_COUNTER v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         stream.writeInt8(v[i]);
     }
     ;
 }
 public void addToStreamEx(Bundle stream, TING_PAI_LIST v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         itemType.addToStreamEx(stream, v[i]);
     }
     ;
 }
 public void addToStreamEx(Bundle stream, List <Int32> v)
 {
     stream.writeUint32((UInt32)v.Count);
     for (int i = 0; i < v.Count; ++i)
     {
         stream.writeInt32(v[i]);
     }
     ;
 }
 public void addToStreamEx(Bundle stream, PLAYER_PUBLIC_INFO v)
 {
     stream.writeUint32(v.userId);
     folds_DataType.addToStreamEx(stream, v.folds);
     angangs_DataType.addToStreamEx(stream, v.angangs);
     diangangs_DataType.addToStreamEx(stream, v.diangangs);
     wangangs_DataType.addToStreamEx(stream, v.wangangs);
     pengs_DataType.addToStreamEx(stream, v.pengs);
     hus_DataType.addToStreamEx(stream, v.hus);
     stream.writeInt8(v.que);
     stream.writeInt8(v.holdsCount);
 }
Example #16
0
 public override void addToStream(Bundle stream, object v)
 {
     stream.writeUint32(2);
     stream.writeFloat(((Vector2)v).X);
     stream.writeFloat(((Vector2)v).Y);
 }
		public override void addToStream(Bundle stream, object v)
		{
			stream.writeUint32(4);
			stream.writeFloat(((Vector4)v).x);
			stream.writeFloat(((Vector4)v).y);
			stream.writeFloat(((Vector4)v).z);
			stream.writeFloat(((Vector4)v).w);
		}
		public override void addToStream(Bundle stream, object v)
		{
			stream.writeUint32(Convert.ToUInt32(v));
		}
Example #19
0
 public void addToStreamEx(Bundle stream, FS_FRAME_DATA v)
 {
     stream.writeUint32(v.frameid);
     operation_DataType.addToStreamEx(stream, v.operation);
 }
 public void addToStreamEx(Bundle stream, PLAYER_PUBLIC_INFO v)
 {
     stream.writeUint32(v.userId);
     stream.writeInt8(v.holdsCount);
 }
        /*
            更新当前玩家的位置与朝向到服务端, 可以通过开关_syncPlayer关闭这个机制
        */
        public void updatePlayerToServer()
        {
            if(!_args.syncPlayer || spaceID == 0)
            {
                return;
            }

            TimeSpan span = DateTime.Now - _lastUpdateToServerTime;

            if(span.Milliseconds < 50)
                return;

            Entity playerEntity = player();
            if(playerEntity == null || playerEntity.inWorld == false)
                return;

            _lastUpdateToServerTime = System.DateTime.Now;

            Vector3 position = playerEntity.position;
            Vector3 direction = playerEntity.direction;

            bool posHasChanged = Vector3.Distance(_entityLastLocalPos, position) > 0.001f;
            bool dirHasChanged = Vector3.Distance(_entityLastLocalDir, direction) > 0.001f;

            if(posHasChanged || dirHasChanged)
            {
                _entityLastLocalPos = position;
                _entityLastLocalDir = direction;

                Bundle bundle = new Bundle();
                bundle.newMessage(Message.messages["Baseapp_onUpdateDataFromClient"]);
                bundle.writeFloat(position.x);
                bundle.writeFloat(position.y);
                bundle.writeFloat(position.z);

                bundle.writeFloat((float)((double)direction.x / 360 * 6.283185307179586));
                bundle.writeFloat((float)((double)direction.y / 360 * 6.283185307179586));
                bundle.writeFloat((float)((double)direction.z / 360 * 6.283185307179586));
                bundle.writeUint8((Byte)(playerEntity.isOnGround == true ? 1 : 0));
                bundle.writeUint32(spaceID);
                bundle.send(_networkInterface);
            }
        }
 public void addToStreamEx(Bundle stream, CITY_TYPE_PRICE_INFO v)
 {
     stream.writeUint32(v.GoodsType);
     stream.writeFloat(v.TypePrice);
 }
 public override void addToStream(Bundle stream, object v)
 {
     stream.writeUint32(Convert.ToUInt32(v));
 }
Example #24
0
 public override void addToStream(Bundle stream, object v)
 {
     stream.writeUint32(4);
     stream.writeFloat(((Vector4)v).X);
     stream.writeFloat(((Vector4)v).Y);
     stream.writeFloat(((Vector4)v).Z);
     stream.writeFloat(((Vector4)v).W);
 }