public WorldServer() { this.Server = new SSyncServer(ConfigurationManager.Instance.Host, ConfigurationManager.Instance.WorldPort); this.Server.OnServerStarted += Server_OnServerStarted; this.Server.OnServerFailedToStart += Server_OnServerFailedToStart; this.Server.OnSocketAccepted += Server_OnSocketAccepted; }
public WorldServer() { this.Server = new SSyncServer(WorldConfiguration.Instance.Host, WorldConfiguration.Instance.Port); this.Server.OnServerStarted += Server_OnServerStarted; this.Server.OnServerFailedToStart += Server_OnServerFailedToStart; this.Server.OnClientConnected += Server_OnSocketAccepted; }
public void Start(string ip, int port) { this.m_server = new SSyncServer(ip, port); this.m_server.OnClientConnected += this.m_server_OnClientConnected; this.m_server.OnServerStarted += this.m_server_OnServerStarted; this.m_server.OnServerFailedToStart += this.m_server_OnServerFailedToStart; this.m_server.Start(); }
static void Main(string[] args) { SSyncCore.OnProtocolLoaded += SSyncCore_OnProtocolLoaded; SSyncCore.Initialize(Assembly.GetAssembly(typeof(ChatRequestMessage)), Assembly.GetExecutingAssembly()); StartupManager.OnItemLoading += StartupManager_OnItemLoaded; StartupManager.OnStartupEnded += StartupManager_OnStartupEnded; StartupManager.Initialize(Assembly.GetExecutingAssembly()); SSyncServer serv = new SSyncServer("127.0.0.1", 500); serv.OnClientConnected += serv_OnSocketAccepted; serv.Start(); loop: string str = Console.ReadLine(); Clients.ForEach(x => x.Send(new ChatMessage(str))); Console.WriteLine(str + " Sended to clients"); goto loop; }