Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setPoint 함수에 triggerCall 을 before 와 after 두가지 추가해주셨으면 합니다 #27

Closed
ghost opened this issue Nov 5, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 5, 2013

https://code.google.com/p/xe-core/issues/detail?id=3095

Reported by sejin7940, Feb 28, 2013
point 모듈의 point.controller.php 파일에 있는
setPoint 함수 에다가 triggerCall 하나 연결해주시면 안 될까요?

포인트가 실제로 올라가기 전에.. before 트리거 하나 넣어주시고..
( $point = $args->point; 위가 적당한듯)

// Call a trigger (before)
포인트,회원정보,모드,변경전포인트,변경후포인트,변경전레벨 등의 정보를 $obj 화 해서
$output = ModuleHandler::triggerCall('point.setPoint', 'before', $obj);
if(!$output->toBool()) return $output;
로 하고

실제 포인트 업데이트 후 그룹 및 레벨 변경 함수 전 쯤에..
( // Get a new level 위에)

포인트가 실제로 올라간 후에.. after 트리거 하나 넣어주시고
// Call a trigger (after)
$output = ModuleHandler::triggerCall('point.setPoint', 'after', $obj);
if(!$output->toBool()) return $output;

이렇게 triggerCall 를 걸어주면 상당히 여러 용도로 쓸 수 있을것 같습니다.
찾아보니, 포인트 자체가 변동될때 외주에서 따른 트리거를 줄수가 없더군요
(현재 XE 에는 다른 행위시 그 트리거컬에, 포인트변동을 거는 형식으로 되어있어서)

전자의 경우는..
포인트 로그내역 같은 형태, 하루 포인트 획득 제한 등, 여러 용도로 확장이 가능하고

후자의 경우는..
별도의 그룹 및 레벨 변경 시스템, 레벨 상승 제한 기능, 랭킹시스템, 명예의 전당 등 상황에 따라 여러 용도로 확장이 가능합니다.

기능을 만들때마다 이부분을 수정해넣어도 되지만..
여러 용도로 충분히 사용가능한 부분이라고 보기에, 트리거콜 추가를 정식으로 건의들비니다.

Feb 28, 2013t #1 sejin7940
생각을 해봤는데, after 트리거는...
포인트 올라간 뒤 쪽이 아니라... 훨씬 아래에..
레벨과 그룹이 변경된 뒤에 배치되는게 더 좋을듯하네요

캐시 생성 이전 쯤에 넣으면 될듯하네요. // Cache Settings 이전에...
전달값은, 이전레벨/이전그룹/이후레벨/이후그룹/회원정보/포인트변경내역 등을 전달하고..

레벨상승 및 그룹제한 , 별도의 그룹쪽도 전부 before 쪽에서 처리하면 될듯하고..
after 쪽에서 그룹변경 에 따른 랭킹 , 명예의전당, 안내메세지 등 여러 효과를 줄 수 있을듯해서요

그룹이 변경되었을때 관련 triggercall 이 없기에, after 를 통해 이 부분 처리가 가능하면 될듯해서요

ghost pushed a commit that referenced this issue Nov 19, 2013
@ghost ghost self-assigned this Nov 19, 2013
@ghost ghost closed this as completed Nov 19, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants