|
加载中! 我是流子吗?我不知道,或许是吧......或许又不是......我真的不知道. |
|
该文章已经转向 Migration from Eidolon1.0 to Crescent1.0 为了纪念几年一些逝去青春回忆,打算把该仿真软件名改成Crescent。 软件环境: 跨平台 主题:移动机器人仿真软件设计,导航,路径规划,避障,定位,传感器,LMS200 使用对象:科研院所、大专院校、大学和对机器人、传感器技术感兴趣的人 开发工具: Java SWT/JFace RCP JDK 1.5.0_11 Eclipse3.3.1 2.0版本将具有新特性如下: 1.新版本将采用流行的RCP架构; 2.彻底融入MVC思想,各个模块更达到了松耦合高内聚的程序规范; 3.UI元素更加丰富,人机交互更加友好。 Target Completed Date:12/31/2008 delay to 01/31/2009 2007.10.31 RCP work implement ,icon personality,see as follows: the root directory and the application UI
2007.11. TBD... the deadline is about the end of 2007 2007.11.13 if update reminded,there is a message mail showed in the right-down label .
2007.11.15 fixed in Crescent 1.0 modify files: cause: solution: .Specify the libraries and folders that constitute the plug-in classpath. in the -INF\MANIFEST.MF, I add the section: Bundle-ClassPath: ., fixed in Crescent 1.0 modify files: build.properties cause: solution: bin.includes = .,\ 2. add the section in the file -INF\MANIFEST.MF Class-Path: ./configuration/com.webex.crescent/ ./log the work is built and the logger and property class for dynamic configuration have been creat,they are the basic class in the application development. here is the tree;
the UI have not been modified much ,here is the little modified section
2007.11.18 collect some png picture for icon ,here is some icon
2007.11.23 timestamp(时间戳) 1.The definition "timestamp" is used in the row in a table in the database, it can help us confirm whether the data in row has been modified . (在数据库中,确定"行"的数据是否发生变化) 2. 在通讯程序中,网络接收到请求之后,我们会将请求缓冲到一个请求队列当中,当请求进列的时候打上一个时间戳,出列的时候进行一下时间比较,看其是否已经超时,决定是否对其进行处理。 3.The definition in MSDN: An imprint of time/date created when a specific event or process takes place. here we'll employ the parameter "timestamp" in the Interface "IRobot" ,methods (e.g. get* and set*) require a timestamp as a parameter.This is to help reduce the amount of I/O to the physical robot.If the timestamp is less than or equal to the value sent on the last call to one of these methods, old data is returned. If the timestamp is -1 or greater than the last timestamp, the robot is queried, and new data is returned. The idea is that during each control cycle the higher level software will increment the timestamp and use it for all calls to these methods. e.g.
/** 2007.11.23 octant(八分仪),quadrant(四分仪), From the ocean navigation, we learn some instruments,.e.g.,octant(八分仪),quadrant(四分仪),sextant(六分仪),in a standard Cartesian coordinates system (笛卡尔坐标系系统),we divide the 2D plane to 8 parts in octant,and other continue CCW. For simulating the octant in ocean navigation(see the pic 1 ), we define the method Vector2D.octant() according to it,the method can analyse which direction the vector is pointing in coordinates according to octant way.
Pic 2:Provides info on which octant (0-7) the vector lies in,the plane is divided to 0~7 parts,the 0 part's degree indicates >=-22.5degree < 22.5 degree and continue CCW Pic3.Provides info on which quadrant(0-3) the vector lies in,the plane is divided to 0~3parts,the 0 part's degree indicates >=-45 degree < 45 degree and continue CCW 2007.11.26 In the model progress,we define some bean (some interface, and abstract class) ,the class dependence explorer is as follows(UML ): here,the interface : IRobot, Defines the basic capabilities all robot classes should provide. Robot, a abstract class SimRobot,a abstract class HardRobot,a abstract class MoblieRobot and MySimRobot are the implemented instances the package hierarchy is as follows:
2007.11.27 IRobot,Robot class code completed. 2007.12.04 http://www.blogjava.net/chengang/category/8012.html 2007.12.06 1.the file path can't to be fix in the compatibility between application&product and the release product,in fact,our solution is to modify manually when the application releasing in RCP,who can tell me why? 2.Add the system property after preferred in log file,here is the summary in the log !------------------SYSTEM PROPERTIES-----------------------------
For in the currrent phase,we focus on the robot MVC design, so the UI module hasn't been designed more,here is the ugly UI,haha....
2007.12.06
2007.12.07 The file "config.properties","log4j.properties" will be edited by dialog in UI ,and the log file will be read-only in editor view also by date selected(haven't done) and the map preview for user chosen by double click in editor as IE7.0 shortcut navigation as follows:
pls see the link:JAVA高质量缩略图--地图导航缩略图 2007-12-11 We can simulate the map display as Starcraft 2008-04-28 change the log.properties add the console output ,the detail you can refer it in the following url: 2008-05-02 1.get the property about free memory and total memory in the Java Virtual Machine 2.Control system is a platform,it serves as an agency for robots,don't care whether the agent is real or simulated.
3.Deion.properties contains some message ,e.g. robot,obstacle,the size about game rectangle,we will support UI definition more friendly in properties file directly In future,we will support online- game with others by TCP/IP,customer can download customized robot from DB server,which is uploaded by other customers. customer can try to connect to query whether there are more robots uploaded.
2008-07-06 design feature : sync TPS (turn per second) whose value is defind in configuration file or slide block.The default value is 30 PS:the tank's velocity have been reduced and the bug in the following turn the tank can't move have been fixed.I think it may be brought by out of memory 2008-07-21
2008-07-24 :分包算法的程序实现,解决了报文的粘包半包现象。 2008-07-29 1.去掉(客户端)对从服务器端发过来的时间戳,VER,ID的验证,时间戳的最大值为7FFFFFFF,如果是在客户端的话,有好几个月可以累加,够用
Issue: 1.服务器端关闭后,好像在客户端isClosed()还是false,那么只有先断开连接,然后再接上其他的连接(已解决) 2.目前加密的ID方式BlueFish,密匙为IP+port,这样做的坏处是密匙差不多都是固定的,以后要用f(timestamp)来做密匙。 3.客户端和服务器段的游戏世界的时间戳需要不需要同步?暂时不需要 5.客户端读取效率或许可以提高,先把正行的密文给读取进来,再验证[不定长数据的话 网络游戏的对时以及同步问题2008-07-30 Achievement 1.Client 端把Transceiver读取密文的方式改成了timestamp+var+ID+CMD+datalen一次,data一次,CRC32一次,这是考虑到以后服务器发送过来的密文是频繁的,而服务器端Transceiver读取密文的方式暂时未有改变,读取TIMESTAMP-->验证-->读取ID-->验证-->读取VER-->验证.... ,主要是考虑到客户端发送密文的频率很小,至于以后用户间聊天如不能满足需求再考虑 两种处理方式的源文件如下: Work in Progress 1对于2008-07-29 Issue 1,我觉得应该这样实现,在服务器端要关闭socket连接前,先发个密文给客户端,然后close这个socket,客户端收到关闭socket的密文,则也close,也就是说,两边通过密文来同步。不知合理否? 通信双方无论哪一方要关闭连接,都要要发送CloseSocket报文给对方,然后在关闭连接。(已解决) 当客户端发密文给服务端,如果验证没通过,那么,Transceiver会发个特殊的消息给消息序列,然后让服务线程来决定断开连接,这样做的好处是让service thread 也知道该什么时候停止消息的发送。[已使用] 2.客户端有comm线程和逻辑线程,中间还有个消息序列,我觉得有几个逻辑线程发送给消息序列的请求是不应该让通讯线程发往服务器的,比如断开与登录服务器的连接,或者与大厅服务器建立连接之类的,因为逻辑线程没有直接对socket进行操作,我觉得这些请求当通讯common线程捕获时,应该自己消化掉的,这点有些特别,我打算在CMD中,分配给一些特定的几个命令,比如9000~90005,当通讯common线程捕获到这些命令的时候,自己处理,断开或者连接另外的IP,port,否则其他的请求则都发往服务器(socket操作不应该在服务线程)(已使用这种方式) e.g. 当server 发消息过来后--->Transceiver--->serviceThread--->Transceiver(断开,重连,然后做其他的逻辑处理)[已使用这种方式] 3.CMD :1000~9000具体数字指令,比如游戏动作,客户端按钮指令,service与 Client一一对应,9000~9500:登陆指令,文字指令,比如chat...9500后为socket断开,重连,新连接指令,send的时候Transceiver自行消化,心跳指令为1000?[已使用这种方式] 具体参考:观察者模式 [Misc] 1.本以为CRC32校验生成的字节始终为8位,但是0043005403e9000000650000232a000000040030生成的16进制码为342e2f4,七位,所以CRC32也要格式化的。 FAQ:
kokobox 2008年07月29日 12点58分11秒 说: kokobox 2008年07月29日 13点40分02秒 说:
2008-07-31 Achievement 1.实现了close service 与client同步,方法是,当客户登录,在server端验证通过,先发个消息给client,让client建立新connect included in ip and port,然后在server端的service thread发送个断开服务端socket的消息给Transceiver,让transceiver自行处理,并不用下发给client,当client receive the msg,先让Transceiver发给service thread,判断是建立新连接的命令,再回发给transceiver,让transceiver断开目前的连接,建立新的连接,然后服务端会主动下发大厅人数,各房间人数== 2.RCP中如何让某个view默认初始最小化已经解决:ApplicationWorkbenchWindowAdvisor中重写postWindowOpen方法。
Work in Progress 1.接下去为连接game hall server工作,先连接然后验证,如果验证没通过,断开,通过,则处理在线用户列表,然后服务端会主动下发大厅人数,各房间人数== 2.观察者模式:做一个全局的对象管理器(主题),所有的玩家都观察这管理器,如果有玩家状态更新了,会通知对象管理器,必将更新这个管理器内部的数据,那么这个管理器将发出广播,通知其他各个玩家. 3.心跳包的实现:心跳包应该直接写在serviceThread,做一个定时器,然后每隔time1,去触发一下,在一定时间time2内收到的话,表示连接良好,否则如第2点一样,调用第2点的重连函数(如果没有connect,则connect) 4.UI change:登录窗口由小变大,小范围变动,从半透明到实体 5.UI enhance:工具箱SWT.TOOL //建立一个类似工具栏的窗口,地图customization 6.code tunning:把CMD和value解析的方法独立出来,建立一个含有CMD和value属性的对象Request. Issue: 1.各个房间的人数同步问题 2008-08-05 Achievement 1.Fix a bug:javax.crypto.BadPaddingException: Given final block not properly padded in decode progress.the detail you can refer it in this URL: 2.Have a test for transceiver for DatainputStream to prove that it's OK.
[采用了缓冲输入/输出流来包装输出流,再采用数据输入/输出输出流进行包装,加快传输的速度。最近把包装类换成了DataInputStream和DataOutputStream,替换了以前的BufferedReader和PrintStream采用了缓冲输入/输出流来包装输出流,再采用数据输入/输出输出流进行包装,加快传输的速度。最近把包装类换成了DataInputStream和DataOutputStream,替换了以前的BufferedReader和PrintStream]
Issue: 1. 如何在一个连接的服务线程中创建另一个新的线程?而在服务线程中没有socket这样的,直接涉及 2008-08-07(先祝明天奥运会开幕一切顺利!) Achievement 1.暂时解决了在一个连接的服务线程中创建另一个新的连接(但不是很好,以后待改进) 2.navigation view加上了游戏树节点 Work in Progress 1.应该用非阻塞NIO才能解决一个界面的不同的view和edit向服务器发请求取数据。 2008-08-08(奥运之梦得以实现,青春的理想何时能成真?) 1.navigation view 游戏catalog tree的的数据从配置文件读取(该文件第一次是从hall server发送过来的[未有实现], 以后从本地读取),房间的数据是定时hall server从 login server定时读取一次 Work in Progress 1.目录树的enhance,入口点击连接game server,点击游戏节点时展示IE页面,对于editor,我们可以用浏览器link,在点击某个游戏节点的时候,展示游戏的使用说明和游戏画面。 2.每个房间的信息用游戏服务器向登录服务器上报,用map来内存持久 Map map=Collections.synchronizedMap(new HashMap()); map.put("127.0.0.1:8080", "Allen"); 2.完成Game server的功能模块,login server 的房间人数汇报监听连接(login server做服务端,game server做客户端), 房间人数广播监听连接(login server做服务端,hall server做客户端) 2008-08-12 1.reconstruct(重构),由于目前为了在几台服务器间达到一些数据共享,给设计带来了很大的困难,总是要考虑socket的连接断开,造成代码耦合性剧烈大,于是,决定一些数据来源放入数据库中,比如在线人数,房间人数==,还是至于cache DBproxy这一层需要research一下,做与否?目前不确定。 2008-08-26 Achievement 1.已经完成了DBproxy的实现,现在各个Server只会与客户端,DBproxy交互,部分数据定时向DBproxy取,比如各房间人数,总在线人数==。 2.完成了Hall Server的展示 Work in Progress 1.把与Hall Server的连接改成短连接 目录等消息发送完毕后,Game Hall Server即断开与Client的连接,以腾出socket资源。在此后的时间里,Client每隔30分钟会重新连接Game Hall Server并向其索要最新的房间目录信息及在线人数信息。由于登录/账号服务器和大厅服务器,它们与客户端的连接都属于短连接(即:取得所需要信息后,客户端与服务器即断开连接),所以,客户端给这两类服务器带来的压力相比于长连接(即:客户端与服务器始终保持连接)而言就要轻得多,它们的压力主要在处理瞬间的并发访问上。(短连接可以考虑用MINA来实现) 2.UI上屏蔽一些按钮 3.Room server的设计 4.每隔30秒心跳线程 5.借鉴:.“根据玩家最近在玩的哪个游戏,由客户端和服务器自动为玩家选择进入这个游戏服务器”,这一项设定充分体现了暴雪一贯的风格:为玩家着想,最大限度地提高游戏的舒适度。再次对暴雪的态度予以肯定! 7.mail group建立个邮件组 8.加一个页面载入的进度条 TBD... 开发还在升级中,漫长的过程,请忍耐...
|
|
Socket socket = new Socket("localhost", 8888); System.out.println("连接成功!"); 以下为流子的回复:
验证连接成功后,应该关闭流和socket |
|
|
|
以下为流子的回复:
Proguard也是一款很好的Java代码混淆器 |
|
|
|
程序员,学生,机器人爱好者,人工智能研究员自己的游戏!输入“Crescent”一探究竟 |
|
|
|
用spring依赖注射方式注射进去,把各个manager的解耦 |
一直期待ing
|