Beispiel #1
0
Packet* packet_mouse_down_new(double x, double y, char type, char fill, double width, double r, double g, double b)
{
	Packet* packet = packet_new(PACKET_TYPE_MOUSE_DOWN);
	packet_add_double(packet, x, MOUSE_DOWN_X);
	packet_add_double(packet, y, MOUSE_DOWN_Y);
	packet_add_byte(packet, type, MOUSE_DOWN_SHAPE_TYPE);
	packet_add_byte(packet, fill, MOUSE_DOWN_FILL);
	packet_add_double(packet, width, MOUSE_DOWN_WIDTH);
	packet_add_double(packet, r, MOUSE_DOWN_R);
	packet_add_double(packet, g, MOUSE_DOWN_G);
	packet_add_double(packet, b, MOUSE_DOWN_B);
	return packet;
}
Beispiel #2
0
Packet* packet_new_stroke_new(int id, double x, double y, char type, char fill, double width, double r, double g, double b)
{
	Packet* packet = packet_new(PACKET_TYPE_NEW_STROKE);
	packet_add_int(packet, id, NEW_STROKE_ID);
	packet_add_double(packet, x, NEW_STROKE_X);
	packet_add_double(packet, y, NEW_STROKE_Y);
	packet_add_byte(packet, type, NEW_STROKE_SHAPE_TYPE);
	packet_add_byte(packet, fill, NEW_STROKE_FILL);
	packet_add_double(packet, width, NEW_STROKE_WIDTH);
	packet_add_double(packet, r, NEW_STROKE_R);
	packet_add_double(packet, g, NEW_STROKE_G);
	packet_add_double(packet, b, NEW_STROKE_B);
	
	return packet;
}
Beispiel #3
0
/**
 * @brief Build auth fail reply
 */
static int build_authfail_response(SSH *ssh) {
	byte *p;

	p = ssh->PacketBuffer;
	memset(p, 0, TCPPACKETSIZE);

	packet_begin(&p, SSH_MSG_USERAUTH_FAILURE);			/* Type message */
	packet_add_name_list(&p, PASSWORD_STR);				/* String password */
	packet_add_byte(&p, 0);								/* False */

	ssh->Length = (p - ssh->PacketBuffer);

	packet_finalize(ssh);

	return 0;
}
Beispiel #4
0
Packet* packet_load_level_new(char level)
{
	Packet* packet = packet_new(PACKET_TYPE_LOAD_LEVEL);
	packet_add_byte(packet, level, LOAD_LEVEL_LEVEL);
	return packet;
}