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.

AppGameKit Classic Chat / Multiplayer sending information over network

Author
Message
Ignatios
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location:
Posted: 2nd May 2015 01:02
So, I am trying to make a card game where I will be needing to send network over the network..This is being focused more toward LAN because I am deploying and I won't have WiFi etc, but I want to be able to play this card game that I am making with my friends in my berthing area but don't want it on the same laptop...

The game is handled all inside 1 application where a person can decide to be a host and 1 other person connects to that host and they both go against eachother...here is my multiplayer code (the connection works because it's copy paste atm from agk), however, I cannot seem to figure out how to make the client see things that the host can see...I am trying to figure this out by sending some data from host to client to see if the client can get anything from the host and move on from there...Here is what I got...




Any help would be greatly appreciated!!!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd May 2015 14:34
In this month's newsletter I have written a tutorial for simple game networking. You can learn from it, but you can also simply drop the #include file into your project if you want a quick solution.

The code shows you how to connect as a host and as a client. It then provides 2 functions for sending and receiving messages. Finally there is a function for reading through the queue of received messages (you can send multiple messages in one cycle).

The newsletter isn't released as I type, but hopefully they'll get it released shortly.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Ignatios
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location:
Posted: 2nd May 2015 20:35
Sounds good, please let me know when it releases.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 3rd May 2015 03:01
this part is wrong,
there you get a network message,
this message id is the parameter for next call

Quote: " Print("Attempting to get data...")
//Attempt to get the message to see the card
GetNetworkMessage(networkId)
GetNetworkMessageInteger(card)"


i think it should look like
iMsgID =GetNetworkMessage(networkId)
value=GetNetworkMessageInteger(iMsgID )[/quote]

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-25 21:23:33
Your offset time is: 2024-11-25 21:23:33