コード例 #1
0
ファイル: Program.cs プロジェクト: vatt849/LibMinecraft
 static void server_OnPlayerConnectionChanged(object sender, PlayerConnectionEventArgs e)
 {
     if (e.ConnectionState == ConnectionState.Connected)
         Console.WriteLine(e.Client.UserName + " joined the game.");
     else
         Console.WriteLine(e.Client.UserName + " left the game.");
 }
コード例 #2
0
ファイル: Helper.cs プロジェクト: Gam3rK1d/MCForge-Vanilla-1
 static void ClassicServer_OnPlayerConnectionChanged(object sender, PlayerConnectionEventArgs e)
 {
     Event args = null;
     if (e.ConnectionState == LibMinecraft.Classic.Server.ConnectionState.Connected)
         args = new PlayerConnectEvent(e.Client);
     if (e.ConnectionState == LibMinecraft.Classic.Server.ConnectionState.Disconnected)
         args = new PlayerDisconnectEvent(e.Client);
     EventCache.Call(args);
 }
コード例 #3
0
 private static void OnPlayerConnectionChanged(object sender, PlayerConnectionEventArgs e)
 {
     Logger.Log(e.ConnectionState == ConnectionState.Connected
                    ? string.Format("{0} ({1}) connected to the server.", e.Client.UserName, e.Client.IpAddress)
                    : string.Format("{0} disconnected from the server.", e.Client.UserName));
 }