示例#1
0
        public IMessage Add(MType name, out ushort value)
        {
            MType value2;

            value = name.TypeID;
            if (name.TypeID == 0)
            {
                ushort val = 0;
                for (int i = 1; i <= 99; i++)
                {
                    val = (ushort)Runner.Network.Random.Next(0, 65535);
                    if (this._ByID.TryGetValue(val, out value2) == false)
                    {
                        break;
                    }
                }
                name.TypeID = val;
                value       = val;
            }
            else
            {
            }
            if (this._ByName.TryGetValue(name.Name, out value2) == false)
            {
                lock (this._ByID)
                {
                    lock (this._ByName)
                    {
                        _ByID.Add(name.TypeID, name);
                        _ByName.Add(name.Name, name);
                    }
                }
            }
            return(new Message());
        }
示例#2
0
        public TypeList()
        {
            this._ByID   = new Dictionary <ushort, MType>();
            this._ByName = new Dictionary <string, MType>();
            MType scratch;

            scratch        = new MType();
            scratch.Name   = "Control.GetTypeID";
            scratch.TypeID = 57005;
            scratch.Static = true;
            this.Add(scratch);
            scratch        = new MType();
            scratch.Name   = "Control.TypeID";
            scratch.TypeID = 48879;
            scratch.Static = true;
            this.Add(scratch);
            scratch        = new MType();
            scratch.Name   = "Control.PreAuth";
            scratch.TypeID = 6500;
            this.Add(scratch);
            scratch        = new MType();
            scratch.Name   = "Control.Auth.Challenge";
            scratch.TypeID = 6501;
            this.Add(scratch);
            scratch        = new MType();
            scratch.Name   = "Control.Auth.Response";
            scratch.TypeID = 6502;
            this.Add(scratch);
            scratch        = new MType();
            scratch.Name   = "Control.Auth.OK";
            scratch.TypeID = 6503;
            this.Add(scratch);
            scratch        = new MType();
            scratch.Name   = "Control.Auth.Failed";
            scratch.TypeID = 6504;
            this.Add(scratch);
            scratch        = new MType();
            scratch.Name   = "Control.Ping";
            scratch.TypeID = 1;
            scratch.Static = true;
            this.Add(scratch);
            scratch        = new MType();
            scratch.Name   = "Control.Pong";
            scratch.TypeID = 2;
            scratch.Static = true;
            this.Add(scratch);

            /*
             * scratch = new Type();
             * scratch.Name = "Control.Auth.Types";
             * scratch.TypeID = 6505;
             * this.Add(scratch);
             */
        }
示例#3
0
 public TypeList()
 {
     this._ByID = new Dictionary<ushort, MType>();
     this._ByName = new Dictionary<string, MType>();
     MType scratch;
     scratch = new MType();
     scratch.Name = "Control.GetTypeID";
     scratch.TypeID = 57005;
     scratch.Static = true;
     this.Add(scratch);
     scratch = new MType();
     scratch.Name = "Control.TypeID";
     scratch.TypeID = 48879;
     scratch.Static = true;
     this.Add(scratch);
     scratch = new MType();
     scratch.Name = "Control.PreAuth";
     scratch.TypeID = 6500;
     this.Add(scratch);
     scratch = new MType();
     scratch.Name = "Control.Auth.Challenge";
     scratch.TypeID = 6501;
     this.Add(scratch);
     scratch = new MType();
     scratch.Name = "Control.Auth.Response";
     scratch.TypeID = 6502;
     this.Add(scratch);
     scratch = new MType();
     scratch.Name = "Control.Auth.OK";
     scratch.TypeID = 6503;
     this.Add(scratch);
     scratch = new MType();
     scratch.Name = "Control.Auth.Failed";
     scratch.TypeID = 6504;
     this.Add(scratch);
     scratch = new MType();
     scratch.Name = "Control.Ping";
     scratch.TypeID = 1;
     scratch.Static = true;
     this.Add(scratch);
     scratch = new MType();
     scratch.Name = "Control.Pong";
     scratch.TypeID = 2;
     scratch.Static = true;
     this.Add(scratch);
     /*
     scratch = new Type();
     scratch.Name = "Control.Auth.Types";
     scratch.TypeID = 6505;
     this.Add(scratch);
     */
 }
示例#4
0
        public bool ContainsID(MType type)
        {
            MType type2;

            if (this._ByID.TryGetValue(type.TypeID, out type2) == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#5
0
        public bool Contains(MType type)
        {
            MType type2;

            if (this._ByName.TryGetValue(type.Name, out type2) == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#6
0
 public bool ContainsID(MType type)
 {
     MType type2;
     if (this._ByID.TryGetValue(type.TypeID, out type2) == true)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
示例#7
0
 public bool Contains(MType type)
 {
     MType type2;
     if (this._ByName.TryGetValue(type.Name,out type2) == true)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
示例#8
0
 public IMessage Remove(MType name)
 {
     return new Message();
 }
示例#9
0
        public IMessage Add(MType name, out ushort value) {
            MType value2;
            value = name.TypeID;
            if (name.TypeID == 0)
            {
                ushort val = 0;
                for (int i = 1; i <= 99; i++)
                {
                    val = (ushort) Runner.Network.Random.Next(0, 65535);
                    if (this._ByID.TryGetValue(val, out value2) == false)
                    {
                        break;
                    }
                }
                name.TypeID = val;
                value = val;
            }
            else
            {

            }
            if (this._ByName.TryGetValue(name.Name, out value2) == false)
            {
                lock (this._ByID)
                {
                    lock (this._ByName)
                    {
                        _ByID.Add(name.TypeID, name);
                        _ByName.Add(name.Name, name);
                    }
                }
            }
            return new Message();
        }
示例#10
0
 public IMessage Add(MType name)
 {
     ushort val;
     return this.Add(name, out val);
 }
示例#11
0
 public IMessage Remove(MType name)
 {
     return(new Message());
 }
示例#12
0
        public IMessage Add(MType name)
        {
            ushort val;

            return(this.Add(name, out val));
        }