public override void Read()
 {
     CharacterData = new CharacterData();
     CharacterData.Race = (Race) ReadC();
     ReadC();
     CharacterData.Name = ReadS();
     int size = 60 - (CharacterData.Name.Length * 2);
     ReadB(size);
     CharacterData.Zodiac = (Zodiac) ReadC();
     CharacterData.Face = (byte) ReadC();
     CharacterData.Hair = (byte) ReadC();
     CharacterData.Unk = (byte)ReadC();
     ReadB(41);
     CharacterData.CharacterDatas = ReadB(989);
 }
예제 #2
0
 public static void CreateNewCharacter(Connection connection, CharacterData playerData)
 {
     var cached = new Player
     {
         AccountId = connection.AccountInfo.Id,
         CharacterData = playerData
     };
     lock (PlayersLock)
     {
         if (Players.Exists(s => s.CharacterData.Name == playerData.Name))
         {
             new SpFailCreateCharacter().Send(connection);
             return;
         }
         cached.PlayerId = GUIDGenerator.NextGUID();
         cached.Level = 1;
         Players.Add(cached);
     }
     new SpCreateCharacter(cached,connection).Send(connection, 1);
     Log.Info("New character created!");
 }