-
Notifications
You must be signed in to change notification settings - Fork 1
/
vchess.rules.inc
79 lines (68 loc) · 2.28 KB
/
vchess.rules.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* Implementation of hook_rules_event_info().
* @ingroup rules
*/
function vchess_rules_event_info() {
$events['vchess_move_made'] = array (
'group' => 'vchess',
'label' => t('Move has been made in a particular game'),
'variables' => array(
'opponent' => array('type' => 'user', 'label' => t('Opponent')),
'gid' => array('type' => 'integer', 'label' => t('Game id')),
'move' => array('type' => 'text', 'label' => t('Last move')),
),
);
$events['vchess_challenge_accepted'] = array (
'group' => 'vchess',
'label' => t('Player has accepted a challenge'),
'variables' => array(
'opponent' => array('type' => 'user', 'label' => t('Opponent')),
'gid' => array('type' => 'integer', 'label' => t('Game id')),
),
);
return $events;
}
// /**
// * Implementation of hook_rules_action_info().
// */
// function vchess_rules_action_info() {
// $actions['vchess_rules_action_inform_user'] = array(
// 'group' => 'vchess',
// 'label' => t('Inform user that the move has happened'),
// 'arguments' => array(
// 'gid' => array(
// 'type' => 'integer',
// 'label' => t('Game id')
// ),
// // // 'white_user' => array(
// // // 'type' => 'user',
// // // 'label' => t('User playing white'),
// // // ),
// // // 'black_user' => array(
// // // 'type' => 'user',
// // // 'label' => t('User playing black'),
// // // ),
// // ),
// // 'node' => array(
// // 'type' => 'node',
// // 'label' => t('MYNODE description'),
// // ),
// ),
// 'help' => t("MYHELP"),
// // 'module' => 'vchess',
// );
// return $actions;
// }
// /**
// * Action for informing user
// */
// // function vchess_rules_action_inform_user($white_user, $black_user) {
// function vchess_rules_action_inform_user($gid) {
// // dpm($gid);
// // dpm($white_user);
// // dpm($black_user);
// // dpm("White user is " . $white_user->name);
// // dpm("Black user is " . $black_user->name);
// }
?>