1 /*
2
3 2010.3.25 zhangbin
4 1.create,瀹氫箟game-core鐨勭綉緇滄帴鍙?br> 5
6 鍗忓畾:
7 1.鏁版嵁綾誨瀷鍚嶇О灝鵑儴娣誨姞T
8
9 2010.3.27 zhangin
10
11 2010.3.29 zhangbin
12 1. 鍙栨秷宸ヤ綔鍗旼ameWorkSheetT緇撴瀯
13 2. 淇敼 ISecureService.auth()瀹夊叏璁よ瘉鐨勬暟鎹被鍨?br> 14 2010.3.30 zhangbin
15 1. heartbeat()縐誨姩鍒癐Service鎺ュ彛
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 //鏃ュ織鏈嶅姟鍣?/span>
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鍖呭惈鎵鏈夌殑涓氬姟澶勭悊綾誨瀷錛屼絾鍚屾椂鍙湁涓縐嶆湁鏁?/span>
135 struct GameTaskletT{
136 string id; //浠誨姟緙栧彿
137 int type; //澶勭悊綾誨瀷
138 string no; //鍗曞彿
139 string gameId; //娓告垙緙栧彿
140 string account; //甯愬彿
141 string password;
142 string area; //鍖?/span>
143 string server; //鏈嶅姟鍣?/span>
144 string lineName;//綰胯礬鍚嶇О(涓虹┖鍒檒ineNo)
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鎺у埗鏈嶅姟绔帴鍙?/span>
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

]]>