|
加载中! 我是流子吗?我不知道,或许是吧......或许又不是......我真的不知道. |
|
有如下几个方案 1.每个游戏各自建一个jar,那么,底层的图形引擎各自独立,不能共享,并且要以房间客户端做消息转发(已找到实现方式) 2.1.针对各个不同的游戏,写不同的脚本,在server side,server会根据预先配置的读入不同的AI脚本,这脚本中包含了根据client发送过来的request进行类似switch判断后,进行的一些逻辑处理;而在client side,也会根据不同的游戏执行不同的脚本,而各个游戏都是运行在相同的game engine之上。
一开始是为了找跨进程共享socket,windows c 下编程实现如下:游戏和大厅使用单独的exe,然后使用COM进行通讯的方式,大厅成了消息转发的地方,COM进行双向的进程过程调用,通过WSADuplicateSocket实现跨进程共享socket,也就是复制SOCKET句柄 OpenMP接口的一种Java共享内存编程接口-JOMP,JOMP主页如下: http://www2.epcc.ed.ac.uk/computing/research_activities/jomp/index_1.html Introduce: JOMP is a research project whose goal is to define and implement an OpenMP-like set of directives and library routines for shared memory parallel programming in Java. It is, of course, possible to write shared memory parallel programs using Java's native threads model, but a directive system has a number of advantages. It is considerably easier to use, less error prone and allows compatibility to be maintained with a sequential version. |