Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
0
        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;
        }