void Start() { synchronizationContext = SynchronizationContext.Current; //sedss_server = GetComponent<SEDSS_Server>(); //sedss_server.SetPassword(null); sedss_client = GetComponent <SEDSS_Client>(); sedss_client.SetPassword(null); var uosc = externalReceiver.gameObject.GetComponent <uOSC.uOscServer>(); uosc.enabled = false; //初期はオフにしておくことで起動時のポートを反映する server = new MemoryMappedFileServer(); server.ReceivedEvent += Server_Received; server.Start("Oredayo_UI_Connection"); Debug.Log(startTime); Application.logMessageReceived += ApplicationLogHandler; Application.logMessageReceivedThreaded += ApplicationLogHandler; Debug.Log("PipeServer started"); synchronizationContext.Post(async(arg) => { await server.SendCommandAsync(new PipeCommands.Hello { startTime = this.startTime }); }, null); }
static void Main(string[] args) { MemoryMappedFileServer.Test(); Console.WriteLine("运行完毕,查看文件是否发生变化."); Console.ReadLine(); }
void Start() { synchronizationContext = SynchronizationContext.Current; //sedss_server = GetComponent<SEDSS_Server>(); //sedss_server.SetPassword(null); sedss_client = GetComponent <SEDSS_Client>(); sedss_client.SetPassword(null); var uosc = externalReceiver.gameObject.GetComponent <uOSC.uOscServer>(); uosc.enabled = false; //初期はオフにしておくことで起動時のポートを反映する server = new MemoryMappedFileServer(); server.ReceivedEvent += Server_Received; server.Start("Oredayo_UI_Connection"); Debug.Log(startTime); Application.logMessageReceived += ApplicationLogHandler; Application.logMessageReceivedThreaded += ApplicationLogHandler; Debug.Log("PipeServer started"); synchronizationContext.Post(async(arg) => { await server.SendCommandAsync(new PipeCommands.Hello { startTime = this.startTime }); }, null); //自動ログイン var config = new DVRAuthConfiguration(TokenManager.DVRSDK_ClientId, new UnitySettingStore(), new UniWebRequest(), new NewtonsoftJsonSerializer()); Authentication.Instance.Init(config); Task <bool> autologin = Authentication.Instance.TryAutoLogin(async(ok) => { if (ok) { Debug.Log("AUTHENTICATION_OK"); await server.SendCommandAsync(new PipeCommands.LoginDVRConnectResult { key = "LOGIN OK" }); await GetAvatarsList(); } }); }
// Use this for initialization void Start() { server = new MemoryMappedFileServer(); server.ReceivedEvent += Server_Received; server.Start("SamplePipeName"); }
private void StartServer_Click(object sender, RoutedEventArgs e) { server = new MemoryMappedFileServer(); server.Start("SamplePipeName"); }