Esempio n. 1
0
            public static void skip_read(adata.zero_copy_buffer stream, ref quest value)
            {
                int offset = stream.read_length();
                  UInt64 tag = 0;
                  adata.stream.read(stream,ref tag);
                  if(stream.error()){return;}
                  Int32 len_tag = 0;
                  adata.stream.read(stream,ref len_tag);
                  if(stream.error()){return;}

                  if((tag&1)>0)      {Int32 dummy_value = 0;adata.stream.skip_read(stream,ref dummy_value);{if(stream.error()){stream.trace_error("id",-1);return;}}}
                  if((tag&2)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream);
                {if(stream.error()){stream.trace_error("name",-1);return;}}
                stream.skip_read(len3);
                {if(stream.error()){stream.trace_error("name",-1);return;}}
                  }
                  if((tag&4)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream);
                {if(stream.error()){stream.trace_error("description",-1);return;}}
                stream.skip_read(len3);
                {if(stream.error()){stream.trace_error("description",-1);return;}}
                  }
                  if(len_tag >= 0)
                  {
                UInt32 read_len = (UInt32)(stream.read_length() - offset);
                UInt32 len = (UInt32)len_tag;
                if(len > read_len) stream.skip_read(len - read_len);
                  }
            }
Esempio n. 2
0
 public static void write(adata.zero_copy_buffer stream , vec3 value)
 {
     UInt64 tag = 7;
       adata.stream.write(stream,tag);
       if(stream.error()){ return; }
       adata.stream.write(stream,size_of(value));
       if(stream.error()){return;}
       {adata.stream.write(stream,value.x);{if(stream.error()){stream.trace_error("x",-1);return;}}}
       {adata.stream.write(stream,value.y);{if(stream.error()){stream.trace_error("y",-1);return;}}}
       {adata.stream.write(stream,value.z);{if(stream.error()){stream.trace_error("z",-1);return;}}}
       return;
 }
Esempio n. 3
0
        public static void skip_read(adata.zero_copy_buffer stream, ref vec3 value)
        {
            int offset = stream.read_length();
              UInt64 tag = 0;
              adata.stream.read(stream,ref tag);
              if(stream.error()){return;}
              Int32 len_tag = 0;
              adata.stream.read(stream,ref len_tag);
              if(stream.error()){return;}

              if((tag&1)>0)      {float dummy_value = 0;adata.stream.skip_read(stream,ref dummy_value);{if(stream.error()){stream.trace_error("x",-1);return;}}}
              if((tag&2)>0)      {float dummy_value = 0;adata.stream.skip_read(stream,ref dummy_value);{if(stream.error()){stream.trace_error("y",-1);return;}}}
              if((tag&4)>0)      {float dummy_value = 0;adata.stream.skip_read(stream,ref dummy_value);{if(stream.error()){stream.trace_error("z",-1);return;}}}
              if(len_tag >= 0)
              {
            UInt32 read_len = (UInt32)(stream.read_length() - offset);
            UInt32 len = (UInt32)len_tag;
            if(len > read_len) stream.skip_read(len - read_len);
              }
        }
Esempio n. 4
0
            public static void read(adata.zero_copy_buffer stream, ref item value)
            {
                int offset = stream.read_length();
                  UInt64 tag = 0;
                  adata.stream.read(stream,ref tag);
                  if(stream.error()){return;}
                  Int32 len_tag = 0;
                  adata.stream.read(stream,ref len_tag);
                  if(stream.error()){return;}

                  if((tag&1)>0)      {adata.stream.read(stream,ref value.id);{if(stream.error()){stream.trace_error("id",-1);return;}}}
                  if((tag&2)>0)      {adata.stream.read(stream,ref value.type);{if(stream.error()){stream.trace_error("type",-1);return;}}}
                  if((tag&4)>0)      {adata.stream.read(stream,ref value.level);{if(stream.error()){stream.trace_error("level",-1);return;}}}
                  if(len_tag >= 0)
                  {
                UInt32 read_len = (UInt32)(stream.read_length() - offset);
                UInt32 len = (UInt32)len_tag;
                if(len > read_len) stream.skip_read(len - read_len);
                  }
            }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Files["file"] != null)
        {
            saveFile();
            return;
        }
        try
        {
            String   action  = Request.QueryString["action"].ToString();
            int      count   = Request.Form.Count;
            object[] mParams = new object[0];
            if (count >= 1)
            {
                mParams = new object[count - 1];
            }
            int a = 0;
            foreach (var key in Request.Form.AllKeys)
            {
                if (key != "action")
                {
                    mParams[a] = Request.Form[key];
                    a++;
                }
            }

            adata  t    = new adata();
            object temp = typeof(adata).GetMethod(action).Invoke(t, mParams);
            Response.Write(temp.ToString());
        }
        catch (Exception ex)
        {
            //Response.Write("[ERROR. Contact ARESH]");
            Response.Write(ex.ToString());
        }
    }
Esempio n. 6
0
 public static void write(adata.zero_copy_buffer stream , quest value)
 {
     UInt64 tag = 1;
       if(value.name.Length > 0){tag|=2;}
       if(value.description.Length > 0){tag|=4;}
       adata.stream.write(stream,tag);
       if(stream.error()){ return; }
       adata.stream.write(stream,size_of(value));
       if(stream.error()){return;}
       {adata.stream.write(stream,value.id);{if(stream.error()){stream.trace_error("id",-1);return;}}}
       if((tag&2)>0)
       {
     UInt32 len3 = (UInt32)value.name.Length;
     adata.stream.write(stream,len3);
     adata.stream.write(stream,value.name,len3);
     {if(stream.error()){stream.trace_error("name",-1);return;}}
       }
       if((tag&4)>0)
       {
     UInt32 len3 = (UInt32)value.description.Length;
     adata.stream.write(stream,len3);
     adata.stream.write(stream,value.description,len3);
     {if(stream.error()){stream.trace_error("description",-1);return;}}
       }
       return;
 }
Esempio n. 7
0
 public abstract void write(adata.zero_copy_buffer stream);
Esempio n. 8
0
 public abstract void read(adata.zero_copy_buffer stream);
Esempio n. 9
0
 public static void write(adata.zero_copy_buffer stream , player_v2 value)
 {
     UInt64 tag = 9;
       if(value.name.Length > 0){tag|=2;}
       if(value.inventory.Count > 0){tag|=16;}
       if(value.quests.Count > 0){tag|=32;}
       if(value.friends.Count > 0){tag|=128;}
       adata.stream.write(stream,tag);
       if(stream.error()){ return; }
       adata.stream.write(stream,size_of(value));
       if(stream.error()){return;}
       {adata.stream.write(stream,value.id);{if(stream.error()){stream.trace_error("id",-1);return;}}}
       if((tag&2)>0)
       {
     UInt32 len3 = (UInt32)value.name.Length;
     adata.stream.write(stream,len3);
     adata.stream.write(stream,value.name,len3);
     {if(stream.error()){stream.trace_error("name",-1);return;}}
       }
     //value.age deleted , skip write.
       {util.vec3_stream.write(stream,value.pos);{if(stream.error()){stream.trace_error("pos",-1);return;}}}
       if((tag&16)>0)
       {
     UInt32 len3 = (UInt32)value.inventory.Count;
     adata.stream.write(stream,len3);
     int count = 0;
     foreach (item i in value.inventory)
     {
       {write(stream,i);}
       {if(stream.error()){stream.trace_error("inventory",count);return;}}
       ++count;
     }
       }
       if((tag&32)>0)
       {
     UInt32 len3 = (UInt32)value.quests.Count;
     adata.stream.write(stream,len3);
     int count = 0;
     foreach (my.game.quest i in value.quests)
     {
       {my.game.quest_stream.write(stream,i);}
       {if(stream.error()){stream.trace_error("quests",count);return;}}
       ++count;
     }
       }
     //value.factor deleted , skip write.
       if((tag&128)>0)
       {
     UInt32 len3 = (UInt32)value.friends.Count;
     adata.stream.write(stream,len3);
     int count = 0;
     foreach (Int32 i in value.friends)
     {
       {adata.stream.write(stream,i);}
       {if(stream.error()){stream.trace_error("friends",count);return;}}
       ++count;
     }
       }
       return;
 }
Esempio n. 10
0
            public static void skip_read(adata.zero_copy_buffer stream, ref player_v2 value)
            {
                int offset = stream.read_length();
                  UInt64 tag = 0;
                  adata.stream.read(stream,ref tag);
                  if(stream.error()){return;}
                  Int32 len_tag = 0;
                  adata.stream.read(stream,ref len_tag);
                  if(stream.error()){return;}

                  if((tag&1)>0)      {Int32 dummy_value = 0;adata.stream.skip_read(stream,ref dummy_value);{if(stream.error()){stream.trace_error("id",-1);return;}}}
                  if((tag&2)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream,30);
                {if(stream.error()){stream.trace_error("name",-1);return;}}
                stream.skip_read(len3);
                {if(stream.error()){stream.trace_error("name",-1);return;}}
                  }
                  if((tag&4)>0)      {Int32 dummy_value = 0;adata.stream.skip_read(stream,ref dummy_value);{if(stream.error()){stream.trace_error("age",-1);return;}}}
                  if((tag&8)>0)      {util.vec3 dummy_value = null;util.vec3_stream.skip_read(stream,ref dummy_value);{if(stream.error()){stream.trace_error("pos",-1);return;}}}
                  if((tag&16)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream);
                {if(stream.error()){stream.trace_error("inventory",-1);return;}}
                for (int i = 0 ; i < len3 ; ++i)
                {
                  {item dummy_value = null;skip_read(stream,ref dummy_value);}
                  {if(stream.error()){stream.trace_error("inventory",(int)i);return;}}
                }
                  }
                  if((tag&32)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream);
                {if(stream.error()){stream.trace_error("quests",-1);return;}}
                for (int i = 0 ; i < len3 ; ++i)
                {
                  {my.game.quest dummy_value = null;my.game.quest_stream.skip_read(stream,ref dummy_value);}
                  {if(stream.error()){stream.trace_error("quests",(int)i);return;}}
                }
                  }
                  if((tag&64)>0)      {float dummy_value = 0;adata.stream.skip_read(stream,ref dummy_value);{if(stream.error()){stream.trace_error("factor",-1);return;}}}
                  if((tag&128)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream);
                {if(stream.error()){stream.trace_error("friends",-1);return;}}
                for (int i = 0 ; i < len3 ; ++i)
                {
                  {Int32 dummy_value = 0;adata.stream.skip_read(stream,ref dummy_value);}
                  {if(stream.error()){stream.trace_error("friends",(int)i);return;}}
                }
                  }
                  if(len_tag >= 0)
                  {
                UInt32 read_len = (UInt32)(stream.read_length() - offset);
                UInt32 len = (UInt32)len_tag;
                if(len > read_len) stream.skip_read(len - read_len);
                  }
            }
Esempio n. 11
0
            public static void read(adata.zero_copy_buffer stream, ref player_v1 value)
            {
                int offset = stream.read_length();
                  UInt64 tag = 0;
                  adata.stream.read(stream,ref tag);
                  if(stream.error()){return;}
                  Int32 len_tag = 0;
                  adata.stream.read(stream,ref len_tag);
                  if(stream.error()){return;}

                  if((tag&1)>0)      {adata.stream.read(stream,ref value.id);{if(stream.error()){stream.trace_error("id",-1);return;}}}
                  if((tag&2)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream,30);
                {if(stream.error()){stream.trace_error("name",-1);return;}}
                adata.stream.read(stream,ref value.name,len3);
                {if(stream.error()){stream.trace_error("name",-1);return;}}
                  }
                  if((tag&4)>0)      {adata.stream.read(stream,ref value.age);{if(stream.error()){stream.trace_error("age",-1);return;}}}
                  if((tag&8)>0)      {util.vec3_stream.read(stream,ref value.pos);{if(stream.error()){stream.trace_error("pos",-1);return;}}}
                  if((tag&16)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream);
                {if(stream.error()){stream.trace_error("inventory",-1);return;}}
                for (int i = 0 ; i < len3 ; ++i)
                {
                  item element= new item();
                  {read(stream,ref element);}
                  value.inventory.Add(element);
                  {if(stream.error()){stream.trace_error("inventory",(int)i);return;}}
                }
                  }
                  if((tag&32)>0)
                  {
                UInt32 len3 = adata.stream.check_read_size(stream);
                {if(stream.error()){stream.trace_error("quests",-1);return;}}
                for (int i = 0 ; i < len3 ; ++i)
                {
                  my.game.quest element= new my.game.quest();
                  {my.game.quest_stream.read(stream,ref element);}
                  value.quests.Add(element);
                  {if(stream.error()){stream.trace_error("quests",(int)i);return;}}
                }
                  }
                  if((tag&64)>0)      {adata.stream.read(stream,ref value.factor);{if(stream.error()){stream.trace_error("factor",-1);return;}}}
                  if(len_tag >= 0)
                  {
                UInt32 read_len = (UInt32)(stream.read_length() - offset);
                UInt32 len = (UInt32)len_tag;
                if(len > read_len) stream.skip_read(len - read_len);
                  }
            }
Esempio n. 12
0
 public static void write(adata.zero_copy_buffer stream , item value)
 {
     UInt64 tag = 7;
       adata.stream.write(stream,tag);
       if(stream.error()){ return; }
       adata.stream.write(stream,size_of(value));
       if(stream.error()){return;}
       {adata.stream.write(stream,value.id);{if(stream.error()){stream.trace_error("id",-1);return;}}}
       {adata.stream.write(stream,value.type);{if(stream.error()){stream.trace_error("type",-1);return;}}}
       {adata.stream.write(stream,value.level);{if(stream.error()){stream.trace_error("level",-1);return;}}}
       return;
 }