using System;
namespace SharpChat {
///
/// Packet IDs sent from the client to the server.
///
public enum ClientPacketId {
/*************
* VERSION 1 *
*************/
///
/// Keep the current session alive and occupied.
///
Ping = 0,
///
/// Authenticates the user and creates a session.
///
Authenticate = 1,
///
/// Sends a message or a command.
///
MessageSend = 2,
/*************
* VERSION 2 *
*************/
///
/// Informs the server which extensions the client supports.
///
Capabilities = 3,
///
/// Informs the server that the client is currently typing a message.
///
Typing = 4,
}
///
/// Packet IDs sent from the server to the client.
///
public enum ServerPacketId {
/*************
* VERSION 1 *
*************/
///
/// Response to the packet.
///
Pong = 0,
///
/// Both acts as a response to and as a method to inform that a user has connected.
///
UserConnect = 1,
///
/// Informs the client of a new message.
///
MessageAdd = 2,
///
/// Informs the client that a user has disconnected.
///
UserDisconnect = 3,
///
/// Informs the client that a channel may have been added, removed or updated.
///
ChannelEvent = 4,
///
/// Informs the client that a user joined or left the channel they are in OR that the client has been forcibly moved to a different channel.
///
UserMove = 5,
///
/// Informs the client that a message has been deleted.
///
MessageDelete = 6,
///
/// Informs the client about preexisting users, channels and messages.
///
ContextPopulate = 7,
///
/// Informs the client that it should clear its user list and/or channel list and/or message list.
///
ContextClear = 8,
///
/// Informs the client that they've been kicked or banned.
///
BAKA = 9,
///
/// Informs the client that another user has been updated.
///
UserUpdate = 10,
/*************
* VERSION 2 *
*************/
///
/// Tells the client what capabilities have been accepted.
///
CapabilityConfirm = 11,
///
/// Informs the client that another user is typing.
///
TypingInfo = 12,
///
/// Tells the client that it should switch to a different server.
///
SwitchServer = 13,
}
///
/// Actions for .
///
public enum ServerChannelSubPacketId {
Create = 0,
Update = 1,
Delete = 2,
}
///
/// Actions for .
///
public enum ServerMoveSubPacketId {
UserJoined = 0,
UserLeft = 1,
ForcedMove = 2,
}
///
/// Actions for .
///
public enum ServerContextSubPacketId {
Users = 0,
Message = 1,
Channels = 2,
}
///
/// Capability list for and .
///
[Flags]
public enum ClientCapability : int {
///
/// Supports the typing event.
///
TYPING = 0x01,
///
/// Supports being in multiple channels at once.
///
MCHAN = 0x02,
}
}