Features - leeOS11223/LeeboxLib GitHub Wiki
Create a new Room
LeeboxManager.Initialize("https://leebox.hereticalstudios.co.uk/api");
Room room = await LeeboxManager.CreateRoom(MaxPlayers:10);
Console.WriteLine($"Room created with ID: {room.ID}.");
Pull the room data, for example like which players are in the room
await room.SyncRoomData(); // pull from the server
// for example we can see who is in the room
foreach (Player player in room)
{
Console.WriteLine($"Player ID: {player.playerId}, Player Name: {player.playerName}");
}
Lock the room
This stops players from being able to join, but doesn't stop rejoining.
await room.SetLocked(state:true);
Say / Broadcast
Everyone
await room.Broadcast("Hello, this is a test message from the game!");
Individual
await player.Say($"Hello {player.playerName}!");
Text Question
Everyone
foreach (KeyValuePair<Player, string> v in await room.AskAll("What is your favorite color?",6))
{
Console.WriteLine($"Player: {v.Key.playerName}, Response: {v.Value}");
}
Individual
Console.WriteLine(await player.Ask("What is your favorite food?"));
Multiple Choice
Everyone
foreach (var v in await room.OptionAll("option question?", new string[] { "A", "B" }, new string[] { "A.png", "B.png" }))
{
Console.WriteLine($"Player: {v.Key.playerName}, Response: {v.Value}");
}
Individual
Console.WriteLine(await player.Option("What is your favorite animal?", new string[] { "Dog", "Cat" }, new string[] { "Dog.png", "Cat.png" }));
Drawing
Everyone
foreach (var v in await room.DrawAll("Draw a fish"))
{
Console.WriteLine($"Player: {v.Key.playerName}, Response: {v.Value}");
}
Individual
Console.WriteLine(await player.Draw("Draw a cat"));
Top Image
Everyone
await room.SetImage("cat.jpg");
Individual
await player.SetImage($"cat.webp");