コード例 #1
0
        private void OnModMessageReceived(object sender, ModMessageReceivedEventArgs e)
        {
            if (e.FromModID != this.ModManifest.UniqueID)
            {
                return;
            }

            switch (e.Type)
            {
            case nameof(DepartureMessage):
                DepartureMessage departureMessage = e.ReadAs <DepartureMessage>();
                mainDeckhand = Game1.getAllFarmers().First(f => f.UniqueMultiplayerID == departureMessage.MainDeckhand);
                trawlerObject.TriggerDepartureEvent();
                break;

            case nameof(TrawlerEventMessage):
                TrawlerEventMessage eventMessage = e.ReadAs <TrawlerEventMessage>();
                UpdateLocalTrawlerMap(eventMessage.EventType, eventMessage.Tile, eventMessage.IsRepairing);
                break;

            case nameof(TrawlerSyncMessage):
                TrawlerSyncMessage syncMessage = e.ReadAs <TrawlerSyncMessage>();
                SyncLocalTrawlerMap(syncMessage.SyncType, syncMessage.Quantity);
                break;

            case nameof(TrawlerNotificationMessage):
                TrawlerNotificationMessage notificationMessage = e.ReadAs <TrawlerNotificationMessage>();
                _activeNotification = notificationMessage.Notification;
                break;
            }
        }
        protected async void Page_Load(object sender, EventArgs e)
        {
            string shipIMO = Request.QueryString["imo"];

            string text = await DepartureMessage.createDepartureMessage(shipIMO);

            message.Text = text;
        }
コード例 #3
0
        public async Task SendDeparture(Schedule schedule)
        {
            var message = new DepartureMessage
            {
                Name = schedule.Ship.Name
            };

            schedule.DepartureSent = true;
            await SendMessage(schedule, message);
        }