Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MSCPP Beta 0.1
#26
i tested it and i get an error on the player id after i login.
Reply
#27
Whenever I try logging in with my character I created, VB6 just gives me an error on the client. Confusedhock: Anyone know why? I'd like to try to get the C++ version of this to work...
Reply
#28
Quote:WARNING: This is NOT a release yet, it is just a preview, since I have the code and it compiles, but does NOT work yet.
¬¬
I said this is not a working version.
I will re-make the hole networking when I have the time.
Reply
#29
I'm re-developing the network Big Grin
It's going great.
I'm on a little doubt about how I'll handle more than 64 connections xD but it's going great.
I think I'll have a releasable version soon ^^
Reply
#30
awesome
Reply
#31
It's going great! I just need to make a better client side buffer to handle the almost 3kbs of the mapdata packet xD
Then I'll test a few things more and release beta 0.2, SEMI-WORKING version ^^
Reply
#32
sweet! im trying to learn C++ at the moment, i'm curious as to how this would work.
Reply
#33
It is almost working. I can send/receive data, but not when the packets are too large. MapData is fucking things up xD But I'll fix it soon.
Reply
#34
What are you using for network communication?
Reply
#35
Tony Wrote:What are you using for network communication?
WinSocket2.2, tcp
Lea Wrote:pull the maps over ftp/http
Not a bad idea, but I'm trying to make it simple. If you don't have a web site then I'll be totally screwed. MS is supposed to be simple(no offense). All it's needed it a better buffering system xD.
Reply
#36
FIXEEEEEED!!!!!!!
IT'S ALIVE!!!!!!!!!!!!!!!
DAMN YOU VERRIGAN xD
Pay attention when you code!!!(jk)
AddToBuffer function is the bitch!
It was:
Call CopyMemory(tBytes(aLen(Buffer)), Additional(0), aLen(Additional))
and should be:
Call CopyMemory(tBytes(aLen(Buffer)), Additional(0), ByteLen)

AAAAAAAAAAA, I'M YELLING OF HAPPINESS!
[Image: idade%2Bpara%2Bser%2Bfeliz..jpg]
Not a verry nice photo, but it passes the idea...
Reply
#37
Dragoons Master Wrote:FIXEEEEEED!!!!!!!
IT'S ALIVE!!!!!!!!!!!!!!!
DAMN YOU VERRIGAN xD
Pay attention when you code!!!(jk)
AddToBuffer function is the bitch!
It was:
Call CopyMemory(tBytes(aLen(Buffer)), Additional(0), aLen(Additional))
and should be:
Call CopyMemory(tBytes(aLen(Buffer)), Additional(0), ByteLen)

AAAAAAAAAAA, I'M YELLING OF HAPPINESS!
[Image: idade%2Bpara%2Bser%2Bfeliz..jpg]
Not a verry nice photo, but it passes the idea...

Fuuuuck. This explains why my code kept on fucking up at AddtoBuffer. Fuck. Ah, christ.

I'll just use Dugor's buffer class instead. Verrigan's system was far too confusing.

Glad you got it working though. I spent ages trying to found out why my aLen function kept erroring there.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#38
The real error is the CopyMemory. It tried to copy too much memory to tBytes, but tBytes is defined as tBytes(tLen - 1), so we don't have that much memory allocated, and then VB6 just bugs like hell.
Reply
#39
Dragoons Master Wrote:The real error is the CopyMemory. It tried to copy too much memory to tBytes, but tBytes is defined as tBytes(tLen - 1), so we don't have that much memory allocated, and then VB6 just bugs like hell.

xD

Ah well, Dugor's code is so much easier to understand.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#40
Doesn't Winsock handle one request at a time?

and UGH byte arrays.. looks so confusing.
Reply
#41
Tony Wrote:Doesn't Winsock handle one request at a time?

and UGH byte arrays.. looks so confusing.

It's really not.

You use the functions to add bytes, integers, strings etc. to the array, then peel them off in the opposite order in the server.

Easy shit.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#42
Robin Wrote:
Tony Wrote:Doesn't Winsock handle one request at a time?

and UGH byte arrays.. looks so confusing.

It's really not.

You use the functions to add bytes, integers, strings etc. to the array, then peel them off in the opposite order in the server.

Easy shit.

Yeah I understood a bit of that part by reading up on Verrigan's tutorial but took a peek at his code and his functions
I did not understand one bit of it.

Okay his code here

Code:
nLen = GetIntegerFromBuffer(Buffer, True)
    nBytes = GetFromBuffer(Buffer, nLen, True)
    Sex = GetByteFromBuffer(Buffer, True)
    Class = GetByteFromBuffer(Buffer, True)
    CharNum = GetByteFromBuffer(Buffer, True)

If there types of bytes in order, and it took that byte from the order, how does it know what's what?
Reply
#43
Tony Wrote:
Robin Wrote:
Tony Wrote:Doesn't Winsock handle one request at a time?

and UGH byte arrays.. looks so confusing.

It's really not.

You use the functions to add bytes, integers, strings etc. to the array, then peel them off in the opposite order in the server.

Easy shit.

Yeah I understood a bit of that part by reading up on Verrigan's tutorial but took a peek at his code and his functions
I did not understand one bit of it.

Okay his code here

Code:
nLen = GetIntegerFromBuffer(Buffer, True)
    nBytes = GetFromBuffer(Buffer, nLen, True)
    Sex = GetByteFromBuffer(Buffer, True)
    Class = GetByteFromBuffer(Buffer, True)
    CharNum = GetByteFromBuffer(Buffer, True)

If there types of bytes in order, and it took that byte from the order, how does it know what's what?

The first line calculates the length of the buffer, then it gets the Sex by reading the first byte in the buffer, and removes it. Then, when it get's the class, it'll be the first byte in the buffer.

"It" doesn't know what's what, but the person who programs the packet knows what order the data is in.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#44
Robin Wrote:"It" doesn't know what's what, but the person who programs the packet knows what order the data is in.
Just like you where doing with Parse().
Reply
#45
Oh shit. For some reason I was thinking the packets would look all crambed together..

Then I remembered they look like 2 3 45 32 or something.

[edit] Wait now I'm confused.. so basically doing byte arrays, we receive all the data as bytes
then we change them accordingly when we receive them?
Reply
#46
Tony Wrote:Oh shit. For some reason I was thinking the packets would look all crambed together..

Then I remembered they look like 2 3 45 32 or something.

[edit] Wait now I'm confused.. so basically doing byte arrays, we receive all the data as bytes
then we change them accordingly when we receive them?

The data is stored in an array of bytes.

The packet sends the entire array. When the server recieves the array, it reads the start of the array to find out how long the packet is, then it takes the data you put into the array, out of the array, piece by piece. 'AddIntegerToBuffer' lets you place an 'Integer' variable into the byte array. 'GetIntegerFromBuffer' reads the integer you put in.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#47
There are two headers I'm using. The packet length and the packet id(playerhp, attacknpc, etc(enum)). So a valid packet would be(IN DEC):
5 2 3 'h' 'i' '!'
That can be interpreted as a packet with 5 bytes, with the id = 2(can be a msg of anything) and a string with 3 bytes(" 3 'h' 'i' '!' " can indicate a string of 3 characters). The number 3 means that the next 3 bytes are the string I want to read. So strings have variable sizes. 2+lenght(string) bytes.
Reply
#48
Ooo! I understand it quite better now, thanks, you sexy beasts.
Reply
#49
||
\/
Reply
#50
Working version almost done. I just need more time. Packets are 100% working, but I need to fix the server it self, because it's not handling them right xD, but packet transfer is 100%)
I'm just not sure witch version I'm converting to C++
xD
I think it is 3.(40-60) or something like that but I'm not sure. When I release it I'll be really thankful if someone check that for me.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)