Forum Multiplayer So this is what I did, anyone?

Discussion and help relating to the PlayerIO Multiplayer API.

So this is what I did, anyone?

Postby SuperficialDiscDrive » February 25th, 2017, 12:56 am

public class MyPlayer : BasePlayer { }

[RoomType("MyRoomType")]
public class MyGame : Game<MyPlayer> {
//This method is called when a room is created
public override void GameStarted() {
//Perform actions to initialize room here
}

//This method is called when the last player leaves the room.
public override void GameClosed() {
//Do any clean-up here such as saving statistics
}

// This method is called whenever a player joins the room
public override void UserJoined(MyPlayer player) {
//Notify other players that someone joined,
//or inform the new player of the game state
}

// This method is called when a player leaves the room
public override void UserLeft(MyPlayer player) {
//Notify other players the someone left
}

//This method is called before a user joins a room.
//If you return false, the user is not allowed to join.
public override bool AllowUserJoin(MyPlayer player) {
return true;
}

//This method is called whenever a player sends a message to the room
public override void GotMessage(MyPlayer player, Message message) {
//Handle all different message types here
//This room broadcasts all incoming messages
//to all connected players:
Broadcast(message);
}
}
its just giving me errors when i replaces that new file with a copy and pasted it in the .DLL im guessing I have to rename like everything, so to cut a long story short can anyone help me make a single player room that lots of different people can join and not talk to eachother? any help would be great.
SuperficialDiscDrive
 
Posts: 3
Joined: February 9th, 2017, 2:18 am

Re: So this is what I did, anyone?

Postby Henrik » February 25th, 2017, 10:32 am

its just giving me errors when i replaces that new file with a copy and pasted it in the .DLL im guessing I have to rename like everything


What errors are you getting?

Which file are you replacing with what?

No, if you rename the methods in your server-side code, you won't have implemented the interface of Game<P>, and it won't be valid server-side code.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to Multiplayer



cron