Wednesday, November 9, 2022
HomeGame Developmentc++ - Server-Consumer Communication - Sport Growth Stack Trade

c++ – Server-Consumer Communication – Sport Growth Stack Trade


I’ve a consumer, and it is mainly a potato consumer. What I imply by that’s it is code is one thing like this: (This can be a junky model of the code, simply to make a degree)

str enter; str output; int inputnum; int outputnum;
cout << output;
if (output == 1) {
    cin << inputnum;
}
else {
    cin << enter;
}

What I am attempting to do is ship these enter variables to and take these output variables from a server that does all the sport logic and the like. The sport is a text-based MUD.

I’ve seen one million issues like this:

Complicated Graph. The elements are unimportant.

However I do not want that kind of factor. All I would like is one thing like this:

[Client] ←→ [Server]

As a result of all of the logic is on the server, so it is not necessary to do stuff like working it via settle for sockets and the like. Is there a easy method to simply join 4 variables two going a method and two going the opposite? That is all I am attempting to do, however there are no easy methods to do this I’ve seen. Here is kind of an instance of the kind of factor I would prefer to occur:

Consumer 1:

Demon HP: [####################]
You used SWORD on DEMON!
Demon HP: [##################--]

Consumer 2:

Demon HP: [####################]
User1 used SWORD on DEMON!
Demon HP: [##################--]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments