public static void SendInitialLobbyData(RemotePlayer p) { var players = GetPlayerList().Where(t => t.ID != p.ID); S2C_InitialLobbyData data = new S2C_InitialLobbyData(); data.AvailablePlayers = players.Select(t => t.GetDisplay()).ToArray(); data.PlayersOnline = ProtoServer.GetPlayerCount(); p.Connection.Send(data); }
public static void BroadcastPlayerCount() { var players = GetPlayerList(); var packet = new S2C_ServerPlayersOnlineCount(ProtoServer.GetPlayerCount()); foreach (var p in players) { p.Connection.Send(packet); } }
static void Main(string[] args) { IUserRepository userRepo = new UserRepositoryDB(); IChildRepository childRepo = new ChildRepositoryDB(); IEntryRepository entryRepo = new EntryRepositoryDB(); IServices service = new ServerImplementation(userRepo, childRepo, entryRepo); //SerialServer server = new SerialServer("127.0.0.1", 55555, service); ProtoServer server = new ProtoServer("127.0.0.1", 55556, service); server.Start(); Console.WriteLine("Server started..."); Console.ReadLine(); }
public static void Main(string[] args) { log4net.Config.XmlConfigurator.Configure(); IUserRepository userRepo = new UserDbRepository(); ITicketRepository ticketRepo = new TicketDbRepository(); IShowRepository showRepo = new ShowDbRepository(); IService serviceImpl = new Service(userRepo, ticketRepo, showRepo); Console.WriteLine("userRepo size : " + userRepo.FindAll().Count); //SerialServer server = new SerialServer("127.0.0.1", 55555, serviceImpl); ProtoServer server = new ProtoServer("127.0.0.1", 55555, serviceImpl); server.Start(); Console.WriteLine("Server started ..."); }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { ProtoServer.Listen(); ProtoServer.Bind(); }