socketref,再见!高德

https://github.com/adoggie

  C++博客 :: 首页 :: 联系 :: 聚合  :: 管理
  246 Posts :: 4 Stories :: 312 Comments :: 0 Trackbacks

常用链接

留言簿(54)

我参与的团队

搜索

  •  

最新评论

阅读排行榜

评论排行榜



  1 /*
  2 
  3 2010.3.25 zhangbin 
  4 1.create,定义game-core的网络接口
  5 
  6 协定:
  7     1.数据类型名称尾部添加T
  8 
  9 2010.3.27 zhangin
 10 
 11 2010.3.29 zhangbin
 12 1. 取消工作单GameWorkSheetT结构
 13 2. 修改 ISecureService.auth()安全认证的数据类型
 14 2010.3.30 zhangbin 
 15 1. heartbeat()移动到IService接口
 16 */
 17 
 18 
 19 #ifndef _GTR_ICE
 20 #define _GTR_ICE
 21 
 22 
 23 module gtr {
 24 
 25 dictionary<string,string>    HashValueSet;
 26 dictionary<string,string>    ReturnValueT;
 27 sequence<byte>                 ByteStreamT;
 28 sequence<string>            StringListT;
 29 sequence<HashValueSet>    HashValueListT;
 30 sequence<int>                    IntListT;
 31 sequence<StringListT>    StringListListT;
 32 
 33 struct CallReturnT{
 34     bool    succ;
 35     string msg;
 36     HashValueSet props;
 37 };
 38 
 39 const int IMAGEJPEG = 1;
 40 const int IMAGEPNG =2 ;
 41 const int IMAGEBMP = 3 ;
 42 
 43 
 44 //图像数据
 45 struct ImageDataT{
 46     int type;
 47     ByteStreamT    bytes;
 48     int width;
 49     int height;    
 50 };
 51 
 52 struct GameAuthDataT{
 53     int             type;     // 1- 图片 ,2 - 坐标
 54     ImageDataT image; //秘宝图片
 55     string seckey;      //秘宝坐标
 56 };
 57 
 58 
 59 struct GameIdentifyT{
 60     string id;            //游戏编号
 61     string tradeNo;    //交易单号
 62 };
 63 
 64 struct ServiceIdentifyT{
 65     string id;
 66     string version;
 67 };
 68 
 69 
 70 interface IService{
 71     int            getType();             //  
 72     ServiceIdentifyT    getId();                //service module id
 73     int                             getTimestamp();        //获取系统时钟  1970之后秒数
 74     void                             shutdown();
 75     void                             heartbeat(string senderType,string senderId);  //发送者类型和Id
 76 };
 77 
 78 /*
 79 enum LogMsgLevelT{
 80     logDEBUG,
 81     logINFO,
 82     logCRITICAL,
 83     logERROR
 84 };
 85 */
 86     
 87 struct LogMessageT{
 88     int                     xclass;    //消息类型    
 89     string                 msg;    
 90 };
 91 
 92 //日志功能
 93 interface ILogger {
 94     void gameMsg(GameIdentifyT gameId,int timetick,LogMessageT msg);  // timetick - 1970~ s
 95     void gameImage(GameIdentifyT gameId,int timetick,string opName,ImageDataT image);    //抓图 opName - 执行游戏步骤名称
 96 };
 97 
 98 //安全管理,包括秘宝认证等
 99 interface ISecure {
100     string auth(GameIdentifyT gameId,GameAuthDataT data); 
101 };
102 
103 //日志服务器
104 interface ILogServer extends ILogger,IService{
105     
106 };
107 
108 interface ISecureServer extends ISecure,IService{
109 };
110 
111 
112 //一个游戏任务相关的信息
113 enum GameWorkSheetTypeT{
114     gwsPost,                    //邮寄
115     gwsAccountAudit, //帐号审核
116     gwsVerify                //验证
117 };
118 
119 
120 //邮寄
121 struct GameWorkSheetPostT {
122     long money;        
123 };
124 //审核
125 struct GameWorkSheetAccountAuditT {
126     string any;
127 };
128 //验证
129 struct GameWorkSheetVerifyT {
130     string any;
131 };
132 
133 //交易任务信息
134 //Tasklet包含所有的业务处理类型,但同时只有一种有效
135 struct GameTaskletT{
136     string id;                            //任务编号
137     int      type;                            //处理类型
138     string no;            //单号
139     string gameId;    //游戏编号
140     string account;    //帐号
141     string password;
142     string area;        //
143     string server;    //服务器
144     string lineName;//线路名称(为空则lineNo)
145     short     lineNo;    //线路编号
146     string createTime;
147     
148     GameWorkSheetPostT post;    //邮寄
149     GameWorkSheetAccountAuditT audit;
150     GameWorkSheetVerifyT        verify;
151 };
152 
153 struct GameTaskResultT{
154     string id;        //任务编号
155     string no;        //单号 (冗余)
156     string gameId;    //游戏编号(冗余)
157     int result;        //处理结果
158     string errmsg;    //提示信息    
159 };
160 
161 //gtr控制服务端接口
162 interface IGameHost extends IService,ILogger,ISecure{    
163     GameTaskletT                    getTask();        //获取任务
164     void                                    completeTask(GameTaskResultT result);         //
165     
166 };
167 
168 
169 
170 };
171 
172 
173 #endif
174 
175 


posted on 2010-09-30 00:38 放屁阿狗 阅读(1355) 评论(0)  编辑 收藏 引用 所属分类: C++/Boost/STL/TemplateIce/xmlrpc

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理