protocol.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879
  1. package client
  2. import (
  3. _ "fmt"
  4. "bet24.com/servers/coreservice/coupontask"
  5. item "bet24.com/servers/micros/item_inventory/proto"
  6. task "bet24.com/servers/micros/task/proto"
  7. mail "bet24.com/servers/micros/userservices/proto"
  8. )
  9. const (
  10. Action_gold = "Action_gold"
  11. Action_diamond = "Action_diamond"
  12. Action_Item = "Action_Item"
  13. Action_Task = "Action_Task"
  14. Action_mail = "Action_mail"
  15. // ...
  16. )
  17. type Request struct {
  18. Msg string
  19. Data string
  20. }
  21. type Response struct {
  22. RetCode int // 返回值
  23. Action []string // 是否需要进一步动作
  24. Data string // 返回数据
  25. }
  26. type Request_base struct {
  27. UserId int
  28. IpAddress string
  29. }
  30. type Request_SigninWheel struct {
  31. Request_base
  32. UserGold int
  33. }
  34. type GiftContinueAward_req struct {
  35. Request_base
  36. Day int
  37. }
  38. type TaskAction_req struct {
  39. Request_base
  40. Action int
  41. Progress int
  42. Scope task.TaskScope
  43. }
  44. type TaskAward_req struct {
  45. Request_base
  46. TaskId int
  47. }
  48. type GetSysTask_req struct {
  49. TaskId int
  50. }
  51. type VipAddPoint_req struct {
  52. Request_base
  53. Point int
  54. }
  55. type VipTryWithdraw_req struct {
  56. Request_base
  57. WantedAmount int
  58. Query bool
  59. }
  60. type UserVipInfo_resp struct {
  61. Level int
  62. Point int
  63. // 其他
  64. }
  65. type LevelAddExp_req struct {
  66. Request_base
  67. GameId int
  68. Score int
  69. }
  70. type UserWinAddScore_req struct {
  71. Request_base
  72. Score int
  73. }
  74. type InventoryConsume_req struct {
  75. Request_base
  76. ItemId int
  77. Count int
  78. Bullet int
  79. IsGift int // 是否赠送扣减(1=赠送扣减)
  80. }
  81. type InventoryConsume_resp struct {
  82. Succeeded bool
  83. ErrMsg string
  84. }
  85. type InventorySell_req struct {
  86. Request_base
  87. ItemId int
  88. Count int
  89. LogType int
  90. }
  91. type InventorySell_resp struct {
  92. Succeeded bool
  93. ErrMsg string
  94. }
  95. type InventoryAddItems_req struct {
  96. Request_base
  97. Items []item.ItemPack
  98. Desc string
  99. LogType int
  100. }
  101. type InventoryAddEnegy_req struct {
  102. Request_base
  103. Bullet int
  104. }
  105. type InventoryUseEnegy_req struct {
  106. Request_base
  107. Bullet int
  108. ItemId int
  109. }
  110. type InventoryGift_req struct {
  111. Request_base
  112. ToUserId int
  113. ItemId int
  114. Count int
  115. }
  116. type GetItemCount_req struct {
  117. Request_base
  118. ItemId int
  119. }
  120. type GetItemCount_resp struct {
  121. Count int
  122. }
  123. type AddNotification_req struct {
  124. Request_base
  125. NotificationId int
  126. Data string
  127. }
  128. type SendUserMail_req struct {
  129. Request_base
  130. Title string
  131. Content string
  132. Img string
  133. }
  134. type GetUserMail_req struct {
  135. Request_base
  136. MailId int
  137. }
  138. type SendSysMail_req struct {
  139. Request_base
  140. *mail.SysMail
  141. }
  142. type UpdateSysMail_req struct {
  143. Request_base
  144. SysMsgId int
  145. Status int
  146. }
  147. type DelSysMail_req struct {
  148. Request_base
  149. SysMsgId int
  150. }
  151. type Shop_req struct {
  152. Request_base
  153. Currency string
  154. ShopType int
  155. ProductID string
  156. ProductIDs []string
  157. Num int
  158. PartnerId int
  159. Price float64
  160. }
  161. type Shop_resp struct {
  162. RetCode int
  163. ErrorMsg string
  164. Price float64
  165. }
  166. type Shop_Giving_Resp struct {
  167. Success bool
  168. ErrorMsg string
  169. Items []item.ItemPack
  170. IsHot int
  171. }
  172. type RankList_req struct {
  173. Request_base
  174. RankType int
  175. Num int
  176. }
  177. type rankItem_resp struct {
  178. RankType int //类型
  179. Rank int //名次
  180. UserId int //用户ID
  181. NickName string //昵称
  182. Amount int //数量
  183. FaceID int //头像ID
  184. FaceUrl string //头像URL
  185. Sex int //性别
  186. UserWords string //用户签名
  187. VipLevel int //Vip等级
  188. IsFriend int //是否好友
  189. Achievements []int //成就列表
  190. Awards []item.ItemPack
  191. }
  192. type PrizeWheel_req struct {
  193. Request_base
  194. NickName string //昵称
  195. Times int // 摇奖次数
  196. }
  197. type AddVitalityPoint_req struct {
  198. Request_base
  199. Point int
  200. }
  201. type BuyGiftPack_req struct {
  202. Request_base
  203. ProductId string
  204. }
  205. type GrowthPackUnlock_req struct {
  206. Request_base
  207. Bullet int
  208. }
  209. type GrowthPackAward_req struct {
  210. Request_base
  211. GrowthPackId int
  212. Index int
  213. }
  214. type BattlePassAddExp_req struct {
  215. Request_base
  216. Exp int
  217. }
  218. type GrowthPackAward_resp struct {
  219. Succeeded bool
  220. ErrMsg string
  221. }
  222. type GetDiamond_resp struct {
  223. Success bool
  224. Diamond int
  225. }
  226. type GetMoney_resp struct {
  227. Success bool
  228. Gold int
  229. }
  230. type SendBroadcast_req struct {
  231. UserID int //用户ID -1=系统广播
  232. GameID int //游戏ID 0=所有游戏
  233. Msg string //消息
  234. Priority int //优先级
  235. Ext string //扩展信息
  236. Score int
  237. GameName string
  238. NickName string
  239. }
  240. type Subsidy_req struct {
  241. Request_base
  242. LowerAmount int
  243. MaxTimes int
  244. CoolSeconds []int
  245. }
  246. type UserExchange_req struct {
  247. Request_base
  248. ExchangeId int
  249. Num int
  250. Remark string
  251. }
  252. type UserExchangeHistory_req struct {
  253. Request_base
  254. PageIndex int
  255. PageSize int
  256. }
  257. type UserExchangeHistory_resp struct {
  258. RecordCount int
  259. List []ExchangeHistory
  260. }
  261. type InventoryReduceByAdmin_req struct {
  262. Request_base
  263. ItemId int
  264. Count int
  265. OpUserID int
  266. OpUserName string
  267. }
  268. type Inventory_resp struct {
  269. Succeeded bool
  270. ErrMsg string
  271. }
  272. type BetList_req struct {
  273. Request_base
  274. GameID int
  275. Days int
  276. PageIndex int
  277. PageSize int
  278. BetZone string
  279. }
  280. type CashLog_req struct {
  281. Request_base
  282. BeginTime string
  283. EndTime string
  284. PageIndex int
  285. PageSize int
  286. }
  287. // 保险柜
  288. type BankInOrOut_req struct {
  289. Request_base
  290. Amount int
  291. GameID int
  292. ServerName string
  293. }
  294. type BankInOrOut_resp struct {
  295. RetCode int
  296. GameID int `json:"GameID,omitempty"`
  297. Gold int
  298. BankAmount int //保险柜金币
  299. OutMsg string
  300. }
  301. // 聊天
  302. type Chat_req struct {
  303. ChannelID int //聊天频道, 目前只有世界频道
  304. SendUserID int //发送者ID
  305. Vip int //VIP等级
  306. NickName string //昵称
  307. FaceUrl string //头像URL
  308. FaceId int //头像ID
  309. Sex int //性别
  310. RecvUserID int //接收者ID,私聊备用
  311. ChatMsg string //内容
  312. IpAddress string
  313. MsgType int
  314. VipExpire int
  315. }
  316. type Chat_Msg_req struct {
  317. Request_base
  318. ChannelID int //聊天频道, 目前只有世界频道
  319. }
  320. type ChannelChat_req struct {
  321. From int
  322. To int
  323. Message string
  324. MsgType int
  325. }
  326. type GetChannelChat_req struct {
  327. UserId int
  328. ChannelKey string
  329. UserId2 int
  330. }
  331. // 好友
  332. type Friend_req struct {
  333. Request_base
  334. TargetUserID int
  335. TargetNickName string
  336. }
  337. type Friend_Apply_req struct {
  338. Request_base
  339. TargetUserID int
  340. Apply int //0,不同意,1,同意
  341. }
  342. type Friend_Status_req struct {
  343. Request_base
  344. IsOnline int
  345. ServerName string
  346. }
  347. type JackPot_req struct {
  348. Request_base
  349. GameId int
  350. IsChipRoom bool
  351. }
  352. type JackPotModify_req struct {
  353. JackPot_req
  354. Amount int
  355. Desc string
  356. }
  357. type SpreadApply_req struct {
  358. Request_base
  359. Code int
  360. }
  361. type SpreadMember_req struct {
  362. Request_base
  363. PageIndex int
  364. PageSize int
  365. }
  366. type SpreadGift_req struct {
  367. Request_base
  368. FromUserID int
  369. }
  370. type AchievementInfo_req struct {
  371. Request_base
  372. TaskID int
  373. }
  374. type AchievementUpdate_req struct {
  375. Request_base
  376. TaskID int
  377. Status int
  378. }
  379. type TrackRecord_req struct {
  380. Request_base
  381. Level_1 string
  382. Level_2 string
  383. Level_3 string
  384. }
  385. type GetGameCount_req struct {
  386. Request_base
  387. GameID int
  388. }
  389. type UpdateDominoGameCount_req struct {
  390. Request_base
  391. Double int
  392. Triple int
  393. Quariter int
  394. Qunitet int
  395. CardData string
  396. }
  397. type UpdateQiuqiuGameCount_req struct {
  398. Request_base
  399. SixDevil int
  400. TwinCards int
  401. SmallCards int
  402. BigCards int
  403. QiuQiu int
  404. CardData string
  405. }
  406. type Video_req struct {
  407. Request_base
  408. VideoId int
  409. }
  410. type VideoSettleInfo_req struct {
  411. Request_base
  412. GameID int
  413. SettleAmount int
  414. }
  415. type VideoSettleInfo_resp struct {
  416. Success bool // 成功标识
  417. TimeStamp int // 时间戳
  418. ReturnAmount int // 总返还金币
  419. MaxTimes int // 最大次数
  420. SettleAmount int // 返还金币
  421. }
  422. type VideoSettle_req struct {
  423. Request_base
  424. TimeStamp int
  425. }
  426. type Review_req struct {
  427. Request_base
  428. AppName string
  429. }
  430. // 游戏视频返还信息
  431. type SettleVideoInfo_resp struct {
  432. SettleId int // 结算Id
  433. GameID int // 游戏ID
  434. ChineseName string // 游戏名称
  435. LoseAmount int // 输金币
  436. MaxTimes int // 最大次数
  437. SettleTimes int // 返还次数
  438. MaxAmount int // 最大金币
  439. SettleAmount int // 返还金币
  440. Crdate string // 时间
  441. }
  442. type AwardGameSettleVideo_req struct {
  443. Request_base
  444. SettleId int
  445. }
  446. type ReceiveNewUserGift_Req struct {
  447. Request_base
  448. IsDouble int
  449. }
  450. type Teacher_req struct {
  451. Request_base
  452. TeacherId int
  453. IsSendMail int
  454. }
  455. type TeacherProfit_req struct {
  456. Request_base
  457. Days int
  458. PageIndex int
  459. PageSize int
  460. }
  461. type TeacherPlayVideo_req struct {
  462. Request_base
  463. Rid int
  464. StudentId int
  465. }
  466. type AgentBind_req struct {
  467. Request_base
  468. HigherUserId int // 上级ID
  469. }
  470. type Agent_req struct {
  471. Request_base
  472. FromUserId int
  473. PageIndex int
  474. PageSize int
  475. }
  476. type AgentSetBindSend_req struct {
  477. Request_base
  478. BindSend int
  479. }
  480. type AgentSendBindSend_req struct {
  481. Request_base
  482. ToUserID int
  483. }
  484. type AgentCommissionRank_req struct {
  485. Request_base
  486. Days int
  487. PageIndex int
  488. PageSize int
  489. }
  490. type AgentApply_req struct {
  491. Request_base
  492. Memo string
  493. }
  494. type AgentGroup_req struct {
  495. Request_base
  496. Id int
  497. Name string
  498. Url string
  499. }
  500. type RankHistory_req struct {
  501. Request_base
  502. DateFlag string // 日期
  503. }
  504. type RankAward_req struct {
  505. Request_base
  506. RankType int
  507. DoubleFlag int
  508. }
  509. type TriggerCouponTask_req struct {
  510. Request_base
  511. GameId int
  512. BaseScore int
  513. IsDouble int
  514. Players int
  515. }
  516. type AwardCouponTask_req struct {
  517. Request_base
  518. UserTaskId int
  519. }
  520. type UserCouponTask_resp struct {
  521. Enabled bool
  522. Info *coupontask.BaseInfo
  523. List []*coupontask.UserTask
  524. }
  525. type Transfer_req struct {
  526. Request_base
  527. ToUserID int
  528. Amount int
  529. }
  530. type Transfer_resp struct {
  531. RetCode int
  532. ErrMsg string
  533. StillAmount int
  534. Refund int
  535. }
  536. type Polling_req struct {
  537. Addr string // 地址
  538. Players int // 玩家数
  539. }
  540. type GiveChip_resp struct {
  541. Request_base
  542. Amount int
  543. LogType int
  544. SourceName string
  545. Remark string
  546. }
  547. type SaveBankInfo_req struct {
  548. Request_base
  549. RealName string // 真实姓名
  550. BankName string // 银行名称
  551. BankCode string // 银行码
  552. BankCard string // 银行卡号
  553. Mobile string // 手机号
  554. }
  555. type SlotScore_req struct {
  556. Request_base
  557. Param int // score,productId
  558. }
  559. type ChipWheel_req struct {
  560. Request_base
  561. Param int
  562. }
  563. type Award_req struct {
  564. Request_base
  565. ActiveId int
  566. HallType int // 0=无效 1=金币大厅 2=元宝大厅 3=不区分大厅类型
  567. }
  568. type CreatePrivateRoomByGameServer_req struct {
  569. Request_base
  570. GameId int
  571. GameName string
  572. Addr string
  573. TableId int
  574. }
  575. type CreatePrivateRoomByUser_req struct {
  576. Request_base
  577. GameId int
  578. RuleName string
  579. Target int
  580. UserCount int
  581. PlayTime int
  582. Fee int
  583. Prize int
  584. }
  585. type PrivateRoom_req struct {
  586. Request_base
  587. RoomNo int
  588. }
  589. type PrivateRoomSit_req struct {
  590. PrivateRoom_req
  591. ChairId int
  592. }
  593. type PrivateRoomUpdateScore_req struct {
  594. PrivateRoom_req
  595. Score int
  596. }
  597. type PrivateRoomSetWinners_req struct {
  598. PrivateRoom_req
  599. Winners []int
  600. }
  601. type PrivateRoomGetGameRules_req struct {
  602. GameId int
  603. }
  604. type PrivateRoomRequstSit_req struct {
  605. PrivateRoom_req
  606. NickName string
  607. FaceId int
  608. FaceUrl string
  609. }
  610. type FriendRoomInvite_req struct {
  611. Request_base
  612. NickName string
  613. ToUserId int
  614. RoomNo int
  615. }
  616. type FriendAddPotential_req struct {
  617. Request_base
  618. ToUserId int
  619. Memo string
  620. }
  621. type RegisterPrivateServer_req struct {
  622. Addr string
  623. GameId int
  624. GameName string
  625. GameRules []string
  626. }
  627. type RegisterPrivateGameRule_req struct {
  628. Addr string
  629. GameId int
  630. GameName string
  631. RuleName string
  632. RuleDesc string
  633. RuleData string
  634. }
  635. type UpdatePrivateServer_req struct {
  636. Addr string
  637. Online int
  638. }
  639. type UpdatePrivateRoomStatus_req struct {
  640. RoomNo int
  641. Status int
  642. }
  643. type CreateSimpleMatch_req struct {
  644. Request_base
  645. GameId int
  646. GameRule string
  647. TotalUser int
  648. TableUser int
  649. Target int
  650. EnrollFee int
  651. Prize int
  652. PlayTime int
  653. }
  654. type SimpleMatch_req struct {
  655. Request_base
  656. MatchNo int
  657. }
  658. type EnrollSimpleMatch_req struct {
  659. SimpleMatch_req
  660. NickName string
  661. FaceId int
  662. FaceUrl string
  663. }
  664. type CreatePointMatch_req struct {
  665. Request_base
  666. GameId int
  667. GameRule string
  668. TotalUser int
  669. TableUser int
  670. EnrollFee int
  671. Prize int
  672. PlayTime int
  673. EliminateScore int
  674. ShrinkSec int
  675. ShrinkScore int
  676. WinnerCount int
  677. }
  678. type SngMatch_req struct {
  679. Request_base
  680. MatchId int
  681. }
  682. type EnrollSngMatch_req struct {
  683. SngMatch_req
  684. NickName string
  685. FaceId int
  686. FaceUrl string
  687. FeeIndex int
  688. }
  689. type PlatformConfigSet_req struct {
  690. Key string
  691. Value string
  692. }
  693. type KeyWord_req struct {
  694. In string
  695. Out string
  696. }
  697. type ChargeCard_Req struct {
  698. Request_base
  699. CardNo string
  700. }
  701. type RobotChat_req struct {
  702. Request_base
  703. Msg string // 消息
  704. Seconds int // 间隔时间(秒)
  705. BeginTime string // 开始时间
  706. EndTime string // 截止时间
  707. }
  708. type ReduceMoney_req struct {
  709. Request_base
  710. Amount int
  711. LogType int
  712. SourceName string
  713. Remark string
  714. }
  715. type SaveCountry_req struct {
  716. Request_base
  717. CountryName string
  718. Currency string
  719. }
  720. type FindIP_req struct {
  721. IP string `json:"ip"`
  722. Country string `json:"country"`
  723. Area string `json:"area"`
  724. }
  725. type WaterPool_req struct {
  726. UserGold int
  727. IsSlots bool
  728. Amount int
  729. GameId int
  730. Tax int
  731. }
  732. type FriendBlack_req struct {
  733. Request_base
  734. ToUserId int
  735. PageIndex int
  736. PageSize int
  737. ToUserIds []int
  738. }
  739. type OnUserLevelChange_req struct {
  740. UserId int
  741. OldLevel int
  742. NewLevel int
  743. }