Beispiel #1
0
 public static void LoadRoomKindInfo()
 {
     using (var con = new MySqlConnection(Conf.Connstr))
     {
         con.Open();
         using (var cmd = new MySqlCommand(string.Empty, con))
         {
             cmd.Parameters.Clear();
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.CommandText = "usp_getRoomKindID";
             using (MySqlDataReader reader = cmd.ExecuteReader())
             {
                 while (reader.Read())
                 {
                     RoomKindInfo roomkindinfo = new RoomKindInfo
                     {
                         GameMode = Convert.ToInt32(reader["GameMode"]),
                         Channel  = Convert.ToInt32(reader["Channel"])
                     };
                     RoomKindInfos.TryAdd(Convert.ToInt32(reader["RoomKindID"]), roomkindinfo);
                 }
             }
         }
     }
     Log.Info("Load RoomKindInfo Count: {0}", RoomKindInfos.Count());
 }
Beispiel #2
0
        public void setGameMode(RoomKindInfo roomkindinfo)
        {
            GameMode = roomkindinfo.GameMode;
            Channel  = roomkindinfo.Channel;
            byte Maxplayer = 0;

            switch (GameMode)
            {
            case 1:     //8人
                Maxplayer = 8;
                is8Player = true;
                break;

            case 2:     //30人
                Maxplayer = ServerSettingHolder.ServerSettings.SurvivalMaxUserNum;
                is8Player = false;
                break;

            case 3:     //接力
                Maxplayer = 20;
                is8Player = false;
                setRelayPosList();
                break;

            case 5:     //八心
                Maxplayer = 8;
                is8Player = true;
                break;

            case 14:    //阿努比斯
                Maxplayer = 8;
                is8Player = true;
                break;

            case 16:    //公園
                Maxplayer = 50;
                is8Player = false;
                break;

            case 17:    //農場
                Maxplayer = 20;
                is8Player = false;
                break;

            case 38:     //小遊戲
                Maxplayer = 4;
                is8Player = true;
                break;

            default:
                Maxplayer = 8;
                is8Player = true;
                break;
            }
            setMaxPlayersCount(Maxplayer);
            setPosList(Maxplayer);
            setSlotCount(Maxplayer);
        }