Ejemplo n.º 1
0
 private void Read(ref SharpSerializer ser)
 {
     this.roomName            = ser.ReadString();
     this.currentConnnections = ser.ReadInt16();
     this.maxConnection       = ser.ReadInt16();
     this.isSecured           = ser.ReadBool();
 }
Ejemplo n.º 2
0
 public void Write(ref SharpSerializer ser)
 {
     ser.Write(this.roomName);
     ser.Write(this.currentConnnections);
     ser.Write(this.maxConnection);
     ser.Write(this.isSecured);
 }
Ejemplo n.º 3
0
 public static SharpSerializer Create()
 {
     if (pool.Count > 0)
     {
         SharpSerializer obj = pool.Dequeue();
         if (obj != null)
         {
             obj._inUse = true;
             return(obj);
         }
         return(new SharpSerializer());
     }
     return(new SharpSerializer());
 }
Ejemplo n.º 4
0
 public static SharpSerializer Create(byte[] data)
 {
     if (pool.Count > 0)
     {
         SharpSerializer obj = pool.Dequeue();
         if (obj != null)
         {
             obj.Load(data);
             return(obj);
         }
         return(new SharpSerializer(data));
     }
     return(new SharpSerializer(data));
 }
Ejemplo n.º 5
0
 public void Write(ref SharpSerializer ser)
 {
     ser.Write(this.room_name);
     ser.Write(this.room_password);
     ser.Write(this.max_connection);
     for (int i = 0; i < slots.Length; i++)
     {
         SharpClient c       = slots[i];
         bool        isExist = (c != null);
         if (!isExist)
         {
             ser.Write(false);
         }
         else
         {
             ser.Write(true);
             c.Write(ref ser);
         }
     }
 }
Ejemplo n.º 6
0
 private void Read(ref SharpSerializer ser)
 {
     this.room_name      = ser.ReadString();
     this.room_password  = ser.ReadString();
     this.max_connection = ser.ReadInt16();
     this.slots          = new SharpClient[this.max_connection];
     for (int i = 0; i < slots.Length; i++)
     {
         bool isExist = ser.ReadBool();
         if (isExist)
         {
             slots[i] = new SharpClient(ref ser);
             slots[i].SetIsConnected(true);
             if (i != 0)
             {
                 connections.Add(slots[i]);
             }
         }
         else if (this.clientCount == 0)
         {
             this.clientCount = (short)i;
         }
     }
 }
Ejemplo n.º 7
0
 public SharpRoom(ref SharpSerializer ser)
 {
     Read(ref ser);
 }
Ejemplo n.º 8
0
 public SharpRoomDetails(ref SharpSerializer ser)
 {
     Read(ref ser);
 }
Ejemplo n.º 9
0
 private void Read(ref SharpSerializer ser)
 {
     this.Name  = ser.ReadString();
     this.netID = ser.ReadInt16();
 }
Ejemplo n.º 10
0
 public void Write(ref SharpSerializer ser)
 {
     ser.Write(this.Name);
     ser.Write(this.netID);
 }
Ejemplo n.º 11
0
 public SharpClient(ref SharpSerializer ser)
 {
     Read(ref ser);
 }