public void parseOfficeStatus(message.MsgS2COfficeStatusACK msg) { _chapter_ids.Clear (); _officilMap.Clear (); foreach (int secion_id in msg.chapter_id) { _chapter_ids.Add (secion_id); } if (_chapter_ids.Count != 0) { message.MsgC2SOfficeMapReq MsgReq = new message.MsgC2SOfficeMapReq (); MsgReq.chapter_id = _chapter_ids [0]; MsgReq.section_id = -1; global_instance.Instance._net_client.send (msg); } else { endOfficilMapLoad (); } }
public void parseOfficeChaper(message.MsgS2COfficeMapACK msg) { int chapter_id = msg.chapter_id; int session_id = 0; if (_officilMap.ContainsKey (chapter_id) == true) { foreach (message.CrashMapData entry in msg.maps) { _officilMap[chapter_id][entry.Section] = entry; session_id = entry.Section; } } int req_chapter_id = -1; int req_section_id = -1; if (msg.section_count == _officilMap [chapter_id].Count) { bool next_chapter_id = false; foreach (int chapter_id_entry in _chapter_ids) { if (next_chapter_id == false) { if (chapter_id == chapter_id_entry) { next_chapter_id = true; } } else { req_chapter_id = chapter_id_entry; break; } } } else { req_chapter_id = chapter_id; req_section_id = session_id; } if (req_chapter_id == -1 && req_section_id == -1) { endOfficilMapLoad (); } else { if (chapter_id != -1) { message.MsgC2SOfficeMapReq MsgReq = new message.MsgC2SOfficeMapReq (); MsgReq.chapter_id = req_chapter_id; MsgReq.section_id = req_section_id; global_instance.Instance._net_client.send (msg); } } }