public static byte[] getBytesFromData(string name, string server, string notes, string violations, UserViolationLevel vl, string id)
        {
            List<byte> bytes = new List<byte>();

            foreach (byte b in NetUtils.stringToBytes(name))
                bytes.Add(b);
            bytes.Add(0x0);

            foreach(byte b in NetUtils.stringToBytes(notes))
                bytes.Add(b);
            bytes.Add(0x0);

            foreach(byte b in NetUtils.stringToBytes(violations))
                bytes.Add(b);
            bytes.Add(0x0);

            bytes.Add(vl.getByteIdentity());
            bytes.Add(0x0);

            foreach (byte b in NetUtils.stringToBytes(server))
                bytes.Add(b);
            bytes.Add(0x0);

            foreach (byte b in NetUtils.stringToBytes(id))
                bytes.Add(b);

            return NetUtils.byteListToArray(bytes);
        }
 public frmPlayerInformation(string name, string server, string notes, string violations, UserViolationLevel vl, string id)
 {
     InitializeComponent();
     this.txtNotes.Text = notes;
     this.txtInfractions.Text = violations;
     this.setViolationLevel(vl);
     this.lblPlayer.Text = name;
     this.lblServer.Text = server;
     this.id = id;
 }
 private void setViolationLevel(UserViolationLevel vl)
 {
     if(vl.Equals(UserViolationLevel.GOOD)){
         this.radGood.Checked = true;
     }else if(vl.Equals(UserViolationLevel.WARN)){
         this.radWarned.Checked = true;
     }else if(vl.Equals(UserViolationLevel.SEVERE)){
         this.radSevere.Checked = true;
     }else{
         this.radBanned.Checked = true;
     }
 }
 public DataResponsePacket(string name, string server, string notes, string violations, UserViolationLevel vl, string id)
     : base(PacketType.DATA_RESPONSE, getBytesFromData(name, server, notes, violations, vl, id))
 {
 }
 public DataUpdatePacket(string user, string server, string notes, string violations, UserViolationLevel vl, string id)
     : base(PacketType.DATA_UPDATE, getBytesFromData(user, server, notes, violations, vl, id))
 {
 }
Esempio n. 6
0
 public bool Equals(UserViolationLevel vl)
 {
     return(this.ident == vl.ident);
 }
 public bool Equals(UserViolationLevel vl)
 {
     return this.ident == vl.ident;
 }