// SendKick sends a kick to an user
486963
func (gs *GRPCClient) SendKick(userID string, serverType string, kick *protos.KickMsg) error {
	var svID string
	var err error

	if gs.bindingStorage == nil {
		return constants.ErrNoBindingStorageModule
	}

	svID, err = gs.bindingStorage.GetUserFrontendID(userID, serverType)
	if err != nil {
		return err
	}

	if c, ok := gs.clientMap.Load(svID); ok {
		ctxT, done := context.WithTimeout(context.Background(), gs.reqTimeout)
		defer done()
		_, err := c.(protos.PitayaClient).KickUser(ctxT, kick)
		return err
	}
	return constants.ErrNoConnectionToServer
}
998076
func (conn *Conn) h_KICK(line *Line) {
	if !line.argslen(1) {
		return
	}
	// XXX: this won't handle autorejoining channels on KICK
	// it's trivial to do this in a seperate handler...
	conn.st.Dissociate(line.Args[0], line.Args[1])
}
960873
func (p *peer) SendBlockHeaders(headers []*types.Header) error {
	return p2p.Send(p.rw, BlockHeadersMsg, headers)
}
798710
func (bot TgBot) SendChatAction(cid int, ca ChatAction) {
	bot.SendChatActionQuery(SendChatActionQuery{cid, ca.String()})
}
281476
func (t *Transactor) SendTransaction(tx *fab.Transaction) (*fab.TransactionResponse, error) {
	ctx, ok := contextImpl.RequestClientContext(t.reqCtx)
	if !ok {
		return nil, errors.New("failed get client context from reqContext for SendTransaction")
	}

	reqCtx, cancel := contextImpl.NewRequest(ctx, contextImpl.WithTimeoutType(fab.OrdererResponse), contextImpl.WithParent(t.reqCtx))
	defer cancel()

	return txn.Send(reqCtx, tx, t.orderers)
}
1348509
func (s *Server) sendBatch(batch []*Notification) error {
	engineConn, err := net.DialTimeout("unix", s.config.EngineSocket, engineTimeout)
	if err != nil {
		return err
	}
	engineConn.SetDeadline(time.Now().Add(engineTimeout))
	engine := rpc.NewClient(engineConn)
	defer engine.Close()

	var reply int
	ctx := ipc.NewTrustedContext(seesaw.SCHealthcheck)
	return engine.Call("SeesawEngine.HealthState", &HealthState{ctx, batch}, &reply)
}
1176053
func (s *Session) Kick(ctx context.Context) error {
	err := s.entity.Kick(ctx)
	if err != nil {
		return err
	}
	return s.entity.Close()
}
349103
func (bot TgBot) SendMessageWithKeyboard(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm ReplyKeyboardMarkup) ResultWithMessage {
	var rkm ReplyMarkupInt = rm
	return bot.SendMessage(cid, text, parsemode, dwp, rtmid, &rkm)
}
247234
func (api *ServerAPI) SendKey(serverID int64, body *sacloud.KeyboardRequest) (bool, error) {
	var (
		method = "PUT"
		uri    = fmt.Sprintf("%s/%d/keyboard", api.getResourceURL(), serverID)
	)

	return api.modify(method, uri, body)
}
1083466
func (c *Client) KickChatMember(chatID string, userID int, opts ...sendOption) error {
	req := url.Values{}
	req.Set("chat_id", chatID)
	req.Set("user_id", fmt.Sprint(userID))
	for _, opt := range opts {
		opt(req)
	}
	var kicked bool
	return c.doRequest("kickChatMember", req, &kicked)
}
953706
func (api *Client) KickUserFromChannel(channelID, user string) error {
	return api.KickUserFromChannelContext(context.Background(), channelID, user)
}
1177339
func (s *Server) Kick(p *player.Player) {
	p.SendMessage("You were kicked from the server.")
	msg := fmt.Sprintf("Player %q was kicked from the server.", p.Name)
	s.BroadcastMessage(msg)
}
390505
func (e *engineImpl) kickTriageLater(c context.Context, jobID string, delay time.Duration) error {
	c = logging.SetField(c, "JobID", jobID)
	return e.cfg.Dispatcher.AddTask(c, &tq.Task{
		Payload: &internal.KickTriageTask{JobId: jobID},
		Delay:   delay,
	})
}
40001
func (qs *queryResponseStream) sendAck(from string) error {
	header := responseHeader{
		Seq:   qs.seq,
		Error: "",
	}
	rec := queryRecord{
		Type: queryRecordAck,
		From: from,
	}
	return qs.client.Send(&header, &rec)
}
1189116
func (d *Driver) SendStickCommand() (err error) {
	d.cmdMutex.Lock()
	defer d.cmdMutex.Unlock()

	buf, _ := d.createPacket(stickCommand, 0x60, 11)
	binary.Write(buf, binary.LittleEndian, int16(0x00)) // seq = 0

	// RightX center=1024 left =364 right =-364
	axis1 := int16(660.0*d.rx + 1024.0)

	// RightY down =364 up =-364
	axis2 := int16(660.0*d.ry + 1024.0)

	// LeftY down =364 up =-364
	axis3 := int16(660.0*d.ly + 1024.0)

	// LeftX left =364 right =-364
	axis4 := int16(660.0*d.lx + 1024.0)

	// speed control
	axis5 := int16(d.throttle)

	packedAxis := int64(axis1)&0x7FF | int64(axis2&0x7FF)<<11 | 0x7FF&int64(axis3)<<22 | 0x7FF&int64(axis4)<<33 | int64(axis5)<<44
	binary.Write(buf, binary.LittleEndian, byte(0xFF&packedAxis))
	binary.Write(buf, binary.LittleEndian, byte(packedAxis>>8&0xFF))
	binary.Write(buf, binary.LittleEndian, byte(packedAxis>>16&0xFF))
	binary.Write(buf, binary.LittleEndian, byte(packedAxis>>24&0xFF))
	binary.Write(buf, binary.LittleEndian, byte(packedAxis>>32&0xFF))
	binary.Write(buf, binary.LittleEndian, byte(packedAxis>>40&0xFF))

	now := time.Now()
	binary.Write(buf, binary.LittleEndian, byte(now.Hour()))
	binary.Write(buf, binary.LittleEndian, byte(now.Minute()))
	binary.Write(buf, binary.LittleEndian, byte(now.Second()))
	binary.Write(buf, binary.LittleEndian, byte(now.UnixNano()/int64(time.Millisecond)&0xff))
	binary.Write(buf, binary.LittleEndian, byte(now.UnixNano()/int64(time.Millisecond)>>8))

	binary.Write(buf, binary.LittleEndian, CalculateCRC16(buf.Bytes()))

	_, err = d.cmdConn.Write(buf.Bytes())

	return
}
1122142
func SendAction(conn client.Connection, action *Action) (string, error) {
	uuid, err := utils.NewUUID()
	if err != nil {
		return "", err
	}

	node := actionPath(action.HostID, uuid)
	if err := conn.Create(node, action); err != nil {
		return "", err
	} else if err := conn.Set(node, action); err != nil {
		return "", err
	}
	return uuid, nil
}
128789
func (m *MockPitayaServer) KickUser(arg0 context.Context, arg1 *protos.KickMsg) (*protos.KickAnswer, error) {
	ret := m.ctrl.Call(m, "KickUser", arg0, arg1)
	ret0, _ := ret[0].(*protos.KickAnswer)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}