Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / DBC multiplayer

Author
Message
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 4th Jul 2005 22:51 Edited at: 4th Jul 2005 23:56
Many apologies upfront, coz I'm sure this question will have been asked before, but I don't see it... also the integrated help system could tell me, but if it foesm I've not understood it properly...

when I set the "2" flag on create net game it makes the game client/server... if a client sends a message (to everyone for example) which of the following should I do:

send net message string checklist quantity() (Host always seems to be the last player in the checklist) , "Whatever that string should be..." - then the host sends it to player 0
OR
send net message string 0, "Whatever that string should be..." -- it's a client/server, so logically, it should be passed through the server anyway

Currently I'm using method 1 and it's all seems to work fine, but I had an idea and thought I'd check it out...

and again, sorry if this has been asked before, I couldn't see anything on it...

Edit: Suppose I should've put this in the newcomers corner, shouldn't I? sorry - wasn't thinking straight...

...maybe one day I'll finish a project
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 8th Jul 2005 13:14
actually, that's a pretty advanced questiond
Client-server programming is a little bit more complex than
pier-pier. The purpose behind CS is control. If this control is
not needed, than yes, any data the server gets (whether memblock,
string, mesh ...) will need to be re-transmitted to all users (user-0). C-S is good if the server handles all AI and other things, while clients may come and go at will during a game.

In DBC, strings are not sent with guaranteed delivery, like memblocks can be. I think the answer is YES ... although I'm not sure exactly the question .. Since all data sent to the server is NOT sent right away, the host must resend the data, IF the clients need the data.

Example:
Player 1 buys a loaf of bread in a village ...
a message is sent to the server ...

the server updates the database ...
no other data is sent to any clients ...

Example 2:
player 1 wants to buy bread from Player 2
sends message to server ...
server sends message to player 2
player 2 says no
sends message to server
server sends message to player 1 (NO)

Example 3:
player 1 kills a peasant
message send to server
server updates database
server scans for nearby players
(Player 2,4,6 are nearby)
server sends message to player 2,4,6 ...
Player 3 and 5 do not get any messages
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 8th Jul 2005 18:11 Edited at: 8th Jul 2005 18:12
suppose what I should really do is save a copy of what I've got now and just try method 2

if it does work, it'll save on the coding, as method 2 would do it all in one step, currently I'm doing it as two steps (method 1 in my first post):

step 1: send to host
step 2: send to all other players

(only a guest can perform step 1 -- only the host can perform step 2)

This would all form into a chat program, IRC runs a client server method, so that the most logical one to me... also the host logs everything that's saidwhich is why everything is FORCED to run through the host first...

...maybe one day I'll finish a project

Login to post a reply

Server time is: 2025-05-23 00:46:35
Your offset time is: 2025-05-23 00:46:35