public async Task BuildPendingUpdateData() { List <Task> tasks = new List <Task>(); PacketOut pkt = new PacketOut(RealmOp.SMSG_UPDATE_OBJECT); foreach (var updatedata in State.PendingUpdateData) { pkt.Reset(RealmOp.SMSG_UPDATE_OBJECT); pkt.Write((UInt32)1); pkt.Write(updatedata); tasks.Add(SendPacket(pkt)); } State.PendingUpdateData.Clear(); await Task.WhenAll(tasks); }
public async Task Login() { await OnLogin(); PacketOut p = new PacketOut(RealmOp.MSG_SET_DUNGEON_DIFFICULTY); p.Reset(RealmOp.MSG_SET_DUNGEON_DIFFICULTY); p.Write((UInt32)0); //difficulty p.Write((UInt32)1); //val p.Write((UInt32)0); //isingroup await SendPacket(p); p.Reset(RealmOp.SMSG_LOGIN_VERIFY_WORLD); p.Write(State.MapID); p.Write(State.PositionX); p.Write(State.PositionY); p.Write(State.PositionZ); p.Write(State.Orientation); await SendPacket(p); await _Account.SendAccountDataTimes(0xEA); p.Reset(RealmOp.SMSG_FEATURE_SYSTEM_STATUS); p.Write((byte)2); p.Write((byte)0); await SendPacket(p); p.Reset(RealmOp.SMSG_MOTD); p.Write((UInt32)0); await SendPacket(p); p.Reset(RealmOp.SMSG_LEARNED_DANCE_MOVES); p.Write((UInt32)0); p.Write((UInt32)0); await SendPacket(p); p.Reset(RealmOp.SMSG_CONTACT_LIST); p.Write((UInt32)7); //update all p.Write((UInt32)0); //nothing yet await SendPacket(p); await SendBindPointUpdate(); p.Reset(RealmOp.SMSG_TALENTS_INFO); p.Write((byte)0); p.Write((UInt32)0); p.Write((byte)0); p.Write((byte)0); await SendPacket(p); p.Reset(RealmOp.SMSG_INSTANCE_DIFFICULTY); p.Write((UInt32)0); p.Write((UInt32)0); await SendPacket(p); p.Reset(RealmOp.SMSG_INITIAL_SPELLS); p.Write((byte)0); p.Write((UInt16)0); await SendPacket(p); p.Reset(RealmOp.SMSG_SEND_UNLEARN_SPELLS); p.Write((UInt32)0); await SendPacket(p); await SendActionButtons(); p.Reset(RealmOp.SMSG_INITIALIZE_FACTIONS); p.Write((UInt32)0); await SendPacket(p); p.Reset(RealmOp.SMSG_LOGIN_SETTIMESPEED); p.WriteWTime(DateTime.Now); p.Write((float)0.01666667f); p.Write((UInt32)0); await SendPacket(p); p.Reset(RealmOp.SMSG_SEND_UNLEARN_SPELLS); p.Write((UInt32)0); await SendPacket(p); p.Reset(RealmOp.SMSG_SET_FORCED_REACTIONS); p.Write((UInt32)0); await SendPacket(p); //add us to our map var realm_manager = GrainFactory.GetGrain <IRealmManager>(0); var map = await realm_manager.GetMap(State.MapID, State.InstanceID, State.RealmID); var mapresult = await map.AddObject(ToRef()); if (mapresult != MapAddResult.OK) { switch (mapresult) { case MapAddResult.AlreadyOnMap: { //might be logging back in after a DC for example await BuildInitialUpdate(); await BuildCreateUpdateAllInRange(); } break; } } }