bool DownloadMissionPackForm::OnFilterEvent(Event *pevt) { if (pevt->eType != askStringEvent) { return false; } // Get the URL and Save preferences so this url is remembered HostGetAskString(gszAskURL, sizeof(gszAskURL)); ggame.SavePreferences(); // Download this custom pack PackId packid; bool play = false; if (!DownloadMissionPackFromURL(gszAskURL, &packid, &play)) { // Some kind of error occured return true; } // User wants to play now? if (play) { // The user wants to play the mission fWantsPlay_ = true; packidPlay_ = packid; EndForm(kidcOk); return true; } // Add this mission pack to the index, and re-fill the list control, // and select it. idxl_.AddIndexEntry(&packid); idxl_.Sort(sort_); ShowIndex(&packid); return true; }
bool LobbyForm::OnFilterEvent(Event *pevt) { if (pevt->eType == askStringEvent) { if (gptra == NULL) { return true; } char s[512]; HostGetAskString(s, sizeof(s)); ListControl *plstc = (ListControl *)GetControlPtr(kidcRoomList); dword roomid = (dword)(pword)plstc->GetSelectedItemData(); RoomMap::iterator it = map_.find(roomid); if (it != map_.end()) { it->second.password = s; InitiateJoinRoom(it->second); } return true; } if (pevt->eType == connectionCloseEvent) { HtMessageBox(kfMbWhiteBorder, "Comm Problem", "The server has closed your connection."); EndForm(kidcCancel); return true; } if (pevt->eType == showMessageEvent) { HtMessageBox(kfMbWhiteBorder, "Server Message", message_.c_str()); message_ = ""; return true; } return false; }