Exemple #1
0
 void ProcessLoadPacket(LoadPacket pkt)
 {
     character = db.LoadCharacter(account, pkt.CharacterId);
     if (character != null)
     {
         if (character.Dead)
             SendFailure("Character is dead.");
         else
         {
             SendPacket(new CreateSuccessPacket()
             {
                 CharacterID = character.CharacterId,
                 ObjectID = Manager.Worlds[targetWorld].EnterWorld(entity = new Player(this))
             });
             stage = ProtocalStage.Ready;
         }
     }
     else
         SendFailure("Failed to Load character.");
 }
Exemple #2
0
 private void ProcessLoadPacket(LoadPacket pkt)
 {
     character = db.LoadCharacter(account, pkt.CharacterId);
     if (character != null)
     {
         if (character.Dead)
             SendPacket(new svrPackets.FailurePacket()
             {
                 Message = "Character is dead."
             });
         else
         {
             var target = RealmManager.Worlds[targetWorld];
             //Delay to let client load remote texture
             target.Timers.Add(new WorldTimer(500, (w, t) =>
             {
                 SendPacket(new CreateResultPacket()
                 {
                     CharacterID = character.CharacterId,
                     ObjectID = RealmManager.Worlds[targetWorld].EnterWorld(entity = new Player(this))
                 });
             }));
             stage = ProtocalStage.Ready;
         }
     }
     else
     {
         Player.SendInfo("Failed to Load character.");
         Disconnect();
     }
 }