//请求房间列表 public static void RequestGetRooms() { RequestGetRooms req = new RequestGetRooms() { Proto = (int)CmdEnum.ReqGetRooms }; byte[] data = ProtobufTool.CreateData(req.Proto, req); Request((CmdEnum)req.Proto, data); }
//请求心跳 public static void RequestAlive() { RequestAlive req = new RequestAlive() { Proto = (int)CmdEnum.ReqAlive }; byte[] data = ProtobufTool.CreateData(req.Proto, req); Request((CmdEnum)req.Proto, data); }
//请求登录 public static void RequestLogin(string username, string password) { RequestLogin req = new RequestLogin() { Proto = (int)CmdEnum.ReqLogin, Account = username, Password = password }; byte[] data = ProtobufTool.CreateData(req.Proto, req); Request((CmdEnum)req.Proto, data); }
//请求注册 public static void RequestRegister(string account, string username, string password) { RequestRegister req = new RequestRegister() { Proto = (int)CmdEnum.ReqRegister, Account = account, Username = username, Password = password }; byte[] data = ProtobufTool.CreateData(req.Proto, req); Request((CmdEnum)req.Proto, data); }
//请求创建房间 public static void RequestCreateRoom(string room_name, string pass_word, bool can_watch, int count) { RequestCreateRoom req = new RequestCreateRoom() { Proto = (int)CmdEnum.ReqCreateRoom, RoomName = room_name, Password = pass_word, CanWatch = can_watch, PlayerNumber = count, PlayerId = GameController.Instance.player.Id }; byte[] data = ProtobufTool.CreateData(req.Proto, req); Request((CmdEnum)req.Proto, data); }
//请求创建房间 public static void RequestCreateRoom(string room_name, string pass_word, bool can_watch, int count) { RequestCreateRoom req = new RequestCreateRoom() { proto = (int)CmdEnum.Req_CreateRoom, room_name = room_name, password = pass_word, can_watch = can_watch, player_number = count, player_id = GameController.Instance.player.id }; byte[] data = ProtobufTool.CreateData(req.proto, req); Request((CmdEnum)req.proto, data); }