-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
Description
現状の実装だと、コードのコメントに書いてあるとおり、TimeLeftUtil::ReDetermineExtendType() をMapが完全にスタートする前に呼び出すとサーバーが死ぬため、ラウンドスタート後にVoteタイマーをスタートしている。
MapChooserSharp/MapChooserSharp/Modules/MapCycle/McsMapCycleController.cs
Lines 169 to 181 in f355040
| // This is for late timer start | |
| // Since we cannot obtain McsMapExtendType before map is fully loaded | |
| // So we'll wait for first round started | |
| Plugin.RegisterEventHandler<EventRoundPoststart>((@event, info) => | |
| { | |
| if (_isMapStarted) | |
| return HookResult.Continue; | |
| _timeLeftUtil.ReDetermineExtendType(); | |
| _isMapStarted = true; | |
| RecreateVoteTimer(); | |
| return HookResult.Continue; | |
| }); |
が、この場合タイトルの通りの状況になるとマップが決まらないままマップが終了してしまうためバグる。
現状思いついている対策は2つ
1. ユーザー参加時の処理でランダムマップにフォールバック
ユーザー参加時(0 -> 1)に VotePending && 投票開始時間 > Timeleft だった場合に強制的に次のマップをランダムで選ぶという対策
2. タイマーの開始タイミングを調整し、正常に動作させる
OnMapStart時にServer.NextFrameなどを呼び出し次のフレームで操作させることでクラッシュを回避する。
3. 2つとも作る
多分これが一番良い