Package com.ngt.jopenmetaverse.shared.structureddata

Examples of com.ngt.jopenmetaverse.shared.structureddata.OSDMap


    /// Serialize the object
    /// </summary>
    /// <returns>An <see cref="OSDMap"/> containing the objects data</returns>
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(5);
      map.put("session_id", OSD.FromUUID(SessionID));

      OSDMap agentMap = new OSDMap(11);
      agentMap.put("agents_in_view", OSD.FromInteger(AgentsInView));
      agentMap.put("fps", OSD.FromReal(AgentFPS));
      agentMap.put("language", OSD.FromString(AgentLanguage));
      agentMap.put("mem_use", OSD.FromReal(AgentMemoryUsed));
      agentMap.put("meters_traveled", OSD.FromReal(MetersTraveled));
      agentMap.put("ping", OSD.FromReal(AgentPing));
      agentMap.put("regions_visited", OSD.FromInteger(RegionsVisited));
      agentMap.put("run_time", OSD.FromReal(AgentRuntime));
      agentMap.put("sim_fps", OSD.FromReal(SimulatorFPS));
      agentMap.put("start_time", OSD.FromUInteger(Utils.dateToUnixTime(AgentStartTime)));
      agentMap.put("version", OSD.FromString(AgentVersion));
      map.put("agent", agentMap);


      OSDMap downloadsMap = new OSDMap(3); // downloads
      downloadsMap.put("object_kbytes", OSD.FromReal(object_kbytes));
      downloadsMap.put("texture_kbytes", OSD.FromReal(texture_kbytes));
      downloadsMap.put("world_kbytes", OSD.FromReal(world_kbytes));
      map.put("downloads", downloadsMap);

      OSDMap miscMap = new OSDMap(2);
      miscMap.put("Version", OSD.FromReal(MiscVersion));
      miscMap.put("Vertex Buffers Enabled", OSD.FromBoolean(VertexBuffersEnabled));
      map.put("misc", miscMap);

      OSDMap statsMap = new OSDMap(2);

      OSDMap failuresMap = new OSDMap(6);
      failuresMap.put("dropped", OSD.FromInteger(StatsDropped));
      failuresMap.put("failed_resends", OSD.FromInteger(StatsFailedResends));
      failuresMap.put("invalid", OSD.FromInteger(FailuresInvalid));
      failuresMap.put("off_circuit", OSD.FromInteger(FailuresOffCircuit));
      failuresMap.put("resent", OSD.FromInteger(FailuresResent));
      failuresMap.put("send_packet", OSD.FromInteger(FailuresSendPacket));
      statsMap.put("failures", failuresMap);

      OSDMap statsMiscMap = new OSDMap(3);
      statsMiscMap.put("int_1", OSD.FromInteger(MiscInt1));
      statsMiscMap.put("int_2", OSD.FromInteger(MiscInt2));
      statsMiscMap.put("string_1", OSD.FromString(MiscString1));
      statsMap.put("misc", statsMiscMap);

      OSDMap netMap = new OSDMap(3);

      // in
      OSDMap netInMap = new OSDMap(4);
      netInMap.put("compressed_packets", OSD.FromInteger(InCompressedPackets));
      netInMap.put("kbytes", OSD.FromReal(InKbytes));
      netInMap.put("packets", OSD.FromReal(InPackets));
      netInMap.put("savings", OSD.FromReal(InSavings));
      netMap.put("in", netInMap);
      // out
      OSDMap netOutMap = new OSDMap(4);
      netOutMap.put("compressed_packets", OSD.FromInteger(OutCompressedPackets));
      netOutMap.put("kbytes", OSD.FromReal(OutKbytes));
      netOutMap.put("packets", OSD.FromReal(OutPackets));
      netOutMap.put("savings", OSD.FromReal(OutSavings));
      netMap.put("out", netOutMap);

      statsMap.put("net", netMap);

      //system
      OSDMap systemStatsMap = new OSDMap(7);
      systemStatsMap.put("cpu", OSD.FromString(SystemCPU));
      systemStatsMap.put("gpu", OSD.FromString(SystemGPU));
      systemStatsMap.put("gpu_class", OSD.FromInteger(SystemGPUClass));
      systemStatsMap.put("gpu_vendor", OSD.FromString(SystemGPUVendor));
      systemStatsMap.put("gpu_version", OSD.FromString(SystemGPUVersion));
      systemStatsMap.put("os", OSD.FromString(SystemOS));
      systemStatsMap.put("ram", OSD.FromInteger(SystemInstalledRam));
      map.put("system", systemStatsMap);

      map.put("stats", statsMap);
      return map;
    }
View Full Code Here


    /// <param name="map">An <see cref="OSDMap"/> containing the data</param>
    public void Deserialize(OSDMap map)
    {
      SessionID = map.get("session_id").asUUID();

      OSDMap agentMap = (OSDMap)map.get("agent");
      AgentsInView = agentMap.get("agents_in_view").asInteger();
      AgentFPS = (float)agentMap.get("fps").asReal();
      AgentLanguage = agentMap.get("language").asString();
      AgentMemoryUsed = (float)agentMap.get("mem_use").asReal();
      MetersTraveled = agentMap.get("meters_traveled").asInteger();
      AgentPing = (float)agentMap.get("ping").asReal();
      RegionsVisited = agentMap.get("regions_visited").asInteger();
      AgentRuntime = (float)agentMap.get("run_time").asReal();
      SimulatorFPS = (float)agentMap.get("sim_fps").asReal();
      AgentStartTime = Utils.unixTimeToDate(agentMap.get("start_time").asUInteger());
      AgentVersion = agentMap.get("version").asString();

      OSDMap downloadsMap = (OSDMap)map.get("downloads");
      object_kbytes = (float)downloadsMap.get("object_kbytes").asReal();
      texture_kbytes = (float)downloadsMap.get("texture_kbytes").asReal();
      world_kbytes = (float)downloadsMap.get("world_kbytes").asReal();

      OSDMap miscMap = (OSDMap)map.get("misc");
      MiscVersion = (float)miscMap.get("Version").asReal();
      VertexBuffersEnabled = miscMap.get("Vertex Buffers Enabled").asBoolean();

      OSDMap statsMap = (OSDMap)map.get("stats");
      OSDMap failuresMap = (OSDMap)statsMap.get("failures");
      StatsDropped = failuresMap.get("dropped").asInteger();
      StatsFailedResends = failuresMap.get("failed_resends").asInteger();
      FailuresInvalid = failuresMap.get("invalid").asInteger();
      FailuresOffCircuit = failuresMap.get("off_circuit").asInteger();
      FailuresResent = failuresMap.get("resent").asInteger();
      FailuresSendPacket = failuresMap.get("send_packet").asInteger();

      OSDMap statsMiscMap = (OSDMap)statsMap.get("misc");
      MiscInt1 = statsMiscMap.get("int_1").asInteger();
      MiscInt2 = statsMiscMap.get("int_2").asInteger();
      MiscString1 = statsMiscMap.get("string_1").asString();
      OSDMap netMap = (OSDMap)statsMap.get("net");
      // in
      OSDMap netInMap = (OSDMap)netMap.get("in");
      InCompressedPackets = netInMap.get("compressed_packets").asInteger();
      InKbytes = netInMap.get("kbytes").asInteger();
      InPackets = netInMap.get("packets").asInteger();
      InSavings = netInMap.get("savings").asInteger();
      // out
      OSDMap netOutMap = (OSDMap)netMap.get("out");
      OutCompressedPackets = netOutMap.get("compressed_packets").asInteger();
      OutKbytes = netOutMap.get("kbytes").asInteger();
      OutPackets = netOutMap.get("packets").asInteger();
      OutSavings = netOutMap.get("savings").asInteger();

      //system
      OSDMap systemStatsMap = (OSDMap)map.get("system");
      SystemCPU = systemStatsMap.get("cpu").asString();
      SystemGPU = systemStatsMap.get("gpu").asString();
      SystemGPUClass = systemStatsMap.get("gpu_class").asInteger();
      SystemGPUVendor = systemStatsMap.get("gpu_vendor").asString();
      SystemGPUVersion = systemStatsMap.get("gpu_version").asString();
      SystemOS = systemStatsMap.get("os").asString();
      SystemInstalledRam = systemStatsMap.get("ram").asInteger();
    }
View Full Code Here

    /// </summary>
    /// <returns>An <see cref="OSDMap"/> containing the objects data</returns>
    @Override
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(1);
      map.put("item_id", OSD.FromUUID(ItemID));

      return map;
    }
View Full Code Here

    /// Serialize the object
    /// </summary>
    /// <returns>An <see cref="OSDMap"/> containing the objects data</returns>
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(5);
      map.put("callback-id", OSD.FromInteger(CallbackID));
      map.put("folder-id", OSD.FromUUID(FolderID));
      map.put("item-id", OSD.FromUUID(ItemID));
      map.put("notecard-id", OSD.FromUUID(NotecardID));
      map.put("object-id", OSD.FromUUID(ObjectID));

      return map;
    }
View Full Code Here

    public UUID AssetID;

    @Override
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(4);
      map.put("state", OSD.FromString(State));
      map.put("new_asset", OSD.FromUUID(AssetID));
      map.put("compiled", OSD.FromBoolean(Compiled));

      OSDArray errorsArray = new OSDArray();
      errorsArray.add(OSD.FromString(Error));


      map.put("errors", errorsArray);
      return map;
    }
View Full Code Here

    /// </summary>
    /// <returns>An <see cref="OSDMap"/> containing the objects data</returns>
    @Override
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(4);
      map.put("is_script_running", OSD.FromBoolean(ScriptRunning));
      map.put("item_id", OSD.FromUUID(ItemID));
      map.put("target", OSD.FromString(Target));
      map.put("task_id", OSD.FromUUID(TaskID));
      return map;
    }
View Full Code Here

    }

    @Override
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(2);
      map.put("state", OSD.FromString(State));
      map.put("new_asset", OSD.FromUUID(AssetID));
      map.put("compiled", OSD.FromBoolean(Compiled));
      return map;
    }
View Full Code Here

    /// </summary>
    /// <returns>An <see cref="OSDMap"/> containing the objects data</returns>
    @Override
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(2);
      map.put("item_id", OSD.FromUUID(ItemID));
      map.put("target", OSD.FromString(Target));
      return map;
    }
View Full Code Here

    /// Serialize the object
    /// </summary>
    /// <returns>An <see cref="OSDMap"/> containing the objects data</returns>
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(6);
      map.put("from", OSD.FromString(FromEmail));
      map.put("msg", OSD.FromString(Message));
      map.put("name", OSD.FromString(FromName));
      map.put("pos-global", OSD.FromVector3(GlobalPosition));
      map.put("subject", OSD.FromString(Subject));
      map.put("to", OSD.FromString(ToEmail));
      return map;
    }
View Full Code Here

  {

    @Override
    public OSDMap Serialize()
    {
      OSDMap map = new OSDMap(1);
      map.put("Flags", OSD.FromInteger(Flags));
      return map;
    }
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.structureddata.OSDMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.