コード例 #1
0
ファイル: DBManager.cs プロジェクト: RudyJ/ODK-DarkEmu
        public static PCInfo[] GetPCInfoList(string userid)
        {
            PCInfo[] result = new PCInfo[3];

            // build query string
            string cmdstr = String.Format(@"SELECT SLOT1, SLOT2, SLOT3 FROM Player WHERE UserID = '{0}'", userid);

            // execute query
            MySqlCommand cmd = new MySqlCommand(cmdstr, mysqlconn);
            MySqlDataReader datareader = cmd.ExecuteReader();

            // read data
            if(datareader.HasRows)
            {
                datareader.Read();


                string name1 = null;
                string name2 = null;
                string name3 = null;

                if(!datareader.IsDBNull(0)) { name1 = datareader.GetString(0); }
                if(!datareader.IsDBNull(1)) { name2 = datareader.GetString(1); }
                if(!datareader.IsDBNull(2)) { name3 = datareader.GetString(2); }

                datareader.Close();

                if(name1 != null)
                {
                    PCType pctype = GetPCType(name1);
                    if(pctype == PCType.SLAYER)
                    {
                        PCSlayerInfo pc = GetPCSlayerInfo(name1);
                        pc.Slot = Slot.SLOT1;

                        result[0] = pc;                       
                    }
                    else if(pctype == PCType.VAMPIRE)
                    {
                        PCVampireInfo pc = GetPCVampireInfo(name1);
                        pc.Slot = Slot.SLOT1;

                        result[0] = pc;
                    }
                    else if (pctype == PCType.OUSTER)
                    {
                        PCOusterInfo pc = GetPCOusterInfo(name1);
                        pc.Slot = Slot.SLOT1;

                        result[0] = pc;
                    }
                }

                if(name2 != null)
                {
                    PCType pctype = GetPCType(name2);
                    if (pctype == PCType.SLAYER)
                    {
                        PCSlayerInfo pc = GetPCSlayerInfo(name2);
                        pc.Slot = Slot.SLOT2;

                        result[1] = pc;      
                    }
                    else if (pctype == PCType.VAMPIRE)
                    {
                        PCVampireInfo pc = GetPCVampireInfo(name2);
                        pc.Slot = Slot.SLOT2;

                        result[1] = pc;
                    }
                    else if (pctype == PCType.OUSTER)
                    {
                        PCOusterInfo pc = GetPCOusterInfo(name2);
                        pc.Slot = Slot.SLOT2;

                        result[1] = pc;
                    }
                }

                if(name3 != null)
                {
                    PCType pctype = GetPCType(name3);
                    if (pctype == PCType.SLAYER)
                    {
                        PCSlayerInfo pc = GetPCSlayerInfo(name3);
                        pc.Slot = Slot.SLOT3;

                        result[2] = pc;    
                    }
                    else if(pctype == PCType.VAMPIRE)
                    {
                        PCVampireInfo pc = GetPCVampireInfo(name3);
                        pc.Slot = Slot.SLOT3;

                        result[2] = pc;
                    }
                    else if(pctype == PCType.OUSTER)
                    {
                        PCOusterInfo pc = GetPCOusterInfo(name3);
                        pc.Slot = Slot.SLOT3;

                        result[2] = pc;
                    }
                }
            }

            // return result
            return result;
        }
コード例 #2
0
        // TODO

        public GCUpdateInfo(PCInfo pcinfo2)
        {
            this.ID = PacketID.GCUpdateInfo;

            this.PCInfo = pcinfo2;

            this.InventoryInfo = new InventoryInfo();
            this.GearInfo      = new GearInfo();

            GearSlotInfo gsi1 = new GearSlotInfo();

            /*gsi1.ObjectID = 0x0B4F0;
             * gsi1.ItemClass = 19;
             * gsi1.ItemType = 1;
             * gsi1.SlotID = 0;
             * this.GearInfo.GearSlotInfoList.Add(gsi1);*/

            this.ExtraInfo = new ExtraInfo();

            /*ExtraSlotInfo esi1 = new ExtraSlotInfo();
             * esi1.ObjectID = 0x0B4F0;
             * esi1.ItemClass = 1;
             * esi1.ItemType = 1;
             *
             * this.ExtraInfo.ExtraSlotInfoList.Add(esi1)*/;

            this.EffectInfo = new EffectInfo();
            EffectInfo.Status a;
            a.val1 = 0;
            a.val2 = 0;
            this.EffectInfo.EList.Add(a);

            this.ZoneID = 12; //12;5001
            this.ZoneX  = 30; // 117;
            this.ZoneY  = 22; //145;

            this.GameTime = new GameTime();

            this.Weather = Weather.WEATHER_RAINY;

            this.DarkLevel  = 0;
            this.LightLevel = 0;

            this.NPCTypeList     = new List <ushort>();
            this.MonsterTypeList = new List <ushort>();

            this.NPCInfoList = new List <NPCInfo>();

            this.Premium = 0;

            this.SMSCharge = 0;

            this.NicknameInfo = new NicknameInfo();

            this.NonPK = 0x0;

            this.GuildUnionID       = 0;
            this.GuildUnionUserType = 0x0;

            this.BloodBibleSignInfo = new BloodBibleSignInfo();

            this.PowerjjangPoint = 0;
            // TODO
        }
コード例 #3
0
ファイル: GCUpdateInfo.cs プロジェクト: RudyJ/ODK-DarkEmu
        // TODO

        public GCUpdateInfo(PCInfo pcinfo2)
        {
            this.ID = PacketID.GCUpdateInfo;

            this.PCInfo = pcinfo2;

            this.InventoryInfo = new InventoryInfo();
            this.GearInfo = new GearInfo();

            GearSlotInfo gsi1 = new GearSlotInfo();
            /*gsi1.ObjectID = 0x0B4F0;
            gsi1.ItemClass = 19;
            gsi1.ItemType = 1;
            gsi1.SlotID = 0;
            this.GearInfo.GearSlotInfoList.Add(gsi1);*/

            this.ExtraInfo = new ExtraInfo();

            /*ExtraSlotInfo esi1 = new ExtraSlotInfo();
            esi1.ObjectID = 0x0B4F0;
            esi1.ItemClass = 1;
            esi1.ItemType = 1;

            this.ExtraInfo.ExtraSlotInfoList.Add(esi1)*/;

            this.EffectInfo = new EffectInfo();
            EffectInfo.Status a;
            a.val1 = 0;
            a.val2 = 0;
            this.EffectInfo.EList.Add(a);

            this.ZoneID = 12;//12;5001
            this.ZoneX = 30;// 117;
            this.ZoneY = 22;//145;

            this.GameTime = new GameTime();

            this.Weather = Weather.WEATHER_RAINY;

            this.DarkLevel = 0;
            this.LightLevel = 0;

            this.NPCTypeList = new List<ushort>();
            this.MonsterTypeList = new List<ushort>();

            this.NPCInfoList = new List<NPCInfo>();

            this.Premium = 0;

            this.SMSCharge = 0;

            this.NicknameInfo = new NicknameInfo();

            this.NonPK = 0x0;

            this.GuildUnionID = 0;
            this.GuildUnionUserType = 0x0;

            this.BloodBibleSignInfo = new BloodBibleSignInfo();

            this.PowerjjangPoint = 0;
            // TODO
        }