Developing new open source silkroad emulator

09/18/2015 16:50 Maho09#1
...
09/18/2015 18:36 DaxterSoul#2
First off, I like your idea to bring emulator development back these days. The release of server files kinda narrowed our view onto editing those because it's less work. But creating an emulator has always been the thrill of creating something unique. I'm still amazed by the creativity of [Only registered and activated users can see links. Click Here To Register...].

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
However your project and those I linked above (most likely the same) share the same code base. That's initially not a bad thing to do, because designing a structure for such a huge project in the first place is complex and very important. But your title says "Developing new open source silkroad emulator".

The code base is outright awful. Almost everything is static, improper use of partial classes where abstract classes would suit wonderful, database code within packet parsing/building, etc. etc. ...

You should make sure if that code base really suits your ideas of an "new open source silkroad emulator" or not.
09/18/2015 20:07 Maho09#3
Hmm t.y for reply.I'm going to fix them in time. Still I'm working hard on it.
09/18/2015 20:58 Royalblade*#4
I like the amount of work you've put in. I assume it's alright for me to use some of packets that you've already parsed.

The Elamidas Team + Torque guy are working together to create something similar, but not going as far as creating a STANDALONE emulator. We're doing it in hybrid with srv files.

Saves tons of extra work and its easy to change stuff. If you'd like to contribute(more packets?) and be rewarded in a monetary fashion, I'm sure we can work something out.

Hit me ip on Skype: Akasch93.

EASY VERSION:
You give packets.
You get money.
You message me on skype: Akasch93.
09/19/2015 00:57 sarkoplata#5
Ok, well I've always loved packet-based silkroad development.
But to be honest, there is not much you can achieve by creating an emulator, if the client will be the same. Tell me an important thing that you can achieve with emulator but not server files?
Currently alot of things are achieved just using a proxy between server files and the user.
I wouldn't suggest you to waste your time on re-inventing the wheel.
Instead, if you really want to work on that, some project like Akasch's would make more sense. Atlelast you're not coding stuff that 100% work.
Sorry for not being useful and discouraging but this is the truth xD
09/19/2015 02:22 Maho09#6
Hmm t.y for reply.
09/20/2015 00:50 Royalblade*#7
Code:
                        uint refItemID = BaseData.Data.silkShopList[silkIndex].refItemID;
                        packet.ReadUInt8Array(5);
                        byte countItemsBought = packet.ReadUInt8();
                        for(int i = 0; i < countItemsBought; i++)
                        {
                            byte slot = packet.ReadUInt8();
                            int invIndex = user.Inventory.FindIndex(s => s.slot == slot);
                            int itemIndex = BaseData.Data.itemList.FindIndex(s => s.itemID == refItemID);
                            byte typeID = BaseData.Data.itemList[itemIndex].typeid;

                            user.Inventory[invIndex].refItemID = refItemID;

                            if (typeID != 1 && typeID != 2 && typeID != 7) //equip, Avatar, Cos scroll etc
                                user.Inventory[invIndex].optLvl = BaseData.Data.itemList[itemIndex].maxStack;
                            else
                                user.Inventory[invIndex].optLvl = 0;

                            if (debug)
                                await PacketUtility.SendMessage(user, "Item Mall to Inventory. Bought item: " + user.latestSilkItemPackage);
                        }
                        //ushort countExtraBytes = packet.ReadUInt16(); // Same as item count. Not stack. dunnow wat the shit is for since its zeros only.
                        //for(int i = 0; i < countExtraBytes; i++)
                        //{
                        //    packet.ReadUInt8Array(4);
                        //}
You needed type 24 @ B034 (7034 reply). Itemmovement crap.
09/20/2015 03:41 Maho09#8
WHAT? THIS IS FALSE :D

TRUE this

Code:
[C -> S][7034]
18          				-> 24	->	MOVE_TYPE (BYTE)                                   
1B 04                       -> 1051 ->  UNKNOW(WORD)                  
02                          -> 2    ->  UNKNOW (BYTE) 
01                          -> 1	->  UNKNOW (BYTE)    
0A                          -> 10	->  UNKNOW (BYTE)  
2A 00                       -> 42	-> ITEM_NAME_LENGTH (WORD)                  
50 41 43 4B 41 47 45 5F 49 54 45 4D 5F 4D 41 4C 4C 5F 52 45 54 55 52 4E 5F 53 43 52 4F 4C 4C 5F 48 49 47 48 5F 53 50 45 45 44  -> PACKAGE_ITEM_MALL_RETURN_SCROLL_HIGH_SPEED  -> ITEM_NAME (STRING)                 
01 00   					-> 1	->  UNKNOW(WORD)                                     
00 00 00 00 00 00 00 00     -> 0 	->  UNKNOW(LWORD)                 
FD 01 00 00                	-> 509	->  UNKNOW(DWORD)     
                 
[S -> C][B034]
01      -> UNKNOW -> 1 -> BYTE                                          
18      -> TYPE -> 24 -> BYTE                                          
1B 04   ->  UNKNOW -> 1051 -> WORD                                          
02      -> UNKNOW -> 2 -> BYTE                                           
01      -> UNKNOW -> 1 -> BYTE                                           
0A      -> UNKNOW -> 10 -> BYTE 
01      -> UNKNOW -> 1 -> BYTE                                      
20     	-> SLOT -> 32 -> BYTE                                           
01 00   -> UNKNOW -> 1 -> WORD                                          
00 00 00 00   -> UNKNOW -> 0 -> DWORD      

// my fixed codes

uint refItemID = BaseData.Data.silkShopList[silkIndex].refItemID;
byte r_MoveType = packet.ReadUInt8();
ushort r_Unknow1 = packet.ReadUInt16();
byte[] r_UnknowBytes = packet.ReadUInt8Array(3);
ushort r_ItemNameLength = packet.ReadUInt16();
string r_ItemName = packet.ReadString(r_ItemNameLength); 

// slot is not client generating auto

	
	byte slot = GetSlot();
	int invIndex = user.Inventory.FindIndex(s => s.slot == slot);
	int itemIndex = BaseData.Data.itemList.FindIndex(s => s.itemID == refItemID);
	byte typeID = BaseData.Data.itemList[itemIndex].typeid; // ??? TYPEID1,TYPEID2,TYPEID3,TYPEID4 which? :D

	user.Inventory[invIndex].refItemID = refItemID;

	if (typeID != 1 && typeID != 2 && typeID != 7) //equip, Avatar, Cos scroll etc
		user.Inventory[invIndex].optLvl = BaseData.Data.itemList[itemIndex].maxStack;
	else
		user.Inventory[invIndex].optLvl = 0;

	if (debug)
		await PacketUtility.SendMessage(user, "Item Mall to Inventory. Bought item: " + user.latestSilkItemPackage);

public byte GetSlot()
{
	// Read 0xB034 packet
	/*
		packet.ReadUInt8Array(7);
		return packet.ReadUInt8();
	*/
}
09/20/2015 03:53 LastThief*#9
You classified everything as unknown and you are calling it "true" lol.
09/20/2015 03:56 Maho09#10
lol.I'm just trying to help.
09/20/2015 13:48 LastThief*#11
Quote:
Originally Posted by Maho09 View Post
lol.I'm just trying to help.
No offense but what Royalblade posted was taken directly from Elamidas Emulator which was tested yesterday.
09/20/2015 18:10 Maho09#12
Up

Quote:
Originally Posted by Iwa13 View Post
Hmm t.y for reply.
??