コード例 #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
ファイル: Type.cs プロジェクト: heliocentric/simplemesh
 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
ファイル: Type.cs プロジェクト: heliocentric/simplemesh
 public bool ContainsID(MType type)
 {
     MType type2;
     if (this._ByID.TryGetValue(type.TypeID, out type2) == true)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #7
0
ファイル: Type.cs プロジェクト: heliocentric/simplemesh
 public bool Contains(MType type)
 {
     MType type2;
     if (this._ByName.TryGetValue(type.Name,out type2) == true)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #8
0
ファイル: Type.cs プロジェクト: heliocentric/simplemesh
 public IMessage Remove(MType name)
 {
     return new Message();
 }
コード例 #9
0
ファイル: Type.cs プロジェクト: heliocentric/simplemesh
        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
ファイル: Type.cs プロジェクト: heliocentric/simplemesh
 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));
        }