Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

New Emulator

Joined
Sep 10, 2007
Messages
970
Reaction score
815
/win?

ThePhailure772 - New Emulator - RaGEZONE Forums

ThePhailure772 - New Emulator - RaGEZONE Forums
 
Joined
Sep 10, 2007
Messages
970
Reaction score
815
It's not win when you've done it before -.-

I have never got equipment to work before actually. I was talking to Lambda and RoA about this. Also:

Code:
        public static void ResponseBuyItem(Client client, Packet packet)
        {
            MUID uidChar = new MUID();
            Int32 nItem = 0;
            ResultSet result = ResultSet.Accepted;

            if (!packet.Read(ref uidChar) ||
                !packet.Read(ref nItem))
            {
                Log.Write("ResponseBuyItem", "Invalid Packet.");
                client.Disconnect();
                return;
            }

            if (uidChar.uiCharacter != client.UIDClient.uiCharacter)
            {
                Log.Write("ResponseBuyItem", "UID Spoofing Detected.");
                client.Disconnect();
                return;
            }

            if (MatchServer.Items.Find(i => i.nItemID == nItem) == null)
                result = ResultSet.ShopItemNonExistant;
            else
            {
                SQL.getNonQuery(string.Format("INSERT INTO CharacterItem(CID,ItemID,RegDate) VALUES ({0},{1},GetDate())", client.CharInfo.nCID, nItem));
                Item item = new Item();
                item.nItemID = nItem;
                item.nItemCID = SQL.getScalar("SELECT CIID from CharacterItem WHERE CID=" + client.CharInfo.nCID + " AND ItemID=" + nItem);
                client.CharInfo.nItems.Add(item);
            }
            packet = new Packet(Operation.MatchResponseBuyItem, PacketVersion.Decrypted, client.m_bPacketCount);
            packet.Write((Int32)result);
            packet.Finalize(client.m_bCrypt);
            client.Send(packet.getPacket());
        }
        public static void ResponseSellItem(Client client, Packet packet)
        {
            MUID uidChar = new MUID();
            Int32 nItemLow = 0, nItemHigh = 0;
            ResultSet result = ResultSet.Accepted;

            if (!packet.Read(ref uidChar) ||
                !packet.Read(ref nItemLow) ||
                !packet.Read(ref nItemHigh))
            {
                Log.Write("ResponseSellItem", "Invalid Packet.");
                client.Disconnect();
                return;
            }
            if (client.CharInfo.nItems.Find(i => i.nItemCID == nItemHigh) == null)
                result = ResultSet.ShopItemNonExistant;
            else
            {
                Item item = client.CharInfo.nItems.Find(i => i.nItemCID == nItemHigh);
                SQL.getNonQuery(string.Format("DELETE FROM CharacterItem WHERE CIID={0}", item.nItemCID));
                client.CharInfo.nItems.Remove(item);
            }

            packet = new Packet(Operation.MatchResponseSellItem, PacketVersion.Decrypted, client.m_bPacketCount);
            packet.Write((Int32)result);
            packet.Finalize (client.m_bCrypt);
            client.Send(packet.getPacket());
        }
        public static void ResponseEquipItem(Client client, Packet packet)
        {
            MUID uidChar = new MUID();
            Int32 nItemLow = 0, nItemHigh = 0, nEquipSlot = 0;
            ResultSet result = ResultSet.Accepted;

            if (!packet.Read(ref uidChar) ||
                !packet.Read(ref nItemLow) ||
                !packet.Read(ref nItemHigh) ||
                !packet.Read(ref nEquipSlot))
            {
                Log.Write("ResponseEquipItem", "Invalid Packet.");
                client.Disconnect();
                return;
            }
            Item nItem = client.CharInfo.nItems.Find(i => i.nItemCID == nItemHigh);

            if (nItem == null)
                result = ResultSet.ShopItemNonExistant;
            else
            {
                client.CharInfo.nEquippedItems[nEquipSlot] = nItemHigh;
                SQL.getNonQuery(string.Format("UPDATE Character SET {0}={1} WHERE CID={2}", (MMatchItemSlotType)nEquipSlot, nItem.nItemID, client.CharInfo.nCID));
            }

            packet = new Packet(Operation.MatchResponseEquipItem, PacketVersion.Decrypted, client.m_bPacketCount);
            packet.Write((Int32)result);
            packet.Finalize(client.m_bCrypt);
            client.Send(packet.getPacket());
        }
        public static void ResponseTakeOffItem(Client client, Packet packet)
        {
            MUID uidPlayer = new MUID();
            Int32 nEquipSlot = 0;

            if (!packet.Read (ref uidPlayer) ||
                !packet.Read (ref nEquipSlot))
            {
                client.Disconnect ();
                return;
            }

            if (uidPlayer.uiCharacter != client.UIDClient.uiCharacter)
            {
                client.Disconnect ();
                return;
            }
            
            client.CharInfo.nEquippedItems[nEquipSlot] = 0;
            SQL.getNonQuery(string.Format("UPDATE Character SET {0}=0 WHERE CID={1}",(MMatchItemSlotType)nEquipSlot,client.CharInfo.nCID));
            packet = new Packet(Operation.MatchResponseTakeOffItem, PacketVersion.Decrypted, client.m_bPacketCount);
            packet.Write((Int32)0);
            packet.Finalize(client.m_bCrypt);
            client.Send(packet.getPacket());
        }

You laugh you lose:
Code:
        private void PacketQueuqe(object Object)
        {
            while (m_nSocket.Connected && RecieveQueue.Count > 0)
            {
                HandlePacket handle = null;
                Packet packet = RecieveQueue.Dequeue();
                Packets.TryGetValue(packet.getOperation(), out handle);

                if (handle != null) handle(this, packet);
            }
        }
 
Last edited:
Experienced Elementalist
Joined
May 25, 2008
Messages
292
Reaction score
33
Looks awesome.
But what exactly will this emulator do?
 
Reverse Engineer
Joined
Mar 19, 2007
Messages
879
Reaction score
37
[05:21:14AM] <~Phail> ThievingSix
[05:21:17AM] <~Phail> you jackass
[05:21:23AM] <~Phail> I just posted saying unblock me from aim
[05:21:24AM] <~Phail> lol
[05:21:40AM] <@Sabashi|Working> lol
[05:21:55AM] <~Phail> SO HOW ABOUT YOU UNBLOCK ME FAGGOT
[05:21:58AM] <~Phail> >=(
[05:22:10AM] <~Phail> k back to gears
[05:22:10AM] <~Phail> afk
[05:22:44AM] <~ThievingSix> ?
[05:22:52AM] <~ThievingSix> im not on aim or msn etc
[05:23:21AM] -> -Phail- I can have trillian off and other things on BEEP
[05:23:22AM] -> -Phail- I can have trillian off and other things on BEEP
[05:23:22AM] -> -Phail- I can have trillian off and other things on BEEP
[05:23:23AM] -> -Phail- I can have trillian off and other things on BEEP
[05:23:23AM] -> -Phail- I can have trillian off and other things on BEEP
[05:23:23AM] -> -Phail- I can have trillian off and other things on BEEP

(dotdot)
 
Gunz Developer / Support
Joined
Feb 3, 2008
Messages
568
Reaction score
45
Use google and find the definition of Emulator.

Phail I like your work, I am now learning C + + and I went well, very soon we begin to design and program my own software.
 
Experienced Elementalist
Joined
Mar 15, 2009
Messages
219
Reaction score
39
All of these things were already working in the public source for my emu. Just look at this. Also, I lol'd@handle(this, packet);
 
Skilled Illusionist
Joined
Nov 26, 2006
Messages
310
Reaction score
20
Since I've had no internet and have been sunburned to hell and back. I decided to rebuild my entire emulator from the ground up. Excluding my packet class of course. I don't have screen shots to post, but I can post information on what I have done.

  • New dynamic interfacing with channels.
  • New "Logic" classes to handle events such as character handling.
  • New interfaces for channels. Ie: class LChannel : IChannel
  • New item handling.
  • New protocol / networking handling.
  • More OOP related now. Such as: client.CharInfo.nAID = 0
  • Using get/set for class/structure handling.
  • Login Handling - Done.
  • Character Handling - Done.
  • Channel Handling - Done
  • Equipment - 25%

Some nice new features I've added for developers:
  • Callbacks for all event handling.
  • SQL multi-threading corrections.
  • Asynchronous SQL.
  • Predicates for all channels: MMatchChannel channel = MatchServer.lChannels.Find(c => c.nMinLevel > 0 && c.MaxLevel > client.CharInfo.nLevel);

SVNNNNNNNNNNNNN:
Cool
I think I'll re-visit S4 League and see what I can do 8D Good luck with this.
Figure out how to unpack the resources folder plz
 
Newbie Spellweaver
Joined
Jan 19, 2008
Messages
95
Reaction score
1
i wish i can help but i suck at C++ and C# im going to see of a freind of mys can help you as soon as he picks up his phone.
 

Guy

Divine Celestial
Joined
Apr 4, 2009
Messages
898
Reaction score
157
Use google and find the definition of Emulator.

Phail I like your work, I am now learning C + + and I went well, very soon we begin to design and program my own software.



Figure out how to unpack the resources folder plz

Done; take a look at their file-system library (FileSystem.dll; there's some very valuable exports ;)), or just dump the files from memory.

I think Gene did that already.

Durr.
 
Junior Spellweaver
Joined
Dec 23, 2006
Messages
145
Reaction score
0
Incredible. Would be good if you either start with Oracle or PG...

Oh my, but oracle is uber expensive!!!11one...well you always have oracle xe.

11/10. I wish I could help but my .NET knowledge is GIS-limited.
 
Back
Top