Skip to content

Instantly share code, notes, and snippets.

@AndrewWeston9
Last active October 6, 2017 06:42
Show Gist options
  • Save AndrewWeston9/4efc575ad744070a3994a9667e90bb18 to your computer and use it in GitHub Desktop.
Save AndrewWeston9/4efc575ad744070a3994a9667e90bb18 to your computer and use it in GitHub Desktop.
WorldManager.cs Snippet: Setting up network message classes.
/// The message sent when the player is updating the level.
class BlockAddMessage : MessageBase
{
public float px;
public float pz;
public float height;
public int blocktype;
}
/// Message sent to the server when resources are taken from a resource brick.
class ResourceTakeMessage : MessageBase
{
public Vector3 position;
public int amount;
}
/// Message for a player sending a single emote to the server.
/*class SendEmoteMessage : MessageBase
{
public int emoteType;
}*/
class SendEmoteMessageAndClientID : MessageBase
{
public int emoteType;
public NetworkInstanceId netId;
}
class PlayerFlagMessage : MessageBase
{
/// Position of the flag object.
public Vector3 position;
/// Connection ID for the player placing or removing the flag.
public int connid;
/// Return to client as false if the flag cannot be removed by that player.
public bool removed;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment