人还是有惰性的,而我还有更加严重的拖延症......
今天找领导签了三方,估计要半个月左右,不过还是不错的,导师也认可了我的工作,开心,虽然我感觉自己的水平不是特别好>_<
今天其实没干啥,帮忙把强制引导的id加了进去,这个是比较简单的;然后把定时推送的代码也写好了,感觉自己本地测试通过了,不知道实际测试怎么样,要回学校啦参加毕业典礼了,哈哈= =
关于推送的主要流程,就是从GameContextManager中获得所有在线的用户,然后向他们推送信息。流程是这样的,现在spring-quartz.xml中配置定时任务,参考点击打开链接,点击打开链接,然后启动方法,方法中从contextManager中获得所有在线用户
Collection<GameContext> contexts = contextManager.getGameContexts(); Iterator iterator = contexts.iterator(); while(iterator.hasNext()){GameContext context = (GameContext) iterator.next(); String id = context.getPlayer().getUid(); int day = context.getPlayer().getSignInfo().getCount(); day++; push(id, new SignNotify(0, day%7==0 ? 7:(day%7)));},
public void push(String account, EncodeResponse response) { GameContext context = contextManager.getContextByAccount(account); if (context != null) { context.push(response); } }SignNotify推送:class SignNotify extends EncodeResponse{ @Override protected Map<String, ?> encodeBody() { Map<String, Object> map = Maps.newHashMap(); map.put("get", day) map.put("day", day) return map }SignNotify(int get, int day) { this.get = get this.day = day }}