//, bool sendToClient) public byte GetVane(int Wind, int param) { byte vane_id = 0; //byte[] imageData = null; using (ProduceBussiness db = new ProduceBussiness()) { VaneInfo vaneInfos = db.GetSingleVane(Math.Abs(Wind)); switch (param) { case 1: vane_id = (byte)vaneInfos.VaneId1; //imageData = vaneInfos.Param1; break; case 2: vane_id = (byte)vaneInfos.VaneId2; //imageData = vaneInfos.Param2; break; case 3: vane_id = (byte)vaneInfos.VaneId3; //imageData = vaneInfos.Param3; break; } //if (sendToClient) // { // SendGameWindPic(vane_id, imageData); //} } return vane_id; }
public void VaneLoading() { ThreadSafeRandom rand = new ThreadSafeRandom(); using (ProduceBussiness db = new ProduceBussiness()) { int cindex = rand.Next(4); int[] start = new int[] { 0, 10, 20, 30, 40 }; int[] end = new int[] { 10, 20, 30, 40, 50 }; for (int wind_id = start[cindex]; wind_id <= end[cindex]; wind_id++) { VaneInfo vaneInfos = db.GetSingleVane(wind_id); if (wind_id == start[cindex]) { SendGameWindPic((byte)vaneInfos.VaneId2, vaneInfos.Param2); } else { SendGameWindPic((byte)vaneInfos.VaneId3, vaneInfos.Param3); } } } //string[] digitals = new string[] {".", "1", "2", "3", "4", "5", "6", "7", "8", "9","0" }; //for (int wind_id = 0; wind_id < 11; wind_id++) //{ // byte id =(byte)wind_id; // byte[] windPic = CheckCode.CreateVane(digitals[wind_id], wind_id); // SendGameWindPic(id, windPic); //} }