Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

Page 2 of 6 FirstFirst 123456 LastLast
Results 16 to 30 of 81
  1. #16
    Freak Mextur is offline
    MemberRank
    Mar 2012 Join Date
    216Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Quote Originally Posted by W00dL3cs View Post
    First of all, I would suggest you to edit the Session class.

    In fact you don't need to set the Socket field to send/receive data: you can pass the socketasynceventargs itself...

    When calling the 'ReceiveAsync' method, you should check if it returns false, and if it does, you can then process data.

    And last but not least, you are sending data non-asynchronously, and I can't understand why..
    Posted via Mobile Device
    I use this to couple the Information of the character into it. Im going to make this: Asynchronously.

    Updated on github: https://github.com/devMextur/Tazqon

  2. #17
    Freak Mextur is offline
    MemberRank
    Mar 2012 Join Date
    216Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Got the DaysInARowAchievement WORKING :)

    Code:
            /// <summary>
            /// Returns an integer with the amount of days in a row.
            /// </summary>
            /// <param name="Logs"></param>
            /// <returns></returns>
            public int GetDaysInARow(ICollection<DateTime> Logs)
            {
                DateTime Now = DateTime.Now;
    
                ICollection<int> Filter = new List<int>();
    
                foreach (var Item in Logs)
                {
                    int UltraDay = (Item.Year * 365) + Item.DayOfYear;
    
                    if (!Filter.Contains(UltraDay))
                    {
                        Filter.Add(UltraDay);
                    }
                }
    
                var Sort = (from item in Filter orderby item descending select item).ToArray();
    
                int Output = 1;
    
                if (Sort.Length > 0)
                {
                    if (Sort.First() != ((Now.Year * 365) + Now.DayOfYear))
                    {
                        Console.WriteLine("not dealing");
                        return Output;
                    }
                }
                else return Output;
    
                for (int i = 0; i < Sort.Length; i++)
                {
                    int UltraDay = Sort[i];
    
                    if (i + 1 >= Sort.Length)
                    {
                        return Output;
                    }
    
                    int NextDay = Sort[i + 1];
    
                    if ((UltraDay - 1) == NextDay)
                    {
                        Output++;
                    }
                    else
                    {
                        return Output;
                    }
                }
    
                return Output;
            }

  3. #18
    swagggggg Livar is offline
    MemberRank
    Oct 2008 Join Date
    United KingdomLocation
    2,272Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Quote Originally Posted by Mextur View Post
    Got the DaysInARowAchievement WORKING :)

    Code:
            /// <summary>
            /// Returns an integer with the amount of days in a row.
            /// </summary>
            /// <param name="Logs"></param>
            /// <returns></returns>
            public int GetDaysInARow(ICollection<DateTime> Logs)
            {
                DateTime Now = DateTime.Now;
    
                ICollection<int> Filter = new List<int>();
    
                foreach (var Item in Logs)
                {
                    int UltraDay = (Item.Year * 365) + Item.DayOfYear;
    
                    if (!Filter.Contains(UltraDay))
                    {
                        Filter.Add(UltraDay);
                    }
                }
    
                var Sort = (from item in Filter orderby item descending select item).ToArray();
    
                int Output = 1;
    
                if (Sort.Length > 0)
                {
                    if (Sort.First() != ((Now.Year * 365) + Now.DayOfYear))
                    {
                        Console.WriteLine("not dealing");
                        return Output;
                    }
                }
                else return Output;
    
                for (int i = 0; i < Sort.Length; i++)
                {
                    int UltraDay = Sort[i];
    
                    if (i + 1 >= Sort.Length)
                    {
                        return Output;
                    }
    
                    int NextDay = Sort[i + 1];
    
                    if ((UltraDay - 1) == NextDay)
                    {
                        Output++;
                    }
                    else
                    {
                        return Output;
                    }
                }
    
                return Output;
            }
    Stop working on achievement and get some in-game screenshots!!!!!!!!


  4. #19
    Freak Mextur is offline
    MemberRank
    Mar 2012 Join Date
    216Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Quote Originally Posted by Livar View Post
    Stop working on achievement and get some in-game screenshots!!!!!!!!

    Why, Im coding into an point.

    Created Matrix (Rooms) > https://github.com/devMextur/Tazqon/...s/RoomModel.cs

    Special coding using paremeter caching & TileNodes (Generating).

  5. #20
    Account Upgraded | Title Enabled! W00dL3cs is offline
    MemberRank
    Mar 2012 Join Date
    202Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    You are making a great work!

    May I suggest you the use of LINQ?

  6. #21
    Freak Mextur is offline
    MemberRank
    Mar 2012 Join Date
    216Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Quote Originally Posted by W00dL3cs View Post
    You are making a great work!

    May I suggest you the use of LINQ?
    Loops are faster than Linq. :) (I sometimes use Linq)

    I made a Pathfinder with Linq :) (In Tazqon I use A*)

    I am using WeakSQLCache (Only for searching and showing up) for Rooms dat dont change untill they are going to be changed( info)

    NO LONGER SQL-FLOOD FOR NAVIGATOR!

    Saving Power using (WEAKSQL)

    Code:
     // 1e request (character) (2 characters) (offline users)
     (25-3-2012 21:41:26) SELECT * FROM character_messenger_groups WHERE character_id = @id
     (25-3-2012 21:41:26) SELECT character_id,friend_id FROM character_friends WHERE character_id = @id AND pending = '0' OR friend_id = @id AND pending = '0'
     (25-3-2012 21:41:26) SELECT * FROM characters WHERE id = @id LIMIT 1
     (25-3-2012 21:41:26) SELECT rank FROM characters WHERE id = @id LIMIT 1
     (25-3-2012 21:41:26) SELECT * FROM characters WHERE id = @id LIMIT 1
     (25-3-2012 21:41:26) SELECT rank FROM characters WHERE id = @id LIMIT 1
    
     // 2e request (same characters)
     (25-3-2012 21:41:59) SELECT * FROM character_messenger_groups WHERE character_id = @id
     (25-3-2012 21:41:59) SELECT character_id,friend_id FROM character_friends WHERE character_id = @id AND pending = '0' OR friend_id = @id AND pending = '0'
     (25-3-2012 21:41:59) SELECT rank FROM characters WHERE id = @id LIMIT 1
     (25-3-2012 21:41:59) SELECT rank FROM characters WHERE id = @id LIMIT 1
    ROOMMANAGER

    Code:
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Linq;
    using System.Text;
    using Tazqon.Commons.Adapters;
    using Tazqon.Storage.Querys;
    
    namespace Tazqon.Habbo.Rooms
    {
        class RoomManager
        {
            /// <summary>
            /// Storage of the models of rooms.
            /// </summary>
            public Dictionary<int, RoomModel> Models { get; private set; }
    
            /// <summary>
            /// Storage of progressing rooms.
            /// </summary>
            public Dictionary<int, RoomAdapter> Adapters { get; private set; }
    
            /// <summary>
            /// Cache to buffer some sql data in.
            /// </summary>
            public Dictionary<int, Room> WeakSQLCache { get; private set; }
    
            public RoomManager()
            {
                Models = new Dictionary<int, RoomModel>();
                Adapters = new Dictionary<int, RoomAdapter>();
                WeakSQLCache = new Dictionary<int, Room>();
    
                foreach (DataRow Row in System.MySQLManager.GetObject(new RoomModelsQuery()).GetOutput<DataTable>().Rows)
                {
                    RoomModel Model = new RoomModel(Row);
    
                    if (!Models.ContainsKey(Model.Id))
                    {
                        Models.Add(Model.Id, Model);
                    }
                }
            }
    
            public RoomModel GetModel(int Id)
            {
                using (DictionaryAdapter<int, RoomModel> DA = new DictionaryAdapter<int, RoomModel>(Models))
                {
                    return DA.TryPopValue(Id);
                }
            }
    
            public Room GetRoom(int RoomId)
            {
                RoomAdapter Adapter;
                Room Room;
    
                if (!Adapters.TryGetValue(RoomId, out Adapter))
                {
                    if (!WeakSQLCache.TryGetValue(RoomId, out Room))
                    {
                        Room = new Room(System.MySQLManager.GetObject(new RoomInfoQuery(RoomId)).GetOutput<DataRow>());
                        WeakSQLCache.Add(RoomId, Room);
                    }
                }
                else Room = Adapter.Information;
    
                return Room;
            }
    
            public RoomAdapter CastAdapter(int RoomId)
            {
                RoomAdapter Adapter;
    
                if (!Adapters.TryGetValue(RoomId, out Adapter))
                {
                    Adapter = new RoomAdapter(GetRoom(RoomId));
                    Adapters.Add(Adapter.Information.Id, Adapter);
    
                    if (WeakSQLCache.ContainsKey(RoomId))
                    {
                        WeakSQLCache.Remove(RoomId);
                    }
                }
    
                return Adapter;
            }
    
            public void DisposeAdapter(RoomAdapter Adapter)
            {
                if (!WeakSQLCache.ContainsKey(Adapter.Information.Id))
                {
                    WeakSQLCache.Add(Adapter.Information.Id, Adapter.Information);
                }
                else WeakSQLCache[Adapter.Information.Id] = Adapter.Information;
    
                Adapters.Remove(Adapter.Information.Id);
    
                Adapter.Dispose();
            }
    
    
            public ICollection<Room> GetRooms(int CharacterId)
            {
                ICollection<Room> Output = new List<Room>();
    
                foreach(DataRow Row in System.MySQLManager.GetObject(new RoomsQuery(CharacterId)).GetOutput<DataTable>().Rows)
                {
                    using (RowAdapter Adapter = new RowAdapter(Row))
                    {
                        Room Room = GetRoom(Adapter.PopInt32("id"));
    
                        Output.Add(Room);
                    }
                }
    
                return Output;
            }
        }
    
        enum NavigatorTab
        {
            PRIVATE_ITEMS = 1, RATED_ITEMS = 2, MY_RAND_FRIENDS = 3, MY_ALIVE_FRIENDS = 4,
            MY_ITEMS = 5, MY_FAV_ITEMS = 6, MY_VISITED_ITEMS = 7, SEARCHED_ITEMS = 8
        }
    }
    UPDATED GITHUB: 25-3-2012 21:57 (UTC +1)
    Last edited by Mextur; 25-03-12 at 09:57 PM.

  7. #22
    ส็็็็็็็ Bloodraven is offline
    MemberRank
    Sep 2009 Join Date
    AntarcticaLocation
    2,414Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Looking good.

  8. #23
    Member Al0ne is offline
    MemberRank
    Jan 2012 Join Date
    NetherlandsLocation
    88Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Nice work Wichard, i always like your work you know! Keep up the good work your C# is prof! May i use your sockets in my emu, or is it not ready?

  9. #24
    Freak Mextur is offline
    MemberRank
    Mar 2012 Join Date
    216Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Updates
    - Following friends from Hotelview.
    - Enter Room (Password and Open)
    - Room Matrix (Room Layout) works fawlessly.
    - RoomUnits adding (removing later).
    - Some MessageEvent(s).

    Pictures





    Github uploaded: https://github.com/devmextur

  10. #25
    Member Al0ne is offline
    MemberRank
    Jan 2012 Join Date
    NetherlandsLocation
    88Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Nice work! will you also code games like wired, banzai, freeze? (i know your prof in coding games!)

  11. #26
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Ahh, Nice, But you need to fix the enter room rotation ;3

    And for the one who want's to see the cms its on github *signature*

  12. #27
    Freak Mextur is offline
    MemberRank
    Mar 2012 Join Date
    216Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Rotarions arent coded yet.
    Posted via Mobile Device

  13. #28
    lol Disguised is offline
    MemberRank
    Jan 2011 Join Date
    521Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]

    Looking great Wichard!
    @joopie You never disappoint!

  14. #29
    Freak Mextur is offline
    MemberRank
    Mar 2012 Join Date
    216Posts
    Quote Originally Posted by Al0ne View Post
    Nice, its a shame i cant like this thread :( (i have to use a proxy site for enter ragezone, cuz my provider is blocking ragezone ><)
    his like button doesn't work..
    Posted via Mobile Device

  15. #30
    Freak Mextur is offline
    MemberRank
    Mar 2012 Join Date
    216Posts

    Re: Tazqon [C#, R63, OS, SS, SQL, FREEWARE]



    Also on github.



Page 2 of 6 FirstFirst 123456 LastLast

Advertisement