public static void Process(byte[] bytes) { try { MsgMissions msg = Utils.BytesToStruct <MsgMissions>(bytes, 0, Size); int step = Mission.Size; int offset = Size; Mission[] missions = new Mission[msg.count]; for (int i = 0; i < msg.count; i++) { missions[i] = Utils.BytesToStruct <Mission>(bytes, offset + i * step, step); } Core.Account.MissionModule.Update(missions); } catch (Exception ex) { Debug.LogError(ex); } }
public IEnumerator Process() { switch (type) { case Type.Event: MsgEvent.Process(m_bytes); break; case Type.CreatePlayer: MsgCreatePlayer.Process(m_bytes); break; case Type.Account: MsgAccount.Process(m_bytes); break; case Type.ChangeMap: yield return(MsgChangeMap.Process(m_bytes)); break; case Type.EntityEnter: MsgEntityEnter.Process(m_bytes); break; case Type.EntityLeave: MsgEntityLeave.Process(m_bytes); break; case Type.Move: MsgMove.Process(m_bytes); break; case Type.Action: MsgAction.Process(m_bytes); break; case Type.Damage: MsgDamage.Process(m_bytes); break; case Type.Attribs: MsgAttribs.Process(m_bytes); break; case Type.Bag: MsgBag.Process(m_bytes); break; case Type.ItemOperation: MsgItemOperation.Process(m_bytes); break; case Type.Missions: MsgMissions.Process(m_bytes); break; default: break; } }