public static void InitializeSSync() { SSyncCore.Initialize(Assembly.GetAssembly(typeof(RawDataMessage)), WorldAssembly, WorldConfiguration.Instance.ShowProtocolMessages); ProtocolTypeManager.Initialize(); }
public View() { InitializeComponent(); Self = this; SSyncCore.Initialize(Assembly.GetAssembly(typeof(ChatMessage)), Assembly.GetAssembly(typeof(View))); Client.OnConnected += Client_OnConnected; Client.OnFailedToConnect += Client_OnFailedToConnect; richTextBox2.KeyPress += richTextBox2_KeyPress; }
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; }