func (sm *ServerManager) SendToGS(s byte, c byte, m string, a interface{}, r interface{}) error {
	sm.lock.RLock()
	for _, value := range sm.servers {
		if value.ServerId == s && value.ChannelId == c {
			var c = value.Client
			sm.lock.RUnlock()
			return c.Call(m, a, r)
		}
	}
	sm.lock.RUnlock()
	return nil
}
Attempts to find GameServer with server and channel id's and send RPC call
package server
import (
	"share/log"
	"share/models/account"
	"share/models/server"
	"share/rpc"
	"sort"
	"sync"
)
type ServerManager struct {
	servers map[string]*server.Server
	lock    sync.RWMutex
}
func (sm *ServerManager) Init() {
	sm.servers = make(map[string]*server.Server)
	sm.lock = sync.RWMutex{}
}
func (sm *ServerManager) NewServer(server server.Server) {
	var endpnt = server.Client.GetEndPnt()
	sm.lock.RLock()
	var err = sm.servers[endpnt]
	sm.lock.RUnlock()
	if err != nil {
		log.Errorf("Server with endpoint exist: %s", endpnt)
		return
	}
	sm.lock.Lock()
	sm.servers[endpnt] = &server
	sm.lock.Unlock()
}
func (sm *ServerManager) RemoveServer(endpnt string) {
	sm.lock.Lock()
	delete(sm.servers, endpnt)
	sm.lock.Unlock()
}
func (sm *ServerManager) GetServer(endpnt string) *server.Server {
	sm.lock.RLock()
	var server = sm.servers[endpnt]
	sm.lock.RUnlock()
	if server == nil {
		log.Errorf("Server with endpoint doesn't exist: %s", endpnt)
	}
	return server
}
func (sm *ServerManager) GetGameServerList() []server.ServerItem {
	var serverList []server.ServerItem
	sm.lock.RLock()
	for _, value := range sm.servers {
		if value.ServerId == 0 {
			continue
		}
		var chn = server.ChannelItem{
			value.ChannelId,
			value.Type,
			value.PublicIp,
			value.PublicPort,
			value.CurrentUsers,
			value.MaxUsers,
		}
		var svr = &server.ServerItem{Id: value.ServerId}
		var found = false
		for i := 0; i < len(serverList); i++ {
			if serverList[i].Id == value.ServerId {
				svr = &serverList[i]
				found = true
				break
			}
		}
		svr.List = append(svr.List, chn)
		if !found {
			serverList = append(serverList, *svr)
		}
	}
	sm.lock.RUnlock()
	sort.Sort(server.ByServer(serverList))
	for i := 0; i < len(serverList); i++ {
		sort.Sort(server.ByChannel(serverList[i].List))
	}
	return serverList
}