Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ChrisM

Pages: [1]
1
General Discussion /
« on: December 14, 2003, 07:21:33 pm »
Hi,

OK, thx for all your answers!

ChrisM

2
General Discussion /
« on: December 13, 2003, 06:49:49 pm »
Hi,

ok, I think I got it now.
netpacket.h is for a part of a message, meaning one UDP packet sent over the network.
message.h is for one merged packet, normally consisting of one netpacket (but can be more if message size > 512 and this packet was automatically splitted by the PS client on the source computer).

Does it work like this?

ChrisM

3
General Discussion /
« on: December 12, 2003, 11:11:49 pm »
Hi,

great, I understood it! :) (I first didn\'t notice that you overload == and comparision operator for all classes that are stored in a tree, so I wondered how you sorted the objects in the tree *g*)

OK, just one last question (I promise it\'s the last ;) )...
Why do you use so many different Message structures? I mean, all those messages derived from MessageCracker are obviously, but what\'s about the other message classes?

I mean, what\'s the different between psMessage and psNetMessage and between MessageEntry and psNetMessageEntry?

ChrisM

4
General Discussion /
« on: December 11, 2003, 03:31:57 pm »
Hi,

Quote
Starting to understand why there is so much code and complexity in PS networking? ;-)

Yes. :)

But why do you separate MsgHandler and ClientMsgHandler since there are no other MsgHandlers? However, I think it\'s for future expansion (to perhaps implement a ServerMsgHandler), isn\'t it? :)

And why do you store everything in those binary trees, even if a linked list would make much more sense, in my opinion (for example the list of the guilds).

ChrisM

5
General Discussion /
« on: December 10, 2003, 07:04:31 pm »
Hi,

very interesting! :)

CS == Crystal Space?

ChrisM

6
General Discussion /
« on: December 10, 2003, 03:00:40 pm »
Hi,

ok, now everything makes sense. :)

Thanks for your answer. I can\'t believe that just before a week I really wanted to use TCP for my network system. :)

Now I just hope, that the \"invalid\" packets (> 512 bytes) in my buffer, won\'t jam it but be deleted after a few seconds.

So, now it\'s really time to start implementing my network interface! ^^

Thanks again for all your answers!

ChrisM

7
General Discussion /
« on: December 09, 2003, 10:52:29 pm »
Hi,

wow, thanks for your cool post, where do you look up things like this? I tried to read in the MSDN for UDP, but there are not very much useful informations.

Did I understand the whole thing?
When a packet is fragmented by one router which routes the packet to its destination, the beginning and the end of the packet may get to the receiver and the middle is missing?
Could it for example be, that a 2048 byte large packet is fragmented and the two middle packets (assuming the packet is split in 512 byte large ones) are missing... will than recvfrom() return 1024 and return just the 512 byte large first packet and the 512 last byte?

ChrisM

8
General Discussion /
« on: December 09, 2003, 06:15:28 pm »
Hi,

argh, one question left:
Is there any limit under this there is no fragmentation or something? Or is it theoretically possible that a two byte packet is split up into two one byte packets? (yes, I know, this won\'t happen, but I am talking about the theory :) )

ChrisM

9
General Discussion /
« on: December 09, 2003, 03:50:34 pm »
Hi,

again thanks for your helpful answers!

I think, now it\'s time for me to start planning my UDP system, I\'ll start with a very simple std::vector or std::list for the clientlist and only one receive()-function with a short queue in its own thread.

But Planeshift source code is sometimes a bit irritating... for example I wonder why the overloaded network classes (NetBase & MsgHandler) for the server are in the server\'s directory, but those for the client are in the netlib?

So, I\'ll create the first source code line now...
Thanks for your help!!

ChrisM

10
General Discussion /
« on: December 08, 2003, 09:33:02 pm »
Hi,

it doesn\'t I think there are torchs :)

ChrisM

11
General Discussion /
« on: December 08, 2003, 04:48:10 pm »
Hi,

Quote
Absolutely! Clients should never ever send out absolute positions. When we are talking about sending out absolute positions, we mean from the server to the players, not ever the other way around. My clients only send keystroke data to the server. The server handles calculating their positions and facings and velocities, and returns this to all the other players.

That\'s exactly what I expected and hoped to hear. :)

As far as I can see it in the PS source code, the client sends absolute coordinates but the position is first valided by the server meaning the server checks whether the client could get to this position since last known position in the elapsed time between the two packets.

I now started planning my network system und my packets are also relatively huge, except of course packets like special commands but the occur not very often and it wouldn\'t be profitable to cache them and wait for another packet to pack them together...

Hmm... PS has a very complex network engine. NetBase seems to be a lowlevel base class overloaded by client and server and MsgHandler a class also overloaded by client and server to distribute incoming packets to those iNetSubscriber-inherit classes who subscribed for these events.

But I don\'t unterstand what the NetThread class for the server is... :(

ChrisM

12
General Discussion /
« on: December 08, 2003, 02:46:13 pm »
Hi,

another thanks for all your new answers! :)

I think I\'ve understood the usage of UDP packets and I\'ll think for my game it will be enough to not merge packets but send them all alone as RonHiler does.

But only one question: Do you really send absolute positions? Isn\'t this very insecure because everyone can manipulate his client to move much faster or implement a \"teleport cheat\"?
Isn\'t it better to send just acceleration und turning events and let the server move the player?

ChrisM

13
General Discussion /
« on: December 07, 2003, 11:50:37 pm »
Hi,

ok, thx for your very informative answers!

I think I will need to use UDP to get a more or less lagfree game... :)

Thanks!

ChrisM

14
General Discussion /
« on: December 07, 2003, 07:16:23 pm »
Hi,

yes, but where is the advantage of UDP if you \"emulate\" TCP with UDP using ACK-packets and so on?

ChrisM

15
General Discussion / (to the programmers) Why use UDP?
« on: December 07, 2003, 12:59:42 pm »
Hi,

I started working on a own multiplayer game and faced the choice to use either TCP or UDP.

First I started working with the TCP-protocol but than I saw your network engine. :)

I tried to unterstand your source, but just a few questions:
- When do you send those ACK-packets, always or just on high priority packets? And how do you guarantee that the ACK packet is coming through? I mean, otherwise the other connection endpoint would send the packet again and again until you ACK comes through.
- How does those multipackets work? Many unimportant pakets (like weather, which does not need to be sent immediately and can wait a few secods) are buffered and stored in a big packet sent when the buffer is full?

Sorry for my really bad English, I hope you understood my questions and could give me a brief answer. :)

ChrisM

Pages: [1]